Added subject to AMP viewer

pull/194/merge
M66B 3 years ago
parent 400c135530
commit 6d464e88a2

@ -30,6 +30,7 @@ import android.content.SharedPreferences;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
import android.view.MenuInflater; import android.view.MenuInflater;
@ -176,6 +177,11 @@ public class ActivityAMP extends ActivityBase {
Uri uri = getIntent().getData(); Uri uri = getIntent().getData();
Log.i("AMP uri=" + uri); Log.i("AMP uri=" + uri);
String subject = getIntent().getStringExtra("subject");
if (TextUtils.isEmpty(subject))
subject = "AMP";
getSupportActionBar().setSubtitle(subject);
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putParcelable("uri", uri); args.putParcelable("uri", uri);

@ -4832,10 +4832,14 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
@Override @Override
protected void onExecuted(Bundle args, EntityAttachment attachment) { protected void onExecuted(Bundle args, EntityAttachment attachment) {
if (attachment == null)
return;
File file = attachment.getFile(context); File file = attachment.getFile(context);
Uri uri = FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID, file); Uri uri = FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID, file);
context.startActivity(new Intent(context, ActivityAMP.class) context.startActivity(new Intent(context, ActivityAMP.class)
.setData(uri)); .setData(uri)
.putExtra("subject", message.subject));
} }
@Override @Override

Loading…
Cancel
Save