随笔分类 -  Android

摘要:LocalBroadcastUtil import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import android.content.Intent 阅读全文
posted @ 2024-11-01 13:59 野生野鸡码农 阅读(9) 评论(0) 推荐(0) 编辑
摘要:public class SaveLocal { //保存文件到sd卡 public static void saveToFile(String content) { BufferedWriter out = null; //获取SD卡状态 String state = Environment.ge 阅读全文
posted @ 2024-04-26 16:34 野生野鸡码农 阅读(45) 评论(0) 推荐(0) 编辑
摘要:import android.graphics.RectF import android.view.View import android.view.ViewGroup object MyGuideUtil { /** * @baseView 在哪个view基础上进行镂空 */ fun guideM 阅读全文
posted @ 2023-12-22 14:03 野生野鸡码农 阅读(186) 评论(0) 推荐(0) 编辑
摘要:Studio打包apk名字中文乱码,及git打包人中文乱码解决办法:Studio-->Help-->Edit Custom VM options-->打开sutdio64.exe.vmoptions文件-->把-Dfile.encoding=UTF-8填进去-->重启studio并打包 阅读全文
posted @ 2023-12-12 16:45 野生野鸡码农 阅读(130) 评论(0) 推荐(0) 编辑
摘要:https://juejin.cn/post/6844903489051557902?from=singlemessage&isappinstalled=0#comment package com.xiucai.common.manager; import android.graphics.Rect 阅读全文
posted @ 2023-09-14 15:58 野生野鸡码农 阅读(237) 评论(0) 推荐(0) 编辑
摘要:你的RecyclerView的adapter进行了两次初始化,并且这两次初始化时间间隔比较短,所以会闪。 解决办法: if (adapter == null) { adapter = ElectLetAdapter(context) binding.recyclerView.adapter = ad 阅读全文
posted @ 2022-09-22 19:06 野生野鸡码农 阅读(720) 评论(0) 推荐(0) 编辑
摘要:https://blog.51cto.com/u_14496797/5364085 方法1:使用约束布局 implementation 'androidx.constraintlayout:constraintlayout:2.0.4' <androidx.constraintlayout.widg 阅读全文
posted @ 2022-09-21 16:33 野生野鸡码农 阅读(519) 评论(0) 推荐(0) 编辑
摘要:设置view的背景颜色,有两种方法,一种是通过代码写的形式,一种是通过写一个xml的形式 先说第一种,用代码实现view的背景渐变色: int colors[] = { 0xff2D0081 , 0xff8B3097, 0xffD14E7A }; GradientDrawable bg = new 阅读全文
posted @ 2022-09-19 10:16 野生野鸡码农 阅读(446) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-09-08 17:57 野生野鸡码农 阅读(14) 评论(0) 推荐(0) 编辑
摘要://java class UIUtils { public static int getScreenWidthInPx(Context context) { DisplayMetrics dm = context.getApplicationContext().getResources().getD 阅读全文
posted @ 2022-05-13 18:13 野生野鸡码农 阅读(1717) 评论(0) 推荐(0) 编辑
摘要:https://www.kancloud.cn/apachecn/programiz-zh/1951767 val num = 1.34567 var o = list.get(i).ori_price.toDouble()var p = list.get(i).price.toDouble()va 阅读全文
posted @ 2022-03-30 16:34 野生野鸡码农 阅读(1723) 评论(0) 推荐(0) 编辑
摘要:var list: ArrayList<PayItem> = Gson().fromJson(resultStr, object : TypeToken<ArrayList<PayItem>>() {}.type) 阅读全文
posted @ 2022-03-24 17:50 野生野鸡码农 阅读(389) 评论(0) 推荐(0) 编辑
摘要:拿走不谢!! import android.content.Context;import android.graphics.drawable.Drawable;import android.util.AttributeSet;import android.widget.ImageView; publ 阅读全文
posted @ 2022-03-24 16:33 野生野鸡码农 阅读(447) 评论(0) 推荐(0) 编辑
摘要:需求 有时会需要改变布局颜色透明度,比如设置控件(如View,Button等)的透明度,有3种方法。 实现方法 java代码实现 text = (TextView) findViewById(R.id.text); text.getBackground().setAlpha(12); setAlph 阅读全文
posted @ 2022-03-22 17:01 野生野鸡码农 阅读(2211) 评论(0) 推荐(0) 编辑
摘要:支付宝SDK与友盟SDK都有同样的utdid包,所以需要移除其中一个 app的build.gradle中 dependencies { api('com.umeng.umsdk:push:6.4.0') { exclude group: 'com.umeng.umsdk', module: 'utd 阅读全文
posted @ 2022-02-23 16:31 野生野鸡码农 阅读(737) 评论(0) 推荐(0) 编辑
摘要:修改前: 修改后: 步骤: 1,定义style:在工程的res/values/styles.xml中添加👇下面配置 <style name="zhuTextStyle" parent="AppTheme.NoActionBar"> <item name="android:colorControlA 阅读全文
posted @ 2022-01-25 15:00 野生野鸡码农 阅读(286) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2021-12-19 22:46 野生野鸡码农 阅读(19) 评论(0) 推荐(0) 编辑
摘要:public class ScreenUtils { private ScreenUtils() { throw new AssertionError(); } /** * dp单位转成px * * @param context context * @param dp dp值 * @return p 阅读全文
posted @ 2021-11-02 18:00 野生野鸡码农 阅读(486) 评论(0) 推荐(0) 编辑
摘要:/** * 注入的注解,为空,仅起标志作用 */ @Target({ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) @interface Inject { } /** * 获取 bean 的容器,必通通过容器获取,而不能使用 new,因 阅读全文
posted @ 2021-04-30 12:05 野生野鸡码农 阅读(1177) 评论(1) 推荐(0) 编辑
摘要:JS代码中: /* * 打开分享微信弹窗 */ function openDialog () { visible = true; var dialogDom = document.getElementById('dialog') dialogDom.style.display = 'flex' di 阅读全文
posted @ 2020-12-24 11:29 野生野鸡码农 阅读(2218) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示