OSDN Git Service

Couple of changes for consistency
authorBraden Farmer <farmerbb@gmail.com>
Wed, 20 May 2020 22:21:09 +0000 (16:21 -0600)
committerBraden Farmer <farmerbb@gmail.com>
Wed, 20 May 2020 22:21:09 +0000 (16:21 -0600)
app/src/main/java/com/farmerbb/taskbar/activity/MainActivity.java
app/src/main/java/com/farmerbb/taskbar/activity/ShortcutActivity.java
app/src/main/java/com/farmerbb/taskbar/activity/StartTaskbarActivity.java
app/src/main/java/com/farmerbb/taskbar/util/Constants.java
app/src/nonlib/java/com/farmerbb/taskbar/util/ShortcutUtils.java

index 6a602a6..7bfd093 100644 (file)
@@ -275,7 +275,7 @@ public class MainActivity extends AppCompatActivity {
             if(shortcutManager.getDynamicShortcuts().size() == 0) {
                 Intent intent = new Intent(Intent.ACTION_MAIN);
                 intent.setClass(this, StartTaskbarActivity.class);
-                intent.putExtra(EXTRA_IS_LAUNCHING_SHORT_CUT, true);
+                intent.putExtra(EXTRA_IS_LAUNCHING_SHORTCUT, true);
 
                 ShortcutInfo shortcut = new ShortcutInfo.Builder(this, "start_taskbar")
                         .setShortLabel(getString(R.string.tb_start_taskbar))
@@ -286,7 +286,7 @@ public class MainActivity extends AppCompatActivity {
                 if(U.enableFreeformModeShortcut(this)) {
                     Intent intent2 = new Intent(Intent.ACTION_MAIN);
                     intent2.setClass(this, ShortcutActivity.class);
-                    intent2.putExtra(EXTRA_IS_LAUNCHING_SHORT_CUT, true);
+                    intent2.putExtra(EXTRA_IS_LAUNCHING_SHORTCUT, true);
 
                     ShortcutInfo shortcut2 = new ShortcutInfo.Builder(this, "freeform_mode")
                             .setShortLabel(getString(R.string.tb_pref_header_freeform))
index 988af1c..82e8b93 100644 (file)
@@ -33,7 +33,7 @@ public class ShortcutActivity extends Activity {
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
-        if(getIntent().hasExtra(EXTRA_IS_LAUNCHING_SHORT_CUT)) {
+        if(getIntent().hasExtra(EXTRA_IS_LAUNCHING_SHORTCUT)) {
             if(U.hasFreeformSupport(this)) {
                 U.restartNotificationService(this);
 
index 8fb75c6..f085e7a 100644 (file)
@@ -32,7 +32,7 @@ public class StartTaskbarActivity extends Activity {
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
-        if(getIntent().hasExtra(EXTRA_IS_LAUNCHING_SHORT_CUT)) {
+        if(getIntent().hasExtra(EXTRA_IS_LAUNCHING_SHORTCUT)) {
             Intent intent = new Intent(U.isServiceRunning(this, NotificationService.class)
                     ? ACTION_QUIT
                     : ACTION_START);
index d11ff8e..3e8791f 100644 (file)
@@ -195,5 +195,6 @@ public class Constants {
     public static final String POSITION_TOP_VERTICAL_RIGHT = "top_vertical_right";
 
     // Intent extra keys
-    public static final String EXTRA_IS_LAUNCHING_SHORT_CUT = "is_launching_shortcut";
+
+    public static final String EXTRA_IS_LAUNCHING_SHORTCUT = "is_launching_shortcut";
 }
index 267c13a..c1d31db 100644 (file)
@@ -30,6 +30,8 @@ import com.farmerbb.taskbar.service.FavoriteApp3;
 import com.farmerbb.taskbar.service.FavoriteApp4;
 import com.farmerbb.taskbar.service.FavoriteApp5;
 
+import static com.farmerbb.taskbar.util.Constants.*;
+
 public class ShortcutUtils {
 
     private ShortcutUtils() {}
@@ -37,7 +39,7 @@ public class ShortcutUtils {
     public static Intent getShortcutIntent(Context context) {
         Intent shortcutIntent = new Intent(context, ShortcutActivity.class);
         shortcutIntent.setAction(Intent.ACTION_MAIN);
-        shortcutIntent.putExtra(Constants.EXTRA_IS_LAUNCHING_SHORT_CUT, true);
+        shortcutIntent.putExtra(EXTRA_IS_LAUNCHING_SHORTCUT, true);
 
         Intent intent = new Intent();
         intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
@@ -50,7 +52,7 @@ public class ShortcutUtils {
     public static Intent getStartStopIntent(Context context) {
         Intent shortcutIntent = new Intent(context, StartTaskbarActivity.class);
         shortcutIntent.setAction(Intent.ACTION_MAIN);
-        shortcutIntent.putExtra(Constants.EXTRA_IS_LAUNCHING_SHORT_CUT, true);
+        shortcutIntent.putExtra(EXTRA_IS_LAUNCHING_SHORTCUT, true);
 
         Intent intent = new Intent();
         intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);