自定义selectorDrawable
来源:互联网 发布:广发交易软件 编辑:程序博客网 时间:2024/06/02 21:30
private boolean defaultTheme; private Context mContext; public ViewStateListDrawable(Context context, boolean defaultTheme) { this.mContext = context; this.defaultTheme = defaultTheme; this.addStateDrawable(); } @SuppressWarnings("deprecation") private void addStateDrawable() { Drawable normal = null; Drawable pressed = null; Drawable focus = null; if (defaultTheme) { //v_selector_btn_session normal = mContext.getResources().getDrawable(R.drawable.v_session_button_normal); pressed = mContext.getResources().getDrawable(R.drawable.v_session_button_pressed); focus = pressed; } else { normal = mContext.getResources().getDrawable(R.drawable.wave_session_button_normal); pressed = mContext.getResources().getDrawable(R.drawable.wave_session_button_pressed); focus = pressed; } this.addState(new int[] { android.R.attr.state_enabled, android.R.attr.state_focused }, focus); this.addState(new int[] { android.R.attr.state_pressed, android.R.attr.state_enabled }, pressed); this.addState(new int[] { android.R.attr.state_focused }, focus); this.addState(new int[] { android.R.attr.state_pressed }, pressed); this.addState(new int[] { android.R.attr.state_selected }, pressed); this.addState(new int[] { android.R.attr.state_enabled }, normal); this.addState(new int[] {}, normal); }
0 0
- 自定义selectorDrawable
- AndroidStudio好用的插件ParcelableGenerator、GsonFormat、ButterKnife Zelezny、Generate SelectorDrawable
- 自定义
- 自定义
- 自定义
- 自定义
- 自定义
- 自定义TexBox,自定义ComboBox
- 自定义View自定义属性
- 自定义View自定义属性
- 自定义View自定义属性
- 自定义View自定义属性
- 自定义一个自定义对话框
- 自定义控件-自定义吐司
- 自定义checkbox,自定义button
- 自定义控件--自定义对话框
- 自定义控件----自定义属性
- 自定义控件:自定义Toast
- 94.大于屏幕宽度的TableView上下拉刷新实现 大于屏幕宽度MJRefresh怎么实现刷新控件显示居中
- Python图形界面编程---Tkinter模块使用
- HashMap与ConcurrentHashMap的区别
- 贪吃蛇(版本1.0还有bug,但是基本能使了)
- 设置Tomcat的UTF-8编码
- 自定义selectorDrawable
- 只用TextView实现知乎主页底部Tab
- Gson使用总结
- 死锁问题分析(个人认为重点讲到了gap间隙锁,解决了我一些不明报死锁的问题)
- SQLServer 大容量导入导致死锁和系统变慢问题
- Axure学习笔记(一)
- 使用HackRF和外部时钟实现GPS欺骗实验
- AsyncTask和Handler的优缺点比较
- SyntaxError: Non-ASCII character '\xe4' in file