![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
android
a670275845
这个作者很懒,什么都没留下…
展开
-
记录一次获取静音状态适配代码
/获取当前音乐多媒体是否静音。//获取当前音乐多媒体是否静音。记录一次获取静音状态适配代码。原创 2024-03-08 15:08:52 · 256 阅读 · 0 评论 -
selectdrawable一次爬坑
默认值不设置属性的顺序需要放在最后一个。原创 2023-11-29 18:19:00 · 341 阅读 · 0 评论 -
lottie-android 替代svg动画
参考地址开源库地址原创 2022-04-19 13:49:58 · 296 阅读 · 0 评论 -
retrofit2 + 协程封装(suspendCancellableCoroutine )
package com.base.commonimport okhttp3.OkHttpClientimport retrofit2.Retrofitimport retrofit2.adapter.rxjava2.RxJava2CallAdapterFactoryimport retrofit2.converter.gson.GsonConverterFactoryimport java.util.concurrent.TimeUnitobject RetrofitClient {原创 2022-02-23 13:24:50 · 1444 阅读 · 0 评论 -
资源文件数字适配plurals
zero 当语言需要特别对待0时(就想阿拉伯)one 当语言需要特别对待1(就像英语里和其他语言里的1;在russian,任何以1结尾但是不是以11结尾的也使用这种情况)two 当语言需要特别对待1(例如Welsh的2,或者Slovenian的102)few 当语言需要特别对待small(例如Czech的2,3,4;或者以2,3,4结尾但是不是12,13,14的Polisth)many 当语言需要特别对待large(例如Maltese的11-99)other 当语言没有要求对特定资源进行特殊对待(原创 2021-01-29 14:01:12 · 129 阅读 · 0 评论 -
camera2实现预览
public class Camera2Helper implements SurfaceHolder.Callback { private int mCameraId; private final SurfaceView mSurfaceView; private ImageReader mImageReader; private int mWidth = 0; private int mHeight = 0; private Handler mainHa原创 2020-06-25 14:49:46 · 525 阅读 · 0 评论 -
SurfaceView 实现预览
废话不多说直接上代码:CameraHelper.javapublic class CameraHelper implements SurfaceHolder.Callback{ private static final String TAG = "CameraHelper"; public int width = 640; public int height = 480; private int mCameraId; private Camera mC原创 2020-06-10 00:25:04 · 536 阅读 · 0 评论 -
仿照微信或qq头像双击摇晃效果
1.资源文件anim下加入cycles_anim.xml (插值器可以设置不同的插值器)<?xml version="1.0" encoding="utf-8"?><cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android" android:cycles="2" />anim_rotate.xml<?xml version="1.0" encoding="utf-原创 2020-05-18 12:12:26 · 1389 阅读 · 0 评论 -
Recyclerview 一次滚动一个item距离
//snapHelper是为了过滤掉item显示一半的情况,这样点击会导致只移动了半个Item距离LinearSnapHelper snapHelper=new LinearSnapHelper();snapHelper.attachToRecyclerView(mRecyclerView);findViewById(R.id.btnUp).setOnClickListener(new Vi...原创 2020-04-22 22:14:07 · 3270 阅读 · 0 评论 -
DownLoadManager使用适配7.0
安装工具类public class SystemIntentUtils { /** * 安装Apk文件 * * @param context 上下文对象 * @param path 文件全名称路径 */ public static void installApk(Context context, String path) { ...原创 2020-04-22 14:55:28 · 225 阅读 · 0 评论 -
Android调用系统裁剪,拍照(单选)
第一步配置图片路径(路径初始化在applicaton中,后面直接通过类名获取):public static String filePath;filePath = AppUtils.createFile(context).getAbsolutePath()+ File.separator;public class AppUtils { public static File createFil...原创 2020-04-20 14:19:56 · 959 阅读 · 0 评论 -
Android 获取国际化资源文件String值
public String getUsString(){ String name; //获取当前环境的Resources Resources resources = getResources(); //获得res资源对象 Configuration config = resources.getConfiguration(); Locale oldL...原创 2020-04-13 17:27:24 · 906 阅读 · 0 评论 -
多个RecyclerView触摸反馈如何做到联动
布局: <RelativeLayout android:layout_marginTop="@dimen/dp_5" android:background="@color/app_black" android:orientation="horizontal" android:layout_width="match_parent" ...原创 2020-04-13 11:23:51 · 285 阅读 · 0 评论 -
CentOS安装linux报错Typical path for xclock: /usr/X11R6/bin/xclock
Ignoring required pre-requisite failures. Continuing…Preparing to launch Oracle Universal Installer from /tmp/OraInstall2019-11-08_09-30-02PM. Please wait …DISPLAY not set. Please set the DISPLAY an...原创 2019-11-08 21:33:42 · 1268 阅读 · 0 评论 -
Centos 下配置NDK环境变量
export NDKROOT=/usr/ndk/android-ndk-r20export PATH=NDKROOT:NDKROOT:NDKROOT:PATH原创 2019-10-16 20:07:57 · 725 阅读 · 0 评论 -
Recyclerview 嵌套recyclerview 空白部分无法点击处理
childRecyclerView.setOnTouchListener(new View.OnTouchListener() {//处理点击到RecyclerView上面无反应@Overridepublic boolean onTouch(View v, MotionEvent event) {if (event.getAction() == MotionEvent.ACTION_UP)...原创 2019-10-16 09:45:31 · 1025 阅读 · 0 评论 -
WebView加载富文本页面,页面整体大小问题
String css = "";String html = “” + css + “” +getIntent().getStringExtra(“data” ) + “”;mWebView.getWebView().loadDataWithBaseURL(null, html, “text/html”, “utf-8”, null);原创 2019-10-16 09:40:04 · 900 阅读 · 0 评论 -
自定义带进度条的WebView导致的问题,并且参考代码实现webiew加载视频全屏播放
布局文件<?xml version="1.0" encoding="utf-8"?><ProgressBar android:id="@+id/progressBar" style="?android:attr/progressBarStyleHorizontal" android:layout_width="match_parent" an...原创 2019-10-16 09:38:55 · 150 阅读 · 0 评论 -
Error: Default interface methods are only supported starting with Android N (--min-api 24)
使用jdk1.8编译 gradle加入compileOptions {incremental truesourceCompatibility JavaVersion.VERSION_1_8targetCompatibility JavaVersion.VERSION_1_8}原创 2019-07-04 18:02:59 · 236 阅读 · 0 评论 -
Bassdiff源码和Bzip2源码下载
连接地址:http://www.daemonology.net/bsdiff/下载bsadiff源码bizp2连接下载地址https://sourceforge.net/projects/bzip2/(http://www.daemonology.net/bsdiff/提示去sourceforge下载 在sourceforge搜索bizp2得到连接地址下载源码)...原创 2019-07-04 09:56:40 · 922 阅读 · 0 评论