07 2020 档案
摘要:在项目中,很多按钮控件都应该避免短时间内多次点击,转载一个可用的工具类 ButtonUtils public class ButtonUtils { private static long lastClickTime = 0; private static long DIFF = 1000; pri
阅读全文
摘要:在布局文件 RecyclerView 外层套一个 RelativeLayout <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <androidx.recyclervi
阅读全文
摘要:private Handler handler = new Handler(); handler.postDelayed(new Runnable() { @Override public void run() { // 跳转操作或者其他 } }, 3000); // 等待的事件 ms
阅读全文
摘要:首先新建一个自定义的 layout 文件 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_wi
阅读全文
摘要:在 onCreateOptionsMenu() 方法中加入所需要的条件判断 @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.action_bar_withdraw_m
阅读全文
摘要:引用==https://www.jianshu.com/p/3ced3bd973e4== 添加依赖 implementation 'com.google.zxing:core:3.2.1' implementation 'cn.bingoogolapple:bga-qrcodecore:1.1.7@
阅读全文
摘要:Android SharedPreferences 的用法 SharedPreferences:一个轻量级的存储类,特别适合用于保存软件配置参数。(是用xml文件存放数据,文件存放在/data/data//shared_prefs目录下) 可以保存的数据类型有:==int、boolean、float
阅读全文
摘要:数据绑定(DataBinding) DataBinding 是 Google 在 Jetpack 中推出的一款数据绑定的支持库,利用该库可以实现在页面组件中直接绑定应用程序的数据源。 DataBinding 可以和 ViewModel 一起使用,实现视图随数据的更新而更新。 要在安卓中使用 Data
阅读全文
摘要:EditText属性设置和输入监听 设置背景,设置@null或者自定义可以遮挡下划线 android:background="@null" 设置隐藏或显示输入光标 android:cursorVisible="false" 设置编辑框内的提示语 android:hint="" 设置提示语的字体颜色
阅读全文