Revert "Provide AllApps item OnLongClickListener through ActivityContext."
This reverts commit 0acab2532d.
Reason for revert: b/290403189
Change-Id: Ie3f67f78a8ffce8c2d5a92f65a7e74d788c82a81
This commit is contained in:
committed by
Android (Google) Code Review
parent
0acab2532d
commit
853a5b9e0c
@@ -15,7 +15,10 @@
|
||||
*/
|
||||
package com.android.launcher3.allapps;
|
||||
|
||||
import static com.android.launcher3.touch.ItemLongClickListener.INSTANCE_ALL_APPS;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
@@ -24,6 +27,7 @@ import android.view.View.OnLongClickListener;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.android.launcher3.BubbleTextView;
|
||||
@@ -135,24 +139,31 @@ public abstract class BaseAllAppsAdapter<T extends Context & ActivityContext> ex
|
||||
|
||||
protected final LayoutInflater mLayoutInflater;
|
||||
protected final OnClickListener mOnIconClickListener;
|
||||
protected final OnLongClickListener mOnIconLongClickListener;
|
||||
protected OnLongClickListener mOnIconLongClickListener = INSTANCE_ALL_APPS;
|
||||
protected OnFocusChangeListener mIconFocusListener;
|
||||
private final int mExtraTextHeight;
|
||||
|
||||
public BaseAllAppsAdapter(T activityContext, LayoutInflater inflater,
|
||||
AlphabeticalAppsList<T> apps, SearchAdapterProvider<?> adapterProvider) {
|
||||
Resources res = activityContext.getResources();
|
||||
mActivityContext = activityContext;
|
||||
mApps = apps;
|
||||
mLayoutInflater = inflater;
|
||||
|
||||
mOnIconClickListener = mActivityContext.getItemOnClickListener();
|
||||
mOnIconLongClickListener = mActivityContext.getAllAppsItemLongClickListener();
|
||||
|
||||
mAdapterProvider = adapterProvider;
|
||||
mExtraTextHeight = Utilities.calculateTextHeight(
|
||||
mActivityContext.getDeviceProfile().allAppsIconTextSizePx);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the long click listener for icons
|
||||
*/
|
||||
public void setOnIconLongClickListener(@Nullable OnLongClickListener listener) {
|
||||
mOnIconLongClickListener = listener;
|
||||
}
|
||||
|
||||
/** Checks if the passed viewType represents all apps divider. */
|
||||
public static boolean isDividerViewType(int viewType) {
|
||||
return isViewType(viewType, VIEW_TYPE_MASK_DIVIDER);
|
||||
|
||||
Reference in New Issue
Block a user