OSDN Git Service

Integrate HSL into Taskbar as part of desktop mode support
authorBraden Farmer <farmerbb@gmail.com>
Fri, 20 Mar 2020 05:38:34 +0000 (23:38 -0600)
committerBraden Farmer <farmerbb@gmail.com>
Fri, 20 Mar 2020 05:41:06 +0000 (23:41 -0600)
19 files changed:
app/src/main/java/com/farmerbb/taskbar/activity/HSLActivity.java [new file with mode: 0644]
app/src/main/java/com/farmerbb/taskbar/activity/HSLConfigActivity.java [new file with mode: 0644]
app/src/main/java/com/farmerbb/taskbar/activity/MainActivity.java
app/src/main/java/com/farmerbb/taskbar/fragment/DesktopModeFragment.java
app/src/main/res/layout/tb_activity_hsl_config.xml [new file with mode: 0644]
app/src/main/res/layout/tb_hsl_row_layout.xml [new file with mode: 0644]
app/src/main/res/menu/tb_hsl_config.xml [new file with mode: 0644]
app/src/main/res/values-de/strings.xml
app/src/main/res/values-ja/strings.xml
app/src/main/res/values-nl/strings.xml
app/src/main/res/values-pl/strings.xml
app/src/main/res/values-ru/strings.xml
app/src/main/res/values-tr/strings.xml
app/src/main/res/values-zh-rCN/strings.xml
app/src/main/res/values/colors.xml
app/src/main/res/values/strings.xml
app/src/main/res/values/styles.xml
app/src/main/res/xml/tb_pref_desktop_mode.xml
app/src/playstore/AndroidManifest.xml

