Created
October 15, 2012 16:27
-
-
Save miquniqu/3893406 to your computer and use it in GitHub Desktop.
Androidアプリ、ボタン操作時のXML定義
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |
<!-- フォーカスあり、選択なし --> | |
<item | |
android:state_focused="true" | |
android:state_pressed="false"> | |
<layer-list> | |
<item> | |
<shape android:shape="rectangle"> | |
<solid android:color="@color/home_button_select_bg" /> | |
<corners android:radius="5dp" /> | |
<stroke android:width="2dp" android:color="@color/home_button_select_stroke"/> | |
</shape> | |
</item> | |
<item> | |
<bitmap android:src="@drawable/btn_channellist_default" android:gravity="center" /> | |
</item> | |
</layer-list> | |
</item> | |
<!-- フォーカス無視、選択あり --> | |
<item | |
android:state_pressed="true"> | |
<layer-list> | |
<item> | |
<shape android:shape="rectangle"> | |
<solid android:color="@color/home_button_push_bg" /> | |
<corners android:radius="5dp" /> | |
</shape> | |
</item> | |
<item> | |
<bitmap android:src="@drawable/btn_channellist_default" android:gravity="center" /> | |
</item> | |
</layer-list> | |
</item> | |
<!-- デフォルト --> | |
<item | |
android:state_pressed="false"> | |
<layer-list> | |
<item> | |
<bitmap android:src="@drawable/btn_channellist_default" android:gravity="center" /> | |
</item> | |
</layer-list> | |
</item> | |
</selector> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment