Update UI: a concept for launching icon
This commit is contained in:
1 parent
0bf8beda94
commit
4b4f5d145b
14 files changed
+50
-17
No files matched your search
@@ -38,12 +38,18 @@ class WidgetProvider : AppWidgetProvider() {
|
||||
})
|
||||
remoteViews.setOnClickPendingIntent(R.id.layout_switch, pendingIntent)
|
||||
if (isRunning) {
|
||||
if (!Utils.getDarkModeStatus(context)) {
|
||||
remoteViews.setInt(R.id.image_switch, "setImageResource", R.drawable.ic_stat_name)
|
||||
}
|
||||
remoteViews.setInt(
|
||||
R.id.layout_switch,
|
||||
"setBackgroundResource",
|
||||
R.drawable.ic_rounded_corner_theme
|
||||
R.drawable.ic_rounded_corner_active
|
||||
)
|
||||
} else {
|
||||
if (!Utils.getDarkModeStatus(context)) {
|
||||
remoteViews.setInt(R.id.image_switch, "setImageResource", R.drawable.ic_stat_name_black)
|
||||
}
|
||||
remoteViews.setInt(
|
||||
R.id.layout_switch,
|
||||
"setBackgroundResource",
|
||||
|
||||
@@ -131,11 +131,17 @@ class MainActivity : BaseActivity(), NavigationView.OnNavigationItemSelectedList
|
||||
mainViewModel.isRunning.observe(this) { isRunning ->
|
||||
adapter.isRunning = isRunning
|
||||
if (isRunning) {
|
||||
binding.fab.backgroundTintList = ColorStateList.valueOf(ContextCompat.getColor(this, R.color.colorSelected))
|
||||
if (!Utils.getDarkModeStatus(this)) {
|
||||
binding.fab.setImageResource(R.drawable.ic_stat_name)
|
||||
}
|
||||
binding.fab.backgroundTintList = ColorStateList.valueOf(ContextCompat.getColor(this, R.color.color_fab_orange))
|
||||
setTestState(getString(R.string.connection_connected))
|
||||
binding.layoutTest.isFocusable = true
|
||||
} else {
|
||||
binding.fab.backgroundTintList = ColorStateList.valueOf(ContextCompat.getColor(this, R.color.colorUnselected))
|
||||
if (!Utils.getDarkModeStatus(this)) {
|
||||
binding.fab.setImageResource(R.drawable.ic_stat_name_black)
|
||||
}
|
||||
binding.fab.backgroundTintList = ColorStateList.valueOf(ContextCompat.getColor(this, R.color.color_fab_grey))
|
||||
setTestState(getString(R.string.connection_not_connected))
|
||||
binding.layoutTest.isFocusable = false
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
android:bottom="2dp" />
|
||||
|
||||
<item
|
||||
android:drawable="@drawable/ic_stat_name_grey"
|
||||
android:drawable="@drawable/ic_stat_name"
|
||||
android:left="12dp"
|
||||
android:top="12dp"
|
||||
android:right="12dp"
|
||||
+3
-3
@@ -5,14 +5,14 @@
|
||||
android:viewportHeight="48">
|
||||
|
||||
<path
|
||||
android:fillColor="#999999"
|
||||
android:fillColor="@color/colorBg"
|
||||
android:pathData="M24,24m-22,0a22,22 0,1 1,44 0a22,22 0,1 1,-44 0Z" />
|
||||
<path
|
||||
android:fillColor="#ffffff"
|
||||
android:fillColor="@color/colorText"
|
||||
android:pathData="M24,21.8 C25.7673,21.8,27.2,23.2327,27.2,25 C27.2,26.7673,25.7673,28.2,24,28.2
|
||||
C22.2327,28.2,20.8,26.7673,20.8,25 C20.8,23.2327,22.2327,21.8,24,21.8 Z" />
|
||||
<path
|
||||
android:fillColor="#ffffff"
|
||||
android:fillColor="@color/colorText"
|
||||
android:pathData="M21,15 L19.17,17 L16,17 A2,2,0,0,0,14,19 L14,31 A2,2,0,0,0,16,33 L32,33
|
||||
A2,2,0,0,0,34,31 L34,19 A2,2,0,0,0,32,17 L28.83,17 L27,15 Z M24,30
|
||||
A5,5,0,1,1,29,25 A5,5,0,0,1,24,30 Z" />
|
||||
+2
-2
@@ -4,10 +4,10 @@
|
||||
android:viewportHeight="1024"
|
||||
android:viewportWidth="1024">
|
||||
<path
|
||||
android:fillColor="#999999"
|
||||
android:fillColor="@color/colorBg"
|
||||
android:pathData="M0,512C0,229.23 229.81,0 512,0 794.77,0 1024,229.81 1024,512 1024,794.77 794.19,1024 512,1024 229.23,1024 0,794.19 0,512Z" />
|
||||
|
||||
<path
|
||||
android:fillColor="#ffffff"
|
||||
android:fillColor="@color/colorText"
|
||||
android:pathData="M515.24,389.28c-67.56,0 -122.33,54.77 -122.33,122.33 0,67.58 54.77,122.35 122.33,122.35 67.58,0 122.34,-54.77 122.34,-122.35C637.57,444.04 582.81,389.28 515.24,389.28L515.24,389.28zM582.53,578.9c-17.98,17.98 -41.87,27.87 -67.29,27.87 -25.41,0 -49.31,-9.89 -67.28,-27.87s-27.87,-41.86 -27.87,-67.29c0,-25.42 9.91,-49.31 27.87,-67.28 17.97,-17.98 41.87,-27.87 67.28,-27.87 25.43,0 49.32,9.91 67.29,27.87 17.97,17.97 27.86,41.86 27.86,67.28C610.39,537.03 600.5,560.92 582.53,578.9L582.53,578.9zM816.2,588.62c0.18,-0.2 0.36,-0.43 0.52,-0.66 0.08,-0.12 0.15,-0.22 0.25,-0.35 0.15,-0.2 0.29,-0.43 0.43,-0.66 0.08,-0.14 0.16,-0.27 0.24,-0.41 0.12,-0.2 0.22,-0.42 0.34,-0.64 0.07,-0.17 0.15,-0.33 0.22,-0.48 0.09,-0.2 0.16,-0.4 0.24,-0.6 0.07,-0.19 0.15,-0.38 0.22,-0.57 0.06,-0.18 0.11,-0.39 0.17,-0.57 0.06,-0.21 0.12,-0.42 0.17,-0.64 0,-0.01 0,-0.02 0,-0.04 5.46,-23.29 8.23,-47.32 8.23,-71.43 0,-24.1 -2.77,-48.14 -8.23,-71.42 0,-0.02 0,-0.04 -0.01,-0.06 -0.09,-0.38 -0.2,-0.74 -0.32,-1.11 -0.02,-0.06 -0.04,-0.13 -0.07,-0.19 -0.14,-0.4 -0.3,-0.78 -0.46,-1.16 -0.02,-0.03 -0.02,-0.06 -0.04,-0.1 -0.18,-0.41 -0.4,-0.79 -0.62,-1.18l0,0c-1.99,-3.39 -5.4,-5.81 -9.39,-6.5 -0.01,0 -0.02,-0.01 -0.04,-0.01 -0.28,-0.04 -0.56,-0.07 -0.86,-0.1 -0.17,-0.01 -0.34,-0.05 -0.51,-0.06 -0.19,-0.01 -0.38,-0.01 -0.56,-0.01 -0.28,-0.01 -0.56,-0.02 -0.85,-0.01 -0.02,0 -0.04,0 -0.07,0 -1.29,0.06 -2.41,0.08 -3.48,0.08 -44.92,0 -81.45,-36.54 -81.45,-81.45 0,-15.84 4.55,-31.2 13.16,-44.4 0.02,-0.02 0.02,-0.04 0.04,-0.06 0.17,-0.28 0.34,-0.57 0.49,-0.85 0.07,-0.11 0.12,-0.22 0.17,-0.33 0.14,-0.28 0.26,-0.56 0.38,-0.84 0.06,-0.14 0.14,-0.27 0.19,-0.42 0.09,-0.22 0.15,-0.45 0.22,-0.67 0.07,-0.2 0.14,-0.41 0.2,-0.61 0.04,-0.15 0.07,-0.3 0.1,-0.45 0.07,-0.28 0.14,-0.56 0.19,-0.85 0.01,-0.07 0.02,-0.14 0.03,-0.2 0.07,-0.37 0.12,-0.74 0.14,-1.11 0,-0.03 0,-0.06 0,-0.09 0.03,-0.4 0.04,-0.8 0.04,-1.21 -0.01,-0.1 -0.02,-0.21 -0.04,-0.31 -0.01,-0.33 -0.03,-0.65 -0.07,-0.98 -0.02,-0.26 -0.09,-0.51 -0.12,-0.77 -0.02,-0.17 -0.04,-0.34 -0.09,-0.51 -0.08,-0.33 -0.17,-0.67 -0.25,-1 -0.04,-0.09 -0.05,-0.17 -0.07,-0.26 -0.12,-0.31 -0.22,-0.61 -0.35,-0.92 -0.04,-0.1 -0.07,-0.2 -0.12,-0.3 -0.11,-0.25 -0.22,-0.48 -0.35,-0.72 -0.08,-0.17 -0.14,-0.33 -0.22,-0.48 -0.09,-0.17 -0.2,-0.33 -0.3,-0.5 -0.13,-0.22 -0.27,-0.45 -0.4,-0.66 -0.09,-0.11 -0.16,-0.22 -0.24,-0.33 -0.2,-0.26 -0.38,-0.51 -0.6,-0.76 -0.06,-0.08 -0.15,-0.16 -0.22,-0.24 -0.22,-0.26 -0.46,-0.51 -0.72,-0.77 -0.02,-0.01 -0.03,-0.03 -0.04,-0.04 -35.58,-34.22 -79.25,-59.78 -126.27,-73.91 -0.1,-0.04 -0.21,-0.06 -0.32,-0.08 -0.25,-0.07 -0.51,-0.14 -0.77,-0.19 -0.18,-0.04 -0.38,-0.08 -0.56,-0.11 -0.25,-0.04 -0.51,-0.08 -0.75,-0.11 -0.2,-0.02 -0.4,-0.04 -0.61,-0.05 -0.22,-0.02 -0.46,-0.03 -0.7,-0.03 -0.22,-0.01 -0.44,0 -0.65,0 -0.22,0.01 -0.43,0.03 -0.64,0.04 -0.23,0.01 -0.46,0.04 -0.69,0.08 -0.2,0.02 -0.4,0.06 -0.6,0.09 -0.23,0.04 -0.46,0.09 -0.69,0.14 -0.2,0.05 -0.4,0.1 -0.6,0.16 -0.22,0.06 -0.43,0.13 -0.64,0.2 -0.21,0.07 -0.41,0.14 -0.61,0.22 -0.2,0.08 -0.4,0.16 -0.59,0.25 -0.2,0.1 -0.42,0.19 -0.62,0.3 -0.17,0.09 -0.35,0.18 -0.52,0.28 -0.21,0.12 -0.42,0.25 -0.63,0.38 -0.15,0.1 -0.32,0.21 -0.47,0.3 -0.2,0.15 -0.4,0.29 -0.6,0.45 -0.14,0.11 -0.3,0.23 -0.44,0.35 -0.17,0.16 -0.36,0.32 -0.53,0.48 -0.15,0.14 -0.3,0.28 -0.44,0.43 -0.15,0.17 -0.32,0.34 -0.46,0.51 -0.15,0.17 -0.3,0.35 -0.44,0.53 -0.14,0.16 -0.25,0.33 -0.38,0.5 -0.15,0.21 -0.29,0.42 -0.42,0.62 -0.1,0.16 -0.21,0.33 -0.31,0.5 -0.13,0.23 -0.25,0.46 -0.37,0.69 -0.05,0.1 -0.11,0.19 -0.15,0.3 -6.5,13.8 -16.71,25.48 -29.54,33.79 -13.16,8.52 -28.45,13.02 -44.21,13.02 -15.75,0 -31.04,-4.5 -44.2,-13.02 -12.83,-8.32 -23.05,-19.99 -29.55,-33.79 -0.04,-0.11 -0.1,-0.2 -0.15,-0.29 -0.12,-0.24 -0.25,-0.48 -0.37,-0.71 -0.1,-0.17 -0.2,-0.33 -0.3,-0.5 -0.14,-0.21 -0.28,-0.43 -0.43,-0.62 -0.12,-0.17 -0.25,-0.33 -0.37,-0.5 -0.14,-0.18 -0.29,-0.35 -0.44,-0.53 -0.14,-0.17 -0.3,-0.34 -0.46,-0.5 -0.15,-0.15 -0.3,-0.3 -0.45,-0.44 -0.17,-0.17 -0.35,-0.33 -0.53,-0.48 -0.15,-0.12 -0.3,-0.25 -0.46,-0.37 -0.2,-0.15 -0.39,-0.29 -0.59,-0.43 -0.16,-0.11 -0.33,-0.22 -0.48,-0.33 -0.2,-0.12 -0.4,-0.25 -0.61,-0.37 -0.17,-0.1 -0.35,-0.19 -0.53,-0.29 -0.2,-0.1 -0.4,-0.19 -0.61,-0.29 -0.2,-0.09 -0.4,-0.17 -0.6,-0.25 -0.2,-0.08 -0.4,-0.15 -0.59,-0.22 -0.22,-0.07 -0.44,-0.14 -0.66,-0.2 -0.2,-0.06 -0.39,-0.11 -0.59,-0.16 -0.23,-0.05 -0.46,-0.1 -0.69,-0.14 -0.2,-0.03 -0.4,-0.07 -0.6,-0.09 -0.23,-0.03 -0.46,-0.06 -0.69,-0.08 -0.22,-0.01 -0.43,-0.03 -0.64,-0.03 -0.22,-0.01 -0.44,-0.01 -0.66,-0.01 -0.23,0 -0.46,0.01 -0.71,0.03 -0.2,0.01 -0.4,0.03 -0.6,0.05 -0.25,0.03 -0.51,0.07 -0.76,0.11 -0.19,0.03 -0.38,0.07 -0.57,0.11 -0.25,0.05 -0.51,0.12 -0.77,0.19 -0.11,0.03 -0.21,0.04 -0.31,0.08 -46.64,14.02 -90.02,39.3 -125.43,73.1 -0.04,0.04 -0.07,0.08 -0.11,0.12 -0.2,0.2 -0.4,0.4 -0.59,0.61 -0.12,0.13 -0.23,0.26 -0.35,0.39 -0.17,0.21 -0.33,0.42 -0.48,0.64 -0.12,0.15 -0.23,0.3 -0.34,0.46 -0.13,0.19 -0.25,0.39 -0.37,0.59 -0.12,0.19 -0.23,0.38 -0.34,0.56 -0.09,0.18 -0.17,0.36 -0.26,0.54 -0.11,0.Line truncated
|
||||
</vector>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:drawable="@drawable/ic_shortcut_background"
|
||||
android:left="2dp"
|
||||
android:top="2dp"
|
||||
android:right="2dp"
|
||||
android:bottom="2dp" />
|
||||
|
||||
<item
|
||||
android:drawable="@drawable/ic_stat_name_black"
|
||||
android:left="12dp"
|
||||
android:top="12dp"
|
||||
android:right="12dp"
|
||||
android:bottom="12dp" />
|
||||
|
||||
</layer-list>
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/colorSelected"/>
|
||||
<solid android:color="@color/color_fab_orange"/>
|
||||
<corners android:radius="20dp"/>
|
||||
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" />
|
||||
</shape>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/colorUnselected"/>
|
||||
<solid android:color="@color/color_fab_grey"/>
|
||||
<corners android:radius="20dp"/>
|
||||
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" />
|
||||
</shape>
|
||||
@@ -2,6 +2,6 @@
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="@color/colorUnselected" />
|
||||
<solid android:color="@color/colorBg" />
|
||||
<size android:width="44dp" android:height="44dp" />
|
||||
</shape>
|
||||
@@ -91,7 +91,7 @@
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:nextFocusLeft="@+id/layout_test"
|
||||
android:src="@drawable/ic_stat_name_grey"
|
||||
android:src="@drawable/ic_stat_name"
|
||||
app:layout_anchorGravity="bottom|right|end" />
|
||||
|
||||
</com.github.jorgecastilloprz.FABProgressCircle>
|
||||
|
||||
@@ -8,8 +8,9 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/image_switch"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:padding="10dp"
|
||||
android:src="@drawable/ic_stat_name_grey" />
|
||||
android:src="@drawable/ic_stat_name" />
|
||||
</LinearLayout>
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="color_fab_grey">#424242</color>
|
||||
<color name="color_secondary">#BDBDBD</color>
|
||||
<color name="colorSelected">#FFFFFF</color>
|
||||
<color name="colorUnselected">#222222</color>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<color name="colorPingRed">#FF0099</color>
|
||||
<color name="color_fab_orange">#f97910</color>
|
||||
|
||||
<color name="color_fab_grey">#EDEDED</color>
|
||||
<color name="color_secondary">#727272</color>
|
||||
<color name="colorSelected">#000000</color>
|
||||
<color name="colorUnselected">#FFFFFF</color>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<shortcut
|
||||
android:enabled="true"
|
||||
android:icon="@drawable/ic_qu_switch_black_24dp"
|
||||
android:icon="@drawable/ic_qu_switch_24dp"
|
||||
android:shortcutDisabledMessage="@string/app_widget_name"
|
||||
android:shortcutId="shortcuts_switch"
|
||||
android:shortcutLongLabel="@string/app_widget_name"
|
||||
@@ -16,7 +16,7 @@
|
||||
</shortcut>
|
||||
<shortcut
|
||||
android:enabled="true"
|
||||
android:icon="@drawable/ic_qu_scan_black_24dp"
|
||||
android:icon="@drawable/ic_qu_scan_24dp"
|
||||
android:shortcutDisabledMessage="@string/menu_item_import_config_qrcode"
|
||||
android:shortcutId="shortcuts_scan"
|
||||
android:shortcutLongLabel="@string/menu_item_import_config_qrcode"
|
||||
@@ -30,7 +30,7 @@
|
||||
</shortcut>
|
||||
<shortcut
|
||||
android:enabled="true"
|
||||
android:icon="@drawable/ic_qu_settings_black_24dp"
|
||||
android:icon="@drawable/ic_qu_settings_24dp"
|
||||
android:shortcutDisabledMessage="@string/title_settings"
|
||||
android:shortcutId="shortcuts_settings"
|
||||
android:shortcutLongLabel="@string/title_settings"
|
||||
|
||||
Reference in new issue
Block a user