<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[Barryjacket的博客]]></title><description><![CDATA[]]></description><link>https://blog.csdn.net/Barryjacket</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; Barryjacket]]></copyright><item><title><![CDATA[RecyclerView源码分析]]></title><link>https://blog.csdn.net/Barryjacket/article/details/119138240</link><guid>https://blog.csdn.net/Barryjacket/article/details/119138240</guid><author>Barryjacket</author><pubDate>Tue, 27 Jul 2021 11:22:22 +0800</pubDate><description><![CDATA[RecyclerView源码分析1.宏观认识2.绘制的源码解析2.1.OnMeasure ：与布局流程相互结合在一起的自动测绘过程可以分为两部分：2.2.OnLayout()onLayout总结2.3.OnDraw()3.缓存机制优点4.缓存策略
1.宏观认识
RecyclerView是谷歌官方出的一个用于大量数据展示的新控件,支持RecyclerView高效运行有六个类.




属性名称
功能描述




Adapter
为每一项Item创建视图


ViewHolder
承载Item视图的子布局


]]></description><category></category></item><item><title><![CDATA[基础界面布局]]></title><link>https://blog.csdn.net/Barryjacket/article/details/119036502</link><guid>https://blog.csdn.net/Barryjacket/article/details/119036502</guid><author>Barryjacket</author><pubDate>Tue, 27 Jul 2021 10:48:03 +0800</pubDate><description><![CDATA[基础界面布局
1.Android布局的概念图
图 1-1 Android布局管理器的类图
图 1-2 Android布局的xml关系图
由上述两张图结合可知，android布局类在代码层面是ViewGroup的子类，布局也是布局管理器，因为布局里面还可以添加布局；布局管理器里面既可以添加多个布局管理器又可以添加多个控件，而控件里面不能在添加布局或控件了。
2.布局的通用属性
属性名称	功能描述
android:id	设置布局的标识
android：layout_width	设置布局的宽度(dp)
andro]]></description><category></category></item><item><title><![CDATA[otto使用和源码解析]]></title><link>https://blog.csdn.net/Barryjacket/article/details/118998844</link><guid>https://blog.csdn.net/Barryjacket/article/details/118998844</guid><author>Barryjacket</author><pubDate>Thu, 22 Jul 2021 15:30:15 +0800</pubDate><description><![CDATA[基本同EventBus
参考文件
使用的区别
1.otto的Bus类相当与EventBus中的EventBus类，它封装了otto的主要功能，但它不是个单例，每次都要用new创建出来，这样显然不是很方便，因此我们用单例模式将它封装起来（DCL）
2. 使用@Produce来发布事件
Produce注解用来生产发布事件，需要注意的是它生产事件前它需要注册，并且在生产完事件后需要取消注册。如果使用这种方法则在跳转到发布者所在的类中则会立即产生事件并触发订阅者
public class SecondActivit]]></description><category></category></item><item><title><![CDATA[事件总线的使用]]></title><link>https://blog.csdn.net/Barryjacket/article/details/118906254</link><guid>https://blog.csdn.net/Barryjacket/article/details/118906254</guid><author>Barryjacket</author><pubDate>Thu, 22 Jul 2021 11:33:03 +0800</pubDate><description><![CDATA[作用：解决了应用程序内各个组件或者组件和后台服务之间的通信问题
基础用法
源码分析
构造方法：使用了(dcl)确保单例,构造函数中调用了另一种构造方法，使用建造者模式–通过EventBusBuilder 来完成对EventBus的配置和构造。
构造方法的流程


...]]></description><category></category></item><item><title><![CDATA[kotlin在Realm中的使用]]></title><link>https://blog.csdn.net/Barryjacket/article/details/118893166</link><guid>https://blog.csdn.net/Barryjacket/article/details/118893166</guid><author>Barryjacket</author><pubDate>Mon, 19 Jul 2021 12:30:35 +0800</pubDate><description><![CDATA[1.android中实体类的创建构造函数，必须给属性分配默认值。如果需要注释，则直接加在前面
	open class MusicModel (var musicID:String?=null,var name:String?=null,var poster:String?=null,
                       var path:String?=null,var author:String?=null):RealmObject()
	open class UserModel(@Primar]]></description><category></category></item><item><title><![CDATA[定义内部接口并在类内设置一个实现属性]]></title><link>https://blog.csdn.net/Barryjacket/article/details/118893148</link><guid>https://blog.csdn.net/Barryjacket/article/details/118893148</guid><author>Barryjacket</author><pubDate>Mon, 19 Jul 2021 12:29:39 +0800</pubDate><description><![CDATA[class MediaPlayerHelp private constructor(context: Context) {
    private var onMediaPlayerHelpListener: OnMediaPlayerHelpListener? = null//实现字段
   
    //    定义接口
    interface OnMediaPlayerHelpListener {
        fun onPrepared(mp: MediaPlayer?)
        f]]></description><category></category></item><item><title><![CDATA[如何实现一个实现了接口的字段]]></title><link>https://blog.csdn.net/Barryjacket/article/details/118893138</link><guid>https://blog.csdn.net/Barryjacket/article/details/118893138</guid><author>Barryjacket</author><pubDate>Mon, 19 Jul 2021 12:28:45 +0800</pubDate><description><![CDATA[ServiceConnection是接口，object:是一个实现了接口的匿名类
 var connection=object :ServiceConnection{
        override fun onServiceConnected(name: ComponentName?, service: IBinder?) {
            /*先是进行赋值，再就是直接播放音乐*/
            mMusicBinder = service as MusicService.Music]]></description><category></category></item><item><title><![CDATA[kotlin lambda表达式测试]]></title><link>https://blog.csdn.net/Barryjacket/article/details/118893099</link><guid>https://blog.csdn.net/Barryjacket/article/details/118893099</guid><author>Barryjacket</author><pubDate>Mon, 19 Jul 2021 12:28:04 +0800</pubDate><description><![CDATA[一个回调