diff --git a/app/src/main/java/com/farmerbb/taskbar/activity/HSLActivity.java b/app/src/main/java/com/farmerbb/taskbar/activity/HSLActivity.java
new file mode 100644 (file)
index 0000000..57fc30c
--- /dev/null
@@ -0,0 +1,104 @@
+/* Copyright 2020 Braden Farmer
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.farmerbb.taskbar.activity;
+
+import android.app.Activity;
+import android.content.ActivityNotFoundException;
+import android.content.ComponentName;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.os.Bundle;
+import android.os.Handler;
+import android.widget.Toast;
+
+import com.farmerbb.taskbar.R;
+import com.farmerbb.taskbar.util.U;
+
+import java.util.List;
+
+public class HSLActivity extends Activity {
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        SharedPreferences pref = U.getSharedPreferences(this);
+        String activityToLaunch = pref.getString("hsl_id", "null");
+
+        Intent homeIntent = new Intent(Intent.ACTION_MAIN);
+        homeIntent.addCategory(Intent.CATEGORY_HOME);
+        PackageManager manager = getPackageManager();
+        List<ResolveInfo> listOfLaunchers = manager.queryIntentActivities(homeIntent, 0);
+
+        try {
+            manager.getApplicationInfo(activityToLaunch, 0);
+
+            for(ResolveInfo launcher : listOfLaunchers) {
+                if(activityToLaunch.equals("com.google.android.googlequicksearchbox")) {
+                    // Only add the Google App onto the list if Google Now Launcher is installed
+                    try {
+                        manager.getApplicationInfo("com.google.android.launcher", 0);
+                        if(activityToLaunch.equals(launcher.activityInfo.packageName))
+                            activityToLaunch = activityToLaunch + "/" + launcher.activityInfo.name;
+
+                    } catch (PackageManager.NameNotFoundException e) {
+                        activityToLaunch = "null";
+                    }
+                } else {
+                    if(activityToLaunch.equals(launcher.activityInfo.packageName))
+                        activityToLaunch = activityToLaunch + "/" + launcher.activityInfo.name;
+                }
+            }
+        } catch (PackageManager.NameNotFoundException e) {
+            activityToLaunch = "null";
+        }
+
+        if(activityToLaunch.equals("null")) {
+            launcherNotFound();
+        } else {
+            Intent intent = new Intent(Intent.ACTION_MAIN);
+            intent.setComponent(ComponentName.unflattenFromString(activityToLaunch));
+            intent.addCategory(Intent.CATEGORY_HOME);
+            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
+                    | Intent.FLAG_ACTIVITY_CLEAR_TOP
+                    | Intent.FLAG_ACTIVITY_SINGLE_TOP);
+
+            try {
+                startActivity(intent);
+
+                // Fire the intent twice to fix launchers that specifically listen
+                // for home button presses (i.e. to jump to the default panel)
+                new Handler().post(() -> startActivity(intent));
+            } catch (ActivityNotFoundException e) {
+                launcherNotFound();
+            }
+        }
+
+        finish();
+    }
+
+    private void launcherNotFound() {
+        SharedPreferences pref = U.getSharedPreferences(this);
+        if(!pref.getString("hsl_name", "null").equals("null")) {
+            U.showToast(this, getString(R.string.tb_hsl_launcher_uninstalled, pref.getString("hsl_name", "null")), Toast.LENGTH_LONG);
+        }
+
+        Intent intent = new Intent(this, HSLConfigActivity.class);
+        startActivity(intent);
+    }
+}
diff --git a/app/src/main/java/com/farmerbb/taskbar/activity/HSLConfigActivity.java b/app/src/main/java/com/farmerbb/taskbar/activity/HSLConfigActivity.java
new file mode 100644 (file)
index 0000000..2a814fe
--- /dev/null
@@ -0,0 +1,187 @@
+/* Copyright 2020 Braden Farmer
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.farmerbb.taskbar.activity;
+
+import android.content.ActivityNotFoundException;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.ListView;
+import android.widget.TextView;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.farmerbb.taskbar.R;
+import com.farmerbb.taskbar.util.U;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class HSLConfigActivity extends AppCompatActivity {
+
+    private boolean returnToSettings;
+
+    private final class LauncherListAdapter extends ArrayAdapter<String> {
+        private LauncherListAdapter(Context context, ArrayList<String> notes) {
+            super(context, R.layout.tb_hsl_row_layout, notes);
+        }
+
+        @Override
+        public View getView(int position, View convertView, ViewGroup parent) {
+            // Get the data item for this position
+            String launcher = getItem(position);
+            // Check if an existing view is being reused, otherwise inflate the view
+            if(convertView == null) {
+                convertView = LayoutInflater.from(getContext()).inflate(R.layout.tb_hsl_row_layout, parent, false);
+            }
+            // Lookup view for data population
+            TextView launcherTitle = (TextView) convertView.findViewById(R.id.launcherTitle);
+            // Populate the data into the template view using the data object
+            launcherTitle.setText(launcher);
+
+            // Return the completed view to render on screen
+            return convertView;
+        }
+    }
+
+    ArrayList<String> packageIds;
+    ArrayList<String> packageNames;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.tb_activity_hsl_config);
+
+        // Make action bar invisible
+        if(getSupportActionBar() != null)
+            getSupportActionBar().setElevation(0);
+
+        setTitle(null);
+
+        returnToSettings = getIntent().getBooleanExtra("return_to_settings", false);
+    }
+
+    @Override
+    protected void onStart() {
+        super.onStart();
+
+        packageIds = new ArrayList<>();
+        packageNames = new ArrayList<>();
+
+        // Get list of currently installed launchers
+        Intent homeIntent = new Intent(Intent.ACTION_MAIN);
+        homeIntent.addCategory(Intent.CATEGORY_HOME);
+        PackageManager manager = getPackageManager();
+        final List<ResolveInfo> listOfLaunchers = manager.queryIntentActivities(homeIntent, 0);
+
+        for(ResolveInfo launcher : listOfLaunchers) {
+            String string = launcher.activityInfo.packageName;
+
+            // Don't include the Settings dummy launcher, or Taskbar itself, on the list
+            if(!string.equals("com.android.settings")
+                    && !string.equals("com.android.tv.settings")
+                    && !string.startsWith("com.farmerbb.taskbar")) {
+                if(string.equals("com.google.android.googlequicksearchbox")) {
+                    // Only add the Google App onto the list if Google Now Launcher is installed
+                    try {
+                        packageNames.add(manager.getApplicationInfo("com.google.android.launcher", 0).loadLabel(manager).toString());
+                        packageIds.add(string);
+                    } catch (PackageManager.NameNotFoundException e) { /* Gracefully fail */ }
+                } else {
+                    packageNames.add(launcher.activityInfo.applicationInfo.loadLabel(manager).toString());
+                    packageIds.add(string);
+                }
+            }
+        }
+
+        ListView listView = (ListView) findViewById(R.id.listView);
+        TextView textView = (TextView) findViewById(R.id.textView);
+
+        // Display the list of launchers
+        if(packageNames.size() > 0) {
+            textView.setText(R.string.tb_hsl_main_activity_text);
+
+            // Create the custom adapter to bind the array to the ListView
+            final LauncherListAdapter adapter = new LauncherListAdapter(this, packageNames);
+
+            // Display the ListView
+            listView.setAdapter(adapter);
+            listView.setClickable(true);
+            listView.setOnItemClickListener((arg0, arg1, position, arg3) -> {
+                SharedPreferences pref = U.getSharedPreferences(HSLConfigActivity.this);
+                SharedPreferences.Editor editor = pref.edit();
+                editor.putString("hsl_id", packageIds.get(position));
+                editor.putString("hsl_name", packageNames.get(position));
+                editor.apply();
+
+                for(ResolveInfo launcher : listOfLaunchers) {
+                    if(packageIds.get(position).equals(launcher.activityInfo.packageName)) {
+                        if(!returnToSettings) {
+                            Intent intent = new Intent(Intent.ACTION_MAIN);
+                            intent.setComponent(ComponentName.unflattenFromString(packageIds.get(position) + "/" + launcher.activityInfo.name));
+                            intent.addCategory(Intent.CATEGORY_HOME);
+                            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
+                                    | Intent.FLAG_ACTIVITY_CLEAR_TOP
+                                    | Intent.FLAG_ACTIVITY_SINGLE_TOP);
+
+                            try {
+                                startActivity(intent);
+                            } catch (ActivityNotFoundException e) { /* Gracefully fail */ }
+                        }
+
+                        finish();
+                    }
+                }
+            });
+        } else
+            textView.setText(R.string.tb_hsl_no_launchers_found);
+    }
+
+    @Override
+    public boolean onCreateOptionsMenu(Menu menu) {
+        // Inflate action bar menu
+        if(!returnToSettings) getMenuInflater().inflate(R.menu.tb_hsl_config, menu);
+        return true;
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        // Handle presses on the action bar items
+
+        if(item.getItemId() == R.id.action_settings) {
+            Intent intent = new Intent(this, MainActivity.class);
+            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+            startActivity(intent);
+        }
+
+        return true;
+    }
+
+    @Override
+    public void onBackPressed() {
+        if(returnToSettings) super.onBackPressed();
+    }
+}
index 0b0b904..aafeca2 100644 (file)
@@ -103,7 +103,11 @@ public class MainActivity extends AppCompatActivity {
         boolean launcherEnabled = (pref.getBoolean("launcher", false) && U.canDrawOverlays(this))
                 || U.isLauncherPermanentlyEnabled(this);
 
+        boolean desktopModeEnabled = U.isDesktopModeSupported(this)
+                && pref.getBoolean("desktop_mode", false);
+
         editor.putBoolean("launcher", launcherEnabled);
+        editor.putBoolean("desktop_mode", desktopModeEnabled);
         editor.apply();
 
         if(!U.isLibrary(this)) {
@@ -135,14 +139,21 @@ public class MainActivity extends AppCompatActivity {
 
             ComponentName component5 = new ComponentName(this, SecondaryHomeActivity.class);
             getPackageManager().setComponentEnabledSetting(component5,
-                    U.isDesktopModeSupported(this)
+                    desktopModeEnabled
+                            ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED
+                            : PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
+                    PackageManager.DONT_KILL_APP);
+
+            ComponentName component6 = new ComponentName(this, HSLActivity.class);
+            getPackageManager().setComponentEnabledSetting(component6,
+                    desktopModeEnabled
                             ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED
                             : PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
                     PackageManager.DONT_KILL_APP);
 
             if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
-                ComponentName component6 = new ComponentName(this, KeyboardShortcutActivityLockDevice.class);
-                getPackageManager().setComponentEnabledSetting(component6,
+                ComponentName component7 = new ComponentName(this, KeyboardShortcutActivityLockDevice.class);
+                getPackageManager().setComponentEnabledSetting(component7,
                         pref.getBoolean("keyboard_shortcut", false)
                                 ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED
                                 : PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
index 5a89a2a..e3a9d68 100644 (file)
 package com.farmerbb.taskbar.fragment;
 
 import android.annotation.TargetApi;
-import android.content.ActivityNotFoundException;
+import android.content.ComponentName;
 import android.content.Intent;
 import android.content.SharedPreferences;
+import android.content.pm.PackageManager;
 import android.os.Bundle;
+import android.preference.CheckBoxPreference;
 import android.preference.Preference;
 
 import androidx.appcompat.app.ActionBar;
 import androidx.appcompat.app.AppCompatActivity;
 
 import com.farmerbb.taskbar.R;
+import com.farmerbb.taskbar.activity.HSLActivity;
+import com.farmerbb.taskbar.activity.HSLConfigActivity;
+import com.farmerbb.taskbar.activity.SecondaryHomeActivity;
 import com.farmerbb.taskbar.util.U;
 
 public class DesktopModeFragment extends SettingsFragment {
@@ -40,7 +45,8 @@ public class DesktopModeFragment extends SettingsFragment {
         addPreferencesFromResource(R.xml.tb_pref_desktop_mode);
 
         // Set OnClickListeners for certain preferences
-        findPreference("set_as_default").setOnPreferenceClickListener(this);
+        findPreference("desktop_mode").setOnPreferenceClickListener(this);
+        findPreference("primary_launcher").setOnPreferenceClickListener(this);
 
         SharedPreferences pref = U.getSharedPreferences(getActivity());
         if(pref.getBoolean("launcher", false))
@@ -62,20 +68,46 @@ public class DesktopModeFragment extends SettingsFragment {
             actionBar.setDisplayHomeAsUpEnabled(true);
     }
 
+    @Override
+    public void onResume() {
+        super.onResume();
+
+        Preference primaryLauncherPref = findPreference("primary_launcher");
+        if(primaryLauncherPref != null) {
+            SharedPreferences pref = U.getSharedPreferences(getActivity());
+            String primaryLauncherName = pref.getString("hsl_name", "null");
+
+            primaryLauncherPref.setSummary(primaryLauncherName.equals("null")
+                    ? getString(R.string.tb_icon_pack_none)
+                    : primaryLauncherName
+            );
+        }
+    }
+
     @TargetApi(29)
     @Override
     public boolean onPreferenceClick(final Preference p) {
-        final SharedPreferences pref = U.getSharedPreferences(getActivity());
-
         switch(p.getKey()) {
-            case "set_as_default":
-                Intent intent = new Intent();
-                intent.setAction(Intent.ACTION_MAIN);
-                intent.addCategory(Intent.CATEGORY_SECONDARY_HOME);
-
-                try {
-                    startActivity(intent);
-                } catch (Exception e) { /* Gracefully fail */ }
+            case "desktop_mode":
+                ComponentName component = new ComponentName(getActivity(), SecondaryHomeActivity.class);
+                getActivity().getPackageManager().setComponentEnabledSetting(component,
+                        ((CheckBoxPreference) p).isChecked()
+                                ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED
+                                : PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
+                        PackageManager.DONT_KILL_APP);
+
+                ComponentName component2 = new ComponentName(getActivity(), HSLActivity.class);
+                getActivity().getPackageManager().setComponentEnabledSetting(component2,
+                        ((CheckBoxPreference) p).isChecked()
+                                ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED
+                                : PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
+                        PackageManager.DONT_KILL_APP);
+
+               break;
+            case "primary_launcher":
+                Intent intent = new Intent(getActivity(), HSLConfigActivity.class);
+                intent.putExtra("return_to_settings", true);
+                startActivity(intent);
 
                 break;
         }
diff --git a/app/src/main/res/layout/tb_activity_hsl_config.xml b/app/src/main/res/layout/tb_activity_hsl_config.xml
new file mode 100644 (file)
index 0000000..9f83c96
--- /dev/null
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Copyright 2020 Braden Farmer\r
+\r
+     Licensed under the Apache License, Version 2.0 (the "License");\r
+     you may not use this file except in compliance with the License.\r
+     You may obtain a copy of the License at\r
+\r
+          http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+     Unless required by applicable law or agreed to in writing, software\r
+     distributed under the License is distributed on an "AS IS" BASIS,\r
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+     See the License for the specific language governing permissions and\r
+     limitations under the License.\r
+-->\r
+\r
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"\r
+    android:orientation="vertical" android:layout_width="match_parent"\r
+    android:layout_height="match_parent"\r
+    android:gravity="center" >\r
+\r
+    <TextView\r
+        android:layout_width="@dimen/tb_match_parent"\r
+        android:layout_height="wrap_content"\r
+        android:padding="32dp"\r
+        android:textSize="20sp"\r
+        android:gravity="center"\r
+        android:id="@+id/textView"/>\r
+\r
+    <ListView\r
+        android:layout_width="@dimen/tb_match_parent"\r
+        android:layout_height="wrap_content"\r
+        android:id="@+id/listView" />\r
+\r
+    <Space\r
+        android:layout_width="match_parent"\r
+        android:layout_height="48dp" />\r
+\r
+</LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/tb_hsl_row_layout.xml b/app/src/main/res/layout/tb_hsl_row_layout.xml
new file mode 100644 (file)
index 0000000..51c9107
--- /dev/null
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Copyright 2020 Braden Farmer\r
+\r
+     Licensed under the Apache License, Version 2.0 (the "License");\r
+     you may not use this file except in compliance with the License.\r
+     You may obtain a copy of the License at\r
+\r
+          http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+     Unless required by applicable law or agreed to in writing, software\r
+     distributed under the License is distributed on an "AS IS" BASIS,\r
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+     See the License for the specific language governing permissions and\r
+     limitations under the License.\r
+-->\r
+\r
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"\r
+    android:layout_width="match_parent"\r
+    android:layout_height="match_parent" >\r
+\r
+    <TextView\r
+        android:id="@+id/launcherTitle"\r
+        android:layout_width="0dp"\r
+        android:layout_height="match_parent"\r
+        android:layout_weight="1"\r
+        android:ellipsize="end"\r
+        android:gravity="center"\r
+        android:maxLines="1"\r
+        android:paddingBottom="10dp"\r
+        android:paddingLeft="5dp"\r
+        android:paddingTop="10dp"\r
+        android:paddingRight="5dp"\r
+        android:text="@null"\r
+        android:textSize="25sp"\r
+        android:textStyle="bold" />\r
+\r
+</LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/menu/tb_hsl_config.xml b/app/src/main/res/menu/tb_hsl_config.xml
new file mode 100644 (file)
index 0000000..a5e728a
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Copyright 2020 Braden Farmer\r
+\r
+     Licensed under the Apache License, Version 2.0 (the "License");\r
+     you may not use this file except in compliance with the License.\r
+     You may obtain a copy of the License at\r
+\r
+          http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+     Unless required by applicable law or agreed to in writing, software\r
+     distributed under the License is distributed on an "AS IS" BASIS,\r
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+     See the License for the specific language governing permissions and\r
+     limitations under the License.\r
+-->\r
+\r
+<menu xmlns:android="http://schemas.android.com/apk/res/android"\r
+      xmlns:app="http://schemas.android.com/apk/res-auto">\r
+\r
+    <item\r
+        android:id="@+id/action_settings"\r
+        android:icon="@drawable/tb_settings"\r
+        android:title="@string/tb_settings"\r
+        app:showAsAction="ifRoom" />\r
+    \r
+</menu>\r
index 75fe2cd..6b1bbdf 100644 (file)
     <string name="tb_restoring_settings">Restoring settings&#8230;</string>
 
     <string name="tb_pref_header_desktop_mode">Desktop mode</string>
+    <string name="tb_primary_launcher">Primary launcher</string>
+
+    <string name="tb_hsl_no_launchers_found">No third-party launchers were found.\n\nPlease download and install one, then re-open this application.</string>
+    <string name="tb_hsl_launcher_uninstalled">%1$s was uninstalled. Please select a different launcher from the list.</string>
+    <string name="tb_hsl_main_activity_text">Select your primary launcher from the list below.\n\nYou can change this selection at any time from within Taskbar\'s desktop mode settings.</string>
 
 </resources>
index 6aca508..6c8b0df 100644 (file)
     <string name="tb_restoring_settings">Restoring settings&#8230;</string>
 
     <string name="tb_pref_header_desktop_mode">Desktop mode</string>
+    <string name="tb_primary_launcher">Primary launcher</string>
+
+    <string name="tb_hsl_no_launchers_found">No third-party launchers were found.\n\nPlease download and install one, then re-open this application.</string>
+    <string name="tb_hsl_launcher_uninstalled">%1$s was uninstalled. Please select a different launcher from the list.</string>
+    <string name="tb_hsl_main_activity_text">Select your primary launcher from the list below.\n\nYou can change this selection at any time from within Taskbar\'s desktop mode settings.</string>
 
 </resources>
\ No newline at end of file
index b3018f9..783c4df 100644 (file)
     <string name="tb_restoring_settings">Restoring settings&#8230;</string>
 
     <string name="tb_pref_header_desktop_mode">Desktop mode</string>
+    <string name="tb_primary_launcher">Primary launcher</string>
+
+    <string name="tb_hsl_no_launchers_found">No third-party launchers were found.\n\nPlease download and install one, then re-open this application.</string>
+    <string name="tb_hsl_launcher_uninstalled">%1$s was uninstalled. Please select a different launcher from the list.</string>
+    <string name="tb_hsl_main_activity_text">Select your primary launcher from the list below.\n\nYou can change this selection at any time from within Taskbar\'s desktop mode settings.</string>
 
 </resources>
index 08ecac0..34cd94a 100644 (file)
@@ -429,5 +429,10 @@ W takim przypadku może być konieczne flashowanie niestandardowego ROM-u w celu
     <string name="tb_restoring_settings">Restoring settings&#8230;</string>
 
     <string name="tb_pref_header_desktop_mode">Desktop mode</string>
+    <string name="tb_primary_launcher">Primary launcher</string>
+
+    <string name="tb_hsl_no_launchers_found">No third-party launchers were found.\n\nPlease download and install one, then re-open this application.</string>
+    <string name="tb_hsl_launcher_uninstalled">%1$s was uninstalled. Please select a different launcher from the list.</string>
+    <string name="tb_hsl_main_activity_text">Select your primary launcher from the list below.\n\nYou can change this selection at any time from within Taskbar\'s desktop mode settings.</string>
 
 </resources>
\ No newline at end of file
index 32b9c82..4025c4d 100644 (file)
     <string name="tb_restoring_settings">Restoring settings&#8230;</string>
 
     <string name="tb_pref_header_desktop_mode">Desktop mode</string>
+    <string name="tb_primary_launcher">Primary launcher</string>
+
+    <string name="tb_hsl_no_launchers_found">No third-party launchers were found.\n\nPlease download and install one, then re-open this application.</string>
+    <string name="tb_hsl_launcher_uninstalled">%1$s was uninstalled. Please select a different launcher from the list.</string>
+    <string name="tb_hsl_main_activity_text">Select your primary launcher from the list below.\n\nYou can change this selection at any time from within Taskbar\'s desktop mode settings.</string>
 
 </resources>
\ No newline at end of file
index e8adcfa..a7220a3 100644 (file)
@@ -404,5 +404,10 @@ Bu durumda, bu cihazdaki serbest biçimli modu kullanmak için özel bir ROM fla
     <string name="tb_restoring_settings">Restoring settings&#8230;</string>
 
     <string name="tb_pref_header_desktop_mode">Desktop mode</string>
+    <string name="tb_primary_launcher">Primary launcher</string>
+
+    <string name="tb_hsl_no_launchers_found">No third-party launchers were found.\n\nPlease download and install one, then re-open this application.</string>
+    <string name="tb_hsl_launcher_uninstalled">%1$s was uninstalled. Please select a different launcher from the list.</string>
+    <string name="tb_hsl_main_activity_text">Select your primary launcher from the list below.\n\nYou can change this selection at any time from within Taskbar\'s desktop mode settings.</string>
 
 </resources>
\ No newline at end of file
index 5cb1e55..7dd6c71 100644 (file)
     <string name="tb_restoring_settings">Restoring settings&#8230;</string>
 
     <string name="tb_pref_header_desktop_mode">Desktop mode</string>
+    <string name="tb_primary_launcher">Primary launcher</string>
+
+    <string name="tb_hsl_no_launchers_found">No third-party launchers were found.\n\nPlease download and install one, then re-open this application.</string>
+    <string name="tb_hsl_launcher_uninstalled">%1$s was uninstalled. Please select a different launcher from the list.</string>
+    <string name="tb_hsl_main_activity_text">Select your primary launcher from the list below.\n\nYou can change this selection at any time from within Taskbar\'s desktop mode settings.</string>
 
 </resources>
\ No newline at end of file
index 65450e5..373866a 100644 (file)
@@ -45,4 +45,9 @@
 
     <color name="tb_desktop_icon_text">#FFFFFF</color>
     <color name="tb_desktop_icon_shadow">#000000</color>
+
+    <color name="tb_hsl_primary">#0277BD</color>
+    <color name="tb_hsl_background">#012C4E</color>
+    <color name="tb_hsl_button">#C1C1C1</color>
+
 </resources>
index a2ff29d..5c651e9 100644 (file)
     <string name="tb_restoring_settings">Restoring settings&#8230;</string>
 
     <string name="tb_pref_header_desktop_mode">Desktop mode</string>
+    <string name="tb_primary_launcher">Primary launcher</string>
+
+    <string name="tb_hsl_no_launchers_found">No primary launchers were found. Please download and install one, then try again.</string>
+    <string name="tb_hsl_launcher_uninstalled">%1$s was uninstalled. Please select a different launcher from the list.</string>
+    <string name="tb_hsl_main_activity_text">Select your primary launcher from the list below. You can change this selection at any time from within Taskbar\'s desktop mode settings.</string>
 
 </resources>
index bdde904..360c6c0 100644 (file)
         <item name="android:colorAccent">@color/tb_colorAccent</item>
     </style>
 
+    <style name="Taskbar.HSLConfigActivity" parent="Theme.AppCompat">
+        <item name="colorPrimary">@color/tb_hsl_background</item>
+        <item name="android:windowBackground">@color/tb_hsl_background</item>
+        <item name="tb_settings_icon_color">@color/tb_settings_icon_color_dark</item>
+    </style>
+
 </resources>
\ No newline at end of file
index f2e7d2c..d3de176 100644 (file)
@@ -22,8 +22,9 @@
         android:title="@string/tb_pref_header_desktop_mode"/>
 
     <Preference
-        android:key="set_as_default"
-        android:title="Set as default"/>
+        android:key="primary_launcher"
+        android:title="@string/tb_primary_launcher"
+        android:dependency="desktop_mode"/>
 
     <PreferenceCategory android:key="dummy" android:title="\n\n" />
 
index cee4b86..f543d6a 100644 (file)
         <activity
             android:name=".activity.BackupRestoreActivity"
             android:theme="@style/Taskbar.Dialog"/>
+        <activity
+            android:name=".activity.HSLActivity"
+            android:label="${appName}"
+            android:launchMode="singleTask"
+            android:enabled="false"
+            android:theme="@android:style/Theme.NoDisplay">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+
+                <category android:name="android.intent.category.DEFAULT" />
+                <category android:name="android.intent.category.HOME"/>
+            </intent-filter>
+        </activity>
+        <activity
+            android:name=".activity.HSLConfigActivity"
+            android:label="${appName}"
+            android:launchMode="singleTask"
+            android:theme="@style/Taskbar.HSLConfigActivity"/>
 
         <service android:name=".service.TaskbarService"/>
         <service android:name=".service.StartMenuService"/>