Giter Site home page Giter Site logo

mybasesdk's Introduction

版本说明(最新JitPack)

(1.1.5)

说明 新增个性化toast

===

(1.1.4)

说明:兼容1.1.3

添加了glide 清除缓存工具

(1.1.3)

1、新版本集成了权限管理的sdk 有用到( api 'com.hjq:xxpermissions:x.x')的需在主模块中去除,避免重复

2、集成了蒲公英APP版本更新功能,详情使用方法请查看蒲公英官方文档,本sdk 关键使用请参考UpdateAppVersionActivity.java

使用说明

Step 1. Add the JitPack repository to your build file

allprojects {
		repositories {
			...
			maven { 
			url 'https://jitpack.io'
			// 1.1.3 新集成了蒲公英版本更新,crash 捕获的功能 必须添加下面这行
			maven { url "https://raw.githubusercontent.com/Pgyer/mvn_repo_pgyer/master" }
			}
		}
	}

Step 2. Add the dependency(注意使用版本)

android {
	...
	  compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
//****************************必须保留start******************
		implementation fileTree(dir: 'libs', include: ['*.jar'])
   		testImplementation 'junit:junit:4.12'
    		androidTestImplementation 'com.android.support.test:runner:1.0.2'
    		androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//****************************必须保留end******************
// 项目使用butterknife 必须添加这行
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
	         implementation 'com.github.kenxiong0113:MyBaseSDK:x.x.x'
	}

Step 3.初始化

public class MyApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
//        初始化base_utils_class
        BaseLibrary.initBaseLibrary(this);
//        设置通知栏应用logo
       BaseLibrary.setAppIcon(R.mipmap.ic_launcher);

    }
}

Step 4.设置actionBar

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        ...
      	<item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>

使用

1.继承 BaseToolBarActivity,重写实现父类必要方法,示例:

public class MainActivity extends BaseToolBarActivity {
    private static final String TAG = "MainActivity";
    @BindView(R.id.et_scan)
    EditText etScan;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_main;
    }

    @Override
    protected void initBase() {

    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initListener() {
       
    }

    @Override
    protected void initData() {

    }
}

2.版本更新示例(请查看UpdateAppVersionActivity.java):

    //关键代码:
      UpdateAppVersionUtils.getInstance().checkAppVersion(this);

打赏(不要理,我就是写一个图片表格试试)

mybasesdk's People

Contributors

kenxiong avatar kenxiong0113 avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.