Merge "Follow up for ag/11916646" into ub-launcher3-rvc-dev

This commit is contained in:
TreeHugger Robot
2020-06-19 01:42:09 +00:00
committed by Android (Google) Code Review
2 changed files with 8 additions and 10 deletions

View File

@@ -125,11 +125,9 @@ public class HotseatPredictionController implements DragController.DragListener,
if (mLauncher.getWorkspace().isSwitchingState()) return false;
if (!mLauncher.getOnboardingPrefs().getBoolean(
OnboardingPrefs.HOTSEAT_LONGPRESS_TIP_SEEN)) {
Intent intent = new Intent(SETTINGS_ACTION);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Snackbar.show(mLauncher, R.string.hotseat_tip_gaps_filled,
R.string.hotseat_prediction_settings, null,
() -> mLauncher.startActivity(intent));
() -> mLauncher.startActivity(getSettingsIntent()));
mLauncher.getOnboardingPrefs().markChecked(OnboardingPrefs.HOTSEAT_LONGPRESS_TIP_SEEN);
mLauncher.getDragLayer().performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
return true;

View File

@@ -99,6 +99,13 @@ public class OnboardingPrefs<T extends Launcher> {
return mSharedPrefs.getBoolean(key, false);
}
/**
* Marks on-boarding preference boolean at true
*/
public void markChecked(String flag) {
mSharedPrefs.edit().putBoolean(flag, true).apply();
}
/**
* Add 1 to the given event count, if we haven't already reached the max count.
* @return Whether we have now reached the max count.
@@ -112,11 +119,4 @@ public class OnboardingPrefs<T extends Launcher> {
mSharedPrefs.edit().putInt(eventKey, count).apply();
return hasReachedMaxCount(count, eventKey);
}
/**
* Marks on-boarding preference boolean at true
*/
public void markChecked(String flag) {
mSharedPrefs.edit().putBoolean(flag, true).apply();
}
}