File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
java/com/simplemobiletools/flashlight/activities Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -104,17 +104,20 @@ public void stateChangedEvent(Events.StateChanged event) {
104104 }
105105
106106 public void enableFlashlight () {
107- final int appColor = getResources ().getColor (R .color .colorPrimary );
108- mToggleBtn .setImageResource (R .mipmap .flashlight_big );
109- mToggleBtn .getDrawable ().mutate ().setColorFilter (appColor , PorterDuff .Mode .SRC_IN );
107+ changeIconColor (R .color .colorPrimary );
110108 getWindow ().addFlags (WindowManager .LayoutParams .FLAG_KEEP_SCREEN_ON );
111109 }
112110
113111 public void disableFlashlight () {
114- mToggleBtn . setImageResource (R .mipmap . flashlight_big );
112+ changeIconColor (R .color . translucent_white );
115113 getWindow ().clearFlags (WindowManager .LayoutParams .FLAG_KEEP_SCREEN_ON );
116114 }
117115
116+ private void changeIconColor (int colorId ) {
117+ final int appColor = getResources ().getColor (colorId );
118+ mToggleBtn .getDrawable ().mutate ().setColorFilter (appColor , PorterDuff .Mode .SRC_IN );
119+ }
120+
118121 @ Subscribe
119122 public void cameraUnavailable (Events .CameraUnavailable event ) {
120123 Utils .showToast (this , R .string .camera_error );
Original file line number Diff line number Diff line change 33 <color name =" colorPrimary" >#fff68630</color >
44 <color name =" colorPrimaryDark" >#ffe27725</color >
55 <color name =" colorAccent" >@color/colorPrimary</color >
6+ <color name =" translucent_white" >#aaffffff</color >
67</resources >
You can’t perform that action at this time.
0 commit comments