diff --git a/app/src/main/java/com/zhuazhu/frame/app/FrameApplication.kt b/app/src/main/java/com/zhuazhu/frame/app/FrameApplication.kt index d512a86..e81ec5c 100644 --- a/app/src/main/java/com/zhuazhu/frame/app/FrameApplication.kt +++ b/app/src/main/java/com/zhuazhu/frame/app/FrameApplication.kt @@ -1,16 +1,22 @@ package com.zhuazhu.frame.app import android.app.Application +import android.view.View import com.squareup.leakcanary.LeakCanary import com.zhuazhu.frame.BuildConfig import com.zhuazhu.frame.R import com.zhuazhu.frame.di.component.AppComponent import com.zhuazhu.frame.di.component.DaggerAppComponent import com.zhuazhu.frame.mvp.image.ImageActivity +import conm.zhuazhu.common.utils.Utils import mejust.frame.FrameManager -import mejust.frame.config.FrameConfig -import mejust.frame.image.ImageConfig +import mejust.frame.annotation.TitleBarMenuLocation +import mejust.frame.common.image.ImageConfig +import mejust.frame.data.FrameConfig +import mejust.frame.di.component.FrameComponent import mejust.frame.net.config.NetConfig +import mejust.frame.widget.title.TitleBarSetting +import mejust.frame.widget.title.TitleBarSetting.TitleMenu /** * @author wangpeifeng @@ -28,12 +34,11 @@ class FrameApplication : Application() { return } LeakCanary.install(this) - initLibrary() - appComponent = DaggerAppComponent.builder().frameComponent(FrameManager.getFrameComponent()) - .build() + val frameComponent = initLibrary() + appComponent = DaggerAppComponent.builder().frameComponent(frameComponent).build() } - private fun initLibrary() { + private fun initLibrary(): FrameComponent { val imageConfig = ImageConfig().apply { hostUrl = BuildConfig.IMAGE_URL placeholderResId = R.drawable.ic_launcher_background @@ -45,9 +50,16 @@ class FrameApplication : Application() { } val frameConfig = FrameConfig().apply { isDebug = BuildConfig.DEBUG - isOpenNetworkState = false + isOpenNetworkState = true loginClass = ImageActivity::class.java + titleBarSetting = TitleBarSetting.Builder() + .addTitleMenu(TitleMenu(TitleBarMenuLocation.leftFirstMenu).apply { + setIconDrawableRes(this@FrameApplication, R.drawable.ic_arrow_back_white) + clickListener = View.OnClickListener { + Utils.getTopActivity().finish() + } + }).build() } - FrameManager.init(this, imageConfig, netConfig, frameConfig) + return FrameManager.init(this, imageConfig, netConfig, frameConfig) } } diff --git a/app/src/main/java/com/zhuazhu/frame/data/ApiOne.kt b/app/src/main/java/com/zhuazhu/frame/data/ApiOne.kt index cd3ff5c..8cd57e2 100644 --- a/app/src/main/java/com/zhuazhu/frame/data/ApiOne.kt +++ b/app/src/main/java/com/zhuazhu/frame/data/ApiOne.kt @@ -2,7 +2,7 @@ package com.zhuazhu.frame.data import com.zhuazhu.frame.mvp.http.model.ResultOne import io.reactivex.Observable -import mejust.frame.annotation.ServiceUrl +import mejust.frame.data.annotation.ServiceUrl import retrofit2.http.GET /** diff --git a/app/src/main/java/com/zhuazhu/frame/data/ApiTwo.kt b/app/src/main/java/com/zhuazhu/frame/data/ApiTwo.kt index fe3e85c..2d00453 100644 --- a/app/src/main/java/com/zhuazhu/frame/data/ApiTwo.kt +++ b/app/src/main/java/com/zhuazhu/frame/data/ApiTwo.kt @@ -2,7 +2,7 @@ package com.zhuazhu.frame.data import com.zhuazhu.frame.mvp.http.model.ResultOne import io.reactivex.Observable -import mejust.frame.annotation.ServiceUrl +import mejust.frame.data.annotation.ServiceUrl import retrofit2.http.GET /** diff --git a/app/src/main/java/com/zhuazhu/frame/mvp/http/view/HttpActivity.kt b/app/src/main/java/com/zhuazhu/frame/mvp/http/view/HttpActivity.kt index cf47d02..f7cb958 100644 --- a/app/src/main/java/com/zhuazhu/frame/mvp/http/view/HttpActivity.kt +++ b/app/src/main/java/com/zhuazhu/frame/mvp/http/view/HttpActivity.kt @@ -8,7 +8,7 @@ import com.zhuazhu.frame.mvp.http.presenter.HttpPresenter import kotlinx.android.synthetic.main.activity_http.bt_get import kotlinx.android.synthetic.main.activity_http.bt_test import kotlinx.android.synthetic.main.activity_http.text_http_result -import mejust.frame.annotation.LayoutId +import mejust.frame.data.annotation.LayoutId import mejust.frame.annotation.TitleBarConfig import mejust.frame.common.log.Logger import mejust.frame.mvp.view.BasePresenterActivity diff --git a/app/src/main/java/com/zhuazhu/frame/mvp/image/ImageAdapter.kt b/app/src/main/java/com/zhuazhu/frame/mvp/image/ImageAdapter.kt index 01f62db..4e0e8a5 100644 --- a/app/src/main/java/com/zhuazhu/frame/mvp/image/ImageAdapter.kt +++ b/app/src/main/java/com/zhuazhu/frame/mvp/image/ImageAdapter.kt @@ -9,7 +9,7 @@ import android.widget.LinearLayout import com.zhuazhu.frame.mvp.image.ImageAdapter.ImageHolder import conm.zhuazhu.common.utils.ScreenUtils import mejust.frame.FrameManager -import mejust.frame.image.ImageLoadConfig +import mejust.frame.common.image.ImageLoadConfig import java.io.File /** diff --git a/app/src/main/res/drawable-xxhdpi/ic_arrow_back_white.png b/app/src/main/res/drawable-xxhdpi/ic_arrow_back_white.png new file mode 100644 index 0000000..0e43ff9 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_arrow_back_white.png differ diff --git a/library/src/main/AndroidManifest.xml b/library/src/main/AndroidManifest.xml index dd8aa6a..90b5b3d 100644 --- a/library/src/main/AndroidManifest.xml +++ b/library/src/main/AndroidManifest.xml @@ -9,7 +9,7 @@ diff --git a/library/src/main/java/mejust/frame/FrameManager.java b/library/src/main/java/mejust/frame/FrameManager.java index e814f0f..b5188fb 100644 --- a/library/src/main/java/mejust/frame/FrameManager.java +++ b/library/src/main/java/mejust/frame/FrameManager.java @@ -3,15 +3,15 @@ import android.app.Application; import android.support.annotation.NonNull; import conm.zhuazhu.common.utils.Utils; -import mejust.frame.app.CrashHandler; +import mejust.frame.common.CrashHandler; import mejust.frame.common.json.IJsonManager; import mejust.frame.common.log.DebugLogTree; import mejust.frame.common.log.ReleaseLogTree; -import mejust.frame.config.FrameConfig; +import mejust.frame.data.FrameConfig; import mejust.frame.di.component.DaggerFrameComponent; import mejust.frame.di.component.FrameComponent; -import mejust.frame.image.IImageLoadManager; -import mejust.frame.image.ImageConfig; +import mejust.frame.common.image.IImageLoadManager; +import mejust.frame.common.image.ImageConfig; import mejust.frame.net.NetManager; import mejust.frame.net.config.NetConfig; import mejust.frame.widget.ToastFrame; @@ -23,17 +23,17 @@ */ public class FrameManager { - private static FrameComponent frameComponent; - private static IImageLoadManager imageLoadManager; private static NetManager netManager; private static IJsonManager iJsonManager; - public static void init(Application application, ImageConfig imageConfig, NetConfig netConfig, - FrameConfig frameConfig) { - frameComponent = DaggerFrameComponent.builder() + private static FrameConfig frameConfig; + + public static FrameComponent init(Application application, ImageConfig imageConfig, + NetConfig netConfig, FrameConfig frameConfig) { + FrameComponent frameComponent = DaggerFrameComponent.builder() .application(application) .imageConfig(imageConfig) .netConfig(netConfig) @@ -42,6 +42,7 @@ public static void init(Application application, ImageConfig imageConfig, NetCon imageLoadManager = frameComponent.imageLoadManager(); netManager = frameComponent.netManager(); iJsonManager = frameComponent.jsonManager(); + FrameManager.frameConfig = frameConfig; if (frameConfig.isDebug()) { Timber.plant(new DebugLogTree()); } else { @@ -50,9 +51,6 @@ public static void init(Application application, ImageConfig imageConfig, NetCon Utils.init(application); ToastFrame.init(application); CrashHandler.getInstance().init(application); - } - - public static FrameComponent getFrameComponent() { return frameComponent; } @@ -84,4 +82,8 @@ public static IJsonManager jsonManager() { } return iJsonManager; } + + public static FrameConfig provideFrameConfig() { + return frameConfig; + } } diff --git a/library/src/main/java/mejust/frame/app/AppConfig.java b/library/src/main/java/mejust/frame/app/AppConfig.java deleted file mode 100644 index 880ac0f..0000000 --- a/library/src/main/java/mejust/frame/app/AppConfig.java +++ /dev/null @@ -1,95 +0,0 @@ -package mejust.frame.app; - -import android.app.Activity; -import android.app.Application; -import android.content.Context; -import android.content.Intent; -import conm.zhuazhu.common.utils.Utils; -import mejust.frame.common.log.DebugLogTree; -import mejust.frame.common.log.ReleaseLogTree; -import mejust.frame.widget.ToastFrame; -import mejust.frame.widget.title.TitleBarSetting; -import timber.log.Timber; - -/** - * @author : Beaven - * @date : 2017-12-20 11:16 - *

- */ -public final class AppConfig { - - /** - * 程序运行状态区分 - */ - public static boolean DEBUG = false; - - /** - * 网络请求详情打印 - */ - public static String URL_LOG = "OkHttp"; - - /** - * 连接超时,单位:秒 - */ - public static long CONNECT_TIME_OUT_DEFAULT = 10; - - /** - * 读取超时,单位:秒 - */ - public static long READ_TIME_OUT_DEFAULT = 10; - - /** - * 写入超时,单位:秒 - */ - public static long WRITE_TIME_OUT_DEFAULT = 10; - - /** - * json解析时间格式 - */ - public static String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss"; - - /** - * 网络状态监听标志判断 - */ - public static boolean NETWORK_STATUS_MONITORING = true; - - /** - * 登录Activity - */ - private static Class loginClass = null; - - /** - * title配置 - */ - private static TitleBarSetting titleBarSetting = new TitleBarSetting.Builder().build(); - - public static void init(Application application, ConfigInterface configInterface) { - setConfigInterface(configInterface); - Utils.init(application); - CrashHandler.getInstance().init(application); - ToastFrame.init(application); - if (AppConfig.DEBUG) { - Timber.plant(new DebugLogTree()); - } else { - Timber.plant(new ReleaseLogTree()); - } - } - - public static TitleBarSetting getTitleBarSetting() { - return titleBarSetting.newBuilder().build(); - } - - public static void startLoginActivity(Context context) { - Class loginClass = AppConfig.loginClass; - if (loginClass == null) { - throw new IllegalArgumentException("login Activity class is null,please set"); - } - context.startActivity(new Intent(context, loginClass)); - } - - private static void setConfigInterface(ConfigInterface configInterface) { - AppConfig.DEBUG = configInterface.isAppDebug(); - AppConfig.loginClass = configInterface.getLoginActivityClass(); - AppConfig.titleBarSetting = configInterface.getTitleBarSetting(); - } -} diff --git a/library/src/main/java/mejust/frame/app/ConfigInterface.java b/library/src/main/java/mejust/frame/app/ConfigInterface.java deleted file mode 100644 index af8a02e..0000000 --- a/library/src/main/java/mejust/frame/app/ConfigInterface.java +++ /dev/null @@ -1,32 +0,0 @@ -package mejust.frame.app; - -import android.app.Activity; -import mejust.frame.widget.title.TitleBarSetting; - -/** - * @author wangpeifeng - * @date 2018/04/18 15:18 - */ -public interface ConfigInterface { - - /** - * check app debug mode - * - * @return true - */ - boolean isAppDebug(); - - /** - * 登录LoginActivity.class - * - * @return Activity - */ - Class getLoginActivityClass(); - - /** - * 全局的TitleBarSetting - * - * @return TitleBarSetting - */ - TitleBarSetting getTitleBarSetting(); -} diff --git a/library/src/main/java/mejust/frame/app/CrashHandler.java b/library/src/main/java/mejust/frame/common/CrashHandler.java similarity index 99% rename from library/src/main/java/mejust/frame/app/CrashHandler.java rename to library/src/main/java/mejust/frame/common/CrashHandler.java index bb1c691..2e7f8f4 100644 --- a/library/src/main/java/mejust/frame/app/CrashHandler.java +++ b/library/src/main/java/mejust/frame/common/CrashHandler.java @@ -1,4 +1,4 @@ -package mejust.frame.app; +package mejust.frame.common; import android.content.Context; import android.content.pm.PackageInfo; diff --git a/library/src/main/java/mejust/frame/image/GlideLoadManager.java b/library/src/main/java/mejust/frame/common/image/GlideLoadManager.java similarity index 99% rename from library/src/main/java/mejust/frame/image/GlideLoadManager.java rename to library/src/main/java/mejust/frame/common/image/GlideLoadManager.java index b8a0a46..add294d 100644 --- a/library/src/main/java/mejust/frame/image/GlideLoadManager.java +++ b/library/src/main/java/mejust/frame/common/image/GlideLoadManager.java @@ -1,4 +1,4 @@ -package mejust.frame.image; +package mejust.frame.common.image; import android.graphics.drawable.Drawable; import android.support.v4.content.ContextCompat; diff --git a/library/src/main/java/mejust/frame/image/IImageLoadManager.java b/library/src/main/java/mejust/frame/common/image/IImageLoadManager.java similarity index 97% rename from library/src/main/java/mejust/frame/image/IImageLoadManager.java rename to library/src/main/java/mejust/frame/common/image/IImageLoadManager.java index f6b3096..e2a3b49 100644 --- a/library/src/main/java/mejust/frame/image/IImageLoadManager.java +++ b/library/src/main/java/mejust/frame/common/image/IImageLoadManager.java @@ -1,4 +1,4 @@ -package mejust.frame.image; +package mejust.frame.common.image; import android.widget.ImageView; import java.io.File; diff --git a/library/src/main/java/mejust/frame/image/ImageConfig.java b/library/src/main/java/mejust/frame/common/image/ImageConfig.java similarity index 95% rename from library/src/main/java/mejust/frame/image/ImageConfig.java rename to library/src/main/java/mejust/frame/common/image/ImageConfig.java index 8824b04..aa3e52b 100644 --- a/library/src/main/java/mejust/frame/image/ImageConfig.java +++ b/library/src/main/java/mejust/frame/common/image/ImageConfig.java @@ -1,4 +1,4 @@ -package mejust.frame.image; +package mejust.frame.common.image; /** * @author wangpeifeng diff --git a/library/src/main/java/mejust/frame/image/ImageLoadConfig.java b/library/src/main/java/mejust/frame/common/image/ImageLoadConfig.java similarity index 94% rename from library/src/main/java/mejust/frame/image/ImageLoadConfig.java rename to library/src/main/java/mejust/frame/common/image/ImageLoadConfig.java index d865524..6721cb6 100644 --- a/library/src/main/java/mejust/frame/image/ImageLoadConfig.java +++ b/library/src/main/java/mejust/frame/common/image/ImageLoadConfig.java @@ -1,4 +1,4 @@ -package mejust.frame.image; +package mejust.frame.common.image; /** * @author wangpeifeng diff --git a/library/src/main/java/mejust/frame/image/MyAppGlideModule.java b/library/src/main/java/mejust/frame/common/image/MyAppGlideModule.java similarity index 92% rename from library/src/main/java/mejust/frame/image/MyAppGlideModule.java rename to library/src/main/java/mejust/frame/common/image/MyAppGlideModule.java index 047162d..264f4d7 100644 --- a/library/src/main/java/mejust/frame/image/MyAppGlideModule.java +++ b/library/src/main/java/mejust/frame/common/image/MyAppGlideModule.java @@ -1,4 +1,4 @@ -package mejust.frame.image; +package mejust.frame.common.image; import com.bumptech.glide.annotation.GlideModule; import com.bumptech.glide.module.AppGlideModule; diff --git a/library/src/main/java/mejust/frame/upgrade/DialogProgress.java b/library/src/main/java/mejust/frame/common/upgrade/DialogProgress.java similarity index 98% rename from library/src/main/java/mejust/frame/upgrade/DialogProgress.java rename to library/src/main/java/mejust/frame/common/upgrade/DialogProgress.java index 4515e06..8894c61 100644 --- a/library/src/main/java/mejust/frame/upgrade/DialogProgress.java +++ b/library/src/main/java/mejust/frame/common/upgrade/DialogProgress.java @@ -1,4 +1,4 @@ -package mejust.frame.upgrade; +package mejust.frame.common.upgrade; import android.content.Context; import android.os.Bundle; diff --git a/library/src/main/java/mejust/frame/upgrade/DownloadResultReceiver.java b/library/src/main/java/mejust/frame/common/upgrade/DownloadResultReceiver.java similarity index 97% rename from library/src/main/java/mejust/frame/upgrade/DownloadResultReceiver.java rename to library/src/main/java/mejust/frame/common/upgrade/DownloadResultReceiver.java index b382403..8606d2e 100644 --- a/library/src/main/java/mejust/frame/upgrade/DownloadResultReceiver.java +++ b/library/src/main/java/mejust/frame/common/upgrade/DownloadResultReceiver.java @@ -1,4 +1,4 @@ -package mejust.frame.upgrade; +package mejust.frame.common.upgrade; import android.os.Bundle; import android.os.Handler; diff --git a/library/src/main/java/mejust/frame/upgrade/NotificationProgress.java b/library/src/main/java/mejust/frame/common/upgrade/NotificationProgress.java similarity index 98% rename from library/src/main/java/mejust/frame/upgrade/NotificationProgress.java rename to library/src/main/java/mejust/frame/common/upgrade/NotificationProgress.java index 58e3552..25b500d 100644 --- a/library/src/main/java/mejust/frame/upgrade/NotificationProgress.java +++ b/library/src/main/java/mejust/frame/common/upgrade/NotificationProgress.java @@ -1,4 +1,4 @@ -package mejust.frame.upgrade; +package mejust.frame.common.upgrade; import android.app.NotificationChannel; import android.app.NotificationManager; diff --git a/library/src/main/java/mejust/frame/upgrade/ProgressHelper.java b/library/src/main/java/mejust/frame/common/upgrade/ProgressHelper.java similarity index 88% rename from library/src/main/java/mejust/frame/upgrade/ProgressHelper.java rename to library/src/main/java/mejust/frame/common/upgrade/ProgressHelper.java index 01c461e..a1f4523 100644 --- a/library/src/main/java/mejust/frame/upgrade/ProgressHelper.java +++ b/library/src/main/java/mejust/frame/common/upgrade/ProgressHelper.java @@ -1,4 +1,4 @@ -package mejust.frame.upgrade; +package mejust.frame.common.upgrade; /** * 创建时间: 2018/03/09 17:37
diff --git a/library/src/main/java/mejust/frame/upgrade/ProgressMessageBuilder.java b/library/src/main/java/mejust/frame/common/upgrade/ProgressMessageBuilder.java similarity index 95% rename from library/src/main/java/mejust/frame/upgrade/ProgressMessageBuilder.java rename to library/src/main/java/mejust/frame/common/upgrade/ProgressMessageBuilder.java index 073bb00..7ba25ca 100644 --- a/library/src/main/java/mejust/frame/upgrade/ProgressMessageBuilder.java +++ b/library/src/main/java/mejust/frame/common/upgrade/ProgressMessageBuilder.java @@ -1,4 +1,4 @@ -package mejust.frame.upgrade; +package mejust.frame.common.upgrade; import java.io.Serializable; diff --git a/library/src/main/java/mejust/frame/upgrade/ProgressType.java b/library/src/main/java/mejust/frame/common/upgrade/ProgressType.java similarity index 93% rename from library/src/main/java/mejust/frame/upgrade/ProgressType.java rename to library/src/main/java/mejust/frame/common/upgrade/ProgressType.java index 92d64d7..0556648 100644 --- a/library/src/main/java/mejust/frame/upgrade/ProgressType.java +++ b/library/src/main/java/mejust/frame/common/upgrade/ProgressType.java @@ -1,4 +1,4 @@ -package mejust.frame.upgrade; +package mejust.frame.common.upgrade; import android.support.annotation.IntDef; import java.lang.annotation.Retention; diff --git a/library/src/main/java/mejust/frame/upgrade/UpgradeAppManager.java b/library/src/main/java/mejust/frame/common/upgrade/UpgradeAppManager.java similarity index 99% rename from library/src/main/java/mejust/frame/upgrade/UpgradeAppManager.java rename to library/src/main/java/mejust/frame/common/upgrade/UpgradeAppManager.java index 453bfd0..beb85cb 100644 --- a/library/src/main/java/mejust/frame/upgrade/UpgradeAppManager.java +++ b/library/src/main/java/mejust/frame/common/upgrade/UpgradeAppManager.java @@ -1,4 +1,4 @@ -package mejust.frame.upgrade; +package mejust.frame.common.upgrade; import android.content.Context; import android.content.Intent; diff --git a/library/src/main/java/mejust/frame/upgrade/UpgradeDownloadService.java b/library/src/main/java/mejust/frame/common/upgrade/UpgradeDownloadService.java similarity index 99% rename from library/src/main/java/mejust/frame/upgrade/UpgradeDownloadService.java rename to library/src/main/java/mejust/frame/common/upgrade/UpgradeDownloadService.java index 953c19d..dd11f8e 100644 --- a/library/src/main/java/mejust/frame/upgrade/UpgradeDownloadService.java +++ b/library/src/main/java/mejust/frame/common/upgrade/UpgradeDownloadService.java @@ -1,4 +1,4 @@ -package mejust.frame.upgrade; +package mejust.frame.common.upgrade; import android.app.IntentService; import android.content.Context; diff --git a/library/src/main/java/mejust/frame/config/FrameConfig.java b/library/src/main/java/mejust/frame/data/FrameConfig.java similarity index 64% rename from library/src/main/java/mejust/frame/config/FrameConfig.java rename to library/src/main/java/mejust/frame/data/FrameConfig.java index e0ba17e..3520159 100644 --- a/library/src/main/java/mejust/frame/config/FrameConfig.java +++ b/library/src/main/java/mejust/frame/data/FrameConfig.java @@ -1,6 +1,7 @@ -package mejust.frame.config; +package mejust.frame.data; import android.app.Activity; +import mejust.frame.widget.title.TitleBarSetting; /** * @author wangpeifeng @@ -14,8 +15,12 @@ public class FrameConfig { /** 登录页面 */ private Class loginClass; + /** 网络状态监听栏控制位 */ private boolean openNetworkState; + /** TitleBar全局配置 */ + private TitleBarSetting titleBarSetting = new TitleBarSetting.Builder().build(); + public boolean isDebug() { return isDebug; } @@ -39,4 +44,12 @@ public boolean isOpenNetworkState() { public void setOpenNetworkState(boolean openNetworkState) { this.openNetworkState = openNetworkState; } + + public TitleBarSetting getTitleBarSetting() { + return titleBarSetting; + } + + public void setTitleBarSetting(TitleBarSetting titleBarSetting) { + this.titleBarSetting = titleBarSetting; + } } diff --git a/library/src/main/java/mejust/frame/annotation/Adapter.java b/library/src/main/java/mejust/frame/data/annotation/Adapter.java similarity index 95% rename from library/src/main/java/mejust/frame/annotation/Adapter.java rename to library/src/main/java/mejust/frame/data/annotation/Adapter.java index 72530cb..721268e 100644 --- a/library/src/main/java/mejust/frame/annotation/Adapter.java +++ b/library/src/main/java/mejust/frame/data/annotation/Adapter.java @@ -1,4 +1,4 @@ -package mejust.frame.annotation; +package mejust.frame.data.annotation; import android.support.annotation.LayoutRes; diff --git a/library/src/main/java/mejust/frame/annotation/LayoutId.java b/library/src/main/java/mejust/frame/data/annotation/LayoutId.java similarity index 92% rename from library/src/main/java/mejust/frame/annotation/LayoutId.java rename to library/src/main/java/mejust/frame/data/annotation/LayoutId.java index 11a473f..ab422f8 100644 --- a/library/src/main/java/mejust/frame/annotation/LayoutId.java +++ b/library/src/main/java/mejust/frame/data/annotation/LayoutId.java @@ -1,4 +1,4 @@ -package mejust.frame.annotation; +package mejust.frame.data.annotation; import android.support.annotation.LayoutRes; diff --git a/library/src/main/java/mejust/frame/annotation/ServiceUrl.java b/library/src/main/java/mejust/frame/data/annotation/ServiceUrl.java similarity index 92% rename from library/src/main/java/mejust/frame/annotation/ServiceUrl.java rename to library/src/main/java/mejust/frame/data/annotation/ServiceUrl.java index f88b11d..bdd58df 100644 --- a/library/src/main/java/mejust/frame/annotation/ServiceUrl.java +++ b/library/src/main/java/mejust/frame/data/annotation/ServiceUrl.java @@ -1,4 +1,4 @@ -package mejust.frame.annotation; +package mejust.frame.data.annotation; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; diff --git a/library/src/main/java/mejust/frame/annotation/StatusBarConfig.java b/library/src/main/java/mejust/frame/data/annotation/StatusBarConfig.java similarity index 96% rename from library/src/main/java/mejust/frame/annotation/StatusBarConfig.java rename to library/src/main/java/mejust/frame/data/annotation/StatusBarConfig.java index 16277cd..799a08f 100644 --- a/library/src/main/java/mejust/frame/annotation/StatusBarConfig.java +++ b/library/src/main/java/mejust/frame/data/annotation/StatusBarConfig.java @@ -1,4 +1,4 @@ -package mejust.frame.annotation; +package mejust.frame.data.annotation; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; diff --git a/library/src/main/java/mejust/frame/exception/BaseException.java b/library/src/main/java/mejust/frame/data/exception/BaseException.java similarity index 94% rename from library/src/main/java/mejust/frame/exception/BaseException.java rename to library/src/main/java/mejust/frame/data/exception/BaseException.java index f9ef6bd..2d5d278 100644 --- a/library/src/main/java/mejust/frame/exception/BaseException.java +++ b/library/src/main/java/mejust/frame/data/exception/BaseException.java @@ -1,4 +1,4 @@ -package mejust.frame.exception; +package mejust.frame.data.exception; import mejust.frame.common.log.Logger; diff --git a/library/src/main/java/mejust/frame/di/component/FrameComponent.java b/library/src/main/java/mejust/frame/di/component/FrameComponent.java index 9439e5c..61a4b05 100644 --- a/library/src/main/java/mejust/frame/di/component/FrameComponent.java +++ b/library/src/main/java/mejust/frame/di/component/FrameComponent.java @@ -5,10 +5,10 @@ import dagger.Component; import javax.inject.Singleton; import mejust.frame.common.json.IJsonManager; -import mejust.frame.config.FrameConfig; +import mejust.frame.data.FrameConfig; import mejust.frame.di.module.FrameModule; -import mejust.frame.image.IImageLoadManager; -import mejust.frame.image.ImageConfig; +import mejust.frame.common.image.IImageLoadManager; +import mejust.frame.common.image.ImageConfig; import mejust.frame.net.NetManager; import mejust.frame.net.config.NetConfig; diff --git a/library/src/main/java/mejust/frame/di/module/FrameModule.java b/library/src/main/java/mejust/frame/di/module/FrameModule.java index 72e7e9c..a262013 100644 --- a/library/src/main/java/mejust/frame/di/module/FrameModule.java +++ b/library/src/main/java/mejust/frame/di/module/FrameModule.java @@ -7,10 +7,10 @@ import javax.inject.Singleton; import mejust.frame.common.json.GsonManagerImpl; import mejust.frame.common.json.IJsonManager; -import mejust.frame.config.FrameConfig; -import mejust.frame.image.GlideLoadManager; -import mejust.frame.image.IImageLoadManager; -import mejust.frame.image.ImageConfig; +import mejust.frame.data.FrameConfig; +import mejust.frame.common.image.GlideLoadManager; +import mejust.frame.common.image.IImageLoadManager; +import mejust.frame.common.image.ImageConfig; import mejust.frame.net.NetManager; import mejust.frame.net.config.NetConfig; import mejust.frame.common.log.Logger; diff --git a/library/src/main/java/mejust/frame/mvp/view/BaseActivity.java b/library/src/main/java/mejust/frame/mvp/view/BaseActivity.java index e105bc8..2ecf578 100644 --- a/library/src/main/java/mejust/frame/mvp/view/BaseActivity.java +++ b/library/src/main/java/mejust/frame/mvp/view/BaseActivity.java @@ -12,9 +12,10 @@ import butterknife.ButterKnife; import butterknife.Unbinder; import conm.zhuazhu.common.utils.KeyboardUtils; +import mejust.frame.FrameManager; import mejust.frame.R; -import mejust.frame.annotation.StatusBarConfig; -import mejust.frame.app.AppConfig; +import mejust.frame.data.annotation.StatusBarConfig; +import mejust.frame.data.annotation.LayoutId; import mejust.frame.mvp.BaseContract; import mejust.frame.mvp.view.support.ActivityStateViewControl; import mejust.frame.utils.ContentViewBind; @@ -29,7 +30,7 @@ /** *

* 添加布局文件,不再调用setContentView方法,在继承的子类上添加
- * {@link mejust.frame.annotation.LayoutId}注解

+ * {@link LayoutId}注解

*

* 状态栏设置,用注解
* {@link StatusBarConfig} @@ -170,7 +171,8 @@ public void finishActivity() { */ private void initBar() { TitleBar mTitleBar = findViewById(R.id.title_bar); - TitleBarUtil.inject(this, mTitleBar, AppConfig.getTitleBarSetting()); + TitleBarUtil.inject(this, mTitleBar, + FrameManager.provideFrameConfig().getTitleBarSetting()); mStatusBar = StatusBarUtil.init(this, mTitleBar); configBar(mTitleBar, mStatusBar); } diff --git a/library/src/main/java/mejust/frame/net/NetManager.java b/library/src/main/java/mejust/frame/net/NetManager.java index 18ca722..dbd48b9 100644 --- a/library/src/main/java/mejust/frame/net/NetManager.java +++ b/library/src/main/java/mejust/frame/net/NetManager.java @@ -10,10 +10,10 @@ import io.reactivex.functions.Function; import io.reactivex.schedulers.Schedulers; import java.util.HashMap; -import mejust.frame.annotation.ServiceUrl; +import mejust.frame.data.annotation.ServiceUrl; import mejust.frame.mvp.view.BaseActivity; import mejust.frame.net.config.NetWorkException; -import mejust.frame.config.FrameConfig; +import mejust.frame.data.FrameConfig; import mejust.frame.net.config.IHttpResult; import mejust.frame.net.config.NetConfig; import mejust.frame.utils.AnnotationUtils; diff --git a/library/src/main/java/mejust/frame/net/config/NetWorkException.java b/library/src/main/java/mejust/frame/net/config/NetWorkException.java index 82adb47..18641c3 100644 --- a/library/src/main/java/mejust/frame/net/config/NetWorkException.java +++ b/library/src/main/java/mejust/frame/net/config/NetWorkException.java @@ -2,7 +2,7 @@ import android.app.Activity; import java.util.Locale; -import mejust.frame.exception.BaseException; +import mejust.frame.data.exception.BaseException; import mejust.frame.utils.CommonUtil; import mejust.frame.widget.ToastFrame; diff --git a/library/src/main/java/mejust/frame/utils/ContentViewBind.java b/library/src/main/java/mejust/frame/utils/ContentViewBind.java index 9b4dd6c..ff8a6fa 100644 --- a/library/src/main/java/mejust/frame/utils/ContentViewBind.java +++ b/library/src/main/java/mejust/frame/utils/ContentViewBind.java @@ -6,7 +6,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import mejust.frame.annotation.LayoutId; +import mejust.frame.data.annotation.LayoutId; /** * @author litao diff --git a/library/src/main/java/mejust/frame/utils/StatusBarUtil.java b/library/src/main/java/mejust/frame/utils/StatusBarUtil.java index 6bb871d..a0249b0 100644 --- a/library/src/main/java/mejust/frame/utils/StatusBarUtil.java +++ b/library/src/main/java/mejust/frame/utils/StatusBarUtil.java @@ -5,7 +5,7 @@ import android.support.annotation.NonNull; import android.view.View; import mejust.frame.R; -import mejust.frame.annotation.StatusBarConfig; +import mejust.frame.data.annotation.StatusBarConfig; import mejust.frame.mvp.view.BaseActivity; import mejust.frame.mvp.view.BaseFragment; import mejust.frame.widget.title.StatusBar; diff --git a/library/src/main/java/mejust/frame/widget/NetWorkControlView.java b/library/src/main/java/mejust/frame/widget/NetWorkControlView.java index d42740b..74832ed 100644 --- a/library/src/main/java/mejust/frame/widget/NetWorkControlView.java +++ b/library/src/main/java/mejust/frame/widget/NetWorkControlView.java @@ -10,8 +10,9 @@ import android.view.View; import android.widget.FrameLayout; import conm.zhuazhu.common.utils.NetworkUtils; +import mejust.frame.FrameManager; import mejust.frame.R; -import mejust.frame.app.AppConfig; +import mejust.frame.data.FrameConfig; import mejust.frame.receiver.NetworkReceiver; /** @@ -33,7 +34,7 @@ public NetWorkControlView(@NonNull Context context, @Nullable AttributeSet attrs public NetWorkControlView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); - if (AppConfig.NETWORK_STATUS_MONITORING) { + if (FrameManager.provideFrameConfig().isOpenNetworkState()) { View statusView = LayoutInflater.from(context) .inflate(R.layout.layout_network_tip_frame, this, true); statusView.setOnClickListener(v -> NetworkUtils.openWifiSettings()); @@ -42,10 +43,10 @@ public NetWorkControlView(@NonNull Context context, @Nullable AttributeSet attrs } /** - * 注册网络变化广播监听,{@link AppConfig#NETWORK_STATUS_MONITORING}标志位默认监听 + * 注册网络变化广播监听,{@link FrameConfig#openNetworkState}标志位 */ public void registerNetChangeListener() { - if (AppConfig.NETWORK_STATUS_MONITORING && mNetworkReceiver == null) { + if (FrameManager.provideFrameConfig().isOpenNetworkState() && mNetworkReceiver == null) { mNetworkReceiver = new NetworkReceiver(); mNetworkReceiver.setOnNetworkListener(this); IntentFilter filter = new IntentFilter(); diff --git a/library/src/main/java/mejust/frame/widget/adapter/RecyclerAdapter.java b/library/src/main/java/mejust/frame/widget/adapter/RecyclerAdapter.java index 65910ad..d5aed09 100644 --- a/library/src/main/java/mejust/frame/widget/adapter/RecyclerAdapter.java +++ b/library/src/main/java/mejust/frame/widget/adapter/RecyclerAdapter.java @@ -17,7 +17,7 @@ import conm.zhuazhu.common.utils.ListUtils; import mejust.frame.R; -import mejust.frame.annotation.Adapter; +import mejust.frame.data.annotation.Adapter; import mejust.frame.common.log.Logger; import mejust.frame.widget.refresh.IPageControl; import mejust.frame.widget.refresh.RefreshLayoutWrapper;