Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 02d6c893 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Invoke document inspector when properites button clicked" into arc-apps

parents 1252d047 f5042d02
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@
        </activity>

        <activity
            android:enabled="false"
            android:enabled="@bool/feature_inspector"
            android:name=".inspector.DocumentInspectorActivity"
            android:label="Properties"
            android:icon="@drawable/launcher_icon"
+1 −1
Original line number Diff line number Diff line
@@ -230,7 +230,7 @@ public abstract class AbstractActionHandler<T extends Activity & CommonAddons>
        throw new UnsupportedOperationException("Can't open document.");
    }

    public void showInspector(Selection selection, Context context) {
    public void showInspector(DocumentInfo doc) {
        throw new UnsupportedOperationException("Can't open properties.");
    }

+1 −1
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ public interface ActionHandler {

    void showCreateDirectoryDialog();

    void showInspector(Selection selection, Context context);
    void showInspector(DocumentInfo doc);

    @Nullable DocumentInfo renameDocument(String name, DocumentInfo document);

+3 −1
Original line number Diff line number Diff line
@@ -684,7 +684,9 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On

            case R.id.action_menu_inspector:
                mActionModeController.finishActionMode();
                mActions.showInspector(selection, getContext());
                assert(selection.size() == 1);
                DocumentInfo doc = mModel.getDocuments(selection).get(0);
                mActions.showInspector(doc);
                return true;

            case R.id.dir_menu_cut_to_clipboard:
+5 −6
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ import com.android.documentsui.clipping.UrisSupplier;
import com.android.documentsui.dirlist.AnimationView;
import com.android.documentsui.dirlist.DocumentDetails;
import com.android.documentsui.files.ActionHandler.Addons;
import com.android.documentsui.inspector.DocumentInspectorActivity;
import com.android.documentsui.queries.SearchViewManager;
import com.android.documentsui.roots.ProvidersAccess;
import com.android.documentsui.selection.Selection;
@@ -674,12 +675,10 @@ public class ActionHandler<T extends Activity & Addons> extends AbstractActionHa
    }

    @Override
    public void showInspector(Selection selected, Context context) {
        assert(selected.size() == 1);
        Intent intent = new Intent(mActivity, FilesActivity.class);
        DocumentInfo selectedDoc = mModel.getDocuments(selected).get(0);
        intent.putExtra(Intent.ACTION_VIEW, selectedDoc.derivedUri);
        Metrics.logUserAction(context, Metrics.USER_ACTION_INSPECTOR);
    public void showInspector(DocumentInfo doc) {
        Intent intent = new Intent(mActivity, DocumentInspectorActivity.class);
        intent.putExtra(Intent.ACTION_VIEW, doc.derivedUri);
        Metrics.logUserAction(mActivity.getBaseContext(), Metrics.USER_ACTION_INSPECTOR);
        mActivity.startActivity(intent);
    }

Loading