自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(37)
  • 收藏
  • 关注

原创 Android版本更新

MainActivity.xml<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" an...

2018-04-20 15:12:34 315

原创 QQ登录分享

权限<uses-permission android:name="android.permission.INTERNET" /><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /><uses-permission android:name="android.permis...

2018-04-04 11:03:34 378

原创 上传头像

工具类import android.graphics.Bitmap;import android.util.Log;import java.io.BufferedOutputStream;import java.io.DataOutputStream;import java.io.File;import java.io.FileInputStream;import java.io.F...

2018-03-28 15:28:54 411

原创 安卓仿京东购物车

注意:在child_layout.xml里面的这个组件必须是自己的项目名需要改一下 直接输入Add就出来了<com.bw.gouwuche.AddDeleteView android:id="@+id/adv_main" android:layout_width="wrap_content" android:layout_height="wrap_content" ...

2018-03-26 21:45:09 512

原创 数据库增删查

首先建一个类继承SQLiteOpenHelper重写里面的方法package com.bw.uigaoji.sql;import android.content.Context;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;public clas...

2018-03-23 17:37:12 208

原创 把集合对象写入sd卡

加入读写权限<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>写的方法//运行的时候把方法调用一下public boolea...

2018-03-23 16:24:44 219

原创 Handler和ViewPager无限轮播

显示页面package com.bw.uigaoji.fragment;import android.os.Bundle;import android.os.Handler;import android.os.Message;import android.support.annotation.Nullable;import android.support.v4.app.Fragment...

2018-03-23 12:16:50 314

原创 Button背景颜色和背景图片

需要在drawable建xml文件  在这里都需要在你的Button里引用一下android:background="@drawable/bjs"这个是背景颜色<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android">

2018-03-23 12:00:53 4070

原创 简单SharedPreferences

5秒跳转 第一次有动画走完动画跳转 第二次不走动画直接跳转 Timer要记得关闭不然会有二次跳转//得到SharedPreferencesSharedPreferences user = getSharedPreferences("user", Context.MODE_PRIVATE);//第一次进入是false//在第二次进入时得到的是Editor存放为true的布尔值所以判断成立 直接...

2018-03-23 11:23:34 180

原创 透明,旋转,移动,缩放

透明//在2s内,将imageView的透明度从1变成0然后再变成1。ObjectAnimator animator = ObjectAnimator.ofFloat(mImg, "alpha", 1f, 0f,1f);animator.setDuration(2000);//时间1sanimator.start();旋转//在2s内,顺时针旋转360度,然后再逆时针旋转360度。Obje...

2018-03-23 10:33:20 241

原创 AlertDialog

加载子布局 ListView长按子条目给子布局赋值mListItem.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> adapterView, View view, ...

2018-03-22 10:09:26 181

原创 友盟集成和分享

