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

Commit 079dff25 authored by Garfield Tan's avatar Garfield Tan Committed by Android (Google) Code Review
Browse files

Merge "Eliminate a cycle in class hierarchy." into nyc-andromeda-dev

parents e899b568 5fd0cbc1
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -97,7 +97,6 @@ import com.android.documentsui.ThumbnailCache;
import com.android.documentsui.clipping.DocumentClipper;
import com.android.documentsui.clipping.UrisSupplier;
import com.android.documentsui.dirlist.MultiSelectManager.Selection;
import com.android.documentsui.dirlist.UserInputHandler.DocumentDetails;
import com.android.documentsui.dirlist.header.TableHeaderController;
import com.android.documentsui.model.DocumentInfo;
import com.android.documentsui.model.RootInfo;
+28 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2016 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.documentsui.dirlist;

import com.android.documentsui.Events.InputEvent;

/**
 * Interface providing a loose coupling between DocumentHolder.
 */
public interface DocumentDetails {
    String getModelId();
    int getAdapterPosition();
    boolean isInSelectionHotspot(InputEvent event);
}
+1 −4
Original line number Diff line number Diff line
@@ -30,12 +30,9 @@ import android.view.ViewGroup;
import com.android.documentsui.Events.InputEvent;
import com.android.documentsui.R;
import com.android.documentsui.State;
import com.android.documentsui.dirlist.UserInputHandler.DocumentDetails;

public abstract class DocumentHolder
        extends RecyclerView.ViewHolder
        implements View.OnKeyListener,
        DocumentDetails {
        extends RecyclerView.ViewHolder implements View.OnKeyListener, DocumentDetails {

    static final float DISABLED_ALPHA = 0.3f;

+1 −11
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import android.view.MotionEvent;

import com.android.documentsui.Events;
import com.android.documentsui.Events.InputEvent;
import com.android.documentsui.dirlist.DocumentHolder.KeyboardEventListener;

import java.util.function.Function;
import java.util.function.Predicate;
@@ -36,7 +35,7 @@ import java.util.function.Predicate;
 */
public final class UserInputHandler<T extends InputEvent>
        extends GestureDetector.SimpleOnGestureListener
        implements KeyboardEventListener {
        implements DocumentHolder.KeyboardEventListener {

    private static final String TAG = "UserInputHandler";

@@ -402,15 +401,6 @@ public final class UserInputHandler<T extends InputEvent>
        }
    }

    /**
     * Class providing limited access to document view info.
     */
    public interface DocumentDetails {
        String getModelId();
        int getAdapterPosition();
        boolean isInSelectionHotspot(InputEvent event);
    }

    @FunctionalInterface
    interface EventHandler {
        boolean apply(InputEvent event);
+0 −1
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import android.support.v7.widget.RecyclerView;
import android.view.MotionEvent;

import com.android.documentsui.Events.InputEvent;
import com.android.documentsui.dirlist.UserInputHandler.DocumentDetails;
import com.android.documentsui.testing.TestEvent;
import com.android.documentsui.testing.TestEvent.Builder;
import com.android.documentsui.testing.TestPredicate;
Loading