CollapsingToolbarLayout
CollapsingToolbarLayout 介绍 CollapsingToolbarLayout 是用来对 Toolbar 进行再次包装的 ViewGroup,主要是用于实现折叠(其实就是看起来像伸缩~)的 App Bar 效果。它需要放在 AppBarLayout 布局里面,并且作为 AppBarLayout 的直接子 View。CollapsingToolbarLayout 主要...
CollapsingToolbarLayout 介绍 CollapsingToolbarLayout 是用来对 Toolbar 进行再次包装的 ViewGroup,主要是用于实现折叠(其实就是看起来像伸缩~)的 App Bar 效果。它需要放在 AppBarLayout 布局里面,并且作为 AppBarLayout 的直接子 View。CollapsingToolbarLayout 主要...
AppbarLayout AppbarLayout 介绍、用途 AppBarLayout,顾名知意,就是用来给 AppBar 布局的容器,是 LinearLayout 的子类。而 AppBar 就包含我们通常所知道的 ActionBar,Toolbar。 AppBarLayout 继承自 LinearLayout,布局方向为垂直方向。所以你可以把它当成垂直布局的 LinearLayou...
ConstraintHelper Optimizer(layout_optimizationLevel) 当我们使用 MATCH_CONSTRAINT 时,ConstraintLayout 将对控件进行 2 次测量,ConstraintLayout 在 1.1 中可以通过设置 layout_optimizationLevel 进行优化。 版本中添加了几个新的优化点,可加快您的布...
ConstraintLayout 应用场景 半透布局,居中对齐 1. 要相对 view 的 bottom,xxx_toBottomOf app:layout_constraintBottom_toBottomOf="@id/tv1" app:layout_constraintTop_toBottomOf="@id/tv1" 2. 要相对于 view 的 top,xxx_toTopO...
ConstraintLayout 和 AS 工具介绍 https://developer.android.com/reference/android/support/constraint/ConstraintLayout ConstraintLayout 特性 Relative positioning Margins Centering positioning Cir...
渠道包方案 1、productFlavor 其实就是采用 gradle 去配置不同的 productFlavor,然后用 manifestPlaceholder 占位符去解析 manifest 文件里面的 meta-data 的 value,来进行打包,耗时耗力,原理就是一个一个包去打,虽然免去了手动,但是很耗时。 2、美团一代 这种只有在 v1 签名的时候才可以这么做,它将 APK...
热修复介绍 什么是热修复 动态更新修复 apk 的行为。不用发布新版本,用户可以更新新的功能及 bug 修复 市面上的热修复技术 QQ 空间的超级补丁方案(Nuwa) 超级补丁基于 DEX 分包方案,使用了多 DEX 加载的原理,大致原理:把 Bug 方法修复以后,放到一个单独的 DEX 里,插入到 dexElements 数组的最前面,让虚拟机去加载修复完后的方法 微信的 Ti...
自定义 Result 类 internal suspend inline fun <reified T> BaseRxHttp.awaitResult(timeoutMillis: Long = 0L): Result<T> { return runCatching { if (timeoutMillis <= 0L) { ...
TextView 效果 ellipsize 什么是 ellipsize ? TextView 中可以设置一个 ellipsize 属性,作用是当文字长度超过 textview 宽度时的显示方式: 例如,字符串 “abcedfghijklmn” 的各种现实效果: android:ellipsize=”start”—–省略号显示在开头 “…lmn” android:ellip...
TextView 文字跑马灯 TextView 跑马灯(显示一行,滚动显示) TextView 不会主动获取焦点,一个布局中只能有一个组件获取焦点获取到焦点时跑马灯。设置成 maxLines=”1” 时跑马灯不工作,要用 singleLine=”true” 系统自带的 xml 中进行属性配置 android:ellipsize="marquee" android:focusabl...