自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(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 176

原创 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 290

原创 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 216

原创 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 150

原创 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 3688

原创 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 188

原创 AndroidUtilCode万能工具类

第一步引入依赖implementation 'com.blankj:utilcodex:1.30.6'第二步初始化在APPlication的oncreate()中Utils.init(this);第三步在要使用的地方查看文档进行使用工具类李

2021-06-10 13:34:14 851

原创 SwipeLayout 左滑删除

第一步添加依赖implementation "com.daimajia.swipelayout:library:1.2.0@aar"第二步在朱布局

2021-06-10 10:25:17 127

原创 自定义对话框

//初始化并弹出对话框方法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 71

原创 popupwindow简单使用

PopupWindow popupWindow = new PopupWindow(getContext());darkenBackground(0.3f); //设置点击后的颜色,由于当前在changa

2021-06-09 17:14:39 144

转载 Banner简单使用

第一步添加依赖implementation 'com.youth.banner:banner:1.4.10'第二部

2021-06-07 16:53:22 488

原创 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 403

原创 AsyncTask简单使用

第一步创建AsyncTask实例updateText=new UpdateText();updateText.execute();注意:

2021-06-04 15:42:07 90

原创 RecyclerView简单使用

第一步导入依赖implementation 'androidx.recyclerview:recyclerview:1.1.0'第二步

2021-06-04 13:26:19 54

原创 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 218

原创 自定义控件简单使用

onmeasure方法View的最终大小在这个方法中测量完成,其中由setMeasuredDimension

2021-06-02 13:44:36 169 1

原创 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:roomv​ersion"annotationProcessor"androidx.room:room−comp

2021-04-22 20:15:44 794

原创 EventBus简单使用

EventBus的定义主要功能是用来替代传统的Intent、Handler、Broadcast在Fragment、Activity、Service以及线程之间传递消息。它的优点解耦和简化Activities, Fragments等组件以及后台线程之间的通信,分离事件发送方和接收方使得代码更简洁,避免出现复杂的依赖性和生命周期问题体积小(大概只有50k 的 jar包)如何使用添加依赖dependencies {implementation ‘org.greenrobot:eventbus:3

2021-04-21 20:19:55 122

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除