class TestCallbackA {
    var mCallBack: ((str: String) -&gt; Unit)? = null//((str: String) -&gt; Unit)用括号括起来说明这是一个字段，可能为null
    fun setCallback(myCallBack: ((str: String) -&gt; Unit)) {
        this.mCallBack = myCallBack
    }
}
private fun testA()]]></description><category></category></item><item><title><![CDATA[kotlin的单例]]></title><link>https://blog.csdn.net/Barryjacket/article/details/118892180</link><guid>https://blog.csdn.net/Barryjacket/article/details/118892180</guid><author>Barryjacket</author><pubDate>Mon, 19 Jul 2021 11:32:11 +0800</pubDate><description><![CDATA[使用kotlin来写传参的线性安全的懒汉单例
class MediaPlayerHelp private constructor(context: Context){
    val mContext=context
    init {
        val mMediaPlayer= MediaPlayer()
    } //构造器执行的构造函数
    companion object{
        @Volatile private var instance:MediaPlayerHelp?]]></description><category></category></item><item><title><![CDATA[常用设计模式]]></title><link>https://blog.csdn.net/Barryjacket/article/details/118888813</link><guid>https://blog.csdn.net/Barryjacket/article/details/118888813</guid><author>Barryjacket</author><pubDate>Mon, 19 Jul 2021 11:28:15 +0800</pubDate><description><![CDATA[常用设计模式六大原则--核心是降低类间的耦合创建型设计模式单例模式java版kotlin版工厂模式建造者模式结构性设计模式代理模式装饰模式外观模式享元模式行为型设计模式策略模式模板方法模式观察者模式
六大原则–核心是降低类间的耦合
单一职责原则
一个类只负责一个变化
开放封闭原则
开发是指扩展是开发的，修改是封闭。
里氏代换原则
使用的基类的地方可以都可以被其子类，完美的替换基类。
要求：子类的方法都必须在父类中进行声明。（ 用子类来代替父类，只能调用父类中声明的方法，但在运行期，我们实际执行的是子类重写父]]></description><category></category></item><item><title><![CDATA[Android10.0通知Notification的使用]]></title><link>https://blog.csdn.net/Barryjacket/article/details/118730281</link><guid>https://blog.csdn.net/Barryjacket/article/details/118730281</guid><author>Barryjacket</author><pubDate>Wed, 14 Jul 2021 16:08:31 +0800</pubDate><description><![CDATA[参考文献

]]></description><category></category></item><item><title><![CDATA[Android Resources之assets]]></title><link>https://blog.csdn.net/Barryjacket/article/details/118700473</link><guid>https://blog.csdn.net/Barryjacket/article/details/118700473</guid><author>Barryjacket</author><pubDate>Tue, 13 Jul 2021 15:01:30 +0800</pubDate><description><![CDATA[assets的基本知识
注：针对assets的文件，只能通过context.asset来进行数据流的处理，不能用File类来进行加载

]]></description><category></category></item><item><title><![CDATA[Assignments are not expressions,and only expressions are allowed in this context]]></title><link>https://blog.csdn.net/Barryjacket/article/details/118699810</link><guid>https://blog.csdn.net/Barryjacket/article/details/118699810</guid><author>Barryjacket</author><pubDate>Tue, 13 Jul 2021 14:42:59 +0800</pubDate><description><![CDATA[kotlin中不提倡将=当作表达式
错误代码
StringBuilder body = new StringBuilder();
String nextLine;
while ((nextLine = bufferReader.readLine()) != null) {
	body.append(nextLine);
	body.append('\n');
}


