- 博客(22)
- 收藏
- 关注
原创 greendao整理
//在项目的build.gradle中添加dependencies { ... classpath 'org.greenrobot:greendao-gradle-plugin:3.2.0'}//在APP的build.gradle中添加dependencies {......implementation 'org.greenrobot:greendao:3.2.0...
2019-09-16 19:21:57
157
原创 自定义流式布局
不知道在哪个博客里看到的整理了一遍创建一个继承ViewGroup的类public class SearchView extends ViewGroup重写onMeasure@Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.on...
2019-09-16 17:29:33
198
原创 activity+mvp的简单封装(自用勿扰)
东拼西凑的整理activity抽取方法 //布局setContentView(initLayout());//初始化init(); //数据initDate(); //逻辑initLogic();fragment的抽取@Nullable @Override public View onCreateView(@NonNull LayoutInf...
2019-09-09 08:13:03
226
转载 Fresco图片加载
版权声明:转载必须注明本文转自严振杰的博客:http://blog.yanzhenjie.com 参考Yw_Ambition的博客https://blog.youkuaiyun.com/yw59792649/article/details/78921025参考博客:https://blog.youkuaiyun.com/xiaoqiang_0719/article/details/52437780...
2019-02-14 11:30:54
550
转载 viewPager+Fragment
//把Fragment添加到ArrayList中fragment = new ArrayList<>();fragment.add(new HomeFragment());fragment.add(new ClassifFragment());fragment.add(new ShoppinFragment());fragment.add(new ListnrFragmen...
2019-01-18 14:33:05
165
原创 自定义注解(自用)
定义一个注解类ElementType.TYPE:用于描述类、接口或enum声明 ElementType.FIELD:用于描述实例变量 ElementType.METHOD ElementType.PARAMETER ElementType.CONSTRUCTOR ElementType.LOCAL_VARIABLE ElementType.ANNOTATION_TYPE...
2018-12-26 20:44:46
250
原创 android初级小技巧
时间戳转换日期格式字符串String format = "yyyy-MM-dd HH:mm:ss";SimpleDateFormat dateFormat = new SimpleDateFormat(format);String format1 = dateFormat.format(time);//EditText中密码的显示和隐藏if (basd==true){ ...
2018-12-20 18:39:41
164
原创 Retrofit简单封装+日志(自用)
依赖implementation 'com.squareup.retrofit2:retrofit:2.4.0'implementation 'com.squareup.retrofit2:converter-gson:2.4.0'implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'implementation ...
2018-12-16 20:48:32
454
原创 分类
viewpager = (ViewPager) findViewById(R.id.viewpager); tabs = (TabLayout) findViewById(R.id.tabs);tabs.addTab(tabs.newTab()); tabs.addTab(tabs.newTab()); tabs.setupWithViewPag...
2018-11-23 08:23:07
169
原创 二级列表ExpandableListView的CheckBox使用
首先要在数据的一级和二级列表中各添加一个boolean数据在Activity中添加点击组条目选中和不选中//一级列表list.get(i).setChtenild(!list.get(i).isChtenild());for (int j = 0; j <list.get(i).getList().size() ; j++) { list.get(i).getList(...
2018-11-22 20:44:06
443
原创 自定义简单的加减器(自用)
继承一个布局public class CustomLayout extends LinearLayout {重写onLayout、onDrawprotected void onLayout(boolean changed, int l, int t, int r, int b) { super.onLayout(changed, l, t, r, b);}@Over...
2018-11-22 20:24:56
259
原创 自定义全局异常捕获类
public class UncaughtExceptionHandl implements Thread.UncaughtExceptionHandler { private static final UncaughtExceptionHandl UncaughtExceptionHandl = new UncaughtExceptionHandl();; private ...
2018-11-11 19:55:21
488
原创 简单的toolbar
//获取toolbar对象是v7的 tobar = findViewById(R.id.tobar); //一定要在第一行 setSupportActionBar(tobar); //设置是否显示主标题 getSupportActionBar().setDisplayShowTitleEnabled(false);...
2018-11-04 20:35:06
159
原创 自定义View轮盘抽奖
canvas.rotate(360/count,0,0);//旋转画布public class LuckyDraw extends View implements View.OnClickListener { private final int widthPixel; private final int heightPixel; private final int...
2018-11-04 20:26:52
307
原创 zxing的简单二维码扫描和生成
这是我看的大神的github:https://github.com/yipianfengye/android-zxingLibrary 先在build中添加implementation 'cn.yipianfengye.android:zxing-library:2.2'在配置里添加<uses-permission android:name="android.perm...
2018-08-12 21:18:53
740
原创 错误的今日头条
public abstract class BaseActivity extends AppCompatActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); ini...
2018-07-30 07:51:10
347
原创 横滑
for (int i=0;i<titles.length;i++){ textView = new TextView(this); textView.setText(titles[i]); textView.setTextSize(20); textView.setId(i); textView.setTextColor(Color.BLACK);...
2018-07-23 08:27:55
182
原创 AsyncTask
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'ImageLoaderConfiguration configuration = new ImageLoaderConfiguration.Builder(this).build();ImageLoader.getInstance(...
2018-06-25 09:27:37
196
原创 横向滑动
<HorizontalScrollView android:id="@+id/horizontalScrollView" android:layout_width="match_parent" android:layout_below="@id/includea" android:scrollbars="none" android:layout_hei...
2018-06-25 08:13:56
220
原创 获取接口
public class MainActivity extends AppCompatActivity { private Button btn; private ListView listView; private String path = "http://v.juhe.cn/joke/content/list.php?sort=0.0&page=&page...
2018-06-10 21:06:34
1134
原创 商品小计和总价
<html> <head> <meta charset="UTF-8"> <title></title> <script type="text/javascript" src="js/angular.min.js" ></script> &
2018-03-27 11:39:44
1896
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人