OSDN Git Service

Taskbar 3.0.6
authorBraden Farmer <farmerbb@gmail.com>
Fri, 3 Feb 2017 02:54:31 +0000 (19:54 -0700)
committerBraden Farmer <farmerbb@gmail.com>
Fri, 3 Feb 2017 02:54:31 +0000 (19:54 -0700)
• Minor bugfixes and improvements

12 files changed:
README.md
app/build.gradle
app/src/main/java/com/farmerbb/taskbar/activity/HomeActivity.java
app/src/main/java/com/farmerbb/taskbar/activity/IconPackApplyActivity.java
app/src/main/java/com/farmerbb/taskbar/activity/InvisibleActivityFreeform.java
app/src/main/java/com/farmerbb/taskbar/fragment/GeneralFragment.java
app/src/main/java/com/farmerbb/taskbar/fragment/SettingsFragment.java
app/src/main/java/com/farmerbb/taskbar/service/StartMenuService.java
app/src/main/java/com/farmerbb/taskbar/util/U.java
app/src/main/res/values-ja/strings.xml
app/src/main/res/values-ru/strings.xml
app/src/main/res/values/strings.xml

index 74b0b5b..94830c4 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-Taskbar puts a start menu and recent apps tray on top of your screen that's accessible at any time, increasing your productivity and turning your Android tablet (or phone) into a real multitasking machine!<br><br>On devices running Android 7.0 Nougat, Taskbar can also launch apps in freeform windows for a PC-like experience!  No root required!  (see below for instructions)<br><br>Also works great as an Android app launcher for Chromebooks! (Be sure to set your Chrome OS shelf to autohide)
+Taskbar puts a start menu and recent apps tray on top of your screen that's accessible at any time, increasing your productivity and turning your Android tablet (or phone) into a real multitasking machine!<br><br>On devices running Android 7.0+ (Nougat), Taskbar can also launch apps in freeform windows for a PC-like experience!  No root required!  (see below for instructions)<br><br>Also works great as an Android app launcher for Chromebooks! (Be sure to set your Chrome OS shelf to autohide)
 
 ## Features
 * Start menu - shows you all applications installed on the device, configurable as a list or as a grid
@@ -9,9 +9,9 @@
 * Designed with keyboard and mouse in mind
 * 100% free, open source, and no ads
 
-#### Freeform window mode (Android 7.0 Nougat)
+#### Freeform window mode (Android 7.0+)
 
-Taskbar lets you launch apps in freeform floating windows on Android 7.0 Nougat.  No root access is required.  Simply follow these steps to configure your device for launching apps in freeform mode:
+Taskbar lets you launch apps in freeform floating windows on Android 7.0+ (Nougat).  No root access is required.  Simply follow these steps to configure your device for launching apps in freeform mode:
 
 1. Check the box for "Freeform window support" inside the Taskbar app
 2. Follow the directions that appear in the pop-up to enable the proper settings on your device
