Hide welcome dialog after shortcut pinned (#2284)

This commit is contained in:
南宫雪珊 2022-12-06 18:49:21 +08:00 committed by GitHub
parent 2b2bd66bb5
commit 8d0ceacd2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -23,7 +23,8 @@ public class WelcomeDialog extends DialogFragment {
.setNegativeButton(R.string.never_show, (dialog, which) ->
App.getPreferences().edit().putBoolean("never_show_welcome", true).apply())
.setNeutralButton(R.string.create_shortcut, (dialog, which) ->
ShortcutUtil.requestPinLaunchShortcut(null))
ShortcutUtil.requestPinLaunchShortcut(() ->
App.getPreferences().edit().putBoolean("never_show_welcome", true).apply()))
.setPositiveButton(android.R.string.ok, null)
.create();
}

View File

@ -182,7 +182,6 @@ public class SettingsFragment extends BaseFragment {
shortcut.setEnabled(true);
shortcut.setSummary(R.string.settings_create_shortcut_summary);
}
shortcut.setEnabled(!ShortcutUtil.isLaunchShortcutPinned());
shortcut.setOnPreferenceClickListener(preference -> {
ShortcutUtil.requestPinLaunchShortcut(() -> {
shortcut.setEnabled(false);
@ -191,6 +190,7 @@ public class SettingsFragment extends BaseFragment {
notification.setEnabled(true);
notification.setSummaryOn(R.string.settings_enable_status_notification_summary);
}
App.getPreferences().edit().putBoolean("never_show_welcome", true).apply();
});
return true;
});