Changing icons

This commit is contained in:
z3r0c00l-2k 2019-05-20 13:43:08 +05:30
parent 20b44214ef
commit d1b9f4e0a8
8 changed files with 64 additions and 15 deletions

View file

@ -41,10 +41,10 @@ class MainActivity : AppCompatActivity() {
val alarm = AlarmHelper()
alarm.cancelAlarm(this)
if (notificStatus) {
btnNotific.background = getDrawable(R.drawable.ic_bell)
btnNotific.setImageDrawable(getDrawable(R.drawable.ic_bell))
alarm.setAlarm(this, sharedPref.getInt(AppUtils.NOTIFICATION_FREQUENCY_KEY, 30).toLong())
} else {
btnNotific.background = getDrawable(R.drawable.ic_bell_disabled)
btnNotific.setImageDrawable(getDrawable(R.drawable.ic_bell_disabled))
}
@ -77,11 +77,11 @@ class MainActivity : AppCompatActivity() {
notificStatus = !notificStatus
sharedPref.edit().putBoolean(AppUtils.NOTIFICATION_STATUS_KEY, notificStatus).apply()
if (notificStatus) {
btnNotific.background = getDrawable(R.drawable.ic_bell)
btnNotific.setImageDrawable(getDrawable(R.drawable.ic_bell))
Snackbar.make(it, "Notification Enabled..", Snackbar.LENGTH_SHORT).show()
alarm.setAlarm(this, sharedPref.getInt(AppUtils.NOTIFICATION_FREQUENCY_KEY, 30).toLong())
} else {
btnNotific.background = getDrawable(R.drawable.ic_bell_disabled)
btnNotific.setImageDrawable(getDrawable(R.drawable.ic_bell_disabled))
Snackbar.make(it, "Notification Disabled..", Snackbar.LENGTH_SHORT).show()
alarm.cancelAlarm(this)
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp"
android:viewportHeight="7.9798" android:viewportWidth="5.7857" android:width="18dp">
<group>
<clip-path android:pathData="m-0.0041,7.97313l5.78637,0l0,-7.97973l-5.78637,0z M 0,0"/>
<path android:fillColor="#fff"
android:pathData="m5.71877,6.90687c-0.08202,0.13758 -0.22489,0.2196 -0.38629,0.2196l-1.54515,0c-0.02646,0.47095 -0.41804,0.8493 -0.89693,0.8493s-0.87047,-0.3757 -0.89693,-0.8493l-1.54515,0c-0.15875,0 -0.30427,-0.08202 -0.38629,-0.2196s-0.08731,-0.30162 -0.01058,-0.44185l0.38893,-0.73024l0,-1.80444c0,-1.11653 0.74876,-2.05843 1.77004,-2.35476l0,-0.89957c0,-0.3757 0.30427,-0.67997 0.67997,-0.67997s0.67997,0.30427 0.67997,0.67997l0,0.89957c1.02128,0.29633 1.77004,1.23823 1.77004,2.35476l0,1.80444l0.38893,0.73024c0.07408,0.14023 0.07144,0.30691 -0.01058,0.44185zM2.57026,1.50151c0.10583,-0.01323 0.21166,-0.02117 0.32014,-0.02117s0.21431,0.00794 0.32014,0.02117l0,-0.82549c0,-0.17727 -0.14287,-0.32014 -0.32014,-0.32014s-0.32014,0.14287 -0.32014,0.32014zM0.80022,5.58397l4.18036,0l0,-1.65627c0,-1.15357 -0.93661,-2.09018 -2.09018,-2.09018s-2.09018,0.93661 -2.09018,2.09018zM3.42749,7.12648l-1.07419,0c0.02646,0.27252 0.25664,0.48947 0.5371,0.48947s0.51064,-0.21431 0.5371,-0.48947zM5.41184,6.63436 L5.04407,5.94645l-4.31001,0l-0.36777,0.68791c-0.02117,0.03969 -0.00529,0.07673 0.00265,0.08731 0.00794,0.01323 0.03175,0.04498 0.07673,0.04498l4.88415,0c0.04498,0 0.06879,-0.03175 0.07673,-0.04498s0.02381,-0.04762 0.00265,-0.08731z"/>
<path android:fillColor="#fff"
android:pathData="m2.89041,2.31906c-0.88899,0 -1.61129,0.7223 -1.61129,1.61129 0,0.10054 0.07937,0.17991 0.17991,0.17991s0.17991,-0.07937 0.17991,-0.17991c0,-0.69055 0.56091,-1.25146 1.25146,-1.25146 0.10054,0 0.17991,-0.07937 0.17991,-0.17991s-0.07937,-0.17991 -0.17991,-0.17991z"/>
</group>
</vector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

View file

@ -0,0 +1,8 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp"
android:viewportHeight="7.9798" android:viewportWidth="5.7857" android:width="18dp">
<path android:fillColor="#fff"
android:pathData="m5.71976,6.90687c-0.08202,0.13758 -0.22489,0.2196 -0.38629,0.2196l-1.54515,0c-0.02646,0.47095 -0.41804,0.8493 -0.89693,0.8493s-0.87047,-0.3757 -0.89693,-0.8493l-1.54515,0c-0.15875,0 -0.30427,-0.08202 -0.38629,-0.2196s-0.08731,-0.30162 -0.01058,-0.44185l0.38893,-0.73024l0,-1.80444c0,-1.11653 0.74876,-2.05843 1.77004,-2.35476l0,-0.89957c0,-0.3757 0.30427,-0.67997 0.67997,-0.67997s0.67997,0.30427 0.67997,0.67997l0,0.89957c1.02128,0.29633 1.77004,1.23823 1.77004,2.35476l0,1.80444l0.38893,0.73024c0.07408,0.14023 0.07144,0.30691 -0.01058,0.44185zM2.57125,1.5015c0.10583,-0.01323 0.21166,-0.02117 0.32014,-0.02117s0.21431,0.00794 0.32014,0.02117l0,-0.82549c0,-0.17727 -0.14287,-0.32014 -0.32014,-0.32014s-0.32014,0.14287 -0.32014,0.32014zM0.80121,5.58397l4.18036,0l0,-1.65627c0,-1.15357 -0.93661,-2.09018 -2.09018,-2.09018s-2.09018,0.93661 -2.09018,2.09018zM3.42849,7.12647l-1.07419,0c0.02646,0.27252 0.25664,0.48947 0.5371,0.48947s0.51064,-0.21431 0.5371,-0.48947zM5.41284,6.63435 L5.04507,5.94644l-4.31001,0l-0.36777,0.68791c-0.02117,0.03969 -0.00529,0.07673 0.00265,0.08731 0.00794,0.01323 0.03175,0.04498 0.07673,0.04498l4.88415,0c0.04498,0 0.06879,-0.03175 0.07673,-0.04498s0.02381,-0.04762 0.00265,-0.08731z"/>
<path android:fillColor="#00000000"
android:pathData="m0.55515,1.18929 l4.49151,6.48327"
android:strokeColor="#fff" android:strokeWidth="0.5"/>
</vector>

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp"
android:viewportHeight="54" android:viewportWidth="54" android:width="24dp">
<path android:fillColor="@color/colorWhite"
android:pathData="M27,13c-7.72,0 -14,6.28 -14,14s6.28,14 14,14s14,-6.28 14,-14S34.72,13 27,13zM27,39c-6.617,0 -12,-5.383 -12,-12s5.383,-12 12,-12s12,5.383 12,12S33.617,39 27,39z"/>
<path android:fillColor="@color/colorWhite"
android:pathData="M51.22,21h-2.018c-0.515,-1.912 -1.272,-3.742 -2.26,-5.457l1.426,-1.426c0.525,-0.525 0.814,-1.224 0.814,-1.966c0,-0.743 -0.289,-1.441 -0.814,-1.967l-4.553,-4.553c-1.05,-1.049 -2.881,-1.051 -3.933,0l-1.426,1.426C36.74,6.07 34.911,5.313 33,4.798V2.78C33,1.247 31.753,0 30.22,0H23.78C22.247,0 21,1.247 21,2.78v2.018c-1.911,0.515 -3.74,1.272 -5.457,2.26l-1.426,-1.426c-1.051,-1.052 -2.883,-1.05 -3.933,0l-4.553,4.553c-0.525,0.525 -0.814,1.224 -0.814,1.967c0,0.742 0.289,1.44 0.814,1.966l1.426,1.426C6.07,17.258 5.312,19.088 4.798,21H2.78C1.247,21 0,22.247 0,23.78v6.439C0,31.753 1.247,33 2.78,33h2.018c0.515,1.911 1.272,3.74 2.26,5.457l-1.426,1.426c-0.525,0.525 -0.814,1.224 -0.814,1.966c0,0.743 0.289,1.441 0.814,1.967l4.553,4.553c1.05,1.051 2.882,1.052 3.933,0l1.426,-1.426c1.717,0.987 3.546,1.745 5.457,2.26v2.018c0,1.533 1.247,2.78 2.78,2.78h6.439c1.533,0 2.78,-1.247 2.78,-2.78v-2.018c1.911,-0.515 3.74,-1.272 5.457,-2.26l1.426,1.426c1.052,1.052 2.882,1.05 3.933,0l4.553,-4.553c0.525,-0.525 0.814,-1.224 0.814,-1.967c0,-0.742 -0.289,-1.44 -0.814,-1.966l-1.426,-1.426c0.987,-1.717 1.745,-3.546 2.26,-5.457h2.018c1.533,0 2.78,-1.247 2.78,-2.78V23.78C54,22.247 52.753,21 51.22,21zM52,30.22C52,30.65 51.65,31 51.22,31h-3.592l-0.18,0.773c-0.521,2.237 -1.399,4.36 -2.613,6.311l-0.42,0.674l2.539,2.539c0.305,0.305 0.305,0.8 0,1.104l-4.553,4.553c-0.304,0.304 -0.799,0.306 -1.104,0l-2.539,-2.539l-0.674,0.42c-1.95,1.214 -4.073,2.093 -6.311,2.613L31,47.628v3.592C31,51.65 30.65,52 30.22,52H23.78C23.35,52 23,51.65 23,51.22v-3.592l-0.773,-0.18c-2.237,-0.521 -4.36,-1.399 -6.311,-2.613l-0.674,-0.42l-2.539,2.539c-0.306,0.306 -0.801,0.304 -1.104,0l-4.553,-4.553c-0.305,-0.305 -0.305,-0.8 0,-1.104l2.539,-2.539l-0.42,-0.674c-1.214,-1.95 -2.093,-4.073 -2.613,-6.311L6.372,31H2.78C2.35,31 2,30.65 2,30.22V23.78C2,23.35 2.35,23 2.78,23h3.592l0.18,-0.773c0.521,-2.238 1.399,-4.361 2.613,-6.311l0.42,-0.674l-2.539,-2.539c-0.305,-0.305 -0.305,-0.8 0,-1.104l4.553,-4.553c0.304,-0.304 0.799,-0.306 1.104,0l2.539,2.539l0.674,-0.42c1.95,-1.214 4.073,-2.093 6.311,-2.613L23,6.372V2.78C23,2.35 23.35,2 23.78,2h6.439C30.65,2 31,2.35 31,2.78v3.592l0.773,0.18c2.237,0.521 4.36,1.399 6.311,2.613l0.674,0.42l2.539,-2.539c0.306,-0.306 0.801,-0.304 1.104,0l4.553,4.553c0.305,0.305 0.305,0.8 0,1.104l-2.539,2.539l0.42,0.674c1.214,1.949 2.093,4.072 2.613,6.311L47.628,23h3.592C51.65,23 52,23.35 52,23.78V30.22z"/>
<path android:fillColor="@color/colorWhite"
android:pathData="M27,17c-5.514,0 -10,4.486 -10,10s4.486,10 10,10s10,-4.486 10,-10S32.514,17 27,17zM27,35c-4.411,0 -8,-3.589 -8,-8s3.589,-8 8,-8s8,3.589 8,8S31.411,35 27,35z"/>
</vector>

View file

@ -0,0 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp"
android:viewportHeight="372" android:viewportWidth="372" android:width="24dp">
<path android:fillColor="@color/colorWhite"
android:pathData="M320,19.6H52c-25.12,0 -52,13.68 -52,52v179.68c0,38.32 26.88,52 52,52h99.2v33.12h-16.48c-4.418,0 -8,3.582 -8,8s3.582,8 8,8h105.6c4.418,0 8,-3.582 8,-8s-3.582,-8 -8,-8H220.8v-33.12H320c38.32,0 52,-26.88 52,-52V71.6C372,33.28 345.12,19.6 320,19.6zM204.8,336.4h-37.6v-33.12h37.6V336.4zM356,251.28c0,10.8 -3.52,36 -36,36H52c-10.8,0 -36,-3.52 -36,-36v-11.44h340V251.28zM356,223.92H16v-152c0,-32.48 25.2,-36 36,-36h268c10.8,0 36,3.52 36,36V223.92z"/>
<path android:fillColor="@color/colorWhite"
android:pathData="M315.69,57.359c-3.532,-2.654 -8.547,-1.942 -11.201,1.59c-0.003,0.004 -0.006,0.007 -0.008,0.011l0.4,0l-59.68,80l-28,-36.4c-1.458,-1.897 -3.689,-3.042 -6.08,-3.12c-2.381,-0.068 -4.669,0.93 -6.24,2.72L159.28,154l-33.44,-57.12c-1.426,-2.405 -4.004,-3.891 -6.8,-3.92c-2.808,-0.016 -5.42,1.441 -6.88,3.84L56.96,186c-2.841,3.384 -2.4,8.43 0.984,11.271c3.384,2.841 8.43,2.4 11.271,-0.984c0.573,-0.682 1.027,-1.455 1.345,-2.287l48,-78.24l32,55.12c2.231,3.814 7.131,5.096 10.945,2.865c0.724,-0.424 1.377,-0.959 1.935,-1.585L210,120.08l28.56,37.12c1.634,1.85 3.937,2.972 6.4,3.12c2.49,-0.025 4.826,-1.208 6.32,-3.2l66,-88.56C319.934,65.028 319.222,60.013 315.69,57.359z"/>
</vector>

View file

@ -9,19 +9,33 @@
android:background="@drawable/main_bg_gradiant"
tools:context=".MainActivity">
<ImageButton
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@drawable/ic_menu"
android:id="@+id/btnMenu" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="16dp" android:layout_marginTop="16dp"
app:layout_constraintTop_toTopOf="parent"/>
android:layout_width="50dp"
android:layout_height="50dp"
android:padding="8dp"
android:background="?attr/selectableItemBackground"
android:src="@drawable/ic_settings"
android:id="@+id/btnMenu"
android:layout_marginTop="16dp"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginEnd="8dp" app:layout_constraintEnd_toEndOf="parent"/>
<ImageButton
android:layout_width="22dp"
android:layout_height="30dp"
android:background="@drawable/ic_bell"
android:layout_width="50dp"
android:layout_height="50dp"
android:padding="8dp"
android:background="?attr/selectableItemBackground"
android:src="@drawable/ic_bell"
android:id="@+id/btnNotific"
android:layout_marginTop="16dp" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="16dp"/>
android:layout_marginTop="16dp"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintEnd_toStartOf="@+id/btnStats"
android:layout_marginEnd="4dp"/>
<ImageButton
android:layout_width="50dp"
android:layout_height="50dp"
android:padding="8dp"
android:background="?attr/selectableItemBackground"
android:src="@drawable/ic_stats"
android:id="@+id/btnStats" app:layout_constraintEnd_toStartOf="@+id/btnMenu"
android:layout_marginEnd="4dp" android:layout_marginTop="16dp" app:layout_constraintTop_toTopOf="parent"/>
<me.itangqi.waveloadingview.WaveLoadingView
android:id="@+id/waterLevelView"
android:layout_width="250dp"
@ -76,4 +90,5 @@
android:layout_marginEnd="8dp"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintTop_toBottomOf="@+id/waterLevelView" android:layout_marginTop="24dp"/>
</androidx.constraintlayout.widget.ConstraintLayout>