`
龙哥IT
  • 浏览: 237155 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
文章分类
社区版块
存档分类
最新评论
文章列表
第一中优化的方法 在Adapter中,以后ViewHolder就调用一下方法 package com.wwl.canvas.adapter; import android.content.Context; import android.util.SparseArray; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; public class ViewHolder { private SparseArray<View& ...
import android.content.Context; import android.graphics.drawable.Drawable; import android.support.v4.view.ViewPager; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.LinearLayout;   import net.youth.banner.indicator.BaseIndicatorAdapter; import net.youth. ...
implementation 'com.github.MZCretin:ExpandableTextView:v1.5.1'   <com.ctetin.expandabletextviewlibrary.ExpandableTextView android:id="@+id/expand_text_view" android:layout_width="fill_parent" android:layout_height="wrap_content" ...
public static boolean isDestory(Activity activity){ if(activity==null){ return true; } else if(activity.isFinishing()){ return true; } else if(activity.isDestroyed()){ return true; } else{ ...
小程序 轮播图标点样式设置(可设置大小 颜色 形状) 轮播图xml <view class='swiper'> <swiper class="swiper-box" indicator-dots="{{true}}" autoplay="{{false}}" bindchange="bindchange" style="height:{{imgheight}}rpx;" indicator-color="{{indicatorCo} ...
var details = res.data.data.details .replace(/<img([\s\w"-=\/\.:;]+)((?:(style="[^"]+")))/ig, '<img$1 style="max-width:100%;height:auto;float:none;display:block;') .replace(/<p([\s\w"=\/\.:;]+)((?:(style="[^"]+")))/ig, '& ...
Activity 间通过隐式 Intent 的跳转,在发出 Intent 之前必须通过 resolveActivity 检查,避免找不到合适的调用组件,造成 ActivityNotFoundException 的异常。   例如: public void viewUrl(String url, String mimeType) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(Uri.parse(url), mimeType); if (getPackageManager().reso ...
  用WebView加载数据,如果只是Http网页链接,直接用LoadUrl加载即可,如果是网页数据或者是js代码,直接用loadDataWithBaseURL方法即可, 如果想在WebView中调起到某个APP或者调起支付,则必须用WebView.setWebChromeClient方法,可以操作Javascript dialogs(js脚本对话框), favicons(添加收藏的标志), titles(标题), 和 progress(进度条)等页面点击事件以及自动跳转等事件处理,如果直接用webview.setWebViewClient达不到想要的效果,因为webview.setWeb ...
  //ViewPager指示器     api 'com.github.hackware1993:MagicIndicator:1.5.0'     <net.lucode.hackware.magicindicator.MagicIndicator android:id="@+id/magic_indicator" android:layout_marginTop="@dimen/my1dp" android:layout_width="match_parent" ...
因为现在的手机版本升级了,虽然保存了文件到本地,但是手机本身是不识别他,需要去通知系统,放了文件到本地,让他去扫描识别 ContentValues values = new ContentValues(); values.put(MediaStore.Images.Media.DATA, VideoPath); values.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg"); getContentResolver().insert(MediaStore.Ima ...
第一个方法是通过在外层添加一个CardView <android.support.v7.widget.CardView android:id="@+id/cardview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight ...
基本上大多数项目,在我的界面或者是设置界面,有一个列表,这个列表布局简单,有没什么挑战性,还必须花很多时间去布局, 这里把这样的列表布局给封装起来,以后就可以直接使用 我这里也是找别人写的,拿过来用,保存着,自己用的时候容易找
当图片设置 android:scaleType="centerCrop" 属性,又要实现圆角图片的时候,出现的一些问题,当设置centerCrop的时候,圆角就没有了, 这个时候需要用到另一个方法,设置两个Transformer Glide.with(mContext) .load(vo.getImage()) .dontAnimate() .placeholder(R.drawable.noinfo) .error(R.drawable.noinfo) .transform( ...
添加包: implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.0.3' //recyclerview库 implementation 'com.android.support:recyclerview-v7:27.1.1' //adapter implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.35' refreshLayout.setOnRefreshListener(new OnRefreshListener() ...
/** * 获取当前屏幕截图,不包含状态栏 * @param activity * @return bp */ public static Bitmap snapShotWithoutStatusBar(Activity activity) { View view = activity.getWindow().getDecorView(); view.setDrawingCacheEnabled(true); view.buildDrawingCache(); B ...
Global site tag (gtag.js) - Google Analytics