- 博客(18)
- 收藏
- 关注
原创 Spinner下拉列表
第一步xml<Spinner android:id="@+id/spinner1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:entries="@array/languages" android:overlapAnchor="false" a
2021-06-16 10:25:52 188
原创 ExpandableListView展开列表控件
第一步创建布局主布局<ExpandableListView android:id="@+id/expend_list" android:layout_width="match_parent" android:layout_height="match_parent"></ExpandableListView>父item布局
2021-06-16 09:49:07 302
原创 ZoomButton放大缩小控件
xml文件布局<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:text="字体大小测试" android:id="@+id/textview"/> <ZoomControls android:layout_below=.
2021-06-15 11:57:07 221
原创 CountdownView圆形倒计时
第一步 <com.hanjx.ui.CountDownView android:id="@+id/count_down_3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" app:finished_color="#FF0000"...
2021-06-15 11:37:13 160
原创 TextClock数字时钟及字体样式和使用字体
<TextClock android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="5dp" android:layout_centerHorizontal="true" android:gravity="center_horizontal" android:format24Hour="hh:mm" andro.
2021-06-15 10:55:02 3932
原创 ToggleButton 状态开关按钮及Switch开关
第一步<ToggleButton android:id="@+id/toggle_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/togglebutton_select" android:textOn="打开" android:textOff="关闭"/>...
2021-06-15 10:38:05 227
原创 AndroidUtilCode万能工具类
第一步引入依赖implementation 'com.blankj:utilcodex:1.30.6'第二步初始化在APPlication的oncreate()中Utils.init(this);第三步在要使用的地方查看文档进行使用工具类李
2021-06-10 13:34:14 979
原创 SwipeLayout 左滑删除
第一步添加依赖implementation "com.daimajia.swipelayout:library:1.2.0@aar"第二步在朱布局
2021-06-10 10:25:17 137
原创 自定义对话框
//初始化并弹出对话框方法private void showDialog(){ View view = LayoutInflater.from(getContext()).inflate(R.layout.diy_dialog,null,false); final AlertDialog dialog = new AlertDialog.Builder(getContext()).setView(view).create(); dialog.getWindow().setBack.
2021-06-09 17:17:49 78
原创 popupwindow简单使用
PopupWindow popupWindow = new PopupWindow(getContext());darkenBackground(0.3f); //设置点击后的颜色,由于当前在changa
2021-06-09 17:14:39 176
原创 BinderService简单使用
第一步通过扩展 Binder 类并从 onBind() 返回它的一个实例来创建接口public class MyBinder extends Binder{ public BinderService getService(){ return BinderService.this; }} @Override public IBinder onBind(Intent intent) { // TODO: Return
2021-06-04 16:54:24 408
原创 AsyncTask简单使用
第一步创建AsyncTask实例updateText=new UpdateText();updateText.execute();注意:
2021-06-04 15:42:07 115
原创 RecyclerView简单使用
第一步导入依赖implementation 'androidx.recyclerview:recyclerview:1.1.0'第二步
2021-06-04 13:26:19 63
原创 Viewpager+Fragment+TabLayout
第一步创建几个fragment,并放入集合中list = new ArrayList<>();list.add(new OneFragment());list.add(new TwoFragment());list.add(new ThreeFragment());第二步
2021-06-03 17:29:27 229
原创 room的基本使用
1.引入依赖def room_version = “2.2.5”implementation “androidx.room:room-runtime:roomversion"annotationProcessor"androidx.room:room−compiler:room_version"annotationProcessor "androidx.room:room-compiler:roomversion"annotationProcessor"androidx.room:room−comp
2021-04-22 20:15:44 812
原创 EventBus简单使用
EventBus的定义主要功能是用来替代传统的Intent、Handler、Broadcast在Fragment、Activity、Service以及线程之间传递消息。它的优点解耦和简化Activities, Fragments等组件以及后台线程之间的通信,分离事件发送方和接收方使得代码更简洁,避免出现复杂的依赖性和生命周期问题体积小(大概只有50k 的 jar包)如何使用添加依赖dependencies {implementation ‘org.greenrobot:eventbus:3
2021-04-21 20:19:55 134
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人