Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file modified MVPModel/.idea/caches/build_file_checksums.ser
Binary file not shown.
2 changes: 1 addition & 1 deletion MVPModel/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 11 additions & 9 deletions MVPModel/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 26
compileSdkVersion 28
defaultConfig {
applicationId "com.gaolei.mvpmodel"
minSdkVersion 15
targetSdkVersion 26
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -20,21 +20,23 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation "com.android.support:design:26+"
implementation 'com.android.support:appcompat-v7:28+'
implementation "com.android.support:design:28+"

implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile 'com.squareup.okhttp3:okhttp:3.10.0'
compile 'com.squareup.retrofit2:retrofit:2.4.0'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.github.bumptech.glide:glide:4.6.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
compile 'com.youth.banner:banner:1.4.10'

implementation 'com.youth.banner:banner:1.4.10'

implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
implementation "io.reactivex.rxjava2:rxjava:2.1.1"
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static void disableShiftMode(BottomNavigationView view) {
for (int i = 0; i < menuView.getChildCount(); i++) {
BottomNavigationItemView item = (BottomNavigationItemView) menuView.getChildAt(i);
//noinspection RestrictedApi
item.setShiftingMode(false);
item.setShifting(false);
// set once again checked value, so view will be updated
//noinspection RestrictedApi
item.setChecked(item.getItemData().isChecked());
Expand Down
245 changes: 0 additions & 245 deletions MVPModel/app/src/main/java/com/gaolei/mvpmodel/JsonUtil.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,17 @@
import com.gaolei.mvpmodel.mpresenter.BasePresenter;


/**
* Created by liuhaiyang on 2017/8/2.
*/

public abstract class BaseMvpActivity<V, P extends BasePresenter<V>> extends BaseActivity {

public abstract class BaseMvpActivity<P extends BasePresenter> extends BaseActivity {

public P mPresenter;

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mPresenter = initPresenter();
mPresenter.attach((V) this);
mPresenter.attach( this);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

import android.app.Application;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.request.RequestOptions;
import com.gaolei.mvpmodel.R;


public class CustomApplication extends Application {

public static ConnectivityManager connectivityManager;
public static RequestOptions options;
@Override
public void onCreate() {
Expand All @@ -18,5 +20,28 @@ public void onCreate() {
// .placeholder(R.drawable.ic_launcher)// 正在加载中的图片
// .error(R.drawable.video_error) // 加载失败的图片
.diskCacheStrategy(DiskCacheStrategy.ALL); // 磁盘缓存策略
connectivityManager= (ConnectivityManager) getApplicationContext()
.getSystemService(Context.CONNECTIVITY_SERVICE);
}
public static boolean isNetworkAvalible() {
// 获得网络状态管理器

if (connectivityManager == null) {
return false;
} else {
// 建立网络数组
NetworkInfo[] net_info = connectivityManager.getAllNetworkInfo();

if (net_info != null) {
for (int i = 0; i < net_info.length; i++) {
// 判断获得的网络状态是否是处于连接状态
if (net_info[i].getState() == NetworkInfo.State.CONNECTED) {
return true;
}
}
}
}
return false;
}

}
Loading