Skip to content

Commit

Permalink
update, use android.app.Loader replace v4 loader
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoyubetter committed Nov 29, 2018
1 parent 2038572 commit 452f974
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 69 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
7 changes: 3 additions & 4 deletions config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
ext {
VERSION_NAME = "3.5.0"
VERSION_CODE = 1
COMPILE_SDK_VERSION = 26 // 25 23
BUILD_TOOLS_VERSION = "26.0.1" // 25.0.2 23.0.2
COMPILE_SDK_VERSION = 27 // 25 23
MIN_SDK_VERSION = 14
TARGET_SDK_VERSION = 23 // 这个千万不能改
SUPPORT_VERSION = "26.0.2"
TARGET_SDK_VERSION = 23
SUPPORT_VERSION = "27.1.1"
GLIDE_VERSION = '3.7.0'
// support依赖支持包
compile_support = [
Expand Down
41 changes: 18 additions & 23 deletions demo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
compileSdkVersion COMPILE_SDK_VERSION

defaultConfig {
applicationId "com.example.demo"
minSdkVersion 15
targetSdkVersion 26
targetSdkVersion TARGET_SDK_VERSION
versionCode 1
versionName VERSION_NAME
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -24,14 +23,14 @@ android {
abortOnError false
}

android.applicationVariants.all {
variant ->
variant.outputs.each { output ->
if (buildType.name == 'release') {
output.outputFile = new File(output.outputFile.parent, "${getCurrentTime()}_album_${buildType.name}_${defaultConfig.versionName}.apk")
}
}
}
// android.applicationVariants.all {
// variant ->
// variant.outputs.each { output ->
// if (buildType.name == 'release') {
// output.outputFile = new File(output.outputFile.parent, "${getCurrentTime()}_album_${buildType.name}_${defaultConfig.versionName}.apk")
// }
// }
// }
}

def getCurrentTime() {
Expand All @@ -40,16 +39,12 @@ def getCurrentTime() {
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile "com.android.support:appcompat-v7:${SUPPORT_VERSION}"
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile project(':mae-bundles-album') // or 使用下面的

compile 'com.github.anrwatchdog:anrwatchdog:1.3.0'

compile "com.github.bumptech.glide:glide:${GLIDE_VERSION}"
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "com.android.support:appcompat-v7:${SUPPORT_VERSION}"
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation project(':mae-bundles-album') // or 使用下面的

implementation 'com.github.anrwatchdog:anrwatchdog:1.3.0'

implementation "com.github.bumptech.glide:glide:${GLIDE_VERSION}"
}
15 changes: 5 additions & 10 deletions mae-bundles-album/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ group='com.github.liyuzero'

android {
compileSdkVersion COMPILE_SDK_VERSION
buildToolsVersion BUILD_TOOLS_VERSION

defaultConfig {
minSdkVersion MIN_SDK_VERSION
Expand Down Expand Up @@ -38,15 +37,11 @@ configurations.all {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile "com.android.support:support-annotations:${SUPPORT_VERSION}"
compile "com.android.support:appcompat-v7:${SUPPORT_VERSION}"
compile "com.android.support:design:${SUPPORT_VERSION}"
testCompile 'junit:junit:4.12'
compile 'com.github.liyuzero:MaeMonitorFragment:1.0.1'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "com.android.support:support-annotations:${SUPPORT_VERSION}"
implementation "com.android.support:appcompat-v7:${SUPPORT_VERSION}"
implementation "com.android.support:design:${SUPPORT_VERSION}"
api 'com.github.liyuzero:MaeMonitorFragment:1.0.1'
}


Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.yu.bundles.album.image;

import android.app.Activity;
import android.app.LoaderManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
Expand All @@ -12,7 +13,6 @@
import android.support.annotation.StringRes;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.LocalBroadcastManager;
import android.view.MenuItem;
import android.view.View;
Expand Down Expand Up @@ -84,6 +84,7 @@ protected void onCreate(Bundle savedInstanceState) {
LocalBroadcastManager.getInstance(getApplicationContext()).registerReceiver(receiver, filter);
}


@Override
protected void onDestroy() {
super.onDestroy();
Expand Down Expand Up @@ -256,8 +257,8 @@ public Activity getActivity() {
}

@Override
public LoaderManager getSupportLoaderManager() {
return super.getSupportLoaderManager();
public LoaderManager getLoadManager() {
return super.getLoaderManager();
}

//--------------------------------- 系统状态处理 ------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.yu.bundles.album.model;

import android.content.Context;
import android.content.CursorLoader;
import android.database.Cursor;
import android.database.MatrixCursor;
import android.database.MergeCursor;
import android.net.Uri;
import android.provider.MediaStore;
import android.support.v4.content.CursorLoader;
import android.text.TextUtils;

import com.yu.bundles.album.ConfigBuilder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.yu.bundles.album.model;

import android.content.Context;
import android.content.CursorLoader;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.database.MatrixCursor;
import android.database.MergeCursor;
import android.net.Uri;
import android.provider.MediaStore;
import android.support.v4.content.CursorLoader;

import com.yu.bundles.album.ConfigBuilder;
import com.yu.bundles.album.entity.Album;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.yu.bundles.album.model;

import android.app.LoaderManager;
import android.content.Context;
import android.content.Loader;
import android.database.Cursor;
import android.os.Bundle;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.Loader;

import com.yu.bundles.album.entity.Album;
import com.yu.bundles.album.entity.ImageInfo;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.yu.bundles.album.model;

import android.content.Context;
import android.content.Loader;
import android.database.Cursor;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.Loader;
import android.app.LoaderManager;

/**
* Created by liyu on 2017/9/28.
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public class AlbumPresenterImpl implements AlbumModelImpl.AlbumCallbacks, AlbumM

public AlbumPresenterImpl(@NonNull AlbumView mAlbumView) {
this.mAlbumView = mAlbumView;
albumModel = new AlbumModelImpl(mAlbumView.getActivity(), mAlbumView.getSupportLoaderManager(), this);
albumMediaModel = new AlbumMediaModelImpl(mAlbumView.getActivity(), mAlbumView.getSupportLoaderManager(), this);
albumModel = new AlbumModelImpl(mAlbumView.getActivity(), mAlbumView.getLoadManager(), this);
albumMediaModel = new AlbumMediaModelImpl(mAlbumView.getActivity(), mAlbumView.getLoadManager(), this);
ImageQueue.init();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.yu.bundles.album.presenter;

import android.app.Activity;
import android.app.LoaderManager;
import android.database.Cursor;
import android.support.annotation.StringRes;
import android.support.v4.app.LoaderManager;

import com.yu.bundles.album.entity.AlbumInfo;

Expand All @@ -22,7 +22,7 @@ public interface AlbumView {

Activity getActivity();

LoaderManager getSupportLoaderManager();
LoaderManager getLoadManager();

void showMessage(@StringRes int messageId);

Expand Down

0 comments on commit 452f974

Please sign in to comment.