修改后的正确代码
将判断和赋值语句分开
StringBuilder body = new StringBuilder();
String ne]]></description><category></category></item><item><title><![CDATA[kotlin lambda与匿名内部类的使用]]></title><link>https://blog.csdn.net/Barryjacket/article/details/118547889</link><guid>https://blog.csdn.net/Barryjacket/article/details/118547889</guid><author>Barryjacket</author><pubDate>Wed, 07 Jul 2021 15:32:42 +0800</pubDate><description><![CDATA[常规的方式实现匿名内部类
valueAnimator.addUpdateListener(object :AnimatorUpdateListener {
    override fun onAnimationUpdate(animation: ValueAnimator?) {
        currentPoint = animation?.animatedValue as Point
        postInvalidate()
    }
})

使用lambda后
valueAnimato]]></description><category></category></item><item><title><![CDATA[分组列表悬浮顶部栏（吸顶效果）]]></title><link>https://blog.csdn.net/Barryjacket/article/details/118520197</link><guid>https://blog.csdn.net/Barryjacket/article/details/118520197</guid><author>Barryjacket</author><pubDate>Tue, 06 Jul 2021 14:41:01 +0800</pubDate><description><![CDATA[分组列表（吸顶效果）

]]></description><category></category></item><item><title><![CDATA[RecyclerView的分割线原理]]></title><link>https://blog.csdn.net/Barryjacket/article/details/118515512</link><guid>https://blog.csdn.net/Barryjacket/article/details/118515512</guid><author>Barryjacket</author><pubDate>Tue, 06 Jul 2021 10:37:23 +0800</pubDate><description><![CDATA[itemDecoration的具体使用

]]></description><category></category></item><item><title><![CDATA[使用Kotlin扩展函数 + ViewBinding来完成自定义组件的功能]]></title><link>https://blog.csdn.net/Barryjacket/article/details/118329747</link><guid>https://blog.csdn.net/Barryjacket/article/details/118329747</guid><author>Barryjacket</author><pubDate>Tue, 29 Jun 2021 11:07:49 +0800</pubDate><description><![CDATA[提示：文章写完后，目录可以自动生成，如何生成可参考右边的帮助文档

使用Kotlin扩展函数 + ViewBinding来完成自定义组件的功能一、写控件布局，并用Include放入界面二、扩展控件Binding类的函数，完成必要的业务操作

一、写控件布局，并用Include放入界面
 标题控件布局
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout xmlns:android="http://schemas.android.com]]></description><category></category></item><item><title><![CDATA[使用ViewBinding时遇到 java.lang.ClassCastException: android.widget.RelativeLayout cannot be]]></title><link>https://blog.csdn.net/Barryjacket/article/details/118329468</link><guid>https://blog.csdn.net/Barryjacket/article/details/118329468</guid><author>Barryjacket</author><pubDate>Tue, 29 Jun 2021 10:58:17 +0800</pubDate><description><![CDATA[提示：文章写完后，目录可以自动生成，如何生成可参考右边的帮助文档

使用ViewBinding时遇到 java.lang.ClassCastException: android.widget.RelativeLayout cannot be cast to cast to android.widget.TextView
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout xmlns:android="http://schemas.a]]></description><category></category></item><item><title><![CDATA[unable to find valid certification path to requested target 报错的解决方法]]></title><link>https://blog.csdn.net/Barryjacket/article/details/117816818</link><guid>https://blog.csdn.net/Barryjacket/article/details/117816818</guid><author>Barryjacket</author><pubDate>Fri, 11 Jun 2021 16:03:06 +0800</pubDate><description><![CDATA[AndroidStudio Cause: unable to find valid certification path to requested target 报错的解决方法项目场景：问题描述：原因分析：解决方案：
项目场景：
在使用AS4.2.1版本时，新建一个例子工程，出现了以上错误


问题描述：
在我们使用Gradle搭建安卓项目骨架时，经常会遇到appcompat-v7找不到依赖的情况或者是需要可靠的认证路径，其报的异常故障码如下：
unable to find valid certificat]]></description><category></category></item><item><title><![CDATA[安卓中Canvas，paint的Api详解]]></title><link>https://blog.csdn.net/Barryjacket/article/details/109575364</link><guid>https://blog.csdn.net/Barryjacket/article/details/109575364</guid><author>Barryjacket</author><pubDate>Mon, 09 Nov 2020 13:12:53 +0800</pubDate><description><![CDATA[安卓中Canvas，paint的Api详解概述两种坐标系Canvas保存和还原paint的常用设置设置颜色设置不透明度设置是否抗锯齿设置文本缩放倍数设置字体大小设置下划线设置实心还是空心设置画笔的粗细画图画文字
概述
我们通过在画布上绘画进行类比，如下：
Canvas：相当于画布，Bitmap提供内存，绘的画会保存在Bitmap中。
Paint：相当于画笔。
有了画笔和画笔我们就可以绘画了。
两种坐标系
Canvas绘图中牵扯到两种坐标系：Canvas坐标系与绘图坐标系。


Canvas坐标系
Canva]]></description><category></category></item></channel></rss>