自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(57)
  • 收藏
  • 关注

原创 Java中的Consumer的使用

二.在Android中怎么使用。

2024-03-24 19:16:15 156

原创 Android中的Context

Android中的Context。

2024-03-24 16:22:30 147 1

原创 Android中的onConfigurationChanged的使用

设备配置发生变化的时候调用,比如:内外屏切换、屏幕方向(orientation)、键盘状态(keyboard)、语言环境(locale)、屏幕布局(screenlayout)等。这个时候旋转手机屏幕,会发现只会重新走一遍activity的创建过程,不会走onConfigurationChanged这个回调。这个时候旋转屏幕,就不会走activity的销毁重建步骤了,只会走onConfigurationChanged这个回调。

2024-03-24 12:15:12 509

原创 RecyclerView中的设计模式解读

Recyclerview中的Adapter可以理解为观察者的父类,我们可以自己实现一个继承自Recyclerview中的Adapter的子类,也就是实例化一个观察者对象。首先具有一个接口,该接口是所有观察者的父接口,各个子观察者通过实现这个接口来实例化一个观察者对象,而被观察者会持有观察者对象的引用。至于怎么将观察者对象传给这个引用的方法有很多,比如通过在被观察者对象类里面写set方法让观察者对象来调用、利用构造函数的参数传递等等。一.观察者模式:(待完善,这个写的不咋地,没理解透彻)被观察者:持有引用;

2023-12-16 21:36:21 607

原创 自定义View之实现一个流式布局

(1)重写onMeasure()方法,实现子View的测量以及设置自身的宽高。(2)重写onLayout()方法,实现子View的布局工作。二.代码实现:(有问题,待解决)

2023-12-10 21:10:03 385

原创 Android中子布局、父布局之间的MeasureSpect、LayoutParameter之间的关系

(1)横坐标是父布局的SpecMode(测量模式),纵坐标是子布局的LayoutParams(布局参数)。(1)子布局的SpecMode(测量模式)可以根据上面的LayoutParams与SpecMode对应关系来记忆即可。(2)子布局的SpecSize(测量大小)只有在固定数值的情况下才是自身大小,其他都是父布局的大小。(2)UNSPECIFIED这种模式一般是系统自身的测量过程才会使用,一般不需要关注这个模式。固定数值------------------>MeasureSpec.EXACTLY。

2023-12-09 20:23:52 344

原创 Android中怎么获取View的宽高信息

onCreate()、onResume()中都不能获取View的真实宽高,只有使用post之后才能拿到View的真实宽高。原因为:onCreate()、onResume()的时候,其实还没有走View的onMeasure()、onLayout()、onDraw()等,所以拿不到测量之后的宽高。1.写一个TextView,然后分别在onCreate()、onCreate()中post之后、onResume()等分别去获取这个TextView的宽高。

2023-12-09 19:51:48 435

原创 Android中AsyncTask的使用

介绍:布局中有一个点击进行后台任务的按钮,有对应的提示的textview,有一个显示后台任务进度的进度条,有一个取消任务的按钮。(1)第一个参数Params:执行AsyncTask需要传入的参数,可用于后台任务中使用。(3)第三个参数Result:任务执行之后,需要对任务结果进行返回,这里是返回结果的类型。(3)onProgressUpdate()方法。(2)doInBackground()方法。(4)onPostExecute()方法。(1)onPreExecute()方法。

2023-10-06 00:03:13 96

原创 Android中的Handler的使用

一.

2023-09-23 15:07:41 109

原创 Android中的图片加载三级缓存策略

1.说一下Android中的图片加载三级策略。

2023-09-11 23:18:52 164

原创 Android中的ScrollView控件的学习

Android中的ScrollView控件的学习。

2023-08-13 22:56:17 118

原创 怎么在github上创建自己的token

2.点击个人头像处,找到设置(setting),如下图所示,点击进入设置。3.找到developer settings,如下图所示,点击即可。5.点击生成new token,按照步骤进行设置就行了。4.就能看见历史token以及新建token了。1.进入自己的github账号,登录好。

