OSDN Git Service

Attempting to add Project Sakura logo
authorhmtheboy154 <buingoc67@gmail.com>
Thu, 2 Sep 2021 03:52:24 +0000 (03:52 +0000)
committerhmtheboy154 <buingoc67@gmail.com>
Thu, 2 Sep 2021 03:52:24 +0000 (03:52 +0000)
app/src/main/java/com/farmerbb/taskbar/activity/NavigationBarButtonsActivity.java
app/src/main/java/com/farmerbb/taskbar/ui/TaskbarController.java
app/src/main/java/com/farmerbb/taskbar/util/U.java
app/src/main/res/drawable-mdpi/tb_sakura.png [new file with mode: 0644]
app/src/main/res/drawable-nodpi/tb_sakura.png [new file with mode: 0644]
app/src/main/res/drawable-xhdpi/tb_sakura.png [new file with mode: 0644]
app/src/main/res/drawable-xxhdpi/tb_sakura.png [new file with mode: 0644]
app/src/main/res/drawable-xxxhdpi/tb_sakura.png [new file with mode: 0644]
app/src/main/res/drawable/sakura.png [new file with mode: 0644]
app/src/main/res/drawable/tb_sakura.png [new file with mode: 0644]

index cac917e..8457b41 100644 (file)
@@ -41,7 +41,7 @@ public class NavigationBarButtonsActivity extends PreferenceActivity implements
         findPreference(PREF_BUTTON_RECENTS).setOnPreferenceClickListener(this);
 
         if(U.isShowHideNavbarSupported()
-                && (U.isBlissOs(this) || U.hasSupportLibrary(this, 7)))
+                && (U.isBlissOs(this) || U.isProjectSakura(this) || U.hasSupportLibrary(this, 7)))
             findPreference(PREF_AUTO_HIDE_NAVBAR).setOnPreferenceClickListener(this);
         else
             getPreferenceScreen().removePreference(findPreference(PREF_AUTO_HIDE_NAVBAR_CATEGORY));
index 190c591..6c80892 100644 (file)
@@ -455,8 +455,10 @@ public class TaskbarController extends UIController {
             case PREF_START_BUTTON_IMAGE_APP_LOGO:
                 Drawable drawable;
 
-                if(U.isAndroidGeneric(context)) {
+                if(U.isBlissOs(context)) {
                     drawable = ContextCompat.getDrawable(context, R.drawable.tb_bliss);
+            }   else if(U.isProjectSakura(context)) {
+                    drawable = ContextCompat.getDrawable(context, R.drawable.tb_sakura);                         
                 } else {
                     LauncherApps launcherApps = (LauncherApps) context.getSystemService(Context.LAUNCHER_APPS_SERVICE);
                     LauncherActivityInfo info = launcherApps.getActivityList(context.getPackageName(), Process.myUserHandle()).get(0);
index 433aab6..b436001 100644 (file)
@@ -1111,8 +1111,20 @@ public class U {
                 && isSystemApp(context);
     }
 
+    public static boolean isProjectSakura(Context context) {
+        boolean validSakuraBuildProp = false;
+
+        String sakuraVersion = getSystemProperty("ro.lineage.build.version");
+        if(sakuraVersion != null && !sakuraVersion.isEmpty())
+            validSakuraBuildProp = true;
+
+        return validSakuraBuildProp
+                && context.getPackageName().equals(BuildConfig.BASE_APPLICATION_ID)
+                && isSystemApp(context);
+    }
+
     public static boolean isAndroidGeneric(Context context) {
-        if(isBlissOs(context)) return true;
+        if(isBlissOs(context) || isProjectSakura(context)) return true;
 
         boolean validAndroidGenericBuildProp = false;
 
@@ -1260,6 +1272,7 @@ public class U {
         if(!isShowHideNavbarSupported()
                 || (!isDesktopModeActive(context)
                 && !isBlissOs(context)
+                && !isProjectSakura(context)
                 && !hasSupportLibrary(context, 7))) {
             return;
         }
@@ -1292,8 +1305,8 @@ public class U {
             return;
         }
 
-        // Show or hide the system navigation bar on Bliss-x86
-        if(!isBlissOs(context)) return;
+        // Show or hide the system navigation bar on Bliss-x86 and Project Sakura
+        if(!isBlissOs(context) || !isProjectSakura(context)) return;
 
         try {
             if(getCurrentApiVersion() >= 28.0f)
diff --git a/app/src/main/res/drawable-mdpi/tb_sakura.png b/app/src/main/res/drawable-mdpi/tb_sakura.png
new file mode 100644 (file)
index 0000000..5000a39
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/tb_sakura.png differ
diff --git a/app/src/main/res/drawable-nodpi/tb_sakura.png b/app/src/main/res/drawable-nodpi/tb_sakura.png
new file mode 100644 (file)
index 0000000..4b3e861
Binary files /dev/null and b/app/src/main/res/drawable-nodpi/tb_sakura.png differ
diff --git a/app/src/main/res/drawable-xhdpi/tb_sakura.png b/app/src/main/res/drawable-xhdpi/tb_sakura.png
new file mode 100644 (file)
index 0000000..ae86336
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/tb_sakura.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/tb_sakura.png b/app/src/main/res/drawable-xxhdpi/tb_sakura.png
new file mode 100644 (file)
index 0000000..5beb0d7
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/tb_sakura.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/tb_sakura.png b/app/src/main/res/drawable-xxxhdpi/tb_sakura.png
new file mode 100644 (file)
index 0000000..4b89139
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/tb_sakura.png differ
diff --git a/app/src/main/res/drawable/sakura.png b/app/src/main/res/drawable/sakura.png
new file mode 100644 (file)
index 0000000..c39644d
Binary files /dev/null and b/app/src/main/res/drawable/sakura.png differ
diff --git a/app/src/main/res/drawable/tb_sakura.png b/app/src/main/res/drawable/tb_sakura.png
new file mode 100644 (file)
index 0000000..4b3e861
Binary files /dev/null and b/app/src/main/res/drawable/tb_sakura.png differ