自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 BannerViewPager轮播图 + okGo赋值

1.依赖allprojects { repositories { google() jcenter() //BannerViewPage maven { url 'https://jitpack.io' } }}//BannerViewPagerimplementation 'com.github.zhpanvip:bannerviewpager:3.5.4'//OkGo网络框架implementat

2021-11-20 08:25:38 2026 1

原创 自动组件化

1.创建App同级Module项目2.依赖项目的build.gradle配置plugins依赖buildscript { ...}plugins { id "calces.appconfig" version "3.3.0-alpha01"}appConfig { //调试开关,控制所有app能不能独立运行 debugEnable true apps { //注意事项: //只设定需要加载的moudle即可,如果设置了启动a.

2021-11-18 14:57:31 1403

原创 三种动画方式 帧动画 属性动画 补间动画

1.帧动画AnimationDrawable animationDrawable = new AnimationDrawable();//添加动画animationDrawable.addFrame(getDrawable(R.drawable.q),100);animationDrawable.addFrame(getDrawable(R.drawable.w),100);animationDrawable.addFrame(getDrawable(R.drawable.e),100);.

2021-11-12 15:35:19 1524

原创 新Banner

1. 依赖implementation'io.github.youth5201314:banner:2.2.2'maven{url"https://s01.oss.sonatype.org/content/groups/public"}2.集合准备要轮播的图片 ArrayList<Integer> list = new ArrayList<>(); list.add(R.drawable.ic_launche...

2021-11-12 15:05:27 366

原创 双击退出APP

1.再Activity里面实现一个方法 onKeyDown2.判断是否 keyCode == 回车键3.定义一个 private boolean isExit; 然后做判断@Override public boolean onKeyDown(int keyCode, KeyEvent event) { if(keyCode == KeyEvent.KEYCODE_BACK){ if(isExit == true){ //如果isE...

2021-11-12 14:53:13 239

原创 GreenDao 数据库的创建

1.导依赖buildscript { repositories { jcenter() mavenCentral() // 第一步. add repository }dependencies { classpath 'com.android.tools.build:gradle:3.5.3' classpath 'org.greenrobot:greendao-gradle-plugin:3.3.0' ...

2021-11-09 14:46:06 304

原创 Activity侧拉

1.第一步加载自己得侧拉包2.两个必须相同 不然SlisdingMenu 报错3.使用SlisdingMenu SlidingMenu slidingMenu = new SlidingMenu(getActivity()); slidingMenu.setMenu(R.layout.duo); //侧拉显示布局 slidingMenu.setBehindWidth(400); //侧拉宽度 ...

2021-11-04 08:32:36 47

原创 Banner轮播图

1.依赖: implementation 'com.youth.banner:banner:1.4.10'2.准备自己要轮播的图片 和 图片的标题 图片必须和标题一一对应 //要轮播的图标 List<Integer> list = new ArrayList<>(); list.add(R.drawable.ic_launcher_background); list.add(R.drawable.ic_laun.

2021-11-03 10:06:20 88

原创 Notification 发送通知 + 通知点击Intent跳转

Intent intent = new Intent(this, MainActivity2.class); //InTENT 跳转 intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0);PendingIntent 的四个参数:Con..

2021-10-22 09:34:06 560

原创 OkGo+Gson 解串

1.首先导入依赖//OkGo网络框架implementation 'com.lzy.net:okgo:3.0.4'implementation 'com.lzy.net:okserver:2.0.5'//Gsonimplementation 'com.google.code.gson:gson:2.8.2'2.get前面的泛型一定要加表示回调结果的类型 不加 泛型不匹配 无法编译通过2.使用OkGo点get/post放入链接 onSuccess 请求成功的回调...

2021-10-22 08:39:06 233

原创 简单的6位随机数生成 和 倒计时

1. random.nextInt(10)意思是返回大于等于0,小于10的一个正整数,既然是生成6位随机数,每个数一定是0-9之内的2.我循环6次,每次从0-9随机选取一个数字拼接字符串返回就是6位数

2021-10-20 13:13:37 392

原创 Java二维码 和 打开相机

1.依赖allprojects { repositories { google() jcenter() maven { url 'https://jitpack.io' } }}dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) implementation 'androidx.appcompat:appcompat:1.0.0'.

2021-10-20 09:02:03 895

原创 PopupWindow 弹框

PopupWindow popupWindow = new PopupWindow();popupWindow.setWidth(ViewGroup.LayoutParams.MATCH_PARENT);popupWindow.setHeight(80);1.设置宽高 根据自己的需求设置 宽高是弹框不可缺少的popupWindow.setOutsideTouchable(true);popupWindow.setFocusable(true);2.setOut...

2021-10-18 15:37:26 90

原创 Comparable 俩种排序方法

public static class DataDTO implements MultiItemEntity, Comparable<JavaBan.DataDTO> {}1.实现接口 Comparable<> 参数 实体类 然后实现一个方法 @Override public int compareTo(DataDTO o) { return getNum() - o.getNum(); }2...

2021-10-18 15:14:59 259

空空如也

空空如也

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

TA关注的人

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