mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 09:56:49 +00:00
Merge "Fix crash on long press of prediction row icons" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
2bcc3f8599
@@ -18,7 +18,9 @@ package com.android.launcher3.secondarydisplay;
|
||||
import static com.android.launcher3.util.OnboardingPrefs.ALL_APPS_VISITED_COUNT;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
|
||||
import com.android.launcher3.allapps.ActivityAllAppsContainerView;
|
||||
import com.android.launcher3.appprediction.AppsDividerView;
|
||||
import com.android.launcher3.appprediction.PredictionRowView;
|
||||
import com.android.launcher3.model.BgDataModel;
|
||||
@@ -39,10 +41,13 @@ public final class SecondaryDisplayPredictionsImpl extends SecondaryDisplayPredi
|
||||
@Override
|
||||
void updateAppDivider() {
|
||||
OnboardingPrefs<?> onboardingPrefs = mActivityContext.getOnboardingPrefs();
|
||||
mActivityContext.getAppsView().getFloatingHeaderView()
|
||||
.findFixedRowByType(AppsDividerView.class)
|
||||
.setShowAllAppsLabel(!onboardingPrefs.hasReachedMaxCount(ALL_APPS_VISITED_COUNT));
|
||||
onboardingPrefs.incrementEventCount(ALL_APPS_VISITED_COUNT);
|
||||
if (onboardingPrefs != null) {
|
||||
mActivityContext.getAppsView().getFloatingHeaderView()
|
||||
.findFixedRowByType(AppsDividerView.class)
|
||||
.setShowAllAppsLabel(
|
||||
!onboardingPrefs.hasReachedMaxCount(ALL_APPS_VISITED_COUNT));
|
||||
onboardingPrefs.incrementEventCount(ALL_APPS_VISITED_COUNT);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -51,4 +56,12 @@ public final class SecondaryDisplayPredictionsImpl extends SecondaryDisplayPredi
|
||||
.findFixedRowByType(PredictionRowView.class)
|
||||
.setPredictedApps(item.items);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLongClickListener(ActivityAllAppsContainerView<?> appsView,
|
||||
View.OnLongClickListener onIconLongClickListener) {
|
||||
appsView.getFloatingHeaderView()
|
||||
.findFixedRowByType(PredictionRowView.class)
|
||||
.setOnIconLongClickListener(onIconLongClickListener);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,6 +303,10 @@ public class SecondaryDisplayLauncher extends BaseDraggingActivity
|
||||
}
|
||||
}
|
||||
|
||||
public SecondaryDisplayPredictions getSecondaryDisplayPredictions() {
|
||||
return mSecondaryDisplayPredictions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StringCache getStringCache() {
|
||||
return mStringCache;
|
||||
|
||||
@@ -16,8 +16,10 @@
|
||||
package com.android.launcher3.secondarydisplay;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.allapps.ActivityAllAppsContainerView;
|
||||
import com.android.launcher3.model.BgDataModel;
|
||||
import com.android.launcher3.util.ResourceBasedOverride;
|
||||
|
||||
@@ -45,4 +47,12 @@ public class SecondaryDisplayPredictions implements ResourceBasedOverride {
|
||||
*/
|
||||
public void setPredictedApps(BgDataModel.FixedContainerItems item) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set long click listener for predicted apps in top of app drawer.
|
||||
*/
|
||||
public void setLongClickListener(
|
||||
ActivityAllAppsContainerView<?> appsView,
|
||||
View.OnLongClickListener onIconLongClickListener) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,8 @@ public class SecondaryDragLayer extends BaseDragLayer<SecondaryDisplayLauncher>
|
||||
|
||||
mAppsView = findViewById(R.id.apps_view);
|
||||
mAppsView.setOnIconLongClickListener(this::onIconLongClicked);
|
||||
|
||||
mActivity.getSecondaryDisplayPredictions()
|
||||
.setLongClickListener(mAppsView, this::onIconLongClicked);
|
||||
// Setup workspace
|
||||
mWorkspace = findViewById(R.id.workspace_grid);
|
||||
mPinnedAppsAdapter = new PinnedAppsAdapter(mActivity, mAppsView.getAppsStore(),
|
||||
|
||||
Reference in New Issue
Block a user