Loading

摘要: 由于android 多渠道打包完各渠道apk比较分散,便写了该脚本整理下。 @echo off set dir=%1 cd %dir% for /r %%f in (*.apk) do xcopy "%%f" "%2\" /y set rar="%ProgramFiles%\WinRAR\winra 阅读全文
posted @ 2022-03-26 12:45 徐影魔 阅读(86) 评论(0) 推荐(0)
摘要: public class UtilsStatusBar { //沉浸式 public static void setImmerseStatusBar(Activity activity) { Window window = activity.getWindow(); window.clearFlag 阅读全文
posted @ 2022-03-26 12:45 徐影魔 阅读(269) 评论(0) 推荐(0)
摘要: def jarPackage(buildType) { return tasks.create("jar${buildType.capitalize()}Package", Copy) { def aarFile = file(project.buildDir.path + "/outputs/aa 阅读全文
posted @ 2022-03-26 12:45 徐影魔 阅读(82) 评论(0) 推荐(0)
摘要: 演示效果 思路 RecyclerView外包裹一个FrameLayout,通过adapter创建悬浮的Item,将其覆盖在RecyclerView上面, 再通过监听RecyclerView的滚动,动态改变悬浮item的translationY,实现悬浮。 使用 floatRvItemContaine 阅读全文
posted @ 2022-03-26 12:45 徐影魔 阅读(389) 评论(0) 推荐(0)
摘要: 由于Kotlin没有三目表达式这种写法,一般用if else就可以,但是写起来比较麻烦,于是我便写了个扩展函数,支持Boolean和表达式,感觉还行。如果大家有更好的方案,可以留言。 /** * * @author xunevermore * create on 2021/10/26 18:20 * 阅读全文
posted @ 2022-03-26 12:45 徐影魔 阅读(160) 评论(0) 推荐(0)
摘要: github 源码 昨天看到有人实现了这个ui,但是主要在布局里写的。当然我之前也是在布局里写的,但是貌似见过用ItemDecoration实现的。于是我评论说让他用ItemDecoration试一下,他回复我想多了。好吧,不管想的多不多,我自己试下就知道可行不可行了。当然是可行的,不然我也不会写这 阅读全文
posted @ 2022-03-26 12:45 徐影魔 阅读(221) 评论(0) 推荐(0)
摘要: 今天在EMUI上获取状态栏高度结果只有6像素,这算是EMUI的bug吧。所以加了个判断来获取状态栏高度。让状态栏至少为25dp。 public static int getStatusBarHeight(@NonNull Context context) { int height = 0; int 阅读全文
posted @ 2022-03-26 12:45 徐影魔 阅读(57) 评论(0) 推荐(0)
摘要: 记录一些觉得用的比较少的android知识。 获取raw文件夹下文件的uri 例如一个叫sample.png的图片 将package_name替换为app的包名。 String path = "android.resource://"+getPackageName()+"/"+R.raw.sampl 阅读全文
posted @ 2022-03-26 12:45 徐影魔 阅读(51) 评论(0) 推荐(0)
摘要: aar引用 android studio 引用jar 包的方法很简单:将jar包放到libs文件夹下,再右键add as library就可以用了,但是aar就不能这样引入。方法是现将aar放到libs文件夹下,在module 级的build gradle中加入: repositories { fl 阅读全文
posted @ 2022-03-26 12:45 徐影魔 阅读(409) 评论(0) 推荐(0)
摘要: git remote git remote set-url origin URL 更换远程仓库地址,URL为新地址。 git remote rm origin 删除现有远程仓库 git remote add origin url添加新远程仓库 git remote add origin url查看远 阅读全文
posted @ 2022-03-26 12:45 徐影魔 阅读(50) 评论(0) 推荐(0)