mirror of
https://github.com/SimpleMobileTools/Simple-Flashlight.git
synced 2025-02-16 20:00:40 +01:00
use a translucent white as the default icon
This commit is contained in:
parent
49815169a2
commit
42bcfa9361
@ -104,17 +104,20 @@ public class MainActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
public void enableFlashlight() {
|
||||
final int appColor = getResources().getColor(R.color.colorPrimary);
|
||||
mToggleBtn.setImageResource(R.mipmap.flashlight_big);
|
||||
mToggleBtn.getDrawable().mutate().setColorFilter(appColor, PorterDuff.Mode.SRC_IN);
|
||||
changeIconColor(R.color.colorPrimary);
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
}
|
||||
|
||||
public void disableFlashlight() {
|
||||
mToggleBtn.setImageResource(R.mipmap.flashlight_big);
|
||||
changeIconColor(R.color.translucent_white);
|
||||
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
}
|
||||
|
||||
private void changeIconColor(int colorId) {
|
||||
final int appColor = getResources().getColor(colorId);
|
||||
mToggleBtn.getDrawable().mutate().setColorFilter(appColor, PorterDuff.Mode.SRC_IN);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void cameraUnavailable(Events.CameraUnavailable event) {
|
||||
Utils.showToast(this, R.string.camera_error);
|
||||
|
@ -3,4 +3,5 @@
|
||||
<color name="colorPrimary">#fff68630</color>
|
||||
<color name="colorPrimaryDark">#ffe27725</color>
|
||||
<color name="colorAccent">@color/colorPrimary</color>
|
||||
<color name="translucent_white">#aaffffff</color>
|
||||
</resources>
|
||||
|
Loading…
x
Reference in New Issue
Block a user