public class DesktopModeFragment extends SettingsFragment {
public static boolean isConfiguringHomeApp;
+ private boolean isConfiguringDeveloperOptions;
private boolean updateAdditionalSettings;
public void onResume() {
super.onResume();
- if(showReminderToast) {
- showReminderToast = false;
- desktopModeSetupComplete();
- }
-
if(updateAdditionalSettings) {
updateAdditionalSettings = false;
updateAdditionalSettings();
if(isConfiguringHomeApp) {
isConfiguringHomeApp = false;
- startStopDesktopMode(true);
+
+ if(showReminderToast) {
+ showReminderToast = false;
+ desktopModeSetupComplete();
+ } else
+ startStopDesktopMode(true);
+ }
+
+ if(isConfiguringDeveloperOptions && !isConfiguringHomeApp) {
+ isConfiguringDeveloperOptions = false;
+
+ boolean desktopModeEnabled = U.isDesktopModePrefEnabled(getActivity());
+ ((CheckBoxPreference) findPreference(PREF_DESKTOP_MODE)).setChecked(desktopModeEnabled);
+
+ handleDesktopModePrefChange(desktopModeEnabled);
+
+ if(desktopModeEnabled) {
+ showReminderToast = true;
+ configureHomeApp();
+ }
}
Preference primaryLauncherPref = findPreference(PREF_PRIMARY_LAUNCHER);
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle(R.string.tb_desktop_mode_dialog_title)
- .setMessage(R.string.tb_freeform_dialog_message)
+ .setMessage(R.string.tb_desktop_mode_dialog_message)
.setPositiveButton(R.string.tb_action_developer_options, (dialogInterface, i) -> {
- showReminderToast = true;
-
Intent intent = new Intent(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS);
try {
startActivity(intent);
- U.showToastLong(getActivity(), R.string.tb_enable_desktop_mode);
+ isConfiguringDeveloperOptions = true;
} catch (ActivityNotFoundException e1) {
intent = new Intent(Settings.ACTION_DEVICE_INFO_SETTINGS);
try {
}
}
- U.setComponentEnabled(getActivity(), SecondaryHomeActivity.class, isChecked);
- U.setComponentEnabled(getActivity(), HSLActivity.class, isChecked);
- startStopDesktopMode(isChecked);
- updateAdditionalSettings(isChecked);
-
+ handleDesktopModePrefChange(isChecked);
break;
case PREF_SET_LAUNCHER_DEFAULT:
- try {
- startActivity(new Intent(Settings.ACTION_HOME_SETTINGS));
- isConfiguringHomeApp = true;
- } catch (ActivityNotFoundException e) {
- U.showToastLong(getActivity(), R.string.tb_unable_to_set_default_home);
- }
-
+ configureHomeApp();
break;
case PREF_PRIMARY_LAUNCHER:
Intent intent = new Intent(getActivity(), HSLConfigActivity.class);
finishedLoadingPrefs = true;
}
+ private void handleDesktopModePrefChange(boolean isChecked) {
+ U.setComponentEnabled(getActivity(), SecondaryHomeActivity.class, isChecked);
+ U.setComponentEnabled(getActivity(), HSLActivity.class, isChecked);
+ startStopDesktopMode(isChecked);
+ updateAdditionalSettings(isChecked);
+ }
+
+ private void configureHomeApp() {
+ try {
+ startActivity(new Intent(Settings.ACTION_HOME_SETTINGS));
+ isConfiguringHomeApp = true;
+ } catch (ActivityNotFoundException e) {
+ U.showToastLong(getActivity(), R.string.tb_unable_to_set_default_home);
+ showReminderToast = false;
+ }
+ }
+
private void desktopModeSetupComplete() {
boolean desktopModeEnabled = U.isDesktopModePrefEnabled(getActivity());
((CheckBoxPreference) findPreference(PREF_DESKTOP_MODE)).setChecked(desktopModeEnabled);
.setMessage(R.string.tb_freeform_dialog_message_alt)
.setPositiveButton(R.string.tb_action_continue, (dialogInterface, i) -> freeformSetupComplete());
} else {
- String settingName = Build.VERSION.SDK_INT > Build.VERSION_CODES.P
- ? getString(R.string.tb_enable_freeform_windows)
- : getString(R.string.tb_force_activities_resizable);
+ String settingName = getString(R.string.tb_force_activities_resizable);
builder.setTitle(R.string.tb_freeform_dialog_title)
.setMessage(getString(R.string.tb_freeform_dialog_message, settingName))
<string name="tb_toggle_dashboard">Dashboard umschalten</string>
<string name="tb_force_activities_resizable">Erzwingen, dass Apps in der Größe veränderbar sind.</string>
- <string name="tb_enable_freeform_windows">Freiform-Fenster aktivieren</string>
<string name="tb_filepicker_select_an_image_file">Wählen Sie bitte eine Bilddatei aus.</string>
<string name="tb_filepicker_install_file_manager">Bitte installieren Sie einen Dateimanager.</string>
<string name="tb_pref_notification_count_title">Show notification count in status area</string>
<string name="tb_pref_notification_count_description">Requires notification access</string>
+ <string name="tb_desktop_mode_dialog_title">Enable desktop mode support</string>
+ <string name="tb_desktop_mode_dialog_message">To configure your device for desktop mode, please follow these steps:\n\n• Go to Developer Options\n\n• Scroll to the bottom and turn on \"Enable freeform windows\" and \"Force desktop mode\"\n\n• Set Taskbar as your default home app\n\n• Reboot your device</string>
+ <string name="tb_reboot_required_alt">Reboot your device to complete desktop mode setup</string>
+ <string name="tb_enable_additional_settings_message">Taskbar can optionally use elevated permissions to improve your desktop mode experience. These permissions are granted by running an adb shell command.\n\nIf you wish to continue, connect your device to a computer with the Android SDK installed, and run the following command (one line):</string>
+ <string name="tb_desktop_mode_pref_description">Use Taskbar to launch windowed apps on an external display, similar to Samsung DeX and other solutions.\n\nRequires either a USB-to-HDMI adapter, or a lapdock, and a device that supports video output.</string>
+ <string name="tb_enable_additional_settings_pref_description">Requires adb shell access – tap for more info</string>
+
</resources>
<string name="tb_toggle_dashboard">Toggle Dashboard</string>
<string name="tb_force_activities_resizable">強制的にアクティビティをリサイズ可能にする</string>
- <string name="tb_enable_freeform_windows">Enable freeform windows</string>
<string name="tb_filepicker_select_an_image_file">Select an image file</string>
<string name="tb_filepicker_install_file_manager">Error selecting image</string>
<string name="tb_pref_notification_count_title">Show notification count in status area</string>
<string name="tb_pref_notification_count_description">Requires notification access</string>
+ <string name="tb_desktop_mode_dialog_title">Enable desktop mode support</string>
+ <string name="tb_desktop_mode_dialog_message">To configure your device for desktop mode, please follow these steps:\n\n• Go to Developer Options\n\n• Scroll to the bottom and turn on \"Enable freeform windows\" and \"Force desktop mode\"\n\n• Set Taskbar as your default home app\n\n• Reboot your device</string>
+ <string name="tb_reboot_required_alt">Reboot your device to complete desktop mode setup</string>
+ <string name="tb_enable_additional_settings_message">Taskbar can optionally use elevated permissions to improve your desktop mode experience. These permissions are granted by running an adb shell command.\n\nIf you wish to continue, connect your device to a computer with the Android SDK installed, and run the following command (one line):</string>
+ <string name="tb_desktop_mode_pref_description">Use Taskbar to launch windowed apps on an external display, similar to Samsung DeX and other solutions.\n\nRequires either a USB-to-HDMI adapter, or a lapdock, and a device that supports video output.</string>
+ <string name="tb_enable_additional_settings_pref_description">Requires adb shell access – tap for more info</string>
+
</resources>
\ No newline at end of file
<string name="tb_toggle_dashboard">Widgetoverzicht tonen/verbergen</string>
<string name="tb_force_activities_resizable">Formaat activiteiten geforceerd aanpasbaar maken</string>
- <string name="tb_enable_freeform_windows">Enable freeform windows</string>
<string name="tb_filepicker_select_an_image_file">Select an image file</string>
<string name="tb_filepicker_install_file_manager">Error selecting image</string>
<string name="tb_pref_notification_count_title">Show notification count in status area</string>
<string name="tb_pref_notification_count_description">Requires notification access</string>
+ <string name="tb_desktop_mode_dialog_title">Enable desktop mode support</string>
+ <string name="tb_desktop_mode_dialog_message">To configure your device for desktop mode, please follow these steps:\n\n• Go to Developer Options\n\n• Scroll to the bottom and turn on \"Enable freeform windows\" and \"Force desktop mode\"\n\n• Set Taskbar as your default home app\n\n• Reboot your device</string>
+ <string name="tb_reboot_required_alt">Reboot your device to complete desktop mode setup</string>
+ <string name="tb_enable_additional_settings_message">Taskbar can optionally use elevated permissions to improve your desktop mode experience. These permissions are granted by running an adb shell command.\n\nIf you wish to continue, connect your device to a computer with the Android SDK installed, and run the following command (one line):</string>
+ <string name="tb_desktop_mode_pref_description">Use Taskbar to launch apps in windows on an external display. similar to Samsung DeX and other solutions.\n\nRequires either a USB-to-HDMI adapter, or a lapdock, and a compatible device.</string>
+ <string name="tb_enable_additional_settings_pref_description">Requires adb shell access – tap for more info</string>
+
</resources>
<string name="tb_enable_developer_options">Włącz opcje programisty, stukając wersję 7 razy</string>
<string name="tb_enable_double_tap_to_sleep">Włączyć dwukrotne stuknięcie w tryb uśpienia?</string>
<string name="tb_enable_force_activities_resizable">Przewiń do dołu i włącz \"%s\"</string>
-<string name="tb_enable_freeform_windows">Włącz okienka freeform</string>
<string name="tb_enable_recent_apps">"Na pasku zadań można opcjonalnie wyświetlać ikony ostatnio używanych aplikacji wzdłuż krawędzi ekranu. W tym celu Taskbar wymaga uprawnień dostępu do użytkowania.
"</string>
<string name="tb_pref_notification_count_title">Show notification count in status area</string>
<string name="tb_pref_notification_count_description">Requires notification access</string>
+ <string name="tb_desktop_mode_dialog_title">Enable desktop mode support</string>
+ <string name="tb_desktop_mode_dialog_message">To configure your device for desktop mode, please follow these steps:\n\n• Go to Developer Options\n\n• Scroll to the bottom and turn on \"Enable freeform windows\" and \"Force desktop mode\"\n\n• Set Taskbar as your default home app\n\n• Reboot your device</string>
+ <string name="tb_reboot_required_alt">Reboot your device to complete desktop mode setup</string>
+ <string name="tb_enable_additional_settings_message">Taskbar can optionally use elevated permissions to improve your desktop mode experience. These permissions are granted by running an adb shell command.\n\nIf you wish to continue, connect your device to a computer with the Android SDK installed, and run the following command (one line):</string>
+ <string name="tb_desktop_mode_pref_description">Use Taskbar to launch windowed apps on an external display, similar to Samsung DeX and other solutions.\n\nRequires either a USB-to-HDMI adapter, or a lapdock, and a device that supports video output.</string>
+ <string name="tb_enable_additional_settings_pref_description">Requires adb shell access – tap for more info</string>
+
</resources>
<string name="tb_toggle_dashboard">Toggle Dashboard</string>
<string name="tb_force_activities_resizable">Изменение размера в многооконном режиме</string>
- <string name="tb_enable_freeform_windows">Enable freeform windows</string>
<string name="tb_filepicker_select_an_image_file">Select an image file</string>
<string name="tb_filepicker_install_file_manager">Error selecting image</string>
<string name="tb_pref_notification_count_title">Show notification count in status area</string>
<string name="tb_pref_notification_count_description">Requires notification access</string>
+ <string name="tb_desktop_mode_dialog_title">Enable desktop mode support</string>
+ <string name="tb_desktop_mode_dialog_message">To configure your device for desktop mode, please follow these steps:\n\n• Go to Developer Options\n\n• Scroll to the bottom and turn on \"Enable freeform windows\" and \"Force desktop mode\"\n\n• Set Taskbar as your default home app\n\n• Reboot your device</string>
+ <string name="tb_reboot_required_alt">Reboot your device to complete desktop mode setup</string>
+ <string name="tb_enable_additional_settings_message">Taskbar can optionally use elevated permissions to improve your desktop mode experience. These permissions are granted by running an adb shell command.\n\nIf you wish to continue, connect your device to a computer with the Android SDK installed, and run the following command (one line):</string>
+ <string name="tb_desktop_mode_pref_description">Use Taskbar to launch windowed apps on an external display, similar to Samsung DeX and other solutions.\n\nRequires either a USB-to-HDMI adapter, or a lapdock, and a device that supports video output.</string>
+ <string name="tb_enable_additional_settings_pref_description">Requires adb shell access – tap for more info</string>
+
</resources>
\ No newline at end of file
<string name="tb_toggle_dashboard">Toggle Dashboard</string>
<string name="tb_force_activities_resizable">Yeniden boyutlandırılacak etkinlikleri zorla</string>
- <string name="tb_enable_freeform_windows">Enable freeform windows</string>
<string name="tb_filepicker_select_an_image_file">Select an image file</string>
<string name="tb_filepicker_install_file_manager">Error selecting image</string>
<string name="tb_pref_notification_count_title">Show notification count in status area</string>
<string name="tb_pref_notification_count_description">Requires notification access</string>
+ <string name="tb_desktop_mode_dialog_title">Enable desktop mode support</string>
+ <string name="tb_desktop_mode_dialog_message">To configure your device for desktop mode, please follow these steps:\n\n• Go to Developer Options\n\n• Scroll to the bottom and turn on \"Enable freeform windows\" and \"Force desktop mode\"\n\n• Set Taskbar as your default home app\n\n• Reboot your device</string>
+ <string name="tb_reboot_required_alt">Reboot your device to complete desktop mode setup</string>
+ <string name="tb_enable_additional_settings_message">Taskbar can optionally use elevated permissions to improve your desktop mode experience. These permissions are granted by running an adb shell command.\n\nIf you wish to continue, connect your device to a computer with the Android SDK installed, and run the following command (one line):</string>
+ <string name="tb_desktop_mode_pref_description">Use Taskbar to launch windowed apps on an external display, similar to Samsung DeX and other solutions.\n\nRequires either a USB-to-HDMI adapter, or a lapdock, and a device that supports video output.</string>
+ <string name="tb_enable_additional_settings_pref_description">Requires adb shell access – tap for more info</string>
+
</resources>
<string name="tb_toggle_dashboard">切换面板</string>
<string name="tb_force_activities_resizable">强制将活动设为可调整大小</string>
- <string name="tb_enable_freeform_windows">开启自由式窗口</string>
<string name="tb_filepicker_select_an_image_file">选择一张图片</string>
<string name="tb_filepicker_install_file_manager">请安装一个文件管理器。</string>
<string name="tb_pref_notification_count_title">Show notification count in status area</string>
<string name="tb_pref_notification_count_description">Requires notification access</string>
+ <string name="tb_desktop_mode_dialog_title">Enable desktop mode support</string>
+ <string name="tb_desktop_mode_dialog_message">To configure your device for desktop mode, please follow these steps:\n\n• Go to Developer Options\n\n• Scroll to the bottom and turn on \"Enable freeform windows\" and \"Force desktop mode\"\n\n• Set Taskbar as your default home app\n\n• Reboot your device</string>
+ <string name="tb_reboot_required_alt">Reboot your device to complete desktop mode setup</string>
+ <string name="tb_enable_additional_settings_message">Taskbar can optionally use elevated permissions to improve your desktop mode experience. These permissions are granted by running an adb shell command.\n\nIf you wish to continue, connect your device to a computer with the Android SDK installed, and run the following command (one line):</string>
+ <string name="tb_desktop_mode_pref_description">Use Taskbar to launch windowed apps on an external display, similar to Samsung DeX and other solutions.\n\nRequires either a USB-to-HDMI adapter, or a lapdock, and a device that supports video output.</string>
+ <string name="tb_enable_additional_settings_pref_description">Requires adb shell access – tap for more info</string>
+
</resources>
\ No newline at end of file
<string name="tb_toggle_dashboard">Toggle Dashboard</string>
<string name="tb_force_activities_resizable">Force activities to be resizable</string>
- <string name="tb_enable_freeform_windows">Enable freeform windows</string>
<string name="tb_filepicker_select_an_image_file">Select an image file</string>
<string name="tb_filepicker_install_file_manager">Error selecting image</string>
<string name="tb_pref_notification_count_description">Requires notification access</string>
<string name="tb_desktop_mode_dialog_title">Enable desktop mode support</string>
- <string name="tb_desktop_mode_dialog_message">In order for Taskbar to support desktop mode, please follow these steps:\n\n• Go to Developer Options\n\n• Scroll to the bottom and turn on \"Enable freeform windows\" and \"Force desktop mode\"\n\n• Reboot your device</string>
- <string name="tb_enable_desktop_mode">Scroll to the bottom and turn on \"Enable freeform support\" and \"Force desktop mode\"</string>
+ <string name="tb_desktop_mode_dialog_message">To configure your device for desktop mode, please follow these steps:\n\n• Go to Developer Options\n\n• Scroll to the bottom and turn on \"Enable freeform windows\" and \"Force desktop mode\"\n\n• Set Taskbar as your default home app\n\n• Reboot your device</string>
<string name="tb_reboot_required_alt">Reboot your device to complete desktop mode setup</string>
<string name="tb_enable_additional_settings_message">Taskbar can optionally use elevated permissions to improve your desktop mode experience. These permissions are granted by running an adb shell command.\n\nIf you wish to continue, connect your device to a computer with the Android SDK installed, and run the following command (one line):</string>
+ <string name="tb_desktop_mode_pref_description">Use Taskbar to launch windowed apps on an external display, similar to Samsung DeX and other solutions.\n\nRequires either a USB-to-HDMI adapter, or a lapdock, and a device that supports video output.</string>
+ <string name="tb_enable_additional_settings_pref_description">Requires adb shell access – tap for more info</string>
</resources>
<item name="colorPrimary">@color/tb_colorPrimary</item>
<item name="colorPrimaryDark">@color/tb_colorPrimaryDark</item>
<item name="colorAccent">@color/tb_colorAccent</item>
- <item name="android:textColor">@color/tb_text_color</item>
+ <item name="android:textColor">@android:color/black</item>
<item name="android:windowMinWidthMajor">95%</item>
<item name="android:windowMinWidthMinor">95%</item>
</style>
<item name="colorPrimary">@color/tb_colorPrimary</item>
<item name="colorPrimaryDark">@color/tb_colorPrimaryDark</item>
<item name="colorAccent">@color/tb_colorAccent</item>
- <item name="android:textColor">@color/tb_text_color_dark</item>
+ <item name="android:textColor">@android:color/white</item>
<item name="android:windowMinWidthMajor">95%</item>
<item name="android:windowMinWidthMinor">95%</item>
</style>
<CheckBoxPreference
android:defaultValue="false"
android:key="desktop_mode"
- android:title="@string/tb_pref_header_desktop_mode"/>
+ android:title="@string/tb_pref_header_desktop_mode"
+ android:summary="@string/tb_desktop_mode_pref_description"/>
<Preference
android:key="set_launcher_default"
<Preference
android:key="enable_additional_settings"
android:title="@string/tb_enable_additional_settings"
+ android:summary="@string/tb_enable_additional_settings_pref_description"
android:dependency="desktop_mode"/>
<ListPreference