mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-08 21:37:53 +00:00
optical feedback on habit button +/- touch
This commit is contained in:
parent
52018f7009
commit
5851bacb98
3 changed files with 37 additions and 16 deletions
6
Habitica/res/drawable-v21/btn_habit_background.xml
Normal file
6
Habitica/res/drawable-v21/btn_habit_background.xml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="?android:colorControlHighlight">
|
||||
<item android:id="@android:id/mask"
|
||||
android:drawable="@color/brand" />
|
||||
</ripple>
|
||||
|
|
@ -1,12 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#33000000" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:state_focused="true" >
|
||||
<item android:state_focused="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#33000000" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
|
|
|
|||
|
|
@ -25,26 +25,40 @@
|
|||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:id="@+id/btnLayout">
|
||||
<Button
|
||||
android:id="@+id/btnPlus"
|
||||
<FrameLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:visibility="@{habit.up ? View.VISIBLE : View.GONE}"
|
||||
android:text="+"
|
||||
android:background="@{habit.down ? @drawable/btn_habit_background : @drawable/btn_habit_single_background}"
|
||||
app:backgroundColor="@{habit.getLightTaskColor}"
|
||||
style="@style/HabitButton" />
|
||||
<Button
|
||||
android:id="@+id/btnMinus"
|
||||
android:layout_weight="1">
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:backgroundColor="@{habit.getLightTaskColor}"/>
|
||||
<Button
|
||||
android:id="@+id/btnPlus"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="+"
|
||||
android:background="@drawable/btn_habit_background"
|
||||
style="@style/HabitButton" />
|
||||
</FrameLayout>
|
||||
<FrameLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:visibility="@{habit.down ? View.VISIBLE : View.GONE}"
|
||||
app:backgroundColor="@{habit.up ? habit.getMediumTaskColor : habit.getLightTaskColor}"
|
||||
android:text="-"
|
||||
android:background="@{habit.up ? @drawable/btn_habit_background : @drawable/btn_habit_single_background}"
|
||||
style="@style/HabitButton"/>
|
||||
android:layout_weight="1">
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:backgroundColor="@{habit.up ? habit.getMediumTaskColor : habit.getLightTaskColor}"/>
|
||||
<Button
|
||||
android:id="@+id/btnMinus"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="-"
|
||||
android:background="@drawable/btn_habit_background"
|
||||
style="@style/HabitButton"/>
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
|||
Loading…
Reference in a new issue