怎样看源码sdk
来源:互联网 发布:mac finder copy path 编辑:程序博客网 时间:2024/04/29 17:28
每一年 谷歌都会举行 I/O大会谷歌推出了 Android Design Support Library
使用了一下TextInputLayout,想看一下源码:
路径:sdk/extras/android/support/design/libs 中将 android-support-design.jar 拷贝出来,修改拓展名为 .zip 并解压。
其实就是一个自定义View,可以看一下他的写法:
attrs.xml :
<declare-styleable name="TextInputLayout"> <attr name="hintTextAppearance" format="reference"/> <!-- The hint to display in the floating label --> <attr name="android:hint"/> <!-- Whether the layout is laid out as if an error will be displayed --> <attr name="errorEnabled" format="boolean"/> <!-- TextAppearance of any error message displayed --> <attr name="errorTextAppearance" format="reference"/> <!-- Whether the layout is laid out as if the character counter will be displayed --> <attr name="counterEnabled" format="boolean"/> <!-- The max length to display in the character counter --> <attr name="counterMaxLength" format="integer" /> <!-- TextAppearance of the character counter --> <attr name="counterTextAppearance" format="reference"/> <!-- TextAppearance of the character counter when the text is longer than the max --> <attr name="counterOverflowTextAppearance" format="reference"/> <attr name="android:textColorHint"/> <!-- Whether to animate hint state changes. --> <attr name="hintAnimationEnabled" format="boolean"/></declare-styleable>
style.xml :
<style name="TextAppearance.Design.Counter" parent="TextAppearance.AppCompat.Caption"/><style name="TextAppearance.Design.Counter.Overflow" parent="TextAppearance.AppCompat.Caption"> <item name="android:textColor">@color/design_textinput_error_color</item></style><style name="TextAppearance.Design.Error" parent="TextAppearance.AppCompat.Caption"> <item name="android:textColor">@color/design_textinput_error_color</item></style><style name="TextAppearance.Design.Hint" parent="TextAppearance.AppCompat.Caption"> <item name="android:textColor">?attr/colorControlActivated</item></style><style name="Widget.Design.TextInputLayout" parent="android:Widget"> <item name="hintTextAppearance">@style/TextAppearance.Design.Hint</item> <item name="errorTextAppearance">@style/TextAppearance.Design.Error</item> <item name="counterTextAppearance">@style/TextAppearance.Design.Counter</item> <item name="counterOverflowTextAppearance">@style/TextAppearance.Design.Counter.Overflow</item></style>
colors.xml:
<color name="design_textinput_error_color">#FFDD2C00</color>
0 0
- 怎样看源码sdk
- 怎样看jdk源码
- 怎样利用directX SDK
- 怎样利用directX SDK
- android 怎样做SDK
- 怎样看K线图
- 怎样看大盘
- 怎样看电路原理图
- 生活,你怎样看 ?
- 怎样看财务报表
- 怎样看K线图
- 怎样看论文
- 怎样看电路图
- 怎样看年报
- 怎样看文献
- 怎么看SDK
- 怎样安装android的sdk
- 怎样查看android SDK文档
- Java集合框架及其区别
- CHROME开发者工具的小技巧
- 孙子兵法-作战篇
- 可重复排列组合算法
- 欢迎使用CSDN-markdown编辑器
- 怎样看源码sdk
- css3响应式写法
- Win10系统内存占用越来越高的解决方法
- ios实现点击复制文字到剪贴板
- 1999年后城镇居民使用宅基地不予确权登记
- 强大的BaseRecyclerViewAdapterHelper使用
- 欢迎使用CSDN-markdown编辑器
- php拒绝连接
- Rancher 1.4发布:k8s体验的大迈进