mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-24 06:53:46 +00:00
[android] Display overlay layer state with icon
Fixes #1402 Signed-off-by: Harry Bond <me@hbond.xyz>
This commit is contained in:
committed by
Konstantin Pastbin
parent
4232de04ac
commit
d44f0ae7da
@@ -29,7 +29,7 @@ public class LayersButton extends FloatingActionButton
|
||||
{
|
||||
final int[] drawableState = super.onCreateDrawableState(extraSpace + 1);
|
||||
if (mAreLayersActive)
|
||||
mergeDrawableStates(drawableState, new int[] {R.attr.layers_enabled});
|
||||
mergeDrawableStates(drawableState, new int[] {R.attr.state_layers_enabled});
|
||||
return drawableState;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
android:state_checked="true"/>
|
||||
|
||||
<item android:color="@color/base_accent"
|
||||
app:layers_enabled="true"/>
|
||||
app:state_layers_enabled="true"/>
|
||||
|
||||
<item android:color="@color/icon_tint"/>
|
||||
</selector>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
android:state_checked="true"/>
|
||||
|
||||
<item android:color="@color/base_accent_night"
|
||||
app:layers_enabled="true"/>
|
||||
app:state_layers_enabled="true"/>
|
||||
|
||||
<item android:color="@color/white_secondary"/>
|
||||
</selector>
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M11.99,18.54l-7.37,-5.73L3,14.07l9,7 9,-7 -1.63,-1.27 -7.38,5.74zM12,16l7.36,-5.73L21,9l-9,-7 -9,7 1.63,1.27L12,16z"/>
|
||||
</vector>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
app:state_layers_enabled="true"
|
||||
android:drawable="@drawable/ic_layers_clear"/>
|
||||
<item
|
||||
app:state_layers_enabled="false"
|
||||
android:drawable="@drawable/ic_layers_default"/>
|
||||
</selector>
|
||||
5
android/app/src/main/res/drawable/ic_layers_default.xml
Normal file
5
android/app/src/main/res/drawable/ic_layers_default.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M11.99,18.54l-7.37,-5.73L3,14.07l9,7 9,-7 -1.63,-1.27 -7.38,5.74zM12,16l7.36,-5.73L21,9l-9,-7 -9,7 1.63,1.27L12,16z"/>
|
||||
</vector>
|
||||
@@ -28,7 +28,7 @@
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="layersButton">
|
||||
<attr name="layers_enabled" format="boolean"/>
|
||||
<attr name="state_layers_enabled" format="boolean"/>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="PlacePageView">
|
||||
|
||||
Reference in New Issue
Block a user