1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-27 02:07:12 +00:00

Revert "Intent.ACTION_QUICK_VIEW experiment"

This reverts commit 1c27def6f1.
This commit is contained in:
M66B 2018-08-21 15:02:05 +00:00
parent 1c27def6f1
commit a0ef4edd56

View file

@ -21,11 +21,9 @@ package eu.faircode.email;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.QuickViewConstants;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo; import android.content.pm.ResolveInfo;
import android.net.Uri; import android.net.Uri;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.util.Log; import android.util.Log;
@ -149,17 +147,9 @@ public class AdapterAttachment extends RecyclerView.Adapter<AdapterAttachment.Vi
Log.i(Helper.TAG, "uri=" + uri); Log.i(Helper.TAG, "uri=" + uri);
// Build intent // Build intent
final Intent intent = new Intent( final Intent intent = new Intent(Intent.ACTION_VIEW);
Build.VERSION.SDK_INT < Build.VERSION_CODES.N ? Intent.ACTION_VIEW : Intent.ACTION_QUICK_VIEW);
intent.setDataAndType(uri, attachment.type); intent.setDataAndType(uri, attachment.type);
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
intent.putExtra(Intent.EXTRA_QUICK_VIEW_FEATURES, new String[]{
QuickViewConstants.FEATURE_VIEW,
QuickViewConstants.FEATURE_DOWNLOAD,
QuickViewConstants.FEATURE_SEND,
QuickViewConstants.FEATURE_PRINT
});
Log.i(Helper.TAG, "Sharing " + file + " type=" + attachment.type); Log.i(Helper.TAG, "Sharing " + file + " type=" + attachment.type);
Log.i(Helper.TAG, "Intent=" + intent); Log.i(Helper.TAG, "Intent=" + intent);