自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

洋葱

this is a 懒人

  • 博客(50)
  • 资源 (5)
  • 收藏
  • 关注

原创 Glide 与ImageView 的scaleType 冲突 圆角无效

如题,glide 设置scaleType,如果图片太小的话,导致设置的圆角无效//不设置scaleType 正常// val roundedCorners = RoundedCorners(ScreenUtils.dpToPx(8))// val options = RequestOptions.bitmapTransform(roundedCorners) //这个是修改..

2022-05-14 17:35:14 1288

原创 本地文件打开之后-选择其他方式打开,出现自己的APP

由于开发了一个音频播放器的APP,需要本地文件打开的时候,选择其他方式打开出现自己的APP 的图标,(目前设置的是音频文件)1.设置AndroidManifest.xml<activity .......>//在你需要启动的activity 下边加入 <intent-filter> <action android:name="android.intent.action.VIEW" /> &

2021-08-26 15:26:50 375 1

原创 Android url 跳转 app 指定界面

在androidManifest.xml 中 activity 下边加<data android:scheme="scheme" android:host="host" android:path="/detail" />在需要跳转的地方加val url = "scheme://host/detail"var intent = Intent(Intent.ACTION_VIEW, Uri.parse(url)) context.startActi..

2021-07-20 11:44:22 723

原创 webview 设置透明背景

wb.setBackgroundColor(0); // 设置背景色//上边必须加,否则 报错wb.getBackground().setAlpha(0);

2021-03-29 17:13:19 385

原创 apk 下载更新,支持暂停,去掉,继续下载,进度条显示【2】

import android.annotation.SuppressLint;import android.app.Activity;import android.app.Notification;import android.app.NotificationChannel;import android.app.NotificationManager;import android.app.PendingIntent;import android.content.Context;impor...

2021-03-22 17:46:30 387

原创 askncTask 下载apk 通知栏进度更新【1】

import android.app.Notification;import android.app.NotificationChannel;import android.app.NotificationManager;import android.app.PendingIntent;import android.content.Context;import android.content.Intent;import android.graphics.BitmapFactory;impo...

2021-03-16 16:53:23 917

原创 greendao 加载本地db文件

