OSDN Git Service

Miscellaneous things
authorBraden Farmer <farmerbb@gmail.com>
Wed, 30 Oct 2019 01:18:30 +0000 (19:18 -0600)
committerBraden Farmer <farmerbb@gmail.com>
Wed, 30 Oct 2019 01:18:30 +0000 (19:18 -0600)
* Add documentation to Taskbar.java API
* Disable auto hide navbar on Bliss OS by default

app/src/lib/java/com/farmerbb/taskbar/lib/Taskbar.java
app/src/main/java/com/farmerbb/taskbar/fragment/SettingsFragment.java
app/src/main/java/com/farmerbb/taskbar/util/U.java

index ec099f9..81d23b0 100644 (file)
@@ -19,6 +19,9 @@ import android.app.Activity;
 import android.content.Context;
 import android.content.Intent;
 import android.support.annotation.Keep;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.annotation.StyleRes;
 
 import com.farmerbb.taskbar.activity.MainActivity;
 
@@ -26,18 +29,45 @@ import com.farmerbb.taskbar.activity.MainActivity;
 
     private Taskbar() {}
 
-    @Keep public static void openSettings(Context context) {
+    /**
+     * Opens the settings page for configuring Taskbar.
+     * @param context Context used to start the activity
+     */
+    @Keep public static void openSettings(@NonNull Context context) {
         openSettings(context, null, -1);
     }
 
-    @Keep public static void openSettings(Context context, String title) {
+    /**
+     * Opens the settings page for configuring Taskbar, using the specified title.
+     * @param context Context used to start the activity
+     * @param title Title to display in the top level of the settings hierarchy.
+     *              If null, defaults to "Settings".
+     */
+    @Keep public static void openSettings(@NonNull Context context, @Nullable String title) {
         openSettings(context, title, -1);
     }
-    @Keep public static void openSettings(Context context, int theme) {
+
+    /**
+     * Opens the settings page for configuring Taskbar, using the specified theme.
+     * @param context Context used to start the activity
+     * @param theme Theme to apply to the settings activity. If set to -1, the activity will
+     *              use the app's default theme if it is a derivative of Theme.AppCompat,
+     *              or Theme.AppCompat.Light otherwise.
+     */
+    @Keep public static void openSettings(@NonNull Context context, @StyleRes int theme) {
         openSettings(context, null, theme);
     }
 
-    @Keep public static void openSettings(Context context, String title, int theme) {
+    /**
+     * Opens the settings page for configuring Taskbar, using the specified title and theme.
+     * @param context Context used to start the activity
+     * @param title Title to display in the top level of the settings hierarchy.
+     *              If null, defaults to "Settings".
+     * @param theme Theme to apply to the settings activity. If set to -1, the activity will
+     *              use the app's default theme if it is a derivative of Theme.AppCompat,
+     *              or Theme.AppCompat.Light otherwise.
+     */
+    @Keep public static void openSettings(@NonNull Context context, @Nullable String title, @StyleRes int theme) {
         Intent intent = new Intent(context, MainActivity.class);
         intent.putExtra("title", title);
         intent.putExtra("theme", theme);
index 814fa3a..151f15d 100644 (file)
@@ -39,6 +39,7 @@ public abstract class SettingsFragment extends PreferenceFragment {
     boolean showReminderToast = false;
     boolean restartNotificationService = false;
 
+    @SuppressWarnings("deprecation")
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
index 3dba331..026426d 100644 (file)
@@ -1240,7 +1240,7 @@ public class U {
             editor.putBoolean("button_back", true);
             editor.putBoolean("button_home", true);
             editor.putBoolean("button_recents", true);
-            editor.putBoolean("auto_hide_navbar", true);
+         // editor.putBoolean("auto_hide_navbar", true);
          // editor.putBoolean("shortcut_icon", false);
             editor.putBoolean("bliss_os_prefs", true);
             editor.apply();