- 博客(37)
- 资源 (2)
- 收藏
- 关注
原创 闪屏问题是低端机型第一次添加surfaceView会出现
低端版本机型存在第一次添加SurfaceView闪屏问题,用SurfaceView占位。
2024-04-24 18:59:48
154
原创 Git下拉和提交等遇到:fatal: early EOF fatal: index-pack failed
Git下拉和提交等遇到:fatal: early EOF fatal: index-pack failed。
2024-03-19 10:21:18
204
原创 Glide 设置下载进度
package com.base.common.glideimport com.bumptech.glide.load.Optionsimport com.bumptech.glide.load.model.*import com.bumptech.glide.load.model.ModelLoader.LoadDataimport java.io.InputStreamimport okhttp3.OkHttpClientclass OkHttpGlideUrlLoader : Mod
2022-04-19 13:50:38
321
原创 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
1588
原创 OpenHarmony编译可能存在的问题
python -V 查看版本sudo ln -sf /usr/bin/python3.9 /usr/bin/python备注:-s = soft,意为软链接-f = force,表示强制创建(使用前请备份之前存在文件)
2021-06-27 19:09:47
519
原创 ubunto下配置ssh允许用户root密码登录
ubunto下配置ssh允许用户root密码登录Ubuntu都会默认安装openssh-client,但是没有安装openssh-serversudo apt install openssh-serversudo apt install openssh-clientapt-get install sshsudo /etc/init.d/ssh startsudo vim /etc/ssh/sshd_config,找到PermitRootLogin without-password 修改为Perm
2021-06-27 14:17:07
215
原创 /usr/bin/env: ‘python’: No such file or directory
问题场景:/usr/bin/env: ‘python’: No such file or directory可能的解决方案 #1如果未安装 Python 3,请安装它: apt-get install python3可能的解决方案#2如果已安装 Python 3,请运行以下命令: whereis python3然后我们为它创建一个符号链接: sudo ln -s /usr/bin/python3 /usr/bin/python參考鏈接:https://stackoverflow.com/que
2021-06-16 14:05:19
5439
2
原创 资源文件数字适配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
154
原创 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
575
原创 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
571
原创 仿照微信或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
1418
原创 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
3464
原创 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
248
原创 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
1010
原创 Android 获取国际化资源文件String值
public String getUsString(){ String name; //获取当前环境的Resources Resources resources = getResources(); //获得res资源对象 Configuration config = resources.getConfiguration(); Locale oldL...
2020-04-13 17:27:24
986
原创 多个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
315
原创 js异步加载监听
test.html代码<script type="text/javascript"> function loadScript(url, callback) { var script = document.createElement("script"); script.type = "text/javascript"; ...
2019-12-12 17:38:16
740
原创 js对象数组去重,利用set
unique(arr) {const res = new Map();return arr.filter((a) => ((!res.has(a.planNo) && res.set(a.planNo, 1))&& (!res.has(a.jobId) && res.set(a.jobId, 1))));}参考文献:htt...
2019-11-27 09:50:35
1622
原创 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
1382
原创 CentOS编译ffmpeg不支持x264
#!/bin/bashNDK=/usr/tools/android-ndk-r20API=21ARCH=armTARGET=linux-androideabiCPU=armv7-aARCH=armHOST=arm-linuxSYSROOT=NDK/toolchains/llvm/prebuilt/linux−x8664/sysrootTOOLCHAIN=NDK/toolchains...
2019-10-20 02:10:29
587
原创 Centos 下配置NDK环境变量
export NDKROOT=/usr/ndk/android-ndk-r20export PATH=NDKROOT:NDKROOT:NDKROOT:PATH
2019-10-16 20:07:57
762
原创 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
1069
原创 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
930
原创 自定义带进度条的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
179
原创 Angular动态加载组件报错:No component factory found for XXXXComponent. Did you add it to
在@NgModule的entryComponents声明组件:@NgModule({imports: [CommonModule,AppRoutingModule],entryComponents: [ControlMessagesComponent],declarations: [ControlMessagesComponent],providers: [AppService]...
2019-08-26 11:43:42
5795
原创 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
268
原创 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
1003
转载 mysql出现The server time zone value '�й���ʱ��' is unrecogni。。。。的解决办法
java.sql.SQLException: The server time zone value ‘�й���ʱ��’ is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configu...
2019-07-03 00:06:13
3963
1
转载 Mysql 连接提示 Client does not support authentication protocol requested by server
Mysql 连接提示 Client does not support authentication protocol requested by server 客户端不支持服务器请求的身份验证协议;考虑升级MySQL客户端登陆进去mysql然后,在命令行输入:ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password B...
2019-07-02 22:55:43
338
原创 Ionic 与Native方法交互调用不到
ionic代码执行调用,导致调用失败Cordova框架在读入HTML5代码之后,要进行HTML5和Native建立桥接,在未能完成这个桥接的初始的情况下,是不能调用Native功能的。document.addEventListener(‘deviceready’, function () {console.log(‘Device is Ready!’);// …your code}, fa...
2019-05-15 14:22:59
325
转载 Python抖音抓脸 只要露脸 小姐姐都是你的
import datetimeimport cv2def processImage():video_full_path = “21.mp4”cap = cv2.VideoCapture(video_full_path)printcap.isOpened()frame_count = 1success = Truewhile (success):success, frame = ...
2018-12-13 21:43:43
321
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人