greendao 打开assets 下边db1.首先复制db 文件到 data/data/包名/databases 下 /** * 复制db */ private void copyDataBase(String dbname) throws IOException { // Open your local db as the input stream InputStream myInput = this.getAssets(...

2021-03-04 10:58:29 864 1

原创 aar

【一 打aar】1.File-》new module2.build.gradle 中增加 task makeJar(type: org.gradle.api.tasks.Copy){ //删除build/libs下的test.jar目录 delete 'build/libs/test.jar' //从build/intermediates/bundles/debug/目录下的classes.jar导入到build/libs/目录.

2021-01-05 14:37:46 102

原创 kotlin 使用databinding 数据双向绑定

data class ShopCartGoods( //商品id var goods_id: Int, //商品最大数量 var goods_num: Int, var goods_specs_str: String, var id: Int, //价格 var money: Double, //商品图片 var pic: String, var specs_id: String, //商品规格 v.

2020-10-10 10:25:08 1537

原创 Aes 解密加密

Aes解密public class AesDecryptUtil { //偏移量 //AES 为16bytes. DES 为8bytes public static final String VIPARA = "0006666000880000"; //编码方式 public static final String CODE_TYPE = "UTF-8";// public static final String CODE_TYPE = "GBK";

2020-06-22 10:08:19 321

原创 修改默认progressbar 颜色

<ProgressBar android:id="@+id/loading" style="?android:attr/progressBarStyle" android:layout_width="51dp" android:layout_height="51dp" android:layout_gravity="center_horiz..

2020-06-11 14:52:46 615

原创 适配Android L webview

public class LollipopFixedWebView extends WebView { public LollipopFixedWebView(Context context) { super(getFixedContext(context)); } public LollipopFixedWebView(Context context, AttributeSet attrs) { super(getFixedContext(co.

2020-06-02 14:01:34 200

原创 腾讯 tinker

腾讯tinker 官网1.在项目的根目录中build.gradle 中的dependencies 中添加 classpath "com.tinkerpatch.sdk:tinkerpatch-gradle-plugin:1.2.14.6"2.在app/build.gradle 中增加依赖provided("com.tinkerpatch.tinke...

2020-04-30 16:47:36 1427

原创 BaseActivity +Databinding

public class BaseActivity<B extends ViewDataBinding> extends AppCompatActivity { protected B mBinding; @Override public void setContentView(...

2020-04-26 15:15:27 1324 1

转载 搜索关键字变色

public class FindUtil { /** * 关键字高亮变色 * * @param color 变化的色值 * @param text 文字 * @param keyword 文字中的关键字 * @return */ public static SpannableString findS...

2020-04-21 14:13:02 211

原创 Android X 获取设备唯一标识

Google解决方案:如果您的应用有追踪非登录用户的需求,可用ANDROID_ID来标识设备。 ANDROID_ID生成规则:签名+设备信息+设备用户 ANDROID_ID重置规则:设备恢复出厂设置时,ANDROID_ID将被重置 String androidId = Settings.Secure.getString(this.getContentResolver(), Se...

2020-04-14 16:26:38 489

原创 Android 线程池

newCachedThreadPool:只有非核心线程,最大线程数非常大,所有线程都活动时会为新任务创建新线程,否则会利用空闲线程 ( 60s空闲时间,过了就会被回收,所以线程池中有0个线程的可能 )来处理任务. 优点:任何任务都会被立即执行(任务队列SynchronousQuue相当于一个空集合);比较适合执行大量的耗时较少的任务. newFixedThreadPo...

2020-04-01 09:35:19 143

原创 progressbar 设置自定义颜色

<?xml version="1.0" encoding="utf-8"?><layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <!-- 设置背景色(黑色) --> <item android:id="@android:id/backgr...

2020-03-12 14:00:06 2515

原创 H5 页面内调起App

App内配置文件中 需要跳转的页面<intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:...

2020-03-05 16:50:08 1696

原创 Android studio 3.4.1 更新 3.5.2 的一系列问题

as 更新3.5.2 , 刚开始从as 内更新的,而且已经下载完成,到最后的时候提示some conflicts were found in the installtion area .some of theconflicts below do not have a solution , so the pattch cannot be applied, please pressed cancl...

2019-12-21 17:20:17 1352

原创 App 锁屏的时候显示App的内容

如题,app 锁屏的时候,等解锁的时候需要显示出来app的壁纸,类似与网易云的锁屏音乐就是一个壁纸显示首先需要一个允许一个程序打开窗口使用TYPE_SYSTEM_ALERT,显示在其他所有程序的顶层权限<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />其次启动一个serv...

2019-10-24 17:46:26 1018

原创 DialogFragment 遇到的系列问题

在onstart中加入if (getDialog() != null) { Window window = getDialog().getWindow(); if (window != null) {//最主要市下边这一句,只加MATCH_PARENT 无效 window.getDecorView().setPadding(0, 0, 0, 0); ...

2019-10-10 08:52:09 332

原创 读取assets 中 .csv 文件

// 读取 .csv 文件 private void readCsv(String path) { try { InputStreamReader inputReader = new InputStreamReader(getResources().getAssets().open("dailyBread.text")); ...

2019-08-29 15:25:47 490

原创 RecyclerView 嵌套 ScrollView 在6.0系统显示不完全

<RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:descendantFocusability="blocksDescendants"> <android.support.v7.widget.Recyc...

2018-07-24 16:31:24 124

原创 科大讯飞 语音评测 + 保存录音 解决wav 录音无法播放问题

    // 设置评测语种 //en_us 英文,zh_cn 汉语 mSpeechEvaluator.setParameter(SpeechConstant.LANGUAGE, "en_us"); // 设置评测题型评测题型,可选值: read_syllable(单字,汉语专有)、read_word(词语...

2018-07-04 13:45:00 8971

原创 retrofit 上传头像

@POST("SchoolApi/Paper/save_audio")@MultipartObservable&lt;String&gt;saveVoice( @Part("uid") String uid, @Part("type") String type, @Part("test_id") String test_id, @...

2018-07-04 13:35:55 146

原创 DatePickerDialog 主题色

final Calendar calendar = Calendar.getInstance(); int year = calendar.get(Calendar.YEAR); int month = calendar.get(Calendar.MONTH); int day = calendar.get(Calendar.DAY_OF_...

2018-04-13 14:22:28 347

原创 RecyclerView ViewPager

/*一次滑动一页*/ LinearSnapHelper snapHelper=new LinearSnapHelper(); snapHelper.attachToRecyclerView(mRecyclerView); /*一次滑动多页*/ PagerSnapHelper snapHelper1=new PagerSnapHelpe

2018-01-08 14:51:31 239

原创 在某Activity做到手机无法截屏

getWindow().addFlags(WindowManager.LayoutParams. FLAG_SECURE);

2018-01-03 09:29:52 253

原创 NestedScrollView RecyclerView 滑动不流畅

NestedScrollView  RecyclerView 滑动不流畅在代码中加入binding.recy.setNestedScrollingEnabled(false);

2017-11-16 14:44:45 346

原创 fresco 加载本地gif图片

Uri uri = new Uri.Builder() .scheme(UriUtil.LOCAL_RESOURCE_SCHEME) .path(String.valueOf(R.mipmap.ticket_order)) .build();DraweeController controller = Fresco.newDraweeControll

2017-09-25 10:23:44 1470

原创 MediaPlayer

public class VoiceNavigationActivity extends BaseActivity implements SeekBar.OnSeekBarChangeListener { private MediaPlayer mMediaPlayer = null;//媒体播放器 private AudioManager mAudioManager = nul

2017-09-08 18:10:06 223

原创 生成realease版本的apk:

gradlew assembleRelease

2017-08-10 08:58:35 384

原创 Md5Utils

public class Md5Utils { /** * MD5加码。32位 * @param s * @return */ public static String MD5(String s) { char hexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '

2017-07-17 10:44:59 448

原创 MediaPlayer.prepare() throws IllegalStateException

在 MediaPlayer.setDataSource(“”);调用 MediaPlayer.prepare() 出现  IllegalStateException  异常现在只需把MediaPlayer设置一个监听事件,mMediaPlayer.reset();mMediaPlayer.setDataSource(scenicDetailResult.getSoftyuy

2017-07-12 16:08:22 2497 2

原创 Toolbar

Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplaySho

2017-06-27 16:04:10 234

原创 IndicatorViewPager (笔记)

1.buildcompile 'com.shizhefei:ViewPagerIndicator:1.1.3'2.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="

2017-06-22 15:10:29 1589

原创 解决APP启动闪屏

1.在style 中设置 背景透明色 true @android:color/transparent 2.在配置文件中 设置启动页的Theme为 刚才设置的主题AppTransparentTheme<activity android:name=".XX" android:theme=

2017-06-20 17:35:26 1880

原创 Scrollview (NestedScrollView) 嵌套 RecyclerView 的时候RecyclerView 抢焦点

Scrollview (NestedScrollView) 嵌套 RecyclerView 的时候RecyclerView 抢焦点,跳转到这个Activity 页面的时候,Scrollview 自动滑动到RecyclerView 的地方而不是本页面的最上方的View, 这时候是因为RecyclerView抢了焦点 ,自动滑动,只需要在xml页面在最顶层的View 加入 android:foc...

2017-06-07 18:30:36 4790 6

原创 Push failed. Failed with error: fatal: Could not read from remote repository.

在往github 仓库提交的时候出现以下错误。Failed with error: fatal: Could not read from remote repository.      此原因是因为ssh公钥有问题,因为之前电脑是以前的同事用着,我直接就改为自己的账号了,导致ssh不一致,查看本地的ssh ,cat ~/.ssh/id_rsa.pub 然后就会出

2017-05-27 14:19:34 4454

购票 日期选择器

购票 日期选择器

2017-06-02

ViewPagerIndicator

Indicator 取代 tabhost,实现网易顶部tab

2017-04-28

购票日期选择(范围)

选择购票日期的日历控件

2017-04-19

recyclerview 上拉刷新下拉加载

recyclerview 上拉刷新下拉加载,发现一个比较好的类库,原demo比较多,进行精简了下。(AS用)

2017-03-16

银联wap支付

银联wap支付,包含代码,还有开发文档,希望对你们有用

2015-03-12

空空如也

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

TA关注的人

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