index bc6842d..c08af49 100644 (file)
@@ -1,5 +1,5 @@
 ext {
-    SUPPORT_LIBRARY_VERSION = "25.1.0"
+    SUPPORT_LIBRARY_VERSION = "25.1.1"
 }
 
 buildscript {
@@ -31,8 +31,8 @@ android {
         minSdkVersion 21
         targetSdkVersion 25
 
-        versionCode 115
-        versionName "3.0.5"
+        versionCode 116
+        versionName "3.0.6"
 
         resConfigs "en", "ja", "ru"
 
index 0cc4ce0..b8f6655 100644 (file)
@@ -267,8 +267,8 @@ public class HomeActivity extends Activity {
         startService(new Intent(this, DashboardService.class));
 
         SharedPreferences pref = U.getSharedPreferences(this);
-        if(pref.getBoolean("taskbar_active", false))
-            startService(new Intent(this, NotificationService.class));
+        if(pref.getBoolean("taskbar_active", false) && !U.isServiceRunning(this, NotificationService.class))
+            pref.edit().putBoolean("taskbar_active", false).apply();
 
         // Show the Taskbar temporarily, as nothing else will be visible on screen
         new Handler().postDelayed(() -> LocalBroadcastManager.getInstance(HomeActivity.this).sendBroadcast(new Intent("com.farmerbb.taskbar.TEMP_SHOW_TASKBAR")), 100);
index 62af8a7..69401d2 100644 (file)
@@ -37,6 +37,10 @@ public class IconPackApplyActivity extends Activity {
         super.onCreate(savedInstanceState);
 
         if(getIntent().hasExtra(Intent.EXTRA_PACKAGE_NAME)) {
+            SharedPreferences pref = U.getSharedPreferences(this);
+            if(pref.getString("theme", "light").equals("dark"))
+                setTheme(R.style.AppTheme_Dialog_Dark);
+
             @SuppressLint("InlinedApi")
             final String iconPackPackage = getIntent().getStringExtra(Intent.EXTRA_PACKAGE_NAME);
             PackageManager pm = getPackageManager();
@@ -53,7 +57,6 @@ public class IconPackApplyActivity extends Activity {
                 builder.setTitle(R.string.apply_icon_pack)
                         .setNegativeButton(R.string.action_cancel, (dialog, which) -> finish())
                         .setPositiveButton(R.string.action_ok, (dialog, which) -> {
-                            SharedPreferences pref = U.getSharedPreferences(IconPackApplyActivity.this);
                             pref.edit().putString("icon_pack", iconPackPackage).apply();
 
                             U.refreshPinnedIcons(IconPackApplyActivity.this);
index 12624cb..7f47cc6 100644 (file)
@@ -198,8 +198,8 @@ public class InvisibleActivityFreeform extends Activity {
             startService(new Intent(this, DashboardService.class));
 
             SharedPreferences pref = U.getSharedPreferences(this);
-            if(pref.getBoolean("taskbar_active", false))
-                startService(new Intent(this, NotificationService.class));
+            if(pref.getBoolean("taskbar_active", false) && !U.isServiceRunning(this, NotificationService.class))
+                pref.edit().putBoolean("taskbar_active", false).apply();
 
             // Show the taskbar when activity is started
             new Handler().postDelayed(() -> {
index 3aaffd4..d0d5f40 100644 (file)
@@ -18,6 +18,7 @@ package com.farmerbb.taskbar.fragment;
 import android.content.ActivityNotFoundException;
 import android.content.Intent;
 import android.content.SharedPreferences;
+import android.os.Build;
 import android.os.Bundle;
 import android.preference.Preference;
 import android.support.v7.app.ActionBar;
@@ -47,6 +48,9 @@ public class GeneralFragment extends SettingsFragment implements Preference.OnPr
             findPreference("blacklist").setOnPreferenceClickListener(this);
             findPreference("notification_settings").setOnPreferenceClickListener(this);
 
+            if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
+                findPreference("hide_taskbar").setSummary(R.string.hide_taskbar_disclaimer);
+
             bindPreferenceSummaryToValue(findPreference("start_menu_layout"));
             bindPreferenceSummaryToValue(findPreference("scrollbar"));
             bindPreferenceSummaryToValue(findPreference("position"));
index 8befd1d..ebe1f62 100644 (file)
@@ -15,7 +15,6 @@
 
 package com.farmerbb.taskbar.fragment;
 
-import android.annotation.SuppressLint;
 import android.app.Activity;
 import android.content.Intent;
 import android.content.SharedPreferences;
@@ -81,7 +80,6 @@ public class SettingsFragment extends PreferenceFragment {
     }
 
     private Preference.OnPreferenceChangeListener sBindPreferenceSummaryToValueListener = new Preference.OnPreferenceChangeListener() {
-        @SuppressLint("CommitPrefEdits")
         @Override
         public boolean onPreferenceChange(Preference preference, Object value) {
             String stringValue = value.toString();
index 453eb4e..9ca4cc0 100644 (file)
@@ -581,13 +581,17 @@ public class StartMenuService extends Service {
                 SharedPreferences pref = U.getSharedPreferences(this);
                 boolean forceFreeformMode = FreeformHackHelper.getInstance().isFreeformHackActive() && !pref.getBoolean("open_in_fullscreen", true);
 
-                Intent intent = new Intent(this, inFreeformMode && !shouldShowSearchBox ? InvisibleActivityAlt.class : InvisibleActivity.class);
+                Class clazz = inFreeformMode && !shouldShowSearchBox ? InvisibleActivityAlt.class : InvisibleActivity.class;
+                Intent intent = new Intent(this, clazz);
                 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                 intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
 
-                if(inFreeformMode || forceFreeformMode)
-                    U.launchAppFullscreen(this, intent);
-                else
+                if(inFreeformMode || forceFreeformMode) {
+                    if(clazz.equals(InvisibleActivity.class))
+                        U.launchAppLowerRight(this, intent);
+                    else if(clazz.equals(InvisibleActivityAlt.class))
+                        U.launchAppFullscreen(this, intent);
+                } else
                     startActivity(intent);
             }
 
index d0e6237..a531fb2 100644 (file)
@@ -207,12 +207,13 @@ public class U {
         boolean shouldDelay = false;
 
         SharedPreferences pref = getSharedPreferences(context);
+        FreeformHackHelper helper = FreeformHackHelper.getInstance();
         boolean openInFullscreen = pref.getBoolean("open_in_fullscreen", true);
         boolean freeformHackActive = openInNewWindow
-                ? FreeformHackHelper.getInstance().isInFreeformWorkspace()
+                ? helper.isInFreeformWorkspace()
                 : (openInFullscreen
-                    ? FreeformHackHelper.getInstance().isInFreeformWorkspace()
-                    : FreeformHackHelper.getInstance().isFreeformHackActive());
+                    ? helper.isInFreeformWorkspace()
+                    : helper.isFreeformHackActive());
 
         if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N
                 && pref.getBoolean("freeform_hack", false)
@@ -227,11 +228,11 @@ public class U {
             }, launchedFromTaskbar ? 0 : 100);
         }
 
-        if(!FreeformHackHelper.getInstance().isFreeformHackActive()) {
+        if(!helper.isFreeformHackActive()) {
             if(!shouldDelay)
                 continueLaunchingApp(context, packageName, componentName, userId,
                         windowSize, launchedFromTaskbar, openInNewWindow, shortcut);
-        } else if(FreeformHackHelper.getInstance().isInFreeformWorkspace() || !openInFullscreen)
+        } else if(helper.isInFreeformWorkspace() || !openInFullscreen)
             continueLaunchingApp(context, packageName, componentName, userId,
                     windowSize, launchedFromTaskbar, openInNewWindow, shortcut);
     }
@@ -251,16 +252,7 @@ public class U {
                 freeformHackIntent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
         }
 
-        DisplayManager dm = (DisplayManager) context.getSystemService(Context.DISPLAY_SERVICE);
-        Display display = dm.getDisplay(Display.DEFAULT_DISPLAY);
-        try {
-            context.startActivity(freeformHackIntent, ActivityOptions.makeBasic().setLaunchBounds(new Rect(
-                    display.getWidth(),
-                    display.getHeight(),
-                    display.getWidth() + 1,
-                    display.getHeight() + 1
-            )).toBundle());
-        } catch (IllegalArgumentException e) { /* Gracefully fail */ }
+        launchAppLowerRight(context, freeformHackIntent);
     }
 
     @TargetApi(Build.VERSION_CODES.N)
@@ -513,6 +505,21 @@ public class U {
         launchMode2(context, intent, FULLSCREEN, userId, null);
     }
 
+    @SuppressWarnings("deprecation")
+    @TargetApi(Build.VERSION_CODES.N)
+    public static void launchAppLowerRight(Context context, Intent intent) {
+        DisplayManager dm = (DisplayManager) context.getSystemService(Context.DISPLAY_SERVICE);
+        Display display = dm.getDisplay(Display.DEFAULT_DISPLAY);
+        try {
+            context.startActivity(intent, ActivityOptions.makeBasic().setLaunchBounds(new Rect(
+                    display.getWidth(),
+                    display.getHeight(),
+                    display.getWidth() + 1,
+                    display.getHeight() + 1
+            )).toBundle());
+        } catch (IllegalArgumentException e) { /* Gracefully fail */ }
+    }
+
     public static void checkForUpdates(Context context) {
         if(!BuildConfig.DEBUG) {
             String url;
index 722a3ab..723b9ef 100644 (file)
     <string name="pref_title_invisible_button">Taskbar を折りたたんでいるときボタンを非表示</string>
     <string name="pref_title_freeform_mode_help">ヘルプ &amp; フリーフォームモードの説明</string>
     <string name="freeform_help_dialog_title">ヘルプ &amp; 説明</string>
-    <string name="freeform_help_dialog_message"><b>フリーフォームモードについて</b>\n\nTaskbar は Android 7.0 Nougat 上でアプリをフリーフォーム フローティング ウインドウで起動することができます。ルート アクセス許可は必要がありません。フリーフォームモードでアプリを起動するには次の手順に従ってください:\n\n<b>1.</b> Taskbar アプリ内で \"フリーフォーム ウインドウ サポート\" のボックスをチェックします\n\n<b>2.</b> ポップアップで表示される向きに従って、お使いのデバイスに適切な設定を有効にします\n\n<b>3.</b> Taskbar をオンにして、お使いのデバイスの最近使用したアプリのページに移動します\n\n<b>4.</b> 最近使用したアプリをすべてクリアして、(空の) 最近使用したアプリのページに戻ります\n\n<b>5.</b> Taskbar の開始ボタンを押して、フリーフォーム ウインドウで起動するアプリを選択します\n\n<b>トラブルシューティング</b>\n\n<i>&#8226; アプリがまだ全画面モードで起動します</i>\n\n起動するアプリがすでにメモリにロードされている場合、Taskbar はそれをフォアグラウンドに移動します。フリーフォームモードでアプリを起動するため、新規の状態から起動する必要があります。\n\n最近使用したアプリからアプリをアプリを外にスワイプして、Taskbar を使用して最近使用したアプリのページから再起移動します。これが動作しない場合は、アプリのアイコンを長押しして、\"アプリ情報\" を選択し、アプリを強制的に停止します。\n\nTaskbar は、お使いのデバイスの最近使用したアプリから、ホーム画面から、フリーフォームワークスペース自身からのみアプリをフリーフォームモードで起動できることにご注意ください。別の全画面アプリからアプリを起動すると、同じく全画面モードで起動されます。\n\n<i>&#8226; 最大化されたアプリがウインドウに復元できません</i>\n\nアプリのタイトルバーで最大化ボタンを押した場合、Android はアプリをフリーフォームモードの外に出して、全画面モードに移動します。そのため、新規の状態から起動した場合のみ Taskbar はアプリをフリーフォームウインドウで起動することができます。\n\nこれを修正するために、アプリのウインドウ フレームの外側をクリックしてウインドウを最大化することができます。これによりフリーフォーム ウインドウ ワークスペースに残ったまま、利用可能なスペースすべてにウインドウを広げます。\n\n<b>完全にシステムレベルのフリーフォーム ウインドウ サポートを有効にする</b>\n\nAndroid SDK をインストールしたコンピュータが利用できる場合、次の adb シェルコマンドを実行して、システムレベルでフリーフォームモードのサポートを有効にすることができます:\n\nsettings put global enable_freeform_support 1\n\n上記のコマンドを実行した後、お使いのデバイスを再起動します。お使いのデバイスの最近使用したアプリのページで、アプリのエントリーに、指定したアプリをフリーフォームモードに入る/終了する新しいボタンが表示されます。</string>
+    <string name="freeform_help_dialog_message"><b>フリーフォームモードについて</b>\n\nTaskbar は Android 7.0+ (Nougat) 上でアプリをフリーフォーム フローティング ウインドウで起動することができます。ルート アクセス許可は必要がありません。フリーフォームモードでアプリを起動するには次の手順に従ってください:\n\n<b>1.</b> Taskbar アプリ内で \"フリーフォーム ウインドウ サポート\" のボックスをチェックします\n\n<b>2.</b> ポップアップで表示される向きに従って、お使いのデバイスに適切な設定を有効にします\n\n<b>3.</b> Taskbar をオンにして、お使いのデバイスの最近使用したアプリのページに移動します\n\n<b>4.</b> 最近使用したアプリをすべてクリアして、(空の) 最近使用したアプリのページに戻ります\n\n<b>5.</b> Taskbar の開始ボタンを押して、フリーフォーム ウインドウで起動するアプリを選択します\n\n<b>トラブルシューティング</b>\n\n<i>&#8226; アプリがまだ全画面モードで起動します</i>\n\n起動するアプリがすでにメモリにロードされている場合、Taskbar はそれをフォアグラウンドに移動します。フリーフォームモードでアプリを起動するため、新規の状態から起動する必要があります。\n\n最近使用したアプリからアプリをアプリを外にスワイプして、Taskbar を使用して最近使用したアプリのページから再起移動します。これが動作しない場合は、アプリのアイコンを長押しして、\"アプリ情報\" を選択し、アプリを強制的に停止します。\n\nTaskbar は、お使いのデバイスの最近使用したアプリから、ホーム画面から、フリーフォームワークスペース自身からのみアプリをフリーフォームモードで起動できることにご注意ください。別の全画面アプリからアプリを起動すると、同じく全画面モードで起動されます。\n\n<i>&#8226; 最大化されたアプリがウインドウに復元できません</i>\n\nアプリのタイトルバーで最大化ボタンを押した場合、Android はアプリをフリーフォームモードの外に出して、全画面モードに移動します。そのため、新規の状態から起動した場合のみ Taskbar はアプリをフリーフォームウインドウで起動することができます。\n\nこれを修正するために、アプリのウインドウ フレームの外側をクリックしてウインドウを最大化することができます。これによりフリーフォーム ウインドウ ワークスペースに残ったまま、利用可能なスペースすべてにウインドウを広げます。\n\n<b>完全にシステムレベルのフリーフォーム ウインドウ サポートを有効にする</b>\n\nAndroid SDK をインストールしたコンピュータが利用できる場合、次の adb シェルコマンドを実行して、システムレベルでフリーフォームモードのサポートを有効にすることができます:\n\nsettings put global enable_freeform_support 1\n\n上記のコマンドを実行した後、お使いのデバイスを再起動します。お使いのデバイスの最近使用したアプリのページで、アプリのエントリーに、指定したアプリをフリーフォームモードに入る/終了する新しいボタンが表示されます。</string>
 
     <string name="action_developer_options">開発者オプションを開く</string>
     <string name="action_close">閉じる</string>
     <string name="power_button_warning_message">Custom ROMs based on CyanogenMod / LineageOS have an issue where the power button does not work while the device is in freeform mode.\n\nPlease test your power button now.  If it does not work, then exercise caution when using freeform mode as you may lose the ability to wake the device from sleep if the screen times out.</string>
     <string name="action_i_understand">I understand</string>
 
+    <string name="hide_taskbar_disclaimer">Does not apply to apps in freeform mode</string>
+
 </resources>
index c5bd632..fa8a60a 100644 (file)
     <string name="power_button_warning_message">Custom ROMs based on CyanogenMod / LineageOS have an issue where the power button does not work while the device is in freeform mode.\n\nPlease test your power button now.  If it does not work, then exercise caution when using freeform mode as you may lose the ability to wake the device from sleep if the screen times out.</string>
     <string name="action_i_understand">I understand</string>
 
+    <string name="hide_taskbar_disclaimer">Does not apply to apps in freeform mode</string>
+
 </resources>
index e3726ca..c3884d8 100644 (file)
     <string name="pref_title_invisible_button">Hide button while Taskbar is collapsed</string>
     <string name="pref_title_freeform_mode_help">Help &amp; instructions for freeform mode</string>
     <string name="freeform_help_dialog_title">Help &amp; instructions</string>
-    <string name="freeform_help_dialog_message"><b>About freeform mode</b>\n\nTaskbar lets you launch apps in freeform floating windows on Android 7.0 Nougat. No root access is required. Simply follow these steps to configure your device for launching apps in freeform mode:\n\n<b>1.</b> Check the box for \"Freeform window support\" inside the Taskbar app\n\n<b>2.</b> Follow the directions that appear in the pop-up to enable the proper settings on your device\n\n<b>3.</b> With Taskbar turned on, go to your device\'s recent apps page\n\n<b>4.</b> Clear all recent apps, then go back to the (empty) recent apps page\n\n<b>5.</b> Press Taskbar\'s start button and select an app to launch it in a freeform window\n\n<b>Troubleshooting</b>\n\n<i>&#8226; Apps still launch full-screen</i>\n\nIf an app is launched that is already loaded into memory, Taskbar will bring it into the foreground. In order to launch the app into freeform mode, it has to be launched from a fresh state.\n\nSwipe the app away from recents, and then re-launch it from the recent apps page using Taskbar. If this doesn\'t work, then long-press the app icon, select \"App info\", and then force stop the app.\n\nNote that Taskbar can only launch apps in freeform mode from your device\'s recent apps page, from the home screen, or from the freeform workspace itself. Launching apps from within another full-screen app will also launch it into full-screen mode.\n\n<i>&#8226; Apps that are maximized cannot be restored into a window</i>\n\nIf you press the Maximize button on an app\'s title bar, Android will bring the app out of freeform mode and into full-screen mode. As mentioned above, Taskbar can only launch apps into freeform windows if they are launched from a fresh state.\n\nTo fix this, you can maximize windows by tapping or clicking just outside the app\'s window frame.  This will expand the window to fill all the available space while keeping it in the freeform window workspace.\n\n<b>Enabling full system-level freeform window support</b>\n\nIf you have access to a computer with the Android SDK installed, you can enable support for freeform mode at the system level by running the following adb shell command:\n\nsettings put global enable_freeform_support 1\n\nReboot your device after running the above command, and a new button will appear for app entries in your device\'s recent apps page to enter/exit freeform mode for a given app.</string>
+    <string name="freeform_help_dialog_message"><b>About freeform mode</b>\n\nTaskbar lets you launch apps in freeform floating windows on Android 7.0+ (Nougat). No root access is required. Simply follow these steps to configure your device for launching apps in freeform mode:\n\n<b>1.</b> Check the box for \"Freeform window support\" inside the Taskbar app\n\n<b>2.</b> Follow the directions that appear in the pop-up to enable the proper settings on your device\n\n<b>3.</b> With Taskbar turned on, go to your device\'s recent apps page\n\n<b>4.</b> Clear all recent apps, then go back to the (empty) recent apps page\n\n<b>5.</b> Press Taskbar\'s start button and select an app to launch it in a freeform window\n\n<b>Troubleshooting</b>\n\n<i>&#8226; Apps still launch full-screen</i>\n\nIf an app is launched that is already loaded into memory, Taskbar will bring it into the foreground. In order to launch the app into freeform mode, it has to be launched from a fresh state.\n\nSwipe the app away from recents, and then re-launch it from the recent apps page using Taskbar. If this doesn\'t work, then long-press the app icon, select \"App info\", and then force stop the app.\n\nNote that Taskbar can only launch apps in freeform mode from your device\'s recent apps page, from the home screen, or from the freeform workspace itself. Launching apps from within another full-screen app will also launch it into full-screen mode.\n\n<i>&#8226; Apps that are maximized cannot be restored into a window</i>\n\nIf you press the Maximize button on an app\'s title bar, Android will bring the app out of freeform mode and into full-screen mode. As mentioned above, Taskbar can only launch apps into freeform windows if they are launched from a fresh state.\n\nTo fix this, you can maximize windows by tapping or clicking just outside the app\'s window frame.  This will expand the window to fill all the available space while keeping it in the freeform window workspace.\n\n<b>Enabling full system-level freeform window support</b>\n\nIf you have access to a computer with the Android SDK installed, you can enable support for freeform mode at the system level by running the following adb shell command:\n\nsettings put global enable_freeform_support 1\n\nReboot your device after running the above command, and a new button will appear for app entries in your device\'s recent apps page to enter/exit freeform mode for a given app. (Note that the button currently does not work on Android 7.1.2)</string>
 
     <string name="action_developer_options">Open Developer Options</string>
     <string name="action_close">Close</string>
     <string name="power_button_warning_message">Custom ROMs based on CyanogenMod / LineageOS have an issue where the power button does not work while the device is in freeform mode.\n\nPlease test your power button now.  If it does not work, then exercise caution when using freeform mode as you may lose the ability to wake the device from sleep if the screen times out.</string>
     <string name="action_i_understand">I understand</string>
 
+    <string name="hide_taskbar_disclaimer">Does not apply to apps in freeform mode</string>
+
 </resources>