Cornholio2108 / BestAlarm

0 stars 0 forks source link

ImageButtons style (Ok, Cancel) #17

Open Cornholio2108 opened 4 years ago

Cornholio2108 commented 4 years ago
<ImageView style="@style/TitleBarLogo"
            android:contentDescription="@string/description_logo"
            android:src="@drawable/title_logo" />
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/title_logo_pressed"/>
    <item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/title_logo_pressed"/>
    <item android:state_focused="true" android:drawable="@drawable/title_logo_selected"/>
    <item android:state_focused="false" android:state_pressed="false" android:drawable="@drawable/title_logo_default"/>
</selector>
Cornholio2108 commented 4 years ago

For expanding clickable area and adding click effect:

<ImageView
 style=”@style/Widget.AppCompat.ActionButton”
 android:layout_width=”wrap_content”
 android:layout_height=”wrap_content”
 android:onClick=”toastLove”
 android:src=”@drawable/ic_favorite_border_black_24dp” />
Cornholio2108 commented 4 years ago

For expanding clickable area and adding click effect:

<ImageView
 style=”@style/Widget.AppCompat.ActionButton”
 android:layout_width=”wrap_content”
 android:layout_height=”wrap_content”
 android:onClick=”toastLove”
 android:src=”@drawable/ic_favorite_border_black_24dp” />

This doesn't do anything on the Ok/Cancel images.