2023-08-02 22:28:50 1188

原创 remote: Support for password authentication was removed on August 13, 2021.remote: Please see https

在弹出的输入密码框的时候,填写github的token值即可。不能使用github的密码进行登录。

2023-08-02 22:12:03 130

原创 git:上传代码时,出现fatal: unable to access ‘XXX‘: Recv failure: Connection was reset

git:上传代码时,出现fatal: unable to access ‘XXX‘: Recv failure: Connection was reset 错误解决方法

2023-06-04 01:17:02 2580

原创 Android中将json数据快速生成Java bean的工具

Android中将json数据快速生成Java bean的工具

2023-05-29 23:33:06 562

原创 git的下载和安装

git的下载和安装。

2023-05-07 23:07:00 61

原创 AndroidStudio和github完成本地仓库、远程仓库关联

在Github上创建自己的项目 | 码农家园

2023-05-07 23:04:21 1099

原创 Android中无法访问http类型网址的解决办法

Android中无法访问http类型网址的解决办法

2023-02-26 20:31:18 1582

原创 Android6.0的动态权限申请

Android6.0的动态权限申请

2023-02-05 11:58:48 391

原创 drawable文件夹xml文件中的selector的使用

drawable文件夹xml文件中的selector的使用

2022-11-25 01:50:04 906

原创 drawable文件夹xml文件中的shape的使用

drawable文件夹xml文件中的shape的使用

2022-11-25 01:49:15 129

原创 drawable文件夹xml文件中的layer-list的使用

drawable文件夹xml文件中的layer-list的使用

2022-11-23 23:36:58 373

原创 自定义View之实现进度条(ProgressBar)

自定义View之实现进度条(ProgressBar)

2022-11-23 22:38:58 534

原创 This custom view should extend androidx.appcompat.widget.AppCompatTextView instead

This custom view should extend androidx.appcompat.widget.AppCompatTextView instead

2022-11-19 21:03:48 1376

原创 Android中的自定义属性

Android中的自定义属性

2022-11-19 18:42:56 565

原创 自定义View之实现一个简单的圆

自定义View之实现一个简单的圆

2022-11-19 14:58:12 875

原创 自定义View之继承LinearLayout

自定义View之继承LinearLayout

2022-11-19 13:57:21 786

原创 Caused by: java.lang.NoSuchMethodException: com.example.myapplication.Activity.CustomLinearLayout.

java.lang.NoSuchMethodException: com.example.myapplication.Activity.CustomLinearLayout. [class android.content.Context, interface android.util.AttributeSet]

2022-11-19 13:23:57 786

原创 The layout “xxx“ in layout has no declaration in the base layout folderMissingDefaultResource

The layout "xxx" in layout has no declaration in the base layout folderMissingDefaultResource

2022-11-19 12:58:58 1506

原创 Glide的使用

Glide的使用

2022-11-12 19:29:17 2181

原创 EventBus的使用

EventBus的使用

2022-11-06 23:08:47 429

原创 Activity动态加载Fragment的实现

Activity动态加载Fragment的实现

2022-11-06 00:48:04 1841

原创 Android架构之MVVM

Android架构之MVVM

2022-11-05 22:01:37 591

原创 Android架构之MVP

Android架构之MVP

2022-11-05 14:07:49 509

原创 Android架构之MVC

Android架构之MVC

2022-10-30 16:23:30 246

原创 Android设计模式之单例模式

Android设计模式之单例模式

2022-10-23 09:08:12 1072

原创 Android设计模式之六大设计原则

Android设计模式之六大设计原则

2022-10-22 10:55:36 815

原创 UML类图介绍

UML类图

2022-10-22 10:14:30 102

原创 Android中的Bitmap相关的知识点

Android中的Bitmap相关的知识点

2022-10-14 20:58:51 576

原创 Version 28 (intended for Android Pie and below) is the last version of the legacy support library

Version 28 (intended for Android Pie and below) is the last version of the legacy support library

2022-10-03 18:11:41 1395 2

空空如也

空空如也

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

TA关注的人

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