在drawable里还要加上图片 这里没有图片自己努力吧自己创建的App别忘了在清单文件里配置首先导依赖compile 'com.umeng.sdk:common:latest.integration'compile 'com.umeng.sdk:analytics:latest.integration'这个是加在最外边那个build里的allprojects { repositorie...

2018-03-21 21:09:00 1102

原创 OK拦截器

public class OkUtils implements Interceptor { private static final String TAG = "MyInter"; @Override public Response intercept(Chain chain) throws IOException { //获取原来的body ...

2018-03-19 19:20:12 241

原创 二级列表RecyclerView购物车

在你敲代码时不要忘记导依赖:compile 'com.squareup.okhttp3:okhttp:3.9.0'compile 'com.squareup.okhttp3:logging-interceptor:3.9.0'compile 'com.google.code.gson:gson:2.8.2'compile 'com.nostra13.universalimageloader:...

2018-03-19 10:57:33 234

原创 Recycler点击按钮切换布局

首先定义一个布尔值boolean flag=false;然后再给按钮设置点击事件mBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (flag==false) { //点击后想要变成什么要的布局样式...

2018-03-17 14:35:06 320

原创 Recycler多条目加载

//现在有三个内部类所以泛型是RecyclerView.ViewHolderpublic class GoodsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { Context context; List<GoodsInfo.DataBean> data;//提前定义好getI...

2018-03-17 14:33:36 249

原创 依赖

OkHttocompile 'com.squareup.okhttp3:okhttp:3.9.1'compile 'com.squareup.okio:okio:1.13.0' Recyclercompile 'com.android.support:recyclerview-v7:23.2.0' Gsoncompile 'com.google.code.gson:gson:2.2.4' ...

2018-03-15 20:44:29 232

原创 RxJava

import com.bwei.rxjavaandretrofit.bean.GoodsInfo;import com.bwei.rxjavaandretrofit.bean.UserInfo;import com.bwei.rxjavaandretrofit.bean.WealInfo;import java.util.List;import retrofit2.http.GET;import ...

2018-03-15 20:44:11 327

原创 Retrofit有参无参接口拼接GET

封装接口公共部分public class Api { public static String api1="http://service.meiyinkeqiu.com/"; public static String api2="http://gank.io/api/"; public static String api3="http://www.93.gov.cn/93a...

2018-03-13 16:26:19 2079

原创 GreenDao+Retrofit+MVP+刷新+加载+有网+没网

Model层public class MyModel { public interface NewCall{ void OnSuccess(FuLi fuLi); } NewCall newCall; public void getNewModel(NewCall newCall){ this.newCall=newCall; ...

2018-03-13 12:22:18 486

原创 GreenDao增删改查

首先完成GreenDao的配置生成DaoMaster和DaoSession和UserDao三个类,我博客里有GreenDao的配置。在建User类的时候主键必须是Long类型1.先定义一个App继承Application使用饿汉式public class MyApp extends Application { public static MyApp myApp; private Da...

2018-03-12 17:25:32 202

原创 Retrofit

1.导依赖compile 'com.squareup.retrofit2:retrofit:2.0.1'compile 'com.squareup.okio:okio:1.5.0'compile 'com.squareup.okhttp3:okhttp:3.2.0'compile 'com.squareup.retrofit2:converter-gson:2.0.1'compile 'c...

2018-03-12 16:25:28 156

原创 京东秒杀

初始化时间int miaosha = 1000000000;final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm:ss");CountDownTimer countDownTimer = new CountDownTimer(miaosha, 1000) { @Override public v...

2018-03-12 16:01:31 1117

原创 全屏滑动

<ScrollView android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_width="match_parent" android:layout_height="matc...

2018-03-12 10:46:32 193

原创 Json原生解析

public class ShowModel { public interface GetModel{ void OnSuccess(JSONArray jsonArray); } GetModel getModel; public void getShowModel(GetModel getModel){ this.getMod...

2018-03-11 16:40:42 395

原创 判断是否有网工具类

网络权限<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>public class Utils {    public static int getType(Context context){        int mState=-1;//-1代表无网络        //获取系统提供的服务...

2018-03-11 16:35:42 156

原创 GreenDao

1.首先在Androidstudio 项目的build.grad 文件中引入一下文件buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.2.1' classpath 'org.gr...

2018-03-10 10:49:23 251

原创 基类

BaseActivity基类public abstract class BaseActivity<T> extends AppCompatActivity {    public  T presenter;    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate...

2018-03-09 19:26:44 199

原创 MVP

//Model层public class FenModel { public interface NewFenModel{ void getSuccess(FenLei fenlei); } NewFenModel newFenModel; public void getFenModel(NewFenModel newFenModel){ ...

2018-03-09 19:21:36 223

原创 EventBus

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activi

2018-03-09 19:17:02 162

原创 Picasso, Glide,fresco

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:id="@+id/activity_

2018-03-09 17:42:44 257

原创 Tablayou加ViewPager

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schem

2018-03-09 17:33:21 315

原创 Recycler适配器和点击事件加传值

public class FenAdapter extends RecyclerView.Adapter<FenAdapter.FenViewHodler> { Context context; List<FenLei.DataBean> data; private View inflate; public FenAdapter(Conte...

2018-03-09 17:14:51 450

原创 Handler倒计时跳转

private Handler handler=new Handler();    private int i=3;   final Timer timer=new Timer();        timer.schedule(new TimerTask() {            @Override            public void run() {                h...

2018-03-09 17:12:23 226

原创 Banner无限轮播

//写一个类继承Applicationpublic class MyApp extends Application {    @Override    public void onCreate() {        super.onCreate();               ImageLoaderConfiguration imageLoaderConfiguration=new ImageL...

2018-03-09 17:11:18 160

原创 二级列表

//先获取到集合List<ErJiLieBiao.DataBean> data = erJiLieBiao.getData();mElist.setAdapter(new ErJiLieBiaoAdapter(getActivity(),data));//默认打开int count = mElist.getCount();for (int i=0; i<count; i...

2018-03-09 17:07:30 259

原创 消除应用标题

在res里values里的styles.xml里更改style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"

2018-03-09 17:02:19 142

空空如也

空空如也

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

TA关注的人

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