![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
android工具类
叫我小十三
8年Android开发
展开
-
popwindow在view左侧弹出,附加弹出动画
直接代码 /** * 显示popwindow * * @param pop_option 需要显示的pop样式view */ private void showPopupWindow(View pop_option) { mPopupmenuView = new PopupWindow(pop_option, ViewGrou...原创 2019-12-12 12:00:20 · 744 阅读 · 0 评论 -
android截屏,保存图片
截屏public void screenshots() { //截取的View bindingView.Layout.post(new Runnable() { @Override public void run() { View dView = bindingView.Layou...原创 2019-12-11 09:40:38 · 588 阅读 · 0 评论 -
android状态栏透明
/** * 状态栏透明 * @param activity */public static void transparencyBar(Activity activity){ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Window window = activity.getWindo...原创 2018-02-28 14:45:18 · 144 阅读 · 0 评论 -
android利用glide显示圆角图片
注意:这样设置圆角的话,xml文件中不要设置centerCrop属性,否则代码是不起作用的,所以要在代码中设置这个属性,上面已经有了。GlideRoundTransform类,直接复制就可以。glide版本现在我用的是4.14.2。PS:下面是4.0之前的用法,已废弃。原创 2018-03-12 10:34:59 · 7990 阅读 · 3 评论 -
RxJava2+retrofit简单使用,基于POST请求封装工具类
首先依赖// Android 支持 Rxjava// 此处一定要注意使用RxJava2的版本compile 'io.reactivex.rxjava2:rxjava:2.0.1'compile 'io.reactivex.rxjava2:rxandroid:2.0.1'// Android 支持 Retrofitcompile 'com.squareup.retrofit2:retrof...原创 2018-03-05 11:52:51 · 602 阅读 · 0 评论 -
android点击软键盘外面的区域关闭软键盘
/** * 点击软键盘外面的区域关闭软键盘 * @param ev * @return */ @Override public boolean dispatchTouchEvent(MotionEvent ev) { if (ev.getAction() == MotionEvent.ACTION_DOWN) { ...原创 2018-11-20 17:23:17 · 1504 阅读 · 1 评论 -
TextView加载HTML,文字和图片
public class ImageGetterUtils { public static MyImageGetter getImageGetter(Context context, TextView textView) { MyImageGetter myImageGetter = new MyImageGetter(context, textView); ...原创 2019-08-08 11:18:58 · 470 阅读 · 0 评论 -
Glide4加载图片显示圆角和显示头像圆形图片
用于记录工具 /** * 加载圆形图片 * @param context * @param view * @param url */ public static void setCirclePicture(Context context, ImageView view, String url) { GlideApp.w...原创 2019-08-08 11:50:01 · 2132 阅读 · 0 评论 -
Android颜色透明度百分比和十六进制对应关系
透明度 十六进制 100% FF 99% FC 98% FA 97% F7 96% F5 95% F2 94% F0 93% ED 92% EB 91% E8 90% E6 89% E3 88% E0 87% DE 86% DB 85% ...原创 2019-08-08 11:56:08 · 181 阅读 · 0 评论