diff --git a/app/build.gradle b/app/build.gradle index 9f24fe436b..020db2cf8e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -222,8 +222,6 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}" - implementation "com.google.android:flexbox:${flexbox}" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "com.contrarywind:Android-PickerView:${pickerView}" @@ -244,8 +242,6 @@ dependencies { implementation "com.llew.huawei:verifier:${verifier}" - implementation "com.lg:skeleton:${skeleton}" - teaImplementation "com.bytedance.applog:RangersAppLog-Lite-cn:${bytedanceApplog}" implementation "net.lingala.zip4j:zip4j:${zip4j}" @@ -257,8 +253,6 @@ dependencies { implementation "io.github.florent37:shapeofview:${shapeOfView}" - implementation "io.github.sinaweibosdk:core:${weiboSDK}" - implementation "com.lg:apksig:${apksig}" implementation "com.lg:gid:${gid}" @@ -271,6 +265,12 @@ dependencies { implementation (project(':module_common')) { exclude group: 'androidx.swiperefreshlayout' } + implementation(project(':module_login')) { + exclude group: 'androidx.swiperefreshlayout' + } + implementation(project(':module_energy')) { + exclude group: 'androidx.swiperefreshlayout' + } } File propFile = file('sign.properties') if (propFile.exists()) { @@ -386,7 +386,7 @@ andResGuard { "R.drawable.ic_recommend_function", "R.drawable.ic_recommend_gift", "R.drawable.ic_recommend_role", - "R.drawable.login_btn_bg", + "R.drawable.download_button_normal_style", "R.drawable.ic_quick_login_check", "R.drawable.ic_quick_login_uncheck", "R.anim.anim_auth_in", diff --git a/app/proguard-rules.txt b/app/proguard-rules.txt index 5338165eaf..955a7a8e01 100644 --- a/app/proguard-rules.txt +++ b/app/proguard-rules.txt @@ -70,8 +70,12 @@ -keep class com.gh.gamecenter.entity.* {*;} -keep class com.gh.gamecenter.common.entity.* {*;} -keep class com.gh.gamecenter.qa.entity.* {*;} +-keep class com.gh.gamecenter.login.entity.* {*;} +-keep class com.gh.gamecenter.energy.entity.* {*;} -keep class com.gh.gamecenter.retrofit.* {*;} -keep class com.gh.gamecenter.eventbus.* {*;} +-keep class com.gh.gamecenter.common.eventbus.* {*;} +-keep class com.gh.gamecenter.energy.eventbus.* {*;} -keep class com.gh.gamecenter.video.detail.* {*;} -keep class com.gh.gamecenter.home.gamecollection.* {*;} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index fc1377b108..65bbc15480 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -75,7 +75,6 @@ android:icon="@mipmap/logo" android:label="@string/app_name" android:largeHeap="true" - android:networkSecurityConfig="@xml/network_security_config" android:resizeableActivity="true" android:theme="@style/AppCompatTheme.APP" tools:replace="android:name,android:allowBackup" @@ -262,11 +261,6 @@ android:name=".category.CategoryListActivity" android:screenOrientation="portrait" /> - - @@ -575,15 +569,6 @@ android:name=".forum.search.ForumOrUserSearchActivity" android:screenOrientation="portrait" /> - - - - @@ -656,14 +641,6 @@ android:name=".gamecollection.detail.GameCollectionPosterActivity" android:screenOrientation="portrait" /> - - - @@ -753,13 +730,6 @@ android:name=".qa.comment.NewCommentDetailActivity" android:screenOrientation="portrait" /> - - diff --git a/app/src/main/java/com/gh/base/GlobalActivityLifecycleObserver.kt b/app/src/main/java/com/gh/base/GlobalActivityLifecycleObserver.kt index 9ece998764..fcb1755058 100644 --- a/app/src/main/java/com/gh/base/GlobalActivityLifecycleObserver.kt +++ b/app/src/main/java/com/gh/base/GlobalActivityLifecycleObserver.kt @@ -9,7 +9,7 @@ import com.gh.download.DownloadManager import com.gh.gamecenter.MainActivity import com.gh.gamecenter.SplashScreenActivity import com.gh.gamecenter.common.utils.PackageFlavorHelper -import com.gh.gamecenter.energy.EnergyCenterActivity +import com.gh.gamecenter.energy.view.EnergyCenterActivity import com.gh.gamecenter.forum.detail.ForumDetailActivity import com.gh.gamecenter.forum.list.ForumListActivity import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity diff --git a/app/src/main/java/com/gh/common/DefaultJsApi.kt b/app/src/main/java/com/gh/common/DefaultJsApi.kt index be6ddb6adc..07e56b5159 100644 --- a/app/src/main/java/com/gh/common/DefaultJsApi.kt +++ b/app/src/main/java/com/gh/common/DefaultJsApi.kt @@ -25,16 +25,20 @@ import com.gh.gamecenter.core.utils.CurrentActivityHolder import com.gh.gamecenter.core.utils.DisplayUtils import com.gh.gamecenter.core.utils.MtaHelper import com.gh.gamecenter.core.utils.SPUtils -import com.gh.gamecenter.energy.EnergyCenterActivity -import com.gh.gamecenter.energy.EnergyHouseActivity -import com.gh.gamecenter.entity.Badge +import com.gh.gamecenter.energy.utils.EnergyTaskHelper +import com.gh.gamecenter.energy.view.EnergyCenterActivity +import com.gh.gamecenter.energy.view.EnergyHouseActivity import com.gh.gamecenter.entity.MtaEvent import com.gh.gamecenter.help.QaFeedbackDialogFragment -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.entity.Badge +import com.gh.gamecenter.login.user.LoginTag +import com.gh.gamecenter.login.view.LoginActivity +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.personalhome.border.AvatarBorderActivity import com.gh.gamecenter.security.BindPhoneActivity -import com.gh.gamecenter.user.LoginTag -import com.gh.gamecenter.user.UserRepository +import com.gh.gamecenter.login.user.UserRepository +import com.gh.gamecenter.login.utils.LoginHelper +import com.gh.gamecenter.login.utils.QuickLoginHelper import com.halo.assistant.HaloApp import com.lightgame.utils.Utils import org.json.JSONObject diff --git a/app/src/main/java/com/gh/common/DefaultUrlHandler.kt b/app/src/main/java/com/gh/common/DefaultUrlHandler.kt index c93dfdec95..ab289979d9 100644 --- a/app/src/main/java/com/gh/common/DefaultUrlHandler.kt +++ b/app/src/main/java/com/gh/common/DefaultUrlHandler.kt @@ -21,6 +21,8 @@ import com.gh.gamecenter.MainActivity import com.gh.gamecenter.NewsDetailActivity import com.gh.gamecenter.WebActivity import com.gh.gamecenter.common.constant.EntranceConsts +import com.gh.gamecenter.common.entity.CommunityEntity +import com.gh.gamecenter.common.entity.LinkEntity import com.gh.gamecenter.core.AppExecutor import com.gh.gamecenter.common.utils.DialogHelper import com.gh.gamecenter.common.utils.EnvHelper diff --git a/app/src/main/java/com/gh/common/constant/Config.java b/app/src/main/java/com/gh/common/constant/Config.java index 3f1b7c0955..8feb0f69ee 100644 --- a/app/src/main/java/com/gh/common/constant/Config.java +++ b/app/src/main/java/com/gh/common/constant/Config.java @@ -20,8 +20,8 @@ import com.gh.gamecenter.entity.GameGuidePopupEntity; import com.gh.gamecenter.entity.NewSettingsEntity; import com.gh.gamecenter.entity.NewsEntity; import com.gh.gamecenter.entity.SettingsEntity; +import com.gh.gamecenter.common.eventbus.EBReuse; import com.gh.gamecenter.entity.VSetting; -import com.gh.gamecenter.eventbus.EBReuse; import com.gh.gamecenter.common.retrofit.BiResponse; import com.gh.gamecenter.common.retrofit.Response; import com.gh.gamecenter.retrofit.RetrofitManager; diff --git a/app/src/main/java/com/gh/common/databind/BindingAdapters.java b/app/src/main/java/com/gh/common/databind/BindingAdapters.java index 614d40c243..8d17a4bbe9 100644 --- a/app/src/main/java/com/gh/common/databind/BindingAdapters.java +++ b/app/src/main/java/com/gh/common/databind/BindingAdapters.java @@ -52,7 +52,7 @@ import com.gh.download.dialog.DownloadDialog; import com.gh.gamecenter.DownloadManagerActivity; import com.gh.gamecenter.R; import com.gh.gamecenter.WebActivity; -import com.gh.gamecenter.baselist.LoadStatus; +import com.gh.gamecenter.common.baselist.LoadStatus; import com.gh.gamecenter.common.callback.OnViewClickListener; import com.gh.gamecenter.common.utils.ExtensionsKt; import com.gh.gamecenter.common.utils.ImageUtils; @@ -64,12 +64,12 @@ import com.gh.gamecenter.core.utils.NumberUtils; import com.gh.gamecenter.databinding.KaifuDetailItemRowBinding; import com.gh.gamecenter.entity.ApkEntity; import com.gh.gamecenter.entity.GameEntity; -import com.gh.gamecenter.entity.LinkEntity; +import com.gh.gamecenter.common.entity.LinkEntity; import com.gh.gamecenter.entity.PluginLocation; import com.gh.gamecenter.entity.ServerCalendarEntity; import com.gh.gamecenter.entity.TagStyleEntity; import com.gh.gamecenter.entity.TestEntity; -import com.gh.gamecenter.eventbus.EBReuse; +import com.gh.gamecenter.common.eventbus.EBReuse; import com.gh.gamecenter.gamedetail.dialog.GamePermissionDialogFragment; import com.gh.gamecenter.manager.PackagesManager; import com.gh.gamecenter.qa.entity.CommunityVideoEntity; diff --git a/app/src/main/java/com/gh/common/dialog/CertificationDialog.kt b/app/src/main/java/com/gh/common/dialog/CertificationDialog.kt index 9b18db28a3..c4076a9a87 100644 --- a/app/src/main/java/com/gh/common/dialog/CertificationDialog.kt +++ b/app/src/main/java/com/gh/common/dialog/CertificationDialog.kt @@ -27,7 +27,7 @@ import com.gh.gamecenter.core.utils.SPUtils import com.gh.gamecenter.entity.AuthDialogEntity import com.gh.gamecenter.entity.AuthDialogLevel import com.gh.gamecenter.entity.GameEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.google.gson.reflect.TypeToken import com.halo.assistant.fragment.user.UserInfoEditFragment import com.lightgame.utils.AppManager diff --git a/app/src/main/java/com/gh/common/dialog/PackageCheckDialogFragment.kt b/app/src/main/java/com/gh/common/dialog/PackageCheckDialogFragment.kt index 73b58f9a47..acada2acf5 100644 --- a/app/src/main/java/com/gh/common/dialog/PackageCheckDialogFragment.kt +++ b/app/src/main/java/com/gh/common/dialog/PackageCheckDialogFragment.kt @@ -29,7 +29,7 @@ import com.gh.gamecenter.databinding.FragmentPackageCheckBinding import com.gh.gamecenter.databinding.PackageCheckItemBinding import com.gh.gamecenter.entity.DetectionObjectEntity import com.gh.gamecenter.entity.GameEntity -import com.gh.gamecenter.entity.LinkEntity +import com.gh.gamecenter.common.entity.LinkEntity import com.gh.gamecenter.entity.PackageDialogEntity import com.gh.gamecenter.eventbus.EBPackage import com.halo.assistant.HaloApp diff --git a/app/src/main/java/com/gh/common/provider/ActivationProviderImpl.kt b/app/src/main/java/com/gh/common/provider/ActivationProviderImpl.kt index 4c7fa2f3b8..a172d9cc2e 100644 --- a/app/src/main/java/com/gh/common/provider/ActivationProviderImpl.kt +++ b/app/src/main/java/com/gh/common/provider/ActivationProviderImpl.kt @@ -7,7 +7,7 @@ import com.gh.gamecenter.common.constant.RouteConsts import com.gh.gamecenter.core.provider.IActivationProvider @Route(path = RouteConsts.provider.activation, name = "ActivationHelper暴露服务") -interface ActivationProviderImpl : IActivationProvider { +class ActivationProviderImpl : IActivationProvider { override fun init(context: Context?) { } diff --git a/app/src/main/java/com/gh/common/provider/ConfigProviderImpl.kt b/app/src/main/java/com/gh/common/provider/ConfigProviderImpl.kt index 50d5c1aaf1..df023e652b 100644 --- a/app/src/main/java/com/gh/common/provider/ConfigProviderImpl.kt +++ b/app/src/main/java/com/gh/common/provider/ConfigProviderImpl.kt @@ -16,6 +16,10 @@ class ConfigProviderImpl : IConfigProvider { return Config.WECHAT_APPID } + override fun getWechatSecret(): String { + return Config.WECHAT_SECRET + } + override fun getUploadLimitSize(): Long { return Config.getSettings()?.image?.uploadLimitSize ?: 0L } @@ -56,6 +60,18 @@ class ConfigProviderImpl : IConfigProvider { return Config.getSettings()?.support?.qq ?: "" } + override fun getQuickLoginAppId(): String { + return Config.QUICK_LOGIN_APPID + } + + override fun getQuickLoginAppKey(): String { + return Config.QUICK_LOGIN_APPKEY + } + + override fun getWeiboAppKey(): String { + return Config.WEIBO_APPKEY + } + override fun init(context: Context?) { } diff --git a/app/src/main/java/com/gh/common/provider/DataUtilsProviderImpl.kt b/app/src/main/java/com/gh/common/provider/DataUtilsProviderImpl.kt new file mode 100644 index 0000000000..7fa1ff9207 --- /dev/null +++ b/app/src/main/java/com/gh/common/provider/DataUtilsProviderImpl.kt @@ -0,0 +1,20 @@ +package com.gh.common.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.common.util.DataUtils +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IDataUtilsProvider +import com.halo.assistant.HaloApp + +@Route(path = RouteConsts.provider.dataUtils, name = "DataUtils暴露服务") +class DataUtilsProviderImpl : IDataUtilsProvider { + + override fun getDeviceCertification() { + DataUtils.getDeviceCertification(HaloApp.getInstance().gid) + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/app/src/main/java/com/gh/common/provider/DefaultUrlHandlerProviderImpl.kt b/app/src/main/java/com/gh/common/provider/DefaultUrlHandlerProviderImpl.kt index d7b1da9fb2..c35c25d854 100644 --- a/app/src/main/java/com/gh/common/provider/DefaultUrlHandlerProviderImpl.kt +++ b/app/src/main/java/com/gh/common/provider/DefaultUrlHandlerProviderImpl.kt @@ -9,8 +9,13 @@ import com.gh.gamecenter.core.provider.IDefaultUrlHandlerProvider @Route(path = RouteConsts.provider.defaultUrlHandler, name = "DefaultUrlHandler暴露服务") class DefaultUrlHandlerProviderImpl : IDefaultUrlHandlerProvider { - override fun interceptUrl(context: Context, url: String, entrance: String):Boolean { - return DefaultUrlHandler.interceptUrl(context, url, entrance) + override fun interceptUrl( + context: Context, + url: String, + entrance: String, + bringAppToFront: Boolean + ): Boolean { + return DefaultUrlHandler.interceptUrl(context, url, entrance, bringAppToFront) } override fun init(context: Context?) { diff --git a/app/src/main/java/com/gh/common/provider/DirectProviderImpl.kt b/app/src/main/java/com/gh/common/provider/DirectProviderImpl.kt index b3016ccd36..f2aa01f111 100644 --- a/app/src/main/java/com/gh/common/provider/DirectProviderImpl.kt +++ b/app/src/main/java/com/gh/common/provider/DirectProviderImpl.kt @@ -21,6 +21,34 @@ class DirectProviderImpl : IDirectProvider { DirectUtils.directToQqConversation(context, qq) } + override fun directToCommodityDetail(context: Context, commodityId: String) { + DirectUtils.directToCommodityDetail(context, commodityId) + } + + override fun directToEnergyRecord(context: Context) { + DirectUtils.directToEnergyRecord(context) + } + + override fun directToEnergyRulePage(context: Context) { + DirectUtils.directToEnergyRulePage(context) + } + + override fun directToInviteFriends(context: Context) { + DirectUtils.directToInviteFriends(context) + } + + override fun directToExchangeRulePage(context: Context) { + DirectUtils.directToExchangeRulePage(context) + } + + override fun directToExchangeCommodityPage(context: Context) { + DirectUtils.directToExchangeCommodityPage(context) + } + + override fun directToLotteryParadisePage(context: Context) { + DirectUtils.directToLotteryParadisePage(context) + } + override fun init(context: Context?) { } diff --git a/app/src/main/java/com/gh/common/provider/DownloadManagerProviderImpl.kt b/app/src/main/java/com/gh/common/provider/DownloadManagerProviderImpl.kt index e2abd7407f..08e1cbcf58 100644 --- a/app/src/main/java/com/gh/common/provider/DownloadManagerProviderImpl.kt +++ b/app/src/main/java/com/gh/common/provider/DownloadManagerProviderImpl.kt @@ -14,6 +14,10 @@ class DownloadManagerProviderImpl : IDownloadManagerProvider { return DownloadManager.getInstance().getDownloadEntityByUrl(url) } + override fun resumeAllInvisiblePendingTask() { + DownloadManager.getInstance().resumeAllInvisiblePendingTask() + } + override fun init(context: Context?) { } diff --git a/app/src/main/java/com/gh/common/provider/ErrorHelperProviderImpl.kt b/app/src/main/java/com/gh/common/provider/ErrorHelperProviderImpl.kt new file mode 100644 index 0000000000..4cb9cedeb0 --- /dev/null +++ b/app/src/main/java/com/gh/common/provider/ErrorHelperProviderImpl.kt @@ -0,0 +1,28 @@ +package com.gh.common.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.common.util.ErrorHelper +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IErrorHelperProvider +import retrofit2.HttpException + +@Route(path = RouteConsts.provider.errorHelper, name = "ErrorHelper暴露服务") +class ErrorHelperProviderImpl : IErrorHelperProvider { + + override fun handleError( + context: Context, + errorString: String?, + showHighPriorityHint: Boolean + ) { + ErrorHelper.handleError(context, errorString, showHighPriorityHint) + } + + override fun handleLoginError(context: Context, httpException: HttpException?) { + ErrorHelper.handleLoginError(context, httpException) + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/app/src/main/java/com/gh/common/provider/FloatingBackViewManagerProviderImpl.kt b/app/src/main/java/com/gh/common/provider/FloatingBackViewManagerProviderImpl.kt new file mode 100644 index 0000000000..854901a61e --- /dev/null +++ b/app/src/main/java/com/gh/common/provider/FloatingBackViewManagerProviderImpl.kt @@ -0,0 +1,19 @@ +package com.gh.common.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.common.util.FloatingBackViewManager +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IFloatingBackViewManagerProvider + +@Route(path = RouteConsts.provider.floatingBackViewManager, name = "FloatingViewBackManager暴露服务") +class FloatingBackViewManagerProviderImpl : IFloatingBackViewManagerProvider { + + override fun enableBackViewForTaskType() { + FloatingBackViewManager.enableBackView(FloatingBackViewManager.TYPE_TASK) + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/app/src/main/java/com/gh/common/provider/GameSubstituteRepositoryProviderImpl.kt b/app/src/main/java/com/gh/common/provider/GameSubstituteRepositoryProviderImpl.kt new file mode 100644 index 0000000000..1ce6a109b5 --- /dev/null +++ b/app/src/main/java/com/gh/common/provider/GameSubstituteRepositoryProviderImpl.kt @@ -0,0 +1,19 @@ +package com.gh.common.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.common.util.GameSubstituteRepositoryHelper +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IGameSubstituteRepositoryProvider + +@Route(path = RouteConsts.provider.gameSubstituteRepository, name = "GameSubstituteRepositoryHelper暴露服务") +class GameSubstituteRepositoryProviderImpl : IGameSubstituteRepositoryProvider { + + override fun updateSubstitutableGames() { + GameSubstituteRepositoryHelper.updateSubstitutableGames() + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/app/src/main/java/com/gh/common/provider/LinkDirectUtilsProviderImpl.kt b/app/src/main/java/com/gh/common/provider/LinkDirectUtilsProviderImpl.kt new file mode 100644 index 0000000000..84780f113f --- /dev/null +++ b/app/src/main/java/com/gh/common/provider/LinkDirectUtilsProviderImpl.kt @@ -0,0 +1,26 @@ +package com.gh.common.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.common.util.DirectUtils +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.common.entity.LinkEntity +import com.gh.gamecenter.common.provider.ILinkDirectUtilsProvider + +@Route(path = RouteConsts.provider.linkDirectUtils, name = "DirectUtils暴露服务,主要是暴露directToLinkPage方法") +class LinkDirectUtilsProviderImpl : ILinkDirectUtilsProvider { + + override fun directToLinkPage( + context: Context, + linkEntity: LinkEntity, + entrance: String, + path: String + ) { + DirectUtils.directToLinkPage(context, linkEntity, entrance, path) + } + + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/app/src/main/java/com/gh/common/provider/LogUtilsProviderImpl.kt b/app/src/main/java/com/gh/common/provider/LogUtilsProviderImpl.kt new file mode 100644 index 0000000000..1966c98b84 --- /dev/null +++ b/app/src/main/java/com/gh/common/provider/LogUtilsProviderImpl.kt @@ -0,0 +1,19 @@ +package com.gh.common.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.common.util.* +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.* + +@Route(path = RouteConsts.provider.logUtils, name = "LogUtils暴露服务") +class LogUtilsProviderImpl : ILogUtilsProvider { + + override fun login(loginStep: String, loginType: String, entrance: String) { + LogUtils.login(loginStep, loginType, entrance) + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/app/src/main/java/com/gh/common/provider/MessageUnreadRepositoryProviderImpl.kt b/app/src/main/java/com/gh/common/provider/MessageUnreadRepositoryProviderImpl.kt new file mode 100644 index 0000000000..8bbc2bd8af --- /dev/null +++ b/app/src/main/java/com/gh/common/provider/MessageUnreadRepositoryProviderImpl.kt @@ -0,0 +1,19 @@ +package com.gh.common.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IMessageUnreadRepositoryProvider +import com.gh.gamecenter.message.MessageUnreadRepository + +@Route(path = RouteConsts.provider.messageUnreadRepository, name = "MessageUnreadRepository暴露服务") +class MessageUnreadRepositoryProviderImpl : IMessageUnreadRepositoryProvider { + + override fun loadMessageUnreadData() { + MessageUnreadRepository.loadMessageUnreadData() + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/app/src/main/java/com/gh/common/provider/QuickLoginProviderImpl.kt b/app/src/main/java/com/gh/common/provider/QuickLoginProviderImpl.kt deleted file mode 100644 index 369322fd73..0000000000 --- a/app/src/main/java/com/gh/common/provider/QuickLoginProviderImpl.kt +++ /dev/null @@ -1,19 +0,0 @@ -package com.gh.common.provider - -import android.content.Context -import com.alibaba.android.arouter.facade.annotation.Route -import com.gh.common.util.QuickLoginHelper -import com.gh.gamecenter.common.constant.RouteConsts -import com.gh.gamecenter.core.provider.IQuickLoginProvider - -@Route(path = RouteConsts.provider.quickLogin, name = "一键登录暴露服务") -class QuickLoginProviderImpl : IQuickLoginProvider { - - override fun startLogin(context: Context, entrance: String) { - QuickLoginHelper.startLogin(context, entrance) - } - - override fun init(context: Context?) { - - } -} \ No newline at end of file diff --git a/app/src/main/java/com/gh/common/provider/ReservationRepositoryProviderImpl.kt b/app/src/main/java/com/gh/common/provider/ReservationRepositoryProviderImpl.kt new file mode 100644 index 0000000000..90e119436e --- /dev/null +++ b/app/src/main/java/com/gh/common/provider/ReservationRepositoryProviderImpl.kt @@ -0,0 +1,23 @@ +package com.gh.common.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.common.repository.ReservationRepository +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IReservationRepositoryProvider + +@Route(path = RouteConsts.provider.reservationRepository, name = "ReservationRepository暴露服务") +class ReservationRepositoryProviderImpl : IReservationRepositoryProvider { + + override fun refreshReservations() { + ReservationRepository.refreshReservations() + } + + override fun clearReservations() { + ReservationRepository.clearReservations() + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/app/src/main/java/com/gh/common/provider/TimeUtilProviderImpl.kt b/app/src/main/java/com/gh/common/provider/TimeUtilProviderImpl.kt new file mode 100644 index 0000000000..f5409ec82d --- /dev/null +++ b/app/src/main/java/com/gh/common/provider/TimeUtilProviderImpl.kt @@ -0,0 +1,17 @@ +package com.gh.common.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.common.exposure.time.TimeUtil +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.ITimeUtilProvider + +@Route(path = RouteConsts.provider.timeUtil, name = "TimeUtil暴露服务") +class TimeUtilProviderImpl : ITimeUtilProvider { + + override fun currentTimeMillis() = TimeUtil.currentTimeMillis() + + override fun currentTime() = TimeUtil.currentTime() + + override fun init(context: Context?) {} +} \ No newline at end of file diff --git a/app/src/main/java/com/gh/common/provider/WebProviderImpl.kt b/app/src/main/java/com/gh/common/provider/WebProviderImpl.kt index 9676f2a62a..5c1664b7cc 100644 --- a/app/src/main/java/com/gh/common/provider/WebProviderImpl.kt +++ b/app/src/main/java/com/gh/common/provider/WebProviderImpl.kt @@ -13,6 +13,10 @@ class WebProviderImpl : IWebProvider { return WebActivity.getIntent(context, url, autoCompletionTitle) } + override fun getWebIntent(context: Context, title: String, url: String): Intent { + return WebActivity.getWebIntent(context, title, url) + } + override fun init(context: Context?) { } diff --git a/app/src/main/java/com/gh/common/provider/WechatHelperProviderImpl.kt b/app/src/main/java/com/gh/common/provider/WechatHelperProviderImpl.kt new file mode 100644 index 0000000000..c584670fa4 --- /dev/null +++ b/app/src/main/java/com/gh/common/provider/WechatHelperProviderImpl.kt @@ -0,0 +1,18 @@ +package com.gh.common.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.common.util.WechatBindHelper +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IWechatBindHelperProvider + +@Route(path = RouteConsts.provider.wechatHelper, name = "WechatHelper暴露服务") +class WechatHelperProviderImpl : IWechatBindHelperProvider { + override fun getWechatConfig() { + WechatBindHelper.getWechatConfig() + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/app/src/main/java/com/gh/common/repository/ReservationRepository.kt b/app/src/main/java/com/gh/common/repository/ReservationRepository.kt index 68ba47ec06..f05609b54c 100644 --- a/app/src/main/java/com/gh/common/repository/ReservationRepository.kt +++ b/app/src/main/java/com/gh/common/repository/ReservationRepository.kt @@ -2,7 +2,7 @@ package com.gh.common.repository import android.annotation.SuppressLint import com.gh.common.util.CheckLoginUtils -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.retrofit.RetrofitManager import com.halo.assistant.HaloApp diff --git a/app/src/main/java/com/gh/common/simulator/SimulatorGameManager.kt b/app/src/main/java/com/gh/common/simulator/SimulatorGameManager.kt index 157783bfcb..b198e89509 100644 --- a/app/src/main/java/com/gh/common/simulator/SimulatorGameManager.kt +++ b/app/src/main/java/com/gh/common/simulator/SimulatorGameManager.kt @@ -21,7 +21,7 @@ import com.gh.gamecenter.core.utils.ToastUtils import com.gh.gamecenter.core.utils.UrlFilterUtils import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.entity.SimulatorGameRecordEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.retrofit.RetrofitManager import com.gh.gamecenter.room.AppDatabase import com.halo.assistant.HaloApp diff --git a/app/src/main/java/com/gh/common/util/CheckLoginUtils.java b/app/src/main/java/com/gh/common/util/CheckLoginUtils.java index 0c88426412..d3e3649b4e 100644 --- a/app/src/main/java/com/gh/common/util/CheckLoginUtils.java +++ b/app/src/main/java/com/gh/common/util/CheckLoginUtils.java @@ -8,10 +8,11 @@ import android.text.TextUtils; import com.gh.gamecenter.common.constant.EntranceConsts; import com.gh.gamecenter.core.utils.CurrentActivityHolder; import com.gh.gamecenter.common.constant.Constants; -import com.gh.gamecenter.LoginActivity; +import com.gh.gamecenter.login.utils.QuickLoginHelper; +import com.gh.gamecenter.login.view.LoginActivity; import com.gh.gamecenter.common.utils.NetworkUtils; import com.gh.gamecenter.core.utils.SPUtils; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.user.UserManager; import com.lightgame.utils.Utils; diff --git a/app/src/main/java/com/gh/common/util/CollectionUtils.kt b/app/src/main/java/com/gh/common/util/CollectionUtils.kt index 3d62483ca4..b80d55a22e 100644 --- a/app/src/main/java/com/gh/common/util/CollectionUtils.kt +++ b/app/src/main/java/com/gh/common/util/CollectionUtils.kt @@ -2,7 +2,7 @@ package com.gh.common.util import android.content.Context import com.gh.gamecenter.eventbus.EBCollectionChanged -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.retrofit.RetrofitManager import io.reactivex.Observable diff --git a/app/src/main/java/com/gh/common/util/CommentHelper.kt b/app/src/main/java/com/gh/common/util/CommentHelper.kt index c95b80b8c6..9a68c55d29 100644 --- a/app/src/main/java/com/gh/common/util/CommentHelper.kt +++ b/app/src/main/java/com/gh/common/util/CommentHelper.kt @@ -18,7 +18,7 @@ import com.gh.gamecenter.common.view.BugFixedPopupWindow import com.gh.gamecenter.entity.CommentEntity import com.gh.gamecenter.entity.MeEntity import com.gh.gamecenter.entity.Permissions -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.qa.comment.OnCommentOptionClickListener import com.gh.gamecenter.retrofit.RetrofitManager import com.halo.assistant.HaloApp diff --git a/app/src/main/java/com/gh/common/util/CommentUtils.java b/app/src/main/java/com/gh/common/util/CommentUtils.java index d809b4b562..1abbda2c85 100644 --- a/app/src/main/java/com/gh/common/util/CommentUtils.java +++ b/app/src/main/java/com/gh/common/util/CommentUtils.java @@ -27,8 +27,8 @@ import com.gh.gamecenter.core.utils.NumberUtils; import com.gh.gamecenter.core.utils.ToastUtils; import com.gh.gamecenter.entity.CommentEntity; import com.gh.gamecenter.entity.MeEntity; -import com.gh.gamecenter.entity.UserInfoEntity; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.entity.UserInfoEntity; +import com.gh.gamecenter.login.user.UserManager; import com.gh.gamecenter.retrofit.RetrofitManager; import com.halo.assistant.HaloApp; import com.lightgame.utils.Utils; diff --git a/app/src/main/java/com/gh/common/util/ConcernUtils.kt b/app/src/main/java/com/gh/common/util/ConcernUtils.kt index a176f70bda..6b3e0676f8 100644 --- a/app/src/main/java/com/gh/common/util/ConcernUtils.kt +++ b/app/src/main/java/com/gh/common/util/ConcernUtils.kt @@ -3,7 +3,7 @@ package com.gh.common.util import android.content.Context import android.text.TextUtils import com.gh.gamecenter.eventbus.EBConcernChanged -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.retrofit.RetrofitManager import io.reactivex.android.schedulers.AndroidSchedulers diff --git a/app/src/main/java/com/gh/common/util/DataUtils.java b/app/src/main/java/com/gh/common/util/DataUtils.java index f9852734e0..344cc8c32c 100644 --- a/app/src/main/java/com/gh/common/util/DataUtils.java +++ b/app/src/main/java/com/gh/common/util/DataUtils.java @@ -23,8 +23,8 @@ import com.gh.gamecenter.core.AppExecutor; import com.gh.gamecenter.core.utils.GsonUtils; import com.gh.gamecenter.core.utils.MtaHelper; import com.gh.gamecenter.core.utils.SPUtils; -import com.gh.gamecenter.entity.IdCardEntity; -import com.gh.gamecenter.entity.UserInfoEntity; +import com.gh.gamecenter.login.entity.IdCardEntity; +import com.gh.gamecenter.login.entity.UserInfoEntity; import com.gh.gamecenter.provider.GhContentProvider; import com.gh.gamecenter.retrofit.RetrofitManager; import com.gh.gid.GidCallback; diff --git a/app/src/main/java/com/gh/common/util/DetailDownloadUtils.java b/app/src/main/java/com/gh/common/util/DetailDownloadUtils.java index 51001af789..3c71fdf6dc 100644 --- a/app/src/main/java/com/gh/common/util/DetailDownloadUtils.java +++ b/app/src/main/java/com/gh/common/util/DetailDownloadUtils.java @@ -14,7 +14,7 @@ import com.gh.gamecenter.R; import com.gh.gamecenter.adapter.viewholder.DetailViewHolder; import com.gh.gamecenter.common.constant.Constants; import com.gh.gamecenter.core.utils.SPUtils; -import com.gh.gamecenter.entity.LinkEntity; +import com.gh.gamecenter.common.entity.LinkEntity; import com.gh.gamecenter.entity.PluginLocation; import com.gh.gamecenter.manager.PackagesManager; import com.gh.vspace.VHelper; diff --git a/app/src/main/java/com/gh/common/util/DialogUtils.java b/app/src/main/java/com/gh/common/util/DialogUtils.java index 6db2ab145a..80a84f75eb 100644 --- a/app/src/main/java/com/gh/common/util/DialogUtils.java +++ b/app/src/main/java/com/gh/common/util/DialogUtils.java @@ -37,7 +37,6 @@ import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.LinearLayout; -import android.widget.RelativeLayout; import android.widget.TextView; import androidx.annotation.NonNull; @@ -80,17 +79,14 @@ import com.gh.gamecenter.core.utils.SpanBuilder; import com.gh.gamecenter.core.utils.StringUtils; import com.gh.gamecenter.core.utils.ToastUtils; import com.gh.gamecenter.databinding.DialogBindPhoneBinding; -import com.gh.gamecenter.databinding.DialogEnergySignBinding; import com.gh.gamecenter.databinding.DialogOverseaConfirmationBinding; import com.gh.gamecenter.databinding.DialogPackageParseErrorBinding; -import com.gh.gamecenter.databinding.DialogQuickLoginPermissionBinding; import com.gh.gamecenter.databinding.DialogReceiveLibaoSuccessBinding; import com.gh.gamecenter.databinding.DialogReportReasonBinding; import com.gh.gamecenter.databinding.DialogWechatReserveSuccessBinding; import com.gh.gamecenter.databinding.ImprintContentItemBinding; import com.gh.gamecenter.databinding.PrivacyItemBinding; import com.gh.gamecenter.entity.ApkEntity; -import com.gh.gamecenter.entity.Badge; import com.gh.gamecenter.entity.BadgeEntity; import com.gh.gamecenter.entity.GameEntity; import com.gh.gamecenter.entity.PermissionsEntity; @@ -98,6 +94,7 @@ import com.gh.gamecenter.entity.PrivacyPolicyEntity; import com.gh.gamecenter.entity.SettingsEntity; import com.gh.gamecenter.entity.SimpleGameEntity; import com.gh.gamecenter.entity.TrackableEntity; +import com.gh.gamecenter.login.entity.Badge; import com.gh.gamecenter.retrofit.RetrofitManager; import com.gh.gamecenter.setting.GameDownloadSettingFragment; import com.gh.gamecenter.suggest.SuggestType; @@ -1891,34 +1888,6 @@ public class DialogUtils { dialog.show(); } - public static void showEnergyTaskNoticeDialog(Context context, String title, String content) { - context = checkDialogContext(context); - - final Dialog dialog = new Dialog(context, R.style.DialogWindowTransparent); - - View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_notice, null); - TextView titleTv = contentView.findViewById(R.id.dialog_title); - TextView contentTv = contentView.findViewById(R.id.dialog_content); - TextView okTv = contentView.findViewById(R.id.dialog_ok); - - if (title == null) { - titleTv.setVisibility(View.GONE); - } else { - titleTv.setVisibility(View.VISIBLE); - titleTv.setText(title); - } - contentTv.setText(content); - - okTv.setTextColor(ContextCompat.getColor(context, R.color.theme_font)); - okTv.setOnClickListener(v -> { - dialog.dismiss(); - }); - - dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); - dialog.setContentView(contentView); - dialog.show(); - } - public static void showSimulatorParseErrorDialog(Context context, String gameId, String gameName, ConfirmListener confirmListener) { context = checkDialogContext(context); final Dialog dialog = new Dialog(context, R.style.GhAlertDialog); @@ -2009,31 +1978,6 @@ public class DialogUtils { dialog.show(); } - public static void showSignSuccessDialog(Context context, ConfirmListener listener) { - context = checkDialogContext(context); - - final Dialog dialog = new Dialog(context, R.style.DialogWindowTransparent); - - View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_sign_success, null); - - ImageView signBg = contentView.findViewById(R.id.signBg); - RelativeLayout signContainer = contentView.findViewById(R.id.signContainer); - - Animation animation1 = AnimationUtils.loadAnimation(context, R.anim.anim_badge_light_bg); - signBg.startAnimation(animation1); - - Animation animation2 = AnimationUtils.loadAnimation(context, R.anim.anim_sign_dialog_dismiss); - signContainer.postDelayed(() -> signContainer.startAnimation(animation2), 2000); - - signContainer.postDelayed(dialog::dismiss, 3000); - - dialog.setOnDismissListener(dialogInterface -> listener.onConfirm()); - - dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); - dialog.setContentView(contentView); - dialog.show(); - } - public static void showSignRuleDialog(Context context) { context = checkDialogContext(context); @@ -2098,59 +2042,6 @@ public class DialogUtils { } } - public static void showQuickLoginPermissionDialog(Context context, ConfirmListener confirmListener, CancelListener cancelListener) { - context = checkDialogContext(context); - - final Dialog dialog = new Dialog(context, R.style.DialogWindowTransparent); - DialogQuickLoginPermissionBinding binding = DialogQuickLoginPermissionBinding.inflate(LayoutInflater.from(context)); - - binding.confirmBtn.setOnClickListener(v -> { - dialog.dismiss(); - confirmListener.onConfirm(); - }); - - binding.cancelBtn.setOnClickListener(v -> { - dialog.dismiss(); - cancelListener.onCancel(); - }); - - dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); - dialog.setContentView(binding.getRoot()); - dialog.show(); - } - - public static void showEnergySignDialog(Context context, int sevenDaySerialSign) { - context = checkDialogContext(context); - - final Dialog dialog = new Dialog(context, R.style.DialogWindowTransparent); - DialogEnergySignBinding binding = DialogEnergySignBinding.inflate(LayoutInflater.from(context)); - - if (sevenDaySerialSign > 7) sevenDaySerialSign = 7; - - for (int i = 1; i <= sevenDaySerialSign; i++) { - int index = (i - 1) * 2; - LinearLayout dayContainer = (LinearLayout) binding.signDaysContainer.getChildAt(index); - ImageView dayIv = (ImageView) dayContainer.getChildAt(1); - dayIv.setImageResource(R.drawable.ic_energy_center_signed); - - if (i != 7) { - int rIndex = (i - 1) * 2 + 1; - LinearLayout lineContainer = (LinearLayout) binding.signDaysContainer.getChildAt(rIndex); - View straightLine = lineContainer.getChildAt(0); - View dottedLine = lineContainer.getChildAt(1); - if (i != sevenDaySerialSign) { - straightLine.setVisibility(View.VISIBLE); - } else { - dottedLine.setVisibility(View.VISIBLE); - } - } - } - - dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); - dialog.setContentView(binding.getRoot()); - dialog.show(); - } - public static void showReserveSuccess2WechatBindDialog(Context context, ConfirmListener confirmListener, CancelListener cancelListener) { context = checkDialogContext(context); diff --git a/app/src/main/java/com/gh/common/util/DirectUtils.kt b/app/src/main/java/com/gh/common/util/DirectUtils.kt index fe58c6f34f..9e8a7f2d23 100644 --- a/app/src/main/java/com/gh/common/util/DirectUtils.kt +++ b/app/src/main/java/com/gh/common/util/DirectUtils.kt @@ -9,28 +9,31 @@ import android.os.Build import android.os.Bundle import android.text.TextUtils import androidx.appcompat.app.AppCompatActivity +import com.gh.gamecenter.common.base.activity.BaseActivity +import com.gh.gamecenter.common.base.activity.BaseActivity_TabLayout +import com.gh.gamecenter.common.base.activity.ToolBarActivity +import com.gh.gamecenter.common.base.fragment.BaseFragment_TabLayout +import com.gh.gamecenter.core.AppExecutor import com.gh.common.constant.Config +import com.gh.gamecenter.common.constant.Constants import com.gh.common.exposure.ExposureEvent import com.gh.common.exposure.ExposureEvent.Companion.createEvent import com.gh.common.exposure.ExposureManager.log import com.gh.common.exposure.ExposureTraceUtils.appendTrace import com.gh.common.exposure.ExposureType -import com.gh.common.util.EntranceUtils.jumpActivity +import com.gh.gamecenter.common.constant.EntranceConsts.* +import com.gh.common.util.EntranceUtils.* import com.gh.gamecenter.* import com.gh.gamecenter.amway.AmwayActivity import com.gh.gamecenter.catalog.CatalogActivity import com.gh.gamecenter.category.CategoryDirectoryActivity import com.gh.gamecenter.category2.CategoryV2Activity -import com.gh.gamecenter.common.base.activity.BaseActivity -import com.gh.gamecenter.common.base.activity.BaseActivity_TabLayout -import com.gh.gamecenter.common.base.activity.ToolBarActivity -import com.gh.gamecenter.common.base.fragment.BaseFragment_TabLayout -import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.common.constant.EntranceConsts -import com.gh.gamecenter.common.constant.EntranceConsts.* +import com.gh.gamecenter.common.entity.CommunityEntity +import com.gh.gamecenter.common.entity.Display +import com.gh.gamecenter.common.entity.LinkEntity import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.common.utils.* -import com.gh.gamecenter.core.AppExecutor import com.gh.gamecenter.core.utils.RunningUtils import com.gh.gamecenter.core.utils.ToastUtils import com.gh.gamecenter.download.DownloadFragment.Companion.INDEX_UPDATE @@ -48,7 +51,7 @@ import com.gh.gamecenter.gamedetail.GameDetailFragment import com.gh.gamecenter.gamedetail.fuli.kaifu.ServersCalendarActivity import com.gh.gamecenter.gamedetail.history.HistoryApkListActivity import com.gh.gamecenter.gamedetail.rating.RatingReplyActivity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.mygame.PlayedGameActivity import com.gh.gamecenter.personalhome.UserHomeActivity import com.gh.gamecenter.personalhome.background.PersonalityBackgroundActivity diff --git a/app/src/main/java/com/gh/common/util/DownloadItemUtils.kt b/app/src/main/java/com/gh/common/util/DownloadItemUtils.kt index 443720afd8..56bafbfb08 100644 --- a/app/src/main/java/com/gh/common/util/DownloadItemUtils.kt +++ b/app/src/main/java/com/gh/common/util/DownloadItemUtils.kt @@ -28,7 +28,8 @@ import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.entity.GameEntity -import com.gh.gamecenter.entity.LinkEntity +import com.gh.gamecenter.common.entity.LinkEntity +import com.gh.gamecenter.energy.utils.EnergyTaskHelper import com.gh.gamecenter.entity.PluginLocation import com.gh.gamecenter.gamedetail.dialog.GamePermissionDialogFragment import com.gh.gamecenter.manager.PackagesManager diff --git a/app/src/main/java/com/gh/common/util/DownloadObserver.kt b/app/src/main/java/com/gh/common/util/DownloadObserver.kt index 8007d797f1..a01769ec3d 100644 --- a/app/src/main/java/com/gh/common/util/DownloadObserver.kt +++ b/app/src/main/java/com/gh/common/util/DownloadObserver.kt @@ -19,6 +19,7 @@ import com.gh.gamecenter.core.utils.GsonUtils import com.gh.gamecenter.core.utils.MtaHelper import com.gh.gamecenter.core.utils.StringUtils import com.gh.gamecenter.core.utils.ToastUtils +import com.gh.gamecenter.energy.utils.EnergyTaskHelper import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.entity.SimpleGameEntity import com.gh.gamecenter.entity.SimulatorEntity diff --git a/app/src/main/java/com/gh/common/util/ErrorHelper.kt b/app/src/main/java/com/gh/common/util/ErrorHelper.kt index 8448d49842..a583a1dc8b 100644 --- a/app/src/main/java/com/gh/common/util/ErrorHelper.kt +++ b/app/src/main/java/com/gh/common/util/ErrorHelper.kt @@ -311,7 +311,9 @@ object ErrorHelper { errorEntity?.toast?.isNotEmpty() == true -> { Utils.toast(context, errorEntity.toast) } - else -> Utils.toast(context, R.string.login_failure) + else -> { + Utils.toast(context, R.string.login_failure) + } } } catch (e: Exception) { e.printStackTrace() diff --git a/app/src/main/java/com/gh/common/util/FloatingBackViewManager.kt b/app/src/main/java/com/gh/common/util/FloatingBackViewManager.kt index 31e09f962a..a2ecc4b977 100644 --- a/app/src/main/java/com/gh/common/util/FloatingBackViewManager.kt +++ b/app/src/main/java/com/gh/common/util/FloatingBackViewManager.kt @@ -7,7 +7,7 @@ import android.widget.TextView import com.gh.gamecenter.R import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.core.utils.DisplayUtils -import com.gh.gamecenter.energy.EnergyCenterActivity +import com.gh.gamecenter.energy.view.EnergyCenterActivity import com.lightgame.utils.Util_System_Keyboard import com.lzf.easyfloat.EasyFloat import com.lzf.easyfloat.enums.ShowPattern diff --git a/app/src/main/java/com/gh/common/util/GameActivityDownloadHelper.kt b/app/src/main/java/com/gh/common/util/GameActivityDownloadHelper.kt index b889ef6919..bb1c0eb66e 100644 --- a/app/src/main/java/com/gh/common/util/GameActivityDownloadHelper.kt +++ b/app/src/main/java/com/gh/common/util/GameActivityDownloadHelper.kt @@ -33,7 +33,7 @@ import com.gh.gamecenter.entity.ApkEntity import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.entity.PluginLocation import com.gh.gamecenter.gamedetail.dialog.GamePermissionDialogFragment -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.retrofit.RetrofitManager import com.gh.gamecenter.teenagermode.TeenagerModeActivity import com.gh.vspace.VHelper diff --git a/app/src/main/java/com/gh/common/util/GameSubstituteRepositoryHelper.kt b/app/src/main/java/com/gh/common/util/GameSubstituteRepositoryHelper.kt index 10854b67e0..ab21897b20 100644 --- a/app/src/main/java/com/gh/common/util/GameSubstituteRepositoryHelper.kt +++ b/app/src/main/java/com/gh/common/util/GameSubstituteRepositoryHelper.kt @@ -9,7 +9,7 @@ import com.gh.gamecenter.common.utils.toObject import com.gh.gamecenter.core.utils.MtaHelper import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.entity.SubjectEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/common/util/HomeBottomBarHelper.kt b/app/src/main/java/com/gh/common/util/HomeBottomBarHelper.kt index ceeb229e72..4026ace723 100644 --- a/app/src/main/java/com/gh/common/util/HomeBottomBarHelper.kt +++ b/app/src/main/java/com/gh/common/util/HomeBottomBarHelper.kt @@ -3,7 +3,7 @@ package com.gh.common.util import com.gh.gamecenter.core.utils.GsonUtils import com.gh.gamecenter.core.utils.SPUtils import com.gh.gamecenter.common.utils.toJson -import com.gh.gamecenter.entity.Display +import com.gh.gamecenter.common.entity.Display import com.gh.gamecenter.entity.SubjectRecommendEntity import com.halo.assistant.HaloApp diff --git a/app/src/main/java/com/gh/common/util/LibaoUtils.java b/app/src/main/java/com/gh/common/util/LibaoUtils.java index 899c3e0f7f..0ad37a6f8c 100644 --- a/app/src/main/java/com/gh/common/util/LibaoUtils.java +++ b/app/src/main/java/com/gh/common/util/LibaoUtils.java @@ -27,10 +27,10 @@ import com.gh.gamecenter.entity.LibaoStatusEntity; import com.gh.gamecenter.entity.MeEntity; import com.gh.gamecenter.common.entity.NotificationUgc; import com.gh.gamecenter.entity.UserDataLibaoEntity; -import com.gh.gamecenter.eventbus.EBReuse; +import com.gh.gamecenter.common.eventbus.EBReuse; import com.gh.gamecenter.eventbus.EBUISwitch; import com.gh.gamecenter.geetest.GeetestUtils; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.user.UserManager; import com.gh.gamecenter.common.retrofit.JSONObjectResponse; import com.gh.gamecenter.common.retrofit.Response; import com.gh.gamecenter.retrofit.RetrofitManager; diff --git a/app/src/main/java/com/gh/common/util/LogUtils.java b/app/src/main/java/com/gh/common/util/LogUtils.java index 97c380cfca..23c63e6852 100644 --- a/app/src/main/java/com/gh/common/util/LogUtils.java +++ b/app/src/main/java/com/gh/common/util/LogUtils.java @@ -18,13 +18,14 @@ import com.gh.gamecenter.common.loghub.LoghubUtils; import com.gh.gamecenter.common.loghub.SimpleLogContainerEntity; import com.gh.gamecenter.common.utils.DeviceUtils; import com.gh.gamecenter.core.utils.GsonUtils; -import com.gh.gamecenter.entity.CommunityEntity; +import com.gh.gamecenter.common.entity.CommunityEntity; import com.gh.gamecenter.entity.DetectionObjectEntity; import com.gh.gamecenter.entity.GameEntity; import com.gh.gamecenter.entity.PackageDialogEntity; import com.gh.gamecenter.entity.SpecialColumn; import com.gh.gamecenter.entity.StartupAdEntity; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.user.UserManager; +import com.gh.gamecenter.manager.CommunityManager; import com.gh.gamecenter.qa.entity.Questions; import com.halo.assistant.HaloApp; import com.lightgame.utils.Utils; @@ -163,8 +164,8 @@ public class LogUtils { JSONObject object = new JSONObject(); try { - object.put("community_id", UserManager.getInstance().getCommunity().getId()); - object.put("community_name", UserManager.getInstance().getCommunity().getName()); + object.put("community_id", CommunityManager.getInstance().getCommunity().getId()); + object.put("community_name", CommunityManager.getInstance().getCommunity().getName()); object.put("keyword", searchKey); object.put("subject", "search"); } catch (JSONException e) { @@ -178,7 +179,7 @@ public class LogUtils { JSONObject object = new JSONObject(); try { object.put("subject", "community_refresh"); - object.put("community_id", UserManager.getInstance().getCommunity().getId()); + object.put("community_id", CommunityManager.getInstance().getCommunity().getId()); object.put("refresh_type", "recommend"); object.put("refresh_way", manualRefresh ? "manual" : "auto"); object.put("data_count", dataCount); diff --git a/app/src/main/java/com/gh/common/util/PlatformUtils.java b/app/src/main/java/com/gh/common/util/PlatformUtils.java index a32c2cc62b..698bd61739 100644 --- a/app/src/main/java/com/gh/common/util/PlatformUtils.java +++ b/app/src/main/java/com/gh/common/util/PlatformUtils.java @@ -9,7 +9,7 @@ import android.text.TextUtils; import com.gh.gamecenter.core.AppExecutor; import com.gh.gamecenter.R; import com.gh.gamecenter.entity.PlatformEntity; -import com.gh.gamecenter.eventbus.EBReuse; +import com.gh.gamecenter.common.eventbus.EBReuse; import com.gh.gamecenter.common.retrofit.Response; import com.gh.gamecenter.retrofit.RetrofitManager; import com.halo.assistant.HaloApp; diff --git a/app/src/main/java/com/gh/common/util/UsageStatsHelper.kt b/app/src/main/java/com/gh/common/util/UsageStatsHelper.kt index dc2172b034..57fc86e676 100644 --- a/app/src/main/java/com/gh/common/util/UsageStatsHelper.kt +++ b/app/src/main/java/com/gh/common/util/UsageStatsHelper.kt @@ -21,7 +21,7 @@ import androidx.annotation.RequiresApi import com.gh.common.util.UsageStatsHelper.getDataByUsageEvents import com.gh.common.util.UsageStatsHelper.getDataByUsageStats import com.gh.gamecenter.common.utils.debugOnly -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.retrofit.RetrofitManager import com.halo.assistant.HaloApp diff --git a/app/src/main/java/com/gh/common/util/WechatBindHelper.kt b/app/src/main/java/com/gh/common/util/WechatBindHelper.kt index 5e8eb5bb25..faa02f1d40 100644 --- a/app/src/main/java/com/gh/common/util/WechatBindHelper.kt +++ b/app/src/main/java/com/gh/common/util/WechatBindHelper.kt @@ -8,7 +8,7 @@ import com.gh.gamecenter.common.utils.createRequestBody import com.gh.gamecenter.common.utils.singleToMain import com.gh.gamecenter.common.utils.toJson import com.gh.gamecenter.entity.WechatConfigEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.retrofit.RetrofitManager import com.halo.assistant.HaloApp diff --git a/app/src/main/java/com/gh/common/videolog/VideoRecordUtils.kt b/app/src/main/java/com/gh/common/videolog/VideoRecordUtils.kt index 1843cae83d..0e91ae5f2d 100644 --- a/app/src/main/java/com/gh/common/videolog/VideoRecordUtils.kt +++ b/app/src/main/java/com/gh/common/videolog/VideoRecordUtils.kt @@ -6,7 +6,7 @@ import android.database.sqlite.SQLiteFullException import com.gh.gamecenter.common.utils.toRequestBody import com.gh.gamecenter.common.utils.toastInInternalRelease import com.gh.gamecenter.common.utils.tryWithDefaultCatch -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.retrofit.RetrofitManager import com.gh.gamecenter.room.AppDatabase diff --git a/app/src/main/java/com/gh/common/view/ImageContainerView.kt b/app/src/main/java/com/gh/common/view/ImageContainerView.kt index 81c7150ebc..9017c2c0ba 100644 --- a/app/src/main/java/com/gh/common/view/ImageContainerView.kt +++ b/app/src/main/java/com/gh/common/view/ImageContainerView.kt @@ -18,7 +18,7 @@ import com.gh.gamecenter.core.utils.DisplayUtils import com.gh.gamecenter.common.utils.ImageUtils import com.gh.gamecenter.core.utils.TopCutProcess import com.gh.gamecenter.databinding.ItemCommunityImageBinding -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.qa.entity.AnswerEntity import com.gh.gamecenter.qa.entity.CommunityVideoEntity import com.gh.gamecenter.video.detail.VideoDetailContainerViewModel diff --git a/app/src/main/java/com/gh/download/DownloadManager.java b/app/src/main/java/com/gh/download/DownloadManager.java index 880653dded..da3d3bb8b7 100644 --- a/app/src/main/java/com/gh/download/DownloadManager.java +++ b/app/src/main/java/com/gh/download/DownloadManager.java @@ -44,7 +44,7 @@ import com.gh.gamecenter.entity.HomePluggableFilterEntity; import com.gh.gamecenter.entity.PluginLocation; import com.gh.gamecenter.eventbus.EBDownloadStatus; import com.gh.gamecenter.manager.PackagesManager; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.user.UserManager; import com.gh.gamecenter.packagehelper.PackageRepository; import com.halo.assistant.HaloApp; import com.lightgame.download.ConnectionUtils; diff --git a/app/src/main/java/com/gh/download/PackageObserver.kt b/app/src/main/java/com/gh/download/PackageObserver.kt index 8c2c1a29b2..ff3286144d 100644 --- a/app/src/main/java/com/gh/download/PackageObserver.kt +++ b/app/src/main/java/com/gh/download/PackageObserver.kt @@ -18,7 +18,7 @@ import com.gh.gamecenter.core.utils.ThirdPartyPackageHelper import com.gh.gamecenter.core.utils.UrlFilterUtils import com.gh.gamecenter.entity.GameDigestEntity import com.gh.gamecenter.eventbus.EBPackage -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.packagehelper.PackageRepository import com.gh.gamecenter.packagehelper.PackageViewModel import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/flutter/FlutterUserServiceImplAop.java b/app/src/main/java/com/gh/flutter/FlutterUserServiceImplAop.java index 4aec684dfb..18e2503b41 100644 --- a/app/src/main/java/com/gh/flutter/FlutterUserServiceImplAop.java +++ b/app/src/main/java/com/gh/flutter/FlutterUserServiceImplAop.java @@ -1,7 +1,7 @@ package com.gh.flutter; -import com.gh.gamecenter.entity.UserInfoEntity; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.entity.UserInfoEntity; +import com.gh.gamecenter.login.user.UserManager; import me.ele.lancet.base.annotations.Insert; import me.ele.lancet.base.annotations.TargetClass; diff --git a/app/src/main/java/com/gh/gamecenter/CommentDetailActivity.java b/app/src/main/java/com/gh/gamecenter/CommentDetailActivity.java index a0e96da438..b684011208 100644 --- a/app/src/main/java/com/gh/gamecenter/CommentDetailActivity.java +++ b/app/src/main/java/com/gh/gamecenter/CommentDetailActivity.java @@ -9,7 +9,7 @@ import android.view.ViewGroup; import com.gh.gamecenter.common.base.activity.ToolBarActivity; import com.gh.gamecenter.common.constant.EntranceConsts; import com.gh.gamecenter.core.utils.DisplayUtils; -import com.gh.gamecenter.entity.LinkEntity; +import com.gh.gamecenter.common.entity.LinkEntity; import com.gh.gamecenter.entity.MessageEntity; import com.gh.gamecenter.qa.comment.CommentActivity; import com.gh.gamecenter.qa.comment.NewCommentConversationFragment; diff --git a/app/src/main/java/com/gh/gamecenter/ImageViewerActivity.kt b/app/src/main/java/com/gh/gamecenter/ImageViewerActivity.kt index e01afdec38..bc47e514bc 100644 --- a/app/src/main/java/com/gh/gamecenter/ImageViewerActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/ImageViewerActivity.kt @@ -48,7 +48,7 @@ import com.gh.gamecenter.common.view.Gh_RelativeLayout import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.ActivityViewimageBinding -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.entity.ImageInfoEntity import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity import com.gh.gamecenter.qa.entity.AnswerEntity diff --git a/app/src/main/java/com/gh/gamecenter/LibaoDetailActivity.java b/app/src/main/java/com/gh/gamecenter/LibaoDetailActivity.java index bee831097b..3e5c074540 100644 --- a/app/src/main/java/com/gh/gamecenter/LibaoDetailActivity.java +++ b/app/src/main/java/com/gh/gamecenter/LibaoDetailActivity.java @@ -1,6 +1,6 @@ package com.gh.gamecenter; -import static com.gh.gamecenter.personal.PersonalFragment.LOGIN_TAG; +import static com.gh.gamecenter.common.constant.Constants.LOGIN_TAG; import android.app.Activity; import android.content.Context; @@ -44,7 +44,7 @@ import com.gh.gamecenter.entity.MeEntity; import com.gh.gamecenter.entity.UserDataLibaoEntity; import com.gh.gamecenter.eventbus.EBDownloadStatus; import com.gh.gamecenter.eventbus.EBPackage; -import com.gh.gamecenter.eventbus.EBReuse; +import com.gh.gamecenter.common.eventbus.EBReuse; import com.gh.gamecenter.eventbus.EBUISwitch; import com.gh.gamecenter.retrofit.RetrofitManager; import com.halo.assistant.HaloApp; diff --git a/app/src/main/java/com/gh/gamecenter/MainActivity.java b/app/src/main/java/com/gh/gamecenter/MainActivity.java index 1c5f59eb8f..82b7bb15d3 100644 --- a/app/src/main/java/com/gh/gamecenter/MainActivity.java +++ b/app/src/main/java/com/gh/gamecenter/MainActivity.java @@ -1,6 +1,7 @@ package com.gh.gamecenter; -import static com.gh.common.util.LoginHelper.WEIBO_SCOPE; +import static com.gh.gamecenter.common.constant.Constants.LOGOUT_TAG; +import static com.gh.gamecenter.login.utils.LoginHelper.WEIBO_SCOPE; import static com.gh.gamecenter.common.constant.EntranceConsts.ENTRANCE_BROWSER; import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_LAUNCH_SIMULATOR_GAME; import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_QQ; @@ -13,8 +14,7 @@ import static com.gh.gamecenter.common.constant.EntranceConsts.KEY_TO; import static com.gh.gamecenter.common.constant.EntranceConsts.KEY_TYPE; import static com.gh.gamecenter.common.utils.ExtensionsKt.observableToMain; import static com.gh.gamecenter.fragment.MainWrapperFragment.INDEX_PERSONAL; -import static com.gh.gamecenter.personal.PersonalFragment.LOGIN_TAG; -import static com.gh.gamecenter.personal.PersonalFragment.LOGOUT_TAG; +import static com.gh.gamecenter.common.constant.Constants.LOGIN_TAG; import android.annotation.SuppressLint; import android.app.Activity; @@ -32,7 +32,6 @@ import android.text.Html; import android.text.TextUtils; import android.view.KeyEvent; import android.view.View; -import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.NonNull; @@ -58,11 +57,11 @@ import com.gh.common.util.ErrorHelper; import com.gh.common.util.HomePluggableHelper; import com.gh.common.util.LogUtils; import com.gh.common.util.LunchType; +import com.gh.gamecenter.common.eventbus.EBReuse; import com.gh.gamecenter.common.utils.NotificationHelper; import com.gh.common.util.PackageInstaller; import com.gh.common.util.PackageUtils; import com.gh.common.util.PlatformUtils; -import com.gh.common.util.QuickLoginHelper; import com.gh.common.util.WechatBindHelper; import com.gh.download.DownloadManager; import com.gh.gamecenter.common.avoidcallback.AvoidOnResultManager; @@ -89,19 +88,20 @@ import com.gh.gamecenter.core.utils.SentryHelper; import com.gh.gamecenter.core.utils.ToastUtils; import com.gh.gamecenter.core.utils.UrlFilterUtils; import com.gh.gamecenter.download.DownloadFragment; -import com.gh.gamecenter.entity.CommunityEntity; +import com.gh.gamecenter.common.entity.CommunityEntity; import com.gh.gamecenter.entity.GameEntity; import com.gh.gamecenter.entity.InnerMetaInfoEntity; import com.gh.gamecenter.common.entity.NotificationUgc; import com.gh.gamecenter.entity.StartupAdEntity; import com.gh.gamecenter.eventbus.EBNetworkState; -import com.gh.gamecenter.eventbus.EBReuse; import com.gh.gamecenter.eventbus.EBSkip; import com.gh.gamecenter.fragment.MainWrapperFragment; import com.gh.gamecenter.home.skip.PackageSkipActivity; +import com.gh.gamecenter.login.utils.QuickLoginHelper; +import com.gh.gamecenter.manager.CommunityManager; import com.gh.gamecenter.manager.DataCollectionManager; import com.gh.gamecenter.manager.UpdateManager; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.user.UserManager; import com.gh.gamecenter.packagehelper.PackageViewModel; import com.gh.gamecenter.retrofit.RetrofitManager; import com.gh.gamecenter.room.AppDatabase; @@ -926,7 +926,7 @@ public class MainActivity extends BaseActivity { InnerMetaInfoEntity info = GsonUtils.getGson().fromJson(reader, InnerMetaInfoEntity.class); if (info != null) { if (EntranceConsts.HOST_COMMUNITY.equals(info.getType())) { - UserManager.getInstance().setCommunityData(new CommunityEntity(info.getLink(), info.getText())); + CommunityManager.getInstance().setCommunityData(new CommunityEntity(info.getLink(), info.getText())); runOnUiThread(() -> mMainWrapperFragment.setCurrentItem(MainWrapperFragment.INDEX_BBS)); } else { DirectUtils.directToSpecificPage(this, diff --git a/app/src/main/java/com/gh/gamecenter/NewsDetailActivity.java b/app/src/main/java/com/gh/gamecenter/NewsDetailActivity.java index 2a528c0daa..8f1081722f 100644 --- a/app/src/main/java/com/gh/gamecenter/NewsDetailActivity.java +++ b/app/src/main/java/com/gh/gamecenter/NewsDetailActivity.java @@ -1,6 +1,6 @@ package com.gh.gamecenter; -import static com.gh.gamecenter.personal.PersonalFragment.LOGIN_TAG; +import static com.gh.gamecenter.common.constant.Constants.LOGIN_TAG; import android.app.Activity; import android.content.Context; @@ -56,7 +56,7 @@ import com.gh.gamecenter.eventbus.EBConcernChanged; import com.gh.gamecenter.eventbus.EBDownloadStatus; import com.gh.gamecenter.eventbus.EBNetworkState; import com.gh.gamecenter.eventbus.EBPackage; -import com.gh.gamecenter.eventbus.EBReuse; +import com.gh.gamecenter.common.eventbus.EBReuse; import com.gh.gamecenter.newsdetail.NewsDetailAdapter; import com.gh.gamecenter.retrofit.RetrofitManager; import com.halo.assistant.fragment.SettingsFragment; diff --git a/app/src/main/java/com/gh/gamecenter/SkipActivity.java b/app/src/main/java/com/gh/gamecenter/SkipActivity.java index e815ac95e5..bd995fe8f8 100644 --- a/app/src/main/java/com/gh/gamecenter/SkipActivity.java +++ b/app/src/main/java/com/gh/gamecenter/SkipActivity.java @@ -54,12 +54,13 @@ import com.gh.common.util.EntranceUtils; import com.gh.common.util.PlatformUtils; import com.gh.gamecenter.core.utils.GsonUtils; import com.gh.gamecenter.core.utils.RunningUtils; -import com.gh.gamecenter.entity.CommunityEntity; -import com.gh.gamecenter.entity.LinkEntity; +import com.gh.gamecenter.common.entity.CommunityEntity; +import com.gh.gamecenter.common.entity.LinkEntity; import com.gh.gamecenter.entity.SimpleGameEntity; import com.gh.gamecenter.entity.SubjectRecommendEntity; import com.gh.gamecenter.entity.VideoLinkEntity; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.user.UserManager; +import com.gh.gamecenter.manager.CommunityManager; import com.gh.gamecenter.video.detail.VideoDetailContainerViewModel; import com.gh.gamecenter.video.videomanager.VideoManagerActivity; import com.lightgame.config.CommonDebug; @@ -152,7 +153,7 @@ public class SkipActivity extends BaseActivity { DirectUtils.directToToolbox(this, uri.getQueryParameter("gameId"), uri.getQueryParameter("toolboxUrl"), ENTRANCE_BROWSER); break; case HOST_COMMUNITY: - UserManager.getInstance().setCommunityData(new CommunityEntity(path, name)); + CommunityManager.getInstance().setCommunityData(new CommunityEntity(path, name)); // 把切换放到 MainActivity 处理 if (RunningUtils.isRunning(this) && MainActivity.class.getName().equals(RunningUtils.getBaseActivity(this))) { diff --git a/app/src/main/java/com/gh/gamecenter/SuggestionActivity.java b/app/src/main/java/com/gh/gamecenter/SuggestionActivity.java index 5b50fc9c2f..362cdc6d48 100644 --- a/app/src/main/java/com/gh/gamecenter/SuggestionActivity.java +++ b/app/src/main/java/com/gh/gamecenter/SuggestionActivity.java @@ -71,8 +71,8 @@ import com.gh.gamecenter.entity.InstallGameEntity; import com.gh.gamecenter.common.entity.NotificationUgc; import com.gh.gamecenter.entity.SettingsEntity; import com.gh.gamecenter.entity.SimpleGameEntity; -import com.gh.gamecenter.entity.UserInfoEntity; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.entity.UserInfoEntity; +import com.gh.gamecenter.login.user.UserManager; import com.gh.gamecenter.common.retrofit.Response; import com.gh.gamecenter.retrofit.RetrofitManager; import com.gh.gamecenter.suggest.SuggestGameCollectAdapter; diff --git a/app/src/main/java/com/gh/gamecenter/ToolBoxActivity.java b/app/src/main/java/com/gh/gamecenter/ToolBoxActivity.java index 7bae0a5a02..16c16ae53a 100644 --- a/app/src/main/java/com/gh/gamecenter/ToolBoxActivity.java +++ b/app/src/main/java/com/gh/gamecenter/ToolBoxActivity.java @@ -18,7 +18,7 @@ //import com.gh.gamecenter.core.utils.UrlFilterUtils; //import com.gh.gamecenter.common.view.VerticalItemDecoration; //import com.gh.gamecenter.adapter.ToolBoxRvAdapter; -//import com.gh.gamecenter.entity.ToolBoxEntity; +//import com.gh.gamecenter.common.entity.ToolBoxEntity; //import com.gh.gamecenter.retrofit.Response; //import com.gh.gamecenter.retrofit.RetrofitManager; //import com.gh.gamecenter.suggest.SuggestType; diff --git a/app/src/main/java/com/gh/gamecenter/UserInfoEditActivity.kt b/app/src/main/java/com/gh/gamecenter/UserInfoEditActivity.kt index d0aa1574a6..8cfec02b92 100644 --- a/app/src/main/java/com/gh/gamecenter/UserInfoEditActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/UserInfoEditActivity.kt @@ -5,7 +5,7 @@ import android.content.Intent import android.os.Bundle import com.gh.gamecenter.common.base.activity.ToolBarActivity import com.gh.gamecenter.common.constant.EntranceConsts -import com.gh.gamecenter.user.UserViewModel +import com.gh.gamecenter.login.user.UserViewModel import com.halo.assistant.fragment.user.UserInfoEditFragment class UserInfoEditActivity : ToolBarActivity() { diff --git a/app/src/main/java/com/gh/gamecenter/WebActivity.kt b/app/src/main/java/com/gh/gamecenter/WebActivity.kt index fc1439692e..5d4a458788 100644 --- a/app/src/main/java/com/gh/gamecenter/WebActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/WebActivity.kt @@ -2,8 +2,6 @@ package com.gh.gamecenter import android.content.Context import android.content.Intent -import android.content.pm.ActivityInfo -import android.os.Build import android.os.Bundle import android.text.TextUtils import android.view.KeyEvent @@ -17,7 +15,7 @@ import com.gh.gamecenter.common.utils.EnvHelper import com.gh.gamecenter.common.utils.updateStatusBarColor import com.gh.gamecenter.entity.ConcernEntity import com.gh.gamecenter.entity.NewsEntity -import com.gh.gamecenter.entity.ToolBoxEntity +import com.gh.gamecenter.common.entity.ToolBoxEntity import com.halo.assistant.fragment.WebFragment @Route(path = RouteConsts.activity.webActivity) diff --git a/app/src/main/java/com/gh/gamecenter/WeiBoShareActivity.java b/app/src/main/java/com/gh/gamecenter/WeiBoShareActivity.java index 7d05b14748..48aef9956c 100644 --- a/app/src/main/java/com/gh/gamecenter/WeiBoShareActivity.java +++ b/app/src/main/java/com/gh/gamecenter/WeiBoShareActivity.java @@ -21,7 +21,7 @@ import androidx.annotation.NonNull; import com.alibaba.android.arouter.facade.annotation.Route; import com.gh.common.constant.Config; -import com.gh.common.util.EnergyTaskHelper; +import com.gh.gamecenter.energy.utils.EnergyTaskHelper; import com.gh.common.util.IntegralLogHelper; import com.gh.gamecenter.common.callback.BiCallback; import com.gh.gamecenter.common.constant.RouteConsts; diff --git a/app/src/main/java/com/gh/gamecenter/adapter/ImagePagerAdapter.java b/app/src/main/java/com/gh/gamecenter/adapter/ImagePagerAdapter.java index f49c1855d5..abc5519611 100644 --- a/app/src/main/java/com/gh/gamecenter/adapter/ImagePagerAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/adapter/ImagePagerAdapter.java @@ -25,7 +25,7 @@ import com.gh.gamecenter.core.utils.StringUtils; import com.gh.gamecenter.MainActivity; import com.gh.gamecenter.R; import com.gh.gamecenter.entity.GameEntity; -import com.gh.gamecenter.entity.LinkEntity; +import com.gh.gamecenter.common.entity.LinkEntity; import com.gh.gamecenter.entity.SubjectRecommendEntity; import com.gh.gamecenter.game.data.GameItemData; diff --git a/app/src/main/java/com/gh/gamecenter/adapter/ToolBoxRvAdapter.java b/app/src/main/java/com/gh/gamecenter/adapter/ToolBoxRvAdapter.java index 6f50c533cc..b965849e78 100644 --- a/app/src/main/java/com/gh/gamecenter/adapter/ToolBoxRvAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/adapter/ToolBoxRvAdapter.java @@ -17,7 +17,7 @@ import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; import com.gh.gamecenter.adapter.viewholder.ReuseViewHolder; import com.gh.gamecenter.adapter.viewholder.ToolBoxViewHolder; import com.gh.gamecenter.databinding.ToolboxItemBinding; -import com.gh.gamecenter.entity.ToolBoxEntity; +import com.gh.gamecenter.common.entity.ToolBoxEntity; import com.gh.gamecenter.common.retrofit.Response; import com.gh.gamecenter.retrofit.RetrofitManager; import com.gh.gamecenter.suggest.SuggestType; diff --git a/app/src/main/java/com/gh/gamecenter/adapter/viewholder/DetailViewHolder.java b/app/src/main/java/com/gh/gamecenter/adapter/viewholder/DetailViewHolder.java index 6bf8c23eb7..69a8951dc5 100644 --- a/app/src/main/java/com/gh/gamecenter/adapter/viewholder/DetailViewHolder.java +++ b/app/src/main/java/com/gh/gamecenter/adapter/viewholder/DetailViewHolder.java @@ -32,7 +32,7 @@ import com.gh.common.simulator.SimulatorGameManager; import com.gh.common.util.CheckLoginUtils; import com.gh.common.util.DetailDownloadUtils; import com.gh.common.util.DialogUtils; -import com.gh.common.util.EnergyTaskHelper; +import com.gh.gamecenter.energy.utils.EnergyTaskHelper; import com.gh.common.util.LogUtils; import com.gh.common.util.PackageInstaller; import com.gh.common.util.PackageUtils; @@ -51,8 +51,8 @@ import com.gh.gamecenter.core.utils.MtaHelper; import com.gh.gamecenter.core.utils.StringUtils; import com.gh.gamecenter.entity.ApkEntity; import com.gh.gamecenter.entity.GameEntity; -import com.gh.gamecenter.entity.LinkEntity; -import com.gh.gamecenter.eventbus.EBReuse; +import com.gh.gamecenter.common.entity.LinkEntity; +import com.gh.gamecenter.common.eventbus.EBReuse; import com.gh.gamecenter.eventbus.EBScroll; import com.gh.gamecenter.gamedetail.GameDetailFragment; import com.gh.gamecenter.gamedetail.dialog.GamePermissionDialogFragment; diff --git a/app/src/main/java/com/gh/gamecenter/adapter/viewholder/FooterViewHolder.java b/app/src/main/java/com/gh/gamecenter/adapter/viewholder/FooterViewHolder.java index 5d321ece06..33c3c79ba8 100644 --- a/app/src/main/java/com/gh/gamecenter/adapter/viewholder/FooterViewHolder.java +++ b/app/src/main/java/com/gh/gamecenter/adapter/viewholder/FooterViewHolder.java @@ -11,8 +11,8 @@ import com.gh.gamecenter.common.base.BaseRecyclerViewHolder; import com.gh.gamecenter.common.base.activity.BaseActivity; import com.gh.gamecenter.common.callback.OnListClickListener; import com.gh.gamecenter.R; -import com.gh.gamecenter.baselist.ListViewModel; -import com.gh.gamecenter.baselist.LoadType; +import com.gh.gamecenter.common.baselist.ListViewModel; +import com.gh.gamecenter.common.baselist.LoadType; import java.util.ArrayList; diff --git a/app/src/main/java/com/gh/gamecenter/adapter/viewholder/ToolBoxViewHolder.java b/app/src/main/java/com/gh/gamecenter/adapter/viewholder/ToolBoxViewHolder.java index 889b4f7ed4..8581502297 100644 --- a/app/src/main/java/com/gh/gamecenter/adapter/viewholder/ToolBoxViewHolder.java +++ b/app/src/main/java/com/gh/gamecenter/adapter/viewholder/ToolBoxViewHolder.java @@ -3,7 +3,7 @@ package com.gh.gamecenter.adapter.viewholder; import com.gh.gamecenter.common.base.BaseRecyclerViewHolder; import com.gh.gamecenter.common.callback.OnListClickListener; import com.gh.gamecenter.databinding.ToolboxItemBinding; -import com.gh.gamecenter.entity.ToolBoxEntity; +import com.gh.gamecenter.common.entity.ToolBoxEntity; /** * Created by khy on 24/05/17. diff --git a/app/src/main/java/com/gh/gamecenter/amway/AmwayAdapter.kt b/app/src/main/java/com/gh/gamecenter/amway/AmwayAdapter.kt index 6f9a566314..e1e0159db4 100644 --- a/app/src/main/java/com/gh/gamecenter/amway/AmwayAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/amway/AmwayAdapter.kt @@ -17,7 +17,7 @@ import com.gh.common.util.NewLogUtils import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.callback.ConfirmListener import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.* diff --git a/app/src/main/java/com/gh/gamecenter/amway/AmwayFragment.kt b/app/src/main/java/com/gh/gamecenter/amway/AmwayFragment.kt index a1514979d0..c1edcc2da6 100644 --- a/app/src/main/java/com/gh/gamecenter/amway/AmwayFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/amway/AmwayFragment.kt @@ -17,8 +17,9 @@ import com.gh.common.xapk.XapkUnzipStatus import com.gh.download.DownloadManager import com.gh.gamecenter.R import com.gh.gamecenter.amway.search.AmwaySearchActivity -import com.gh.gamecenter.baselist.LazyListFragment -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.LazyListFragment +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.common.view.VerticalItemDecoration @@ -31,10 +32,9 @@ import com.gh.gamecenter.databinding.FragmentAmwayBinding import com.gh.gamecenter.entity.RatingComment import com.gh.gamecenter.eventbus.EBDownloadStatus import com.gh.gamecenter.eventbus.EBPackage -import com.gh.gamecenter.eventbus.EBReuse +import com.gh.gamecenter.common.eventbus.EBReuse import com.gh.gamecenter.fragment.HomeSearchToolWrapperFragment import com.gh.gamecenter.gamedetail.rating.RatingFragment -import com.gh.gamecenter.personal.PersonalFragment import com.google.android.material.appbar.AppBarLayout import com.lightgame.download.DataWatcher import com.lightgame.download.DownloadEntity @@ -290,7 +290,7 @@ class AmwayFragment : LazyListFragment() { fun onEventMainThread(reuse: EBReuse) { if ("Refresh" == reuse.type) { mAdapter?.notifyDataSetChanged() - } else if (reuse.type == PersonalFragment.LOGIN_TAG) { // 登入 + } else if (reuse.type == Constants.LOGIN_TAG) { // 登入 scrollToTop() mViewModel.initData(false) } diff --git a/app/src/main/java/com/gh/gamecenter/amway/AmwayViewModel.kt b/app/src/main/java/com/gh/gamecenter/amway/AmwayViewModel.kt index faa97c4101..fbb97664dc 100644 --- a/app/src/main/java/com/gh/gamecenter/amway/AmwayViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/amway/AmwayViewModel.kt @@ -4,9 +4,9 @@ import android.annotation.SuppressLint import android.app.Application import com.gh.common.util.* import com.gh.download.DownloadManager -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.baselist.LoadStatus -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.entity.AmwayCommentEntity import com.gh.gamecenter.entity.GameEntity @@ -16,6 +16,7 @@ import com.gh.gamecenter.home.LegacyHomeItemData import com.gh.gamecenter.home.LegacyHomeSubjectTransformer import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.common.retrofit.Response +import com.gh.gamecenter.energy.utils.EnergyTaskHelper import com.gh.gamecenter.retrofit.RetrofitManager import com.lightgame.utils.Utils import io.reactivex.Observable diff --git a/app/src/main/java/com/gh/gamecenter/amway/search/AmwaySearchAdapter.kt b/app/src/main/java/com/gh/gamecenter/amway/search/AmwaySearchAdapter.kt index e7ef0672a1..7f302339df 100644 --- a/app/src/main/java/com/gh/gamecenter/amway/search/AmwaySearchAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/amway/search/AmwaySearchAdapter.kt @@ -4,7 +4,7 @@ import android.content.Context import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.common.utils.toBinding -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.entity.GameEntity class AmwaySearchAdapter(context: Context, val mViewModel: AmwaySearchViewModel) : ListAdapter(context) { diff --git a/app/src/main/java/com/gh/gamecenter/amway/search/AmwaySearchListFragment.kt b/app/src/main/java/com/gh/gamecenter/amway/search/AmwaySearchListFragment.kt index 47f3a78370..7d685eae36 100644 --- a/app/src/main/java/com/gh/gamecenter/amway/search/AmwaySearchListFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/amway/search/AmwaySearchListFragment.kt @@ -6,7 +6,7 @@ import androidx.recyclerview.widget.LinearLayoutManager import com.gh.gamecenter.common.utils.observeNonNull import com.gh.gamecenter.common.utils.viewModelProviderFromParent import com.gh.gamecenter.SuggestionActivity -import com.gh.gamecenter.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.LoadStatus import com.gh.gamecenter.databinding.FragmentAmwaySearchBinding import com.gh.gamecenter.common.base.fragment.ToolbarFragment import com.gh.gamecenter.suggest.SuggestType diff --git a/app/src/main/java/com/gh/gamecenter/amway/search/AmwaySearchViewModel.kt b/app/src/main/java/com/gh/gamecenter/amway/search/AmwaySearchViewModel.kt index 6ad48969f8..b9ba43cea2 100644 --- a/app/src/main/java/com/gh/gamecenter/amway/search/AmwaySearchViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/amway/search/AmwaySearchViewModel.kt @@ -8,9 +8,9 @@ import androidx.lifecycle.MutableLiveData import com.gh.common.constant.Config import com.gh.common.util.PackageHelper import com.gh.gamecenter.BuildConfig -import com.gh.gamecenter.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.LoadStatus import com.gh.gamecenter.entity.GameEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/gamecenter/catalog/NewCatalogListAdapter.kt b/app/src/main/java/com/gh/gamecenter/catalog/NewCatalogListAdapter.kt index 6e1f3e118b..e82024b1ff 100644 --- a/app/src/main/java/com/gh/gamecenter/catalog/NewCatalogListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/catalog/NewCatalogListAdapter.kt @@ -14,7 +14,7 @@ import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.core.utils.StringUtils import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.utils.toBinding diff --git a/app/src/main/java/com/gh/gamecenter/catalog/NewCatalogListFragment.kt b/app/src/main/java/com/gh/gamecenter/catalog/NewCatalogListFragment.kt index 0c94c8485a..d472aa975a 100644 --- a/app/src/main/java/com/gh/gamecenter/catalog/NewCatalogListFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/catalog/NewCatalogListFragment.kt @@ -11,10 +11,10 @@ import com.gh.common.xapk.XapkInstaller import com.gh.common.xapk.XapkUnzipStatus import com.gh.download.DownloadManager import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListFragment import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.observeNonNull +import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.common.utils.viewModelProvider import com.gh.gamecenter.databinding.FragmentCatalogListBinding diff --git a/app/src/main/java/com/gh/gamecenter/catalog/NewCatalogListViewModel.kt b/app/src/main/java/com/gh/gamecenter/catalog/NewCatalogListViewModel.kt index 08b3ab6212..6596d1b0d7 100644 --- a/app/src/main/java/com/gh/gamecenter/catalog/NewCatalogListViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/catalog/NewCatalogListViewModel.kt @@ -6,7 +6,7 @@ import com.gh.gamecenter.common.entity.ExposureEntity import com.gh.common.exposure.ExposureUtils import com.gh.gamecenter.core.utils.UrlFilterUtils import com.gh.common.view.CatalogFilterView -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.entity.CatalogEntity import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.entity.SubjectSettingEntity diff --git a/app/src/main/java/com/gh/gamecenter/catalog/SpecialCatalogAdapter.kt b/app/src/main/java/com/gh/gamecenter/catalog/SpecialCatalogAdapter.kt index a6095309ba..878841d3ec 100644 --- a/app/src/main/java/com/gh/gamecenter/catalog/SpecialCatalogAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/catalog/SpecialCatalogAdapter.kt @@ -19,7 +19,7 @@ import com.gh.common.exposure.IExposable import com.gh.common.util.* import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.PageSwitchDataHelper import com.gh.gamecenter.databinding.* diff --git a/app/src/main/java/com/gh/gamecenter/catalog/SpecialCatalogFragment.kt b/app/src/main/java/com/gh/gamecenter/catalog/SpecialCatalogFragment.kt index 7c9788fbc6..de7b696ae7 100644 --- a/app/src/main/java/com/gh/gamecenter/catalog/SpecialCatalogFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/catalog/SpecialCatalogFragment.kt @@ -8,7 +8,7 @@ import com.gh.common.exposure.ExposureListener import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.viewModelProvider import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListFragment +import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.databinding.FragmentListBaseSkeletonBinding diff --git a/app/src/main/java/com/gh/gamecenter/catalog/SpecialCatalogSubjectCollectionAdapter.kt b/app/src/main/java/com/gh/gamecenter/catalog/SpecialCatalogSubjectCollectionAdapter.kt index 3fda30c261..6f5499c33c 100644 --- a/app/src/main/java/com/gh/gamecenter/catalog/SpecialCatalogSubjectCollectionAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/catalog/SpecialCatalogSubjectCollectionAdapter.kt @@ -10,7 +10,7 @@ import com.gh.gamecenter.common.utils.toBinding import com.gh.gamecenter.common.view.WrapContentDraweeView import com.gh.gamecenter.databinding.CatalogSubjectCollectionListItemBinding import com.gh.gamecenter.entity.GameEntity -import com.gh.gamecenter.entity.LinkEntity +import com.gh.gamecenter.common.entity.LinkEntity import com.lightgame.adapter.BaseRecyclerAdapter class SpecialCatalogSubjectCollectionAdapter(context: Context, diff --git a/app/src/main/java/com/gh/gamecenter/catalog/SpecialCatalogViewModel.kt b/app/src/main/java/com/gh/gamecenter/catalog/SpecialCatalogViewModel.kt index 839dbe5833..dec8e0625c 100644 --- a/app/src/main/java/com/gh/gamecenter/catalog/SpecialCatalogViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/catalog/SpecialCatalogViewModel.kt @@ -6,7 +6,7 @@ import androidx.lifecycle.ViewModelProvider import com.gh.gamecenter.common.entity.ExposureEntity import com.gh.common.exposure.ExposureSource import com.gh.common.util.LogUtils -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.entity.SpecialCatalogEntity import com.gh.gamecenter.retrofit.RetrofitManager import com.halo.assistant.HaloApp diff --git a/app/src/main/java/com/gh/gamecenter/category/CategoryDirectoryAdapter.kt b/app/src/main/java/com/gh/gamecenter/category/CategoryDirectoryAdapter.kt index 21a866b1d7..73e9dd4614 100644 --- a/app/src/main/java/com/gh/gamecenter/category/CategoryDirectoryAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/category/CategoryDirectoryAdapter.kt @@ -7,7 +7,7 @@ import android.widget.LinearLayout import androidx.recyclerview.widget.RecyclerView import com.gh.common.view.SubCategoryView import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.category.CategoryListActivity.Companion.getIntent import com.gh.gamecenter.common.utils.ImageUtils import com.gh.gamecenter.common.utils.toBinding diff --git a/app/src/main/java/com/gh/gamecenter/category/CategoryDirectoryFragment.kt b/app/src/main/java/com/gh/gamecenter/category/CategoryDirectoryFragment.kt index 74e69f6c46..fb08da6dde 100644 --- a/app/src/main/java/com/gh/gamecenter/category/CategoryDirectoryFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/category/CategoryDirectoryFragment.kt @@ -9,7 +9,7 @@ import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.common.view.VerticalItemDecoration import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.LazyListFragment +import com.gh.gamecenter.common.baselist.LazyListFragment import com.gh.gamecenter.databinding.FragmentListBaseSkeletonBinding import com.gh.gamecenter.entity.CategoryEntity diff --git a/app/src/main/java/com/gh/gamecenter/category/CategoryDirectoryListViewModel.kt b/app/src/main/java/com/gh/gamecenter/category/CategoryDirectoryListViewModel.kt index d8e4464000..48fd020450 100644 --- a/app/src/main/java/com/gh/gamecenter/category/CategoryDirectoryListViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/category/CategoryDirectoryListViewModel.kt @@ -1,7 +1,7 @@ package com.gh.gamecenter.category import android.app.Application -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.entity.CategoryEntity import com.gh.gamecenter.retrofit.RetrofitManager import io.reactivex.Observable diff --git a/app/src/main/java/com/gh/gamecenter/category/NewCategoryListAdapter.kt b/app/src/main/java/com/gh/gamecenter/category/NewCategoryListAdapter.kt index 8ca25035a6..a95e89a71c 100644 --- a/app/src/main/java/com/gh/gamecenter/category/NewCategoryListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/category/NewCategoryListAdapter.kt @@ -17,7 +17,7 @@ import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.eventbus.EBDownloadStatus import com.gh.gamecenter.game.GameItemViewHolder diff --git a/app/src/main/java/com/gh/gamecenter/category/NewCategoryListFragment.kt b/app/src/main/java/com/gh/gamecenter/category/NewCategoryListFragment.kt index 15acd24cf0..703ab589fd 100644 --- a/app/src/main/java/com/gh/gamecenter/category/NewCategoryListFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/category/NewCategoryListFragment.kt @@ -11,9 +11,9 @@ import com.gh.common.xapk.XapkInstaller import com.gh.common.xapk.XapkUnzipStatus import com.gh.download.DownloadManager import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.ListFragment import com.gh.gamecenter.common.constant.Constants +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.observeNonNull import com.gh.gamecenter.common.utils.toColor diff --git a/app/src/main/java/com/gh/gamecenter/category/NewCategoryListViewModel.kt b/app/src/main/java/com/gh/gamecenter/category/NewCategoryListViewModel.kt index 1edf8a7077..6079394f0d 100644 --- a/app/src/main/java/com/gh/gamecenter/category/NewCategoryListViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/category/NewCategoryListViewModel.kt @@ -5,7 +5,7 @@ import androidx.lifecycle.MutableLiveData import com.gh.common.exposure.ExposureUtils import com.gh.gamecenter.core.utils.UrlFilterUtils import com.gh.common.view.ConfigFilterView -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.entity.CategoryEntity import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.entity.SubjectSettingEntity diff --git a/app/src/main/java/com/gh/gamecenter/category2/CategoryV2ListAdapter.kt b/app/src/main/java/com/gh/gamecenter/category2/CategoryV2ListAdapter.kt index d612c7b9c3..d9db4ba903 100644 --- a/app/src/main/java/com/gh/gamecenter/category2/CategoryV2ListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/category2/CategoryV2ListAdapter.kt @@ -18,7 +18,7 @@ import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.utils.toBinding import com.gh.gamecenter.common.utils.toColor diff --git a/app/src/main/java/com/gh/gamecenter/category2/CategoryV2ListFragment.kt b/app/src/main/java/com/gh/gamecenter/category2/CategoryV2ListFragment.kt index a6552429e4..40f90c6a4a 100644 --- a/app/src/main/java/com/gh/gamecenter/category2/CategoryV2ListFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/category2/CategoryV2ListFragment.kt @@ -4,6 +4,7 @@ import android.os.Bundle import android.view.View import android.view.ViewGroup import com.ethanhua.skeleton.Skeleton +import com.gh.gamecenter.common.constant.Constants import com.gh.common.exposure.ExposureListener import com.gh.common.util.DialogUtils import com.gh.common.view.CategoryFilterView @@ -11,8 +12,7 @@ import com.gh.common.xapk.XapkInstaller import com.gh.common.xapk.XapkUnzipStatus import com.gh.download.DownloadManager import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListFragment -import com.gh.gamecenter.common.constant.Constants +import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.databinding.FragmentCategoryListBinding diff --git a/app/src/main/java/com/gh/gamecenter/category2/CategoryV2ListViewModel.kt b/app/src/main/java/com/gh/gamecenter/category2/CategoryV2ListViewModel.kt index afc2bce771..e002248f8f 100644 --- a/app/src/main/java/com/gh/gamecenter/category2/CategoryV2ListViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/category2/CategoryV2ListViewModel.kt @@ -9,7 +9,7 @@ import com.gh.common.exposure.ExposureSource import com.gh.common.exposure.ExposureUtils import com.gh.gamecenter.core.utils.UrlFilterUtils import com.gh.common.view.CategoryFilterView -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.entity.SubjectSettingEntity import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/gamecenter/collection/AnswerAdapter.java b/app/src/main/java/com/gh/gamecenter/collection/AnswerAdapter.java index 4f52920db5..8b48db17fe 100644 --- a/app/src/main/java/com/gh/gamecenter/collection/AnswerAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/collection/AnswerAdapter.java @@ -17,8 +17,8 @@ import com.gh.gamecenter.common.utils.ExtensionsKt; import com.gh.gamecenter.core.utils.DisplayUtils; import com.gh.gamecenter.R; import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; -import com.gh.gamecenter.baselist.ListAdapter; -import com.gh.gamecenter.baselist.LoadType; +import com.gh.gamecenter.common.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.LoadType; import com.gh.gamecenter.databinding.CommunityAnswerItemBinding; import com.gh.gamecenter.databinding.PopupHistoryOptionBinding; import com.gh.gamecenter.history.ManageOption; diff --git a/app/src/main/java/com/gh/gamecenter/collection/AnswerFragment.java b/app/src/main/java/com/gh/gamecenter/collection/AnswerFragment.java index 3f71493869..78b767c38a 100644 --- a/app/src/main/java/com/gh/gamecenter/collection/AnswerFragment.java +++ b/app/src/main/java/com/gh/gamecenter/collection/AnswerFragment.java @@ -13,9 +13,9 @@ import com.gh.common.util.CollectionUtils; import com.gh.gamecenter.common.constant.EntranceConsts; import com.gh.gamecenter.common.view.CustomDividerItemDecoration; import com.gh.gamecenter.R; -import com.gh.gamecenter.baselist.ListAdapter; -import com.gh.gamecenter.baselist.ListFragment; -import com.gh.gamecenter.baselist.LoadType; +import com.gh.gamecenter.common.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.ListFragment; +import com.gh.gamecenter.common.baselist.LoadType; import com.gh.gamecenter.eventbus.EBCollectionChanged; import com.gh.gamecenter.history.IBatchDelete; import com.gh.gamecenter.history.ManageOption; diff --git a/app/src/main/java/com/gh/gamecenter/collection/AnswerViewModel.kt b/app/src/main/java/com/gh/gamecenter/collection/AnswerViewModel.kt index ecd336bc1d..a5dabd1f86 100644 --- a/app/src/main/java/com/gh/gamecenter/collection/AnswerViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/collection/AnswerViewModel.kt @@ -5,9 +5,9 @@ import android.app.Application import com.gh.gamecenter.core.AppExecutor import com.gh.common.history.HistoryDatabase import com.gh.common.history.HistoryHelper -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.baselist.LoadType -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.LoadType +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.qa.entity.AnswerEntity import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/gamecenter/collection/ArticleAdapter.java b/app/src/main/java/com/gh/gamecenter/collection/ArticleAdapter.java index e24f38d357..9d48840699 100644 --- a/app/src/main/java/com/gh/gamecenter/collection/ArticleAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/collection/ArticleAdapter.java @@ -25,7 +25,7 @@ import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; import com.gh.gamecenter.adapter.viewholder.NewsImage1ViewHolder; import com.gh.gamecenter.adapter.viewholder.NewsImage2ViewHolder; import com.gh.gamecenter.adapter.viewholder.NewsImage3ViewHolder; -import com.gh.gamecenter.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.ListAdapter; import com.gh.gamecenter.databinding.NewsImage1ItemBinding; import com.gh.gamecenter.databinding.NewsImage2ItemBinding; import com.gh.gamecenter.databinding.NewsImage3ItemBinding; diff --git a/app/src/main/java/com/gh/gamecenter/collection/ArticleFragment.java b/app/src/main/java/com/gh/gamecenter/collection/ArticleFragment.java index 2bf368e615..00ac1b2293 100644 --- a/app/src/main/java/com/gh/gamecenter/collection/ArticleFragment.java +++ b/app/src/main/java/com/gh/gamecenter/collection/ArticleFragment.java @@ -15,9 +15,9 @@ import com.gh.gamecenter.common.constant.EntranceConsts; import com.gh.gamecenter.common.view.CustomDividerItemDecoration; import com.gh.gamecenter.NewsDetailActivity; import com.gh.gamecenter.R; -import com.gh.gamecenter.baselist.ListAdapter; -import com.gh.gamecenter.baselist.ListFragment; -import com.gh.gamecenter.baselist.LoadType; +import com.gh.gamecenter.common.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.ListFragment; +import com.gh.gamecenter.common.baselist.LoadType; import com.gh.gamecenter.entity.NewsEntity; import com.gh.gamecenter.eventbus.EBCollectionChanged; import com.gh.gamecenter.history.IBatchDelete; diff --git a/app/src/main/java/com/gh/gamecenter/collection/ArticleViewModel.java b/app/src/main/java/com/gh/gamecenter/collection/ArticleViewModel.java index 2ccd953e6a..a4adf33b18 100644 --- a/app/src/main/java/com/gh/gamecenter/collection/ArticleViewModel.java +++ b/app/src/main/java/com/gh/gamecenter/collection/ArticleViewModel.java @@ -6,12 +6,12 @@ import com.gh.gamecenter.core.AppExecutor; import com.gh.common.history.HistoryDatabase; import com.gh.common.history.HistoryHelper; import com.gh.gamecenter.core.utils.UrlFilterUtils; -import com.gh.gamecenter.baselist.ListViewModel; -import com.gh.gamecenter.baselist.LoadType; +import com.gh.gamecenter.common.baselist.ListViewModel; +import com.gh.gamecenter.common.baselist.LoadType; import com.gh.gamecenter.entity.NewsEntity; import com.gh.gamecenter.entity.ViewsEntity; import com.gh.gamecenter.info.NewsViewsRepository; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.user.UserManager; import com.gh.gamecenter.retrofit.RetrofitManager; import java.util.ArrayList; diff --git a/app/src/main/java/com/gh/gamecenter/collection/CollectionWrapperFragment.java b/app/src/main/java/com/gh/gamecenter/collection/CollectionWrapperFragment.java index 368a5cae60..68580fbb07 100644 --- a/app/src/main/java/com/gh/gamecenter/collection/CollectionWrapperFragment.java +++ b/app/src/main/java/com/gh/gamecenter/collection/CollectionWrapperFragment.java @@ -7,7 +7,7 @@ import com.gh.gamecenter.common.base.fragment.BaseFragment_TabLayout; import com.gh.gamecenter.common.constant.EntranceConsts; import com.gh.gamecenter.core.utils.MtaHelper; import com.gh.gamecenter.R; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.user.UserManager; import java.util.List; diff --git a/app/src/main/java/com/gh/gamecenter/collection/CommunityArticleAdapter.kt b/app/src/main/java/com/gh/gamecenter/collection/CommunityArticleAdapter.kt index 91df199a22..8e9266176e 100644 --- a/app/src/main/java/com/gh/gamecenter/collection/CommunityArticleAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/collection/CommunityArticleAdapter.kt @@ -13,11 +13,11 @@ import com.gh.gamecenter.common.constant.ItemViewType import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.databinding.CommunityAnswerItemBinding import com.gh.gamecenter.databinding.PopupHistoryOptionBinding -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.history.ManageOption import com.gh.gamecenter.qa.answer.CommunityAnswerItemViewHolder import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity diff --git a/app/src/main/java/com/gh/gamecenter/collection/CommunityArticleFragment.kt b/app/src/main/java/com/gh/gamecenter/collection/CommunityArticleFragment.kt index 32fbbf2bf2..01549a877b 100644 --- a/app/src/main/java/com/gh/gamecenter/collection/CommunityArticleFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/collection/CommunityArticleFragment.kt @@ -9,8 +9,8 @@ import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.common.utils.toDrawable import com.gh.gamecenter.common.view.CustomDividerItemDecoration import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListFragment -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListFragment +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.eventbus.EBCollectionChanged import com.gh.gamecenter.history.IBatchDelete import com.gh.gamecenter.history.ManageOption diff --git a/app/src/main/java/com/gh/gamecenter/collection/CommunityArticleViewModel.kt b/app/src/main/java/com/gh/gamecenter/collection/CommunityArticleViewModel.kt index d3a958dda0..db5b170b0f 100644 --- a/app/src/main/java/com/gh/gamecenter/collection/CommunityArticleViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/collection/CommunityArticleViewModel.kt @@ -6,9 +6,9 @@ import com.gh.gamecenter.core.AppExecutor import com.gh.common.history.HistoryDatabase import com.gh.common.history.HistoryHelper import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.baselist.LoadType -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.LoadType +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.qa.entity.AnswerEntity import com.gh.gamecenter.qa.entity.ArticleEntity import com.gh.gamecenter.common.retrofit.BiResponse diff --git a/app/src/main/java/com/gh/gamecenter/collection/GamesCollectionAdapter.kt b/app/src/main/java/com/gh/gamecenter/collection/GamesCollectionAdapter.kt index b1eef762d2..39e6e5b897 100644 --- a/app/src/main/java/com/gh/gamecenter/collection/GamesCollectionAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/collection/GamesCollectionAdapter.kt @@ -21,7 +21,7 @@ import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameCollectionItemViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.collection.GamesCollectionFragment.Companion.TYPE_USER import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* @@ -32,7 +32,7 @@ import com.gh.gamecenter.entity.TagInfoEntity import com.gh.gamecenter.gamecollection.detail.GameCollectionDetailActivity import com.gh.gamecenter.gamecollection.publish.GameCollectionEditActivity import com.gh.gamecenter.history.ManageOption -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.google.android.flexbox.FlexboxLayout class GamesCollectionAdapter( diff --git a/app/src/main/java/com/gh/gamecenter/collection/GamesCollectionFragment.kt b/app/src/main/java/com/gh/gamecenter/collection/GamesCollectionFragment.kt index afc5c8f322..efcb772921 100644 --- a/app/src/main/java/com/gh/gamecenter/collection/GamesCollectionFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/collection/GamesCollectionFragment.kt @@ -6,13 +6,13 @@ import androidx.core.content.ContextCompat import com.gh.gamecenter.common.constant.EntranceConsts.* import com.gh.gamecenter.common.view.SpacingItemDecoration import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListFragment -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListFragment +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.common.utils.viewModelProvider import com.gh.gamecenter.entity.GamesCollectionEntity -import com.gh.gamecenter.eventbus.EBReuse +import com.gh.gamecenter.common.eventbus.EBReuse import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode import com.gh.gamecenter.history.IBatchDelete diff --git a/app/src/main/java/com/gh/gamecenter/collection/GamesCollectionViewModel.kt b/app/src/main/java/com/gh/gamecenter/collection/GamesCollectionViewModel.kt index 1730b6dd71..4f0ec5aeff 100644 --- a/app/src/main/java/com/gh/gamecenter/collection/GamesCollectionViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/collection/GamesCollectionViewModel.kt @@ -12,8 +12,8 @@ import com.gh.common.util.ErrorHelper import com.gh.gamecenter.core.utils.ToastUtils import com.gh.gamecenter.common.utils.observableToMain import com.gh.gamecenter.common.utils.singleToMain -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.collection.GamesCollectionFragment.Companion.TYPE_COLLECT import com.gh.gamecenter.collection.GamesCollectionFragment.Companion.TYPE_HISTORY import com.gh.gamecenter.entity.GamesCollectionEntity diff --git a/app/src/main/java/com/gh/gamecenter/collection/ToolsAdapter.java b/app/src/main/java/com/gh/gamecenter/collection/ToolsAdapter.java index 632299d602..6920097b91 100644 --- a/app/src/main/java/com/gh/gamecenter/collection/ToolsAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/collection/ToolsAdapter.java @@ -11,9 +11,9 @@ import com.gh.gamecenter.common.utils.ImageUtils; import com.gh.gamecenter.R; import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; import com.gh.gamecenter.adapter.viewholder.ToolBoxViewHolder; -import com.gh.gamecenter.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.ListAdapter; import com.gh.gamecenter.databinding.ToolboxItemBinding; -import com.gh.gamecenter.entity.ToolBoxEntity; +import com.gh.gamecenter.common.entity.ToolBoxEntity; import java.util.ArrayList; import java.util.List; diff --git a/app/src/main/java/com/gh/gamecenter/collection/ToolsFragment.java b/app/src/main/java/com/gh/gamecenter/collection/ToolsFragment.java index 38d0911482..8bad1b7e0d 100644 --- a/app/src/main/java/com/gh/gamecenter/collection/ToolsFragment.java +++ b/app/src/main/java/com/gh/gamecenter/collection/ToolsFragment.java @@ -15,13 +15,13 @@ import com.gh.gamecenter.common.view.CustomDividerItemDecoration; import com.gh.gamecenter.NewsDetailActivity; import com.gh.gamecenter.R; import com.gh.gamecenter.WebActivity; -import com.gh.gamecenter.baselist.ListAdapter; -import com.gh.gamecenter.baselist.ListFragment; -import com.gh.gamecenter.baselist.LoadType; -import com.gh.gamecenter.baselist.NormalListViewModel; -import com.gh.gamecenter.entity.ToolBoxEntity; +import com.gh.gamecenter.common.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.ListFragment; +import com.gh.gamecenter.common.baselist.LoadType; +import com.gh.gamecenter.common.baselist.NormalListViewModel; +import com.gh.gamecenter.common.entity.ToolBoxEntity; import com.gh.gamecenter.eventbus.EBCollectionChanged; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.user.UserManager; import com.gh.gamecenter.retrofit.RetrofitManager; import org.greenrobot.eventbus.Subscribe; diff --git a/app/src/main/java/com/gh/gamecenter/collection/VideoAdapter.kt b/app/src/main/java/com/gh/gamecenter/collection/VideoAdapter.kt index 118bc0375e..6213f6ab36 100644 --- a/app/src/main/java/com/gh/gamecenter/collection/VideoAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/collection/VideoAdapter.kt @@ -15,7 +15,7 @@ import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.* import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.databinding.PopupHistoryOptionBinding import com.gh.gamecenter.databinding.VideoNewItemBinding diff --git a/app/src/main/java/com/gh/gamecenter/collection/VideoFragment.kt b/app/src/main/java/com/gh/gamecenter/collection/VideoFragment.kt index 7c38ab9202..51a68bb981 100644 --- a/app/src/main/java/com/gh/gamecenter/collection/VideoFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/collection/VideoFragment.kt @@ -8,7 +8,7 @@ import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.utils.viewModelProvider import com.gh.gamecenter.common.view.GridSpacingItemDecoration -import com.gh.gamecenter.baselist.ListFragment +import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.entity.MyVideoEntity import com.gh.gamecenter.history.IBatchDelete import com.gh.gamecenter.history.ManageOption diff --git a/app/src/main/java/com/gh/gamecenter/collection/VideoViewModel.kt b/app/src/main/java/com/gh/gamecenter/collection/VideoViewModel.kt index b897744744..64489ca1ef 100644 --- a/app/src/main/java/com/gh/gamecenter/collection/VideoViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/collection/VideoViewModel.kt @@ -6,12 +6,12 @@ import com.gh.common.constant.Config import com.gh.common.history.HistoryDatabase import com.gh.common.history.HistoryHelper import com.gh.gamecenter.core.utils.UrlFilterUtils -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.entity.MyVideoEntity import com.gh.gamecenter.entity.PersonalHistoryEntity import com.gh.gamecenter.entity.User -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.retrofit.RetrofitManager import com.halo.assistant.HaloApp import io.reactivex.Observable diff --git a/app/src/main/java/com/gh/gamecenter/douyinapi/DouYinEntryActivity.java b/app/src/main/java/com/gh/gamecenter/douyinapi/DouYinEntryActivity.java index 70584ff83a..d246111aae 100644 --- a/app/src/main/java/com/gh/gamecenter/douyinapi/DouYinEntryActivity.java +++ b/app/src/main/java/com/gh/gamecenter/douyinapi/DouYinEntryActivity.java @@ -12,7 +12,7 @@ //import com.bytedance.sdk.open.aweme.common.model.BaseResp; //import com.bytedance.sdk.open.douyin.DouYinOpenApiFactory; //import com.bytedance.sdk.open.douyin.api.DouYinOpenApi; -//import com.gh.common.util.LoginHelper; +//import com.gh.gamecenter.login.utils.LoginHelper; // //import org.json.JSONObject; // diff --git a/app/src/main/java/com/gh/gamecenter/download/GameUpdateFragment.java b/app/src/main/java/com/gh/gamecenter/download/GameUpdateFragment.java index 93bbad16fa..21434ad5ca 100644 --- a/app/src/main/java/com/gh/gamecenter/download/GameUpdateFragment.java +++ b/app/src/main/java/com/gh/gamecenter/download/GameUpdateFragment.java @@ -15,7 +15,7 @@ import com.gh.gamecenter.common.constant.EntranceConsts; import com.gh.gamecenter.MainActivity; import com.gh.gamecenter.databinding.GameupdateBinding; import com.gh.gamecenter.eventbus.EBDownloadStatus; -import com.gh.gamecenter.eventbus.EBReuse; +import com.gh.gamecenter.common.eventbus.EBReuse; import com.gh.gamecenter.fragment.MainWrapperFragment; import com.gh.gamecenter.packagehelper.PackageViewModel; diff --git a/app/src/main/java/com/gh/gamecenter/download/InstalledGameFragment.kt b/app/src/main/java/com/gh/gamecenter/download/InstalledGameFragment.kt index ee4cb48dd5..268110c4f3 100644 --- a/app/src/main/java/com/gh/gamecenter/download/InstalledGameFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/download/InstalledGameFragment.kt @@ -24,7 +24,7 @@ //import com.gh.gamecenter.entity.GameEntity //import com.gh.gamecenter.entity.GameInstall //import com.gh.gamecenter.eventbus.EBDownloadStatus -//import com.gh.gamecenter.eventbus.EBReuse +//import com.gh.gamecenter.common.eventbus.EBReuse //import com.gh.gamecenter.fragment.MainWrapperFragment //import com.gh.gamecenter.manager.PackagesManager //import com.gh.gamecenter.common.base.fragment.NormalFragment diff --git a/app/src/main/java/com/gh/gamecenter/download/NewInstalledGameFragment.kt b/app/src/main/java/com/gh/gamecenter/download/NewInstalledGameFragment.kt index 8212b1cad7..26d43395e8 100644 --- a/app/src/main/java/com/gh/gamecenter/download/NewInstalledGameFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/download/NewInstalledGameFragment.kt @@ -23,7 +23,7 @@ import com.gh.gamecenter.databinding.FragmentMyGameBinding import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.entity.GameInstall import com.gh.gamecenter.eventbus.EBDownloadStatus -import com.gh.gamecenter.eventbus.EBReuse +import com.gh.gamecenter.common.eventbus.EBReuse import com.gh.gamecenter.fragment.MainWrapperFragment import com.gh.gamecenter.manager.PackagesManager import com.gh.gamecenter.packagehelper.PackageRepository diff --git a/app/src/main/java/com/gh/gamecenter/download/UpdatableGameFragment.kt b/app/src/main/java/com/gh/gamecenter/download/UpdatableGameFragment.kt index c128b53204..b69d5358de 100644 --- a/app/src/main/java/com/gh/gamecenter/download/UpdatableGameFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/download/UpdatableGameFragment.kt @@ -11,7 +11,7 @@ import com.gh.gamecenter.common.view.FixLinearLayoutManager import com.gh.gamecenter.core.utils.EmptyCallback import com.gh.gamecenter.databinding.FragmentGameUpdatableBinding import com.gh.gamecenter.eventbus.EBDownloadStatus -import com.gh.gamecenter.eventbus.EBReuse +import com.gh.gamecenter.common.eventbus.EBReuse import com.gh.gamecenter.fragment.MainWrapperFragment import com.gh.gamecenter.packagehelper.PackageRepository import com.gh.gamecenter.packagehelper.PackageViewModel diff --git a/app/src/main/java/com/gh/gamecenter/energy/CommodityViewModel.kt b/app/src/main/java/com/gh/gamecenter/energy/CommodityViewModel.kt deleted file mode 100644 index 1963425595..0000000000 --- a/app/src/main/java/com/gh/gamecenter/energy/CommodityViewModel.kt +++ /dev/null @@ -1,52 +0,0 @@ -package com.gh.gamecenter.energy - -import android.app.Application -import androidx.lifecycle.ViewModel -import androidx.lifecycle.ViewModelProvider -import com.gh.gamecenter.core.utils.UrlFilterUtils -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.baselist.LoadParams -import com.gh.gamecenter.entity.CommodityEntity -import com.gh.gamecenter.entity.SubjectSettingEntity -import com.gh.gamecenter.retrofit.RetrofitManager -import com.halo.assistant.HaloApp -import io.reactivex.Single - -class CommodityViewModel(application: Application, var categoryId: String, var entrance: String): ListViewModel(application) { - - init { - if (entrance == "光能中心") { - setOverLimitSize(11) // 光能中心的商品列表最多只展示10个 - } - } - - var sortSize = SubjectSettingEntity.Size() - - override fun provideDataObservable(page: Int) = null - - override fun provideDataSingle(page: Int): Single> { - return RetrofitManager.getInstance().api.getCommodities( - getFilter(), - page, - if (entrance == "光能中心") 10 - else LoadParams.DEFAULT_PAGE_SIZE - ) - } - - override fun mergeResultLiveData() { - mResultLiveData.addSource(mListLiveData) { mResultLiveData.postValue(it) } - } - - private fun getFilter(): String { - return UrlFilterUtils.getFilterQuery( - "category_id", categoryId, - "min_energy", sortSize.min.toString(), - "max_energy", sortSize.max.toString()) - } - - class Factory(private val categoryId: String, private val entrance: String) : ViewModelProvider.NewInstanceFactory() { - override fun create(modelClass: Class): T { - return CommodityViewModel(HaloApp.getInstance().application, categoryId, entrance) as T - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/entity/ApkEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/ApkEntity.kt index b599df9036..534774f762 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/ApkEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/ApkEntity.kt @@ -3,6 +3,9 @@ package com.gh.gamecenter.entity import android.os.Parcelable import android.text.TextUtils import com.gh.common.util.PlatformUtils +import com.gh.gamecenter.common.entity.CommunityEntity +import com.gh.gamecenter.common.entity.Display +import com.gh.gamecenter.common.entity.LinkEntity import com.google.gson.annotations.SerializedName import com.halo.assistant.HaloApp import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/com/gh/gamecenter/entity/ApplyModeratorStatusEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/ApplyModeratorStatusEntity.kt index 3631cb078d..65f87a241f 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/ApplyModeratorStatusEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/ApplyModeratorStatusEntity.kt @@ -1,6 +1,7 @@ package com.gh.gamecenter.entity import android.os.Parcelable +import com.gh.gamecenter.common.entity.LinkEntity import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/com/gh/gamecenter/entity/ArticleCommentParent.kt b/app/src/main/java/com/gh/gamecenter/entity/ArticleCommentParent.kt index c391153869..9843333ab1 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/ArticleCommentParent.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/ArticleCommentParent.kt @@ -1,6 +1,7 @@ package com.gh.gamecenter.entity import android.os.Parcelable +import com.gh.gamecenter.login.entity.Badge import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/com/gh/gamecenter/entity/BadgeEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/BadgeEntity.kt index e73b336d5c..80ed53c4de 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/BadgeEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/BadgeEntity.kt @@ -1,5 +1,6 @@ package com.gh.gamecenter.entity +import com.gh.gamecenter.login.entity.BadgeAction import com.google.gson.annotations.SerializedName data class BadgeEntity( diff --git a/app/src/main/java/com/gh/gamecenter/entity/CarouselEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/CarouselEntity.kt index b7e88e8273..8c8a742334 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/CarouselEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/CarouselEntity.kt @@ -1,5 +1,6 @@ package com.gh.gamecenter.entity +import com.gh.gamecenter.common.entity.LinkEntity import com.google.gson.annotations.SerializedName data class CarouselEntity( diff --git a/app/src/main/java/com/gh/gamecenter/entity/CatalogEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/CatalogEntity.kt index ce00ce2e07..524d090928 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/CatalogEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/CatalogEntity.kt @@ -1,6 +1,7 @@ package com.gh.gamecenter.entity import android.os.Parcelable +import com.gh.gamecenter.common.entity.LinkEntity import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/com/gh/gamecenter/entity/CommentParentEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/CommentParentEntity.kt index 1120bc9811..317d345621 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/CommentParentEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/CommentParentEntity.kt @@ -1,6 +1,7 @@ package com.gh.gamecenter.entity import android.os.Parcelable +import com.gh.gamecenter.login.entity.Badge import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/com/gh/gamecenter/entity/CommonCollectionEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/CommonCollectionEntity.kt index 7c1844114e..26e3765670 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/CommonCollectionEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/CommonCollectionEntity.kt @@ -24,7 +24,7 @@ data class CommonCollectionContentEntity( val style: String = "", val image: String = "", @SerializedName("link") - val linkEntity: LinkEntity, + val linkEntity: ExposureLinkEntity, @SerializedName("added_content_1") var addedContent1: String? = "", @SerializedName("added_content_2") diff --git a/app/src/main/java/com/gh/gamecenter/entity/CommunityEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/CommunityEntity.kt deleted file mode 100644 index dde63b5dec..0000000000 --- a/app/src/main/java/com/gh/gamecenter/entity/CommunityEntity.kt +++ /dev/null @@ -1,24 +0,0 @@ -package com.gh.gamecenter.entity - -import android.os.Parcelable -import com.google.gson.annotations.SerializedName -import kotlinx.parcelize.Parcelize - -@Parcelize -data class CommunityEntity( - @SerializedName("_id", alternate = ["id"]) - var id: String = "", - var name: String = "", - var refreshSort: String = "choiceness", // choiceness/time - @SerializedName("icon", alternate = ["ori_icon"]) - var icon: String? = "", - @SerializedName("icon_subscript") - var iconSubscript: String? = null, - var type: String = "game_bbs",//game_bbs/official_bbs - var game: SimpleGame? = null) : Parcelable { - constructor(id: String = "", name: String = "") : this(id, name, "choiceness") - - companion object { - const val SORT_TIME = "time" - } -} \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/entity/ErrorEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/ErrorEntity.kt index 4ee0c1cd5b..abae2a938b 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/ErrorEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/ErrorEntity.kt @@ -1,5 +1,7 @@ package com.gh.gamecenter.entity +import com.gh.gamecenter.common.entity.CommunityEntity +import com.gh.gamecenter.common.entity.LinkEntity import com.google.gson.annotations.SerializedName data class ErrorEntity(var code: Int? = 0, diff --git a/app/src/main/java/com/gh/gamecenter/entity/FollowersOrFansEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/FollowersOrFansEntity.kt index 17bb46ef11..bb9d13a11e 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/FollowersOrFansEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/FollowersOrFansEntity.kt @@ -1,5 +1,7 @@ package com.gh.gamecenter.entity +import com.gh.gamecenter.login.entity.Auth +import com.gh.gamecenter.login.entity.Badge import com.google.gson.annotations.SerializedName data class FollowersOrFansEntity( diff --git a/app/src/main/java/com/gh/gamecenter/entity/ForumActivityEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/ForumActivityEntity.kt index b95c838a2f..227c03178d 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/ForumActivityEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/ForumActivityEntity.kt @@ -1,5 +1,6 @@ package com.gh.gamecenter.entity +import com.gh.gamecenter.common.entity.LinkEntity import com.google.gson.annotations.SerializedName data class ForumActivityCategoryEntity( diff --git a/app/src/main/java/com/gh/gamecenter/entity/ForumDetailEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/ForumDetailEntity.kt index 963d0d1731..c0192b0c5b 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/ForumDetailEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/ForumDetailEntity.kt @@ -1,5 +1,6 @@ package com.gh.gamecenter.entity +import com.gh.gamecenter.common.entity.LinkEntity import com.gh.gamecenter.gamedetail.entity.ZoneEntity import com.google.gson.annotations.SerializedName diff --git a/app/src/main/java/com/gh/gamecenter/entity/ForumEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/ForumEntity.kt index c77c48f376..2fb8bb6d74 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/ForumEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/ForumEntity.kt @@ -3,6 +3,7 @@ package com.gh.gamecenter.entity import androidx.room.Entity import androidx.room.Ignore import androidx.room.PrimaryKey +import com.gh.gamecenter.common.entity.LinkEntity import com.google.gson.annotations.SerializedName @Entity diff --git a/app/src/main/java/com/gh/gamecenter/entity/ForumVideoEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/ForumVideoEntity.kt index bd95b7fbb8..c748f478e1 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/ForumVideoEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/ForumVideoEntity.kt @@ -1,6 +1,7 @@ package com.gh.gamecenter.entity import android.os.Parcelable +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.qa.entity.Count import com.google.gson.annotations.SerializedName import kotlinx.parcelize.IgnoredOnParcel diff --git a/app/src/main/java/com/gh/gamecenter/entity/FunctionalGroupEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/FunctionalGroupEntity.kt index 4b201efa36..ba460f24c8 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/FunctionalGroupEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/FunctionalGroupEntity.kt @@ -2,6 +2,7 @@ package com.gh.gamecenter.entity import android.os.Parcelable import androidx.annotation.DrawableRes +import com.gh.gamecenter.common.entity.LinkEntity import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/com/gh/gamecenter/entity/GameDetailEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/GameDetailEntity.kt index 127dcaf72e..ee5cc31122 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/GameDetailEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/GameDetailEntity.kt @@ -2,90 +2,92 @@ package com.gh.gamecenter.entity import android.os.Parcelable import com.gh.common.constant.Config +import com.gh.gamecenter.common.entity.LinkEntity import com.google.gson.annotations.SerializedName import kotlinx.parcelize.IgnoredOnParcel import kotlinx.parcelize.Parcelize @Parcelize class GameDetailEntity( - var id: String? = null, + var id: String? = null, - var info: TipsEntity? = null, + var info: TipsEntity? = null, - @SerializedName("top_tag") - var topTag: ArrayList? = null, + @SerializedName("top_tag") + var topTag: ArrayList? = null, - @SerializedName("update_des") - var updateDes: String? = "", + @SerializedName("update_des") + var updateDes: String? = "", - var video: ArrayList? = arrayListOf(), + var video: ArrayList? = arrayListOf(), - @SerializedName("image_recommend") - var imageRecommend: LinkEntity? = null, + @SerializedName("image_recommend") + var imageRecommend: LinkEntity? = null, - private var tag: ArrayList? = null, + private var tag: ArrayList? = null, - private var tips: TipsEntity? = null, + private var tips: TipsEntity? = null, - var news: List? = null, + var news: List? = null, - var gallery: ArrayList? = null, + var gallery: ArrayList? = null, - var des: String? = null, + var des: String? = null, - @SerializedName("article_types") - var articleTypes: ArrayList? = null, + @SerializedName("article_types") + var articleTypes: ArrayList? = null, - @SerializedName("share_code") - var shareCode: String? = null, + @SerializedName("share_code") + var shareCode: String? = null, - @SerializedName("download_off_text") - var downloadOffText: String? = null, + @SerializedName("download_off_text") + var downloadOffText: String? = null, - @SerializedName("skin_test") - var isSkinTest: Boolean = false, + @SerializedName("skin_test") + var isSkinTest: Boolean = false, - var contact: GameDetailContact? = null, + var contact: GameDetailContact? = null, - var notice: MutableList? = null, + var notice: MutableList? = null, - @SerializedName("tag_style") - var tagStyle: ArrayList = ArrayList(), + @SerializedName("tag_style") + var tagStyle: ArrayList = ArrayList(), - @SerializedName("server") - var serverEntity: GameDetailServer? = null, + @SerializedName("server") + var serverEntity: GameDetailServer? = null, - @SerializedName("related_game") - var relatedGames: List? = null, + @SerializedName("related_game") + var relatedGames: List? = null, - var fulishuoming: String? = null, + var fulishuoming: String? = null, - @SerializedName("show_comment") - val showComment: Boolean = false, + @SerializedName("show_comment") + val showComment: Boolean = false, - @SerializedName("me") - var me: MeEntity = MeEntity(), + @SerializedName("me") + var me: MeEntity = MeEntity(), - @SerializedName("related_version") - var relatedVersion: ArrayList = arrayListOf(), + @SerializedName("related_version") + var relatedVersion: ArrayList = arrayListOf(), - @SerializedName("custom_columns") - var customColumns: ArrayList = arrayListOf(), + @SerializedName("custom_columns") + var customColumns: ArrayList = arrayListOf(), - @SerializedName("detail_dialog") - var detailDialog: GameEntity.Dialog? = null, + @SerializedName("detail_dialog") + var detailDialog: GameEntity.Dialog? = null, - @SerializedName("server_label") - val serverLabel: ColorEntity? = null, + @SerializedName("server_label") + val serverLabel: ColorEntity? = null, - @SerializedName("top_video") - var topVideo: Video? = null, + @SerializedName("top_video") + var topVideo: Video? = null, - @SerializedName("intro_video") - var introVideo: Video? = null, + @SerializedName("intro_video") + var introVideo: Video? = null, - @SerializedName("direct_comment") - val directComment: Boolean = false) : Parcelable { + @SerializedName("direct_comment") + val directComment: Boolean = false +) : Parcelable { fun getTag(): ArrayList { if (!Config.isShowPlugin(id)) return ArrayList() @@ -112,33 +114,37 @@ class GameDetailEntity( @Parcelize data class Video( - @SerializedName("_id", alternate = ["video_id"]) - var videoId: String = "", - @SerializedName("new_video_count", alternate = ["video_count"]) // 选用 JSON 最后一个值作为 videoCount 的值 - var videoCount: Int = 0, - var poster: String = "", - var title: String = "", - var url: String = "", - var user: User? = null, - var vote: Int = 0 + @SerializedName("_id", alternate = ["video_id"]) + var videoId: String = "", + @SerializedName( + "new_video_count", + alternate = ["video_count"] + ) // 选用 JSON 最后一个值作为 videoCount 的值 + var videoCount: Int = 0, + var poster: String = "", + var title: String = "", + var url: String = "", + var user: User? = null, + var vote: Int = 0 ) : Parcelable @Parcelize data class RelatedVersion( - var first: Boolean = false, - var last: Boolean = false, - var game: SimpleGame? = null, - @SerializedName("game_id") - var gameId: String = "", - @SerializedName("game_name") - private var mGameName: String = "", - @SerializedName("name_suffix") - var nameSuffix: String? = "", - @SerializedName("game_icon") - var gameIcon: String = "", - @SerializedName(value = "game_tag", alternate = arrayOf("new_game_tag")) - var gameTags: ArrayList = ArrayList(), - var index: Int) : Parcelable { + var first: Boolean = false, + var last: Boolean = false, + var game: SimpleGame? = null, + @SerializedName("game_id") + var gameId: String = "", + @SerializedName("game_name") + private var mGameName: String = "", + @SerializedName("name_suffix") + var nameSuffix: String? = "", + @SerializedName("game_icon") + var gameIcon: String = "", + @SerializedName(value = "game_tag", alternate = arrayOf("new_game_tag")) + var gameTags: ArrayList = ArrayList(), + var index: Int + ) : Parcelable { @IgnoredOnParcel val gameName: String get() = mGameName.removeSuffix(".") + (nameSuffix ?: "") @@ -146,23 +152,27 @@ class GameDetailEntity( @Parcelize data class CustomColumn( - var name: String, - var link: LinkEntity? = null, - @SerializedName("info_tag") - var infoTag: ArrayList = arrayListOf(), - var title: Title? = null, - var order: Int = 0, - var des: String = "", - @SerializedName("show_info_tag_des") - var showInfoTagDes: Boolean = true, - @SerializedName("show_info_tag") - var showInfoTag: Boolean = true + var name: String, + var link: LinkEntity? = null, + @SerializedName("info_tag") + var infoTag: ArrayList = arrayListOf(), + var title: Title? = null, + var order: Int = 0, + var des: String = "", + @SerializedName("show_info_tag_des") + var showInfoTagDes: Boolean = true, + @SerializedName("show_info_tag") + var showInfoTag: Boolean = true ) : Parcelable { @Parcelize data class Title(var icon: String, var value: String, var color: String) : Parcelable { fun titleToTips(des: String): TipsEntity { - return TipsEntity(icon = icon, content = des, title = TitleEntity(color = color, value = value)) + return TipsEntity( + icon = icon, + content = des, + title = TitleEntity(color = color, value = value) + ) } } diff --git a/app/src/main/java/com/gh/gamecenter/entity/GameEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/GameEntity.kt index 053666cc1b..21fec0cfe7 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/GameEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/GameEntity.kt @@ -7,6 +7,9 @@ import com.gh.common.exposure.ExposureEvent import com.gh.common.filter.RegionSettingHelper import com.gh.gamecenter.R import com.gh.gamecenter.common.constant.Constants +import com.gh.gamecenter.common.entity.CommunityEntity +import com.gh.gamecenter.common.entity.Display +import com.gh.gamecenter.common.entity.LinkEntity import com.gh.gamecenter.game.data.GameSubjectData import com.gh.gamecenter.gamedetail.entity.GameInfo import com.gh.gamecenter.gamedetail.entity.ZoneEntity @@ -884,4 +887,13 @@ data class SimpleGame( gameEntity.downloadStatus = downloadStatus return gameEntity } + + fun toCommunityGameEntity(): CommunityEntity.CommunityGameEntity { + val gameEntity = CommunityEntity.CommunityGameEntity(id = id, mName = name) + gameEntity.nameSuffix = nameSuffix ?: "" + gameEntity.mIcon = mIcon + gameEntity.mRawIcon = mRawIcon + gameEntity.iconSubscript = iconSubscript + return gameEntity + } } diff --git a/app/src/main/java/com/gh/gamecenter/entity/GameGuidePopupEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/GameGuidePopupEntity.kt index 3551ec0126..28321173be 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/GameGuidePopupEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/GameGuidePopupEntity.kt @@ -1,5 +1,6 @@ package com.gh.gamecenter.entity +import com.gh.gamecenter.common.entity.LinkEntity import com.google.gson.annotations.SerializedName data class GameGuidePopupEntity( diff --git a/app/src/main/java/com/gh/gamecenter/entity/GameNavigationEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/GameNavigationEntity.kt index 900c1d7cca..aa79a04714 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/GameNavigationEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/GameNavigationEntity.kt @@ -1,5 +1,6 @@ package com.gh.gamecenter.entity +import com.gh.gamecenter.common.entity.LinkEntity import com.google.gson.annotations.SerializedName data class GameNavigationWrapper( diff --git a/app/src/main/java/com/gh/gamecenter/entity/HomeRecommend.kt b/app/src/main/java/com/gh/gamecenter/entity/HomeRecommend.kt index b9795072cb..a3576accc3 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/HomeRecommend.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/HomeRecommend.kt @@ -1,5 +1,7 @@ package com.gh.gamecenter.entity +import com.gh.gamecenter.common.entity.Display +import com.gh.gamecenter.common.entity.LinkEntity import com.google.gson.annotations.SerializedName data class HomeRecommend(@SerializedName("link_type") diff --git a/app/src/main/java/com/gh/gamecenter/entity/HomeSlide.kt b/app/src/main/java/com/gh/gamecenter/entity/HomeSlide.kt index c4cabb95f3..cad775e719 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/HomeSlide.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/HomeSlide.kt @@ -1,5 +1,6 @@ package com.gh.gamecenter.entity +import com.gh.gamecenter.common.entity.LinkEntity import com.google.gson.annotations.SerializedName data class HomeSlide(@SerializedName("link_type") diff --git a/app/src/main/java/com/gh/gamecenter/entity/HotTagEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/HotTagEntity.kt index ea7ecf17d8..9cf9e6c0e8 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/HotTagEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/HotTagEntity.kt @@ -1,5 +1,6 @@ package com.gh.gamecenter.entity +import com.gh.gamecenter.common.entity.LinkEntity import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/com/gh/gamecenter/entity/LinkEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/LinkEntity.kt index 604ee5c66c..41a74c83da 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/LinkEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/LinkEntity.kt @@ -1,45 +1,11 @@ package com.gh.gamecenter.entity -import android.os.Parcelable import com.gh.common.exposure.ExposureEvent -import com.google.gson.annotations.SerializedName +import com.gh.gamecenter.common.entity.LinkEntity import kotlinx.parcelize.Parcelize @Parcelize -open class LinkEntity( - var name: String? = "", // tag - var title: String? = "", - var image: String? = "", - @SerializedName("target", alternate = ["link", "link_id"]) - var link: String? = "", - @SerializedName("type", alternate = ["link_type"]) - var type: String? = "", - var icon: String = "", - @SerializedName("game_icon") - var gameIcon: String? = "", - @SerializedName("game_icon_subscript") - var gameIconSubscript: String? = "", - var text: String? = "", - @SerializedName("link_text") - var linkText: String? = "",//游戏详情弹窗,兼容旧版本用 - var value: String? = "", - @SerializedName("community_id") - var communityId: String? = "", - @SerializedName("link_community", alternate = ["community"]) - var community: CommunityEntity? = CommunityEntity(), - var display: Display? = null, // 板块 - @SerializedName("close_button") - var closeButton: String = "open",//用户判断h5游戏关闭按钮是否显示,hide(隐藏)、open(开启) - @SerializedName("button_link") - var buttonLink: Boolean = false, - var toolkit: ToolBoxEntity? = ToolBoxEntity(), - @SerializedName("activity_id") - var activityId: String = "", - var style: String = "", - - //本地字段 (埋点用) - var blockId: String = "", - var blockName: String = "", +data class ExposureLinkEntity( // 本地字段 (关联的曝光) var exposureEvent: ExposureEvent? = null -) : Parcelable \ No newline at end of file +) : LinkEntity() \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/entity/MessageKeFuEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/MessageKeFuEntity.kt index 57609ff724..b9e836855b 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/MessageKeFuEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/MessageKeFuEntity.kt @@ -1,5 +1,7 @@ package com.gh.gamecenter.entity +import com.gh.gamecenter.common.entity.LinkEntity +import com.gh.gamecenter.login.entity.Auth import com.google.gson.annotations.SerializedName /** diff --git a/app/src/main/java/com/gh/gamecenter/entity/MessageLinkEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/MessageLinkEntity.kt index 09bf59a99c..b912ee4e8a 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/MessageLinkEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/MessageLinkEntity.kt @@ -1,5 +1,6 @@ package com.gh.gamecenter.entity +import com.gh.gamecenter.common.entity.CommunityEntity import com.google.gson.annotations.SerializedName /** diff --git a/app/src/main/java/com/gh/gamecenter/entity/PackageDialogEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/PackageDialogEntity.kt index 30aa7e7941..c5a4b026f2 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/PackageDialogEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/PackageDialogEntity.kt @@ -1,6 +1,7 @@ package com.gh.gamecenter.entity import android.os.Parcelable +import com.gh.gamecenter.common.entity.LinkEntity import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/com/gh/gamecenter/entity/PersonalEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/PersonalEntity.kt index 4b2cf44135..20ab48dffc 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/PersonalEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/PersonalEntity.kt @@ -1,6 +1,10 @@ package com.gh.gamecenter.entity import android.os.Parcelable +import com.gh.gamecenter.login.entity.Auth +import com.gh.gamecenter.login.entity.AvatarBorderEntity +import com.gh.gamecenter.login.entity.BackgroundImageEntity +import com.gh.gamecenter.login.entity.Badge import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize @@ -61,16 +65,4 @@ data class LastVisitor( @SerializedName("_id") var id: String = "", var name: String = "", - var icon: String = "") : Parcelable - -// 徽章 -@Parcelize -data class Badge( - var name: String = "", - var icon: String = "", - var actions: List? = null) : Parcelable - -// 徽章领取条件 -@Parcelize -data class BadgeAction( - var text: String = "") : Parcelable + var icon: String = "") : Parcelable \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/entity/PersonalHistoryEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/PersonalHistoryEntity.kt index b6f99ffd10..86f8ec0586 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/PersonalHistoryEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/PersonalHistoryEntity.kt @@ -4,10 +4,11 @@ import android.os.Parcel import android.os.Parcelable import com.gh.gamecenter.common.annotation.SyncPage import com.gh.gamecenter.common.constant.Constants +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.common.syncpage.SyncFieldConstants import com.gh.gamecenter.core.utils.SPUtils import com.gh.gamecenter.core.utils.TimeUtils -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.qa.entity.AnswerEntity import com.gh.gamecenter.qa.entity.CommunityVideoEntity import com.gh.gamecenter.qa.entity.ImageInfo @@ -19,35 +20,35 @@ import kotlinx.parcelize.Parcelize @Parcelize data class PersonalHistoryEntity( - @SerializedName("_id") - val id: String = "", - val type: String = "", - var question: Question = Question(), - var brief: String = "", - var des: String = "", - var url: String = "", - var status: String? = "", - @SerializedName("video_info") - var videoInfo: VideoInfo = VideoInfo(), - var poster: String = "", - var length: Long = 0, - var count: Count = Count(), - val time: Long = 0, - var title: String = "", - var description: String = "", - val community: CommunityEntity = CommunityEntity(), - var videos: List = ArrayList(), - var user: PersonalEntity? = null, - @SerializedName("fold_users") - var foldUsers: List? = null, - val images: List = ArrayList(), - @SerializedName("images_info") - var imagesInfo: List = ArrayList(), - val me: MeEntity = MeEntity(), - var comment: Comment = Comment(), - var commentable: Boolean = true, - @SerializedName("is_edit") - var isEdit: Boolean = false + @SerializedName("_id") + val id: String = "", + val type: String = "", + var question: Question = Question(), + var brief: String = "", + var des: String = "", + var url: String = "", + var status: String? = "", + @SerializedName("video_info") + var videoInfo: VideoInfo = VideoInfo(), + var poster: String = "", + var length: Long = 0, + var count: Count = Count(), + val time: Long = 0, + var title: String = "", + var description: String = "", + val community: CommunityEntity = CommunityEntity(), + var videos: List = ArrayList(), + var user: PersonalEntity? = null, + @SerializedName("fold_users") + var foldUsers: List? = null, + val images: List = ArrayList(), + @SerializedName("images_info") + var imagesInfo: List = ArrayList(), + val me: MeEntity = MeEntity(), + var comment: Comment = Comment(), + var commentable: Boolean = true, + @SerializedName("is_edit") + var isEdit: Boolean = false ) : Parcelable { fun getPassVideos(): List { diff --git a/app/src/main/java/com/gh/gamecenter/entity/PushNotificationEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/PushNotificationEntity.kt index 4f0e7a86f8..37c1073dc7 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/PushNotificationEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/PushNotificationEntity.kt @@ -1,5 +1,6 @@ package com.gh.gamecenter.entity +import com.gh.gamecenter.common.entity.LinkEntity import com.google.gson.annotations.SerializedName // 相关文档可见 https://gitlab.ghzs.com/halo/halo-api/wikis/push#%E6%B6%88%E6%81%AF%E6%8E%A8%E9%80%81 diff --git a/app/src/main/java/com/gh/gamecenter/entity/RecommendPopupEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/RecommendPopupEntity.kt index 5bc58844a7..89be52c8f3 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/RecommendPopupEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/RecommendPopupEntity.kt @@ -1,5 +1,6 @@ package com.gh.gamecenter.entity +import com.gh.gamecenter.common.entity.LinkEntity import com.google.gson.annotations.SerializedName data class RecommendPopupEntity( diff --git a/app/src/main/java/com/gh/gamecenter/entity/ServerTestEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/ServerTestEntity.kt index 233e780afa..2b7e1fa7bc 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/ServerTestEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/ServerTestEntity.kt @@ -1,5 +1,6 @@ package com.gh.gamecenter.entity +import com.gh.gamecenter.common.entity.LinkEntity import com.google.gson.annotations.SerializedName data class ServerTestEntity(val settings: Settings, diff --git a/app/src/main/java/com/gh/gamecenter/entity/SettingsEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/SettingsEntity.kt index 38162da908..5b0d3c5ec8 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/SettingsEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/SettingsEntity.kt @@ -3,6 +3,9 @@ package com.gh.gamecenter.entity import android.preference.PreferenceManager import com.gh.common.constant.Config import com.gh.common.exposure.ExposureEvent +import com.gh.gamecenter.common.entity.CommunityEntity +import com.gh.gamecenter.common.entity.Display +import com.gh.gamecenter.common.entity.LinkEntity import com.google.gson.annotations.SerializedName import com.halo.assistant.HaloApp diff --git a/app/src/main/java/com/gh/gamecenter/entity/SignEntity.java b/app/src/main/java/com/gh/gamecenter/entity/SignEntity.java index e35b68cd9e..9f2bfb1031 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/SignEntity.java +++ b/app/src/main/java/com/gh/gamecenter/entity/SignEntity.java @@ -1,5 +1,7 @@ package com.gh.gamecenter.entity; +import com.gh.gamecenter.common.entity.CommunityEntity; +import com.gh.gamecenter.common.entity.Display; import com.gh.gamecenter.room.converter.SignDataConverter; import com.google.gson.annotations.SerializedName; diff --git a/app/src/main/java/com/gh/gamecenter/entity/StartupAdEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/StartupAdEntity.kt index 0097e4281e..3a82eb1c99 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/StartupAdEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/StartupAdEntity.kt @@ -1,5 +1,6 @@ package com.gh.gamecenter.entity +import com.gh.gamecenter.common.entity.LinkEntity import com.google.gson.annotations.SerializedName data class StartupAdEntity( @@ -7,4 +8,5 @@ data class StartupAdEntity( val id: String, val desc: String, val button: Boolean, - val jump: LinkEntity) \ No newline at end of file + val jump: LinkEntity +) \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/entity/SubjectEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/SubjectEntity.kt index d9269c058d..2a5b7f10ca 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/SubjectEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/SubjectEntity.kt @@ -3,6 +3,7 @@ package com.gh.gamecenter.entity import android.os.Parcelable import android.text.TextUtils import com.gh.common.constant.Config +import com.gh.gamecenter.common.entity.LinkEntity import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/com/gh/gamecenter/entity/SubjectRecommendEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/SubjectRecommendEntity.kt index 4852e4725c..c971a3f20e 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/SubjectRecommendEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/SubjectRecommendEntity.kt @@ -2,7 +2,7 @@ package com.gh.gamecenter.entity import android.graphics.Color import android.os.Parcelable -import androidx.core.graphics.ColorUtils +import com.gh.gamecenter.common.entity.Display import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize @@ -58,12 +58,3 @@ data class SubjectRecommendEntity( }*/ } -@Parcelize -data class Display( - var slide: Boolean = true, - var recommend: Boolean = true, - var navigation: Boolean = true, - var refresh: Boolean = false -) : Parcelable - - diff --git a/app/src/main/java/com/gh/gamecenter/entity/TaskEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/TaskEntity.kt deleted file mode 100644 index be0bca52dc..0000000000 --- a/app/src/main/java/com/gh/gamecenter/entity/TaskEntity.kt +++ /dev/null @@ -1,25 +0,0 @@ -package com.gh.gamecenter.entity - -import android.os.Parcelable -import com.google.gson.annotations.SerializedName -import kotlinx.parcelize.Parcelize - -@Parcelize -data class TaskEntity( - @SerializedName("_id") - var id: String = "", - @SerializedName("task_id") - var taskId: String = "", - var name: String = "", - var descr: String = "", - var icon: String = "", - var action: String = "", - var energy: Long = 0, - var done: Int = 0, - var limit: Int = 0, - var quota: Int = 0, // 任务指标,代表需要做多少个才算完成 - var progress: Int = 0, // 已完成的进度 - var status: String = "", // normal正常 finished完成 limiting任务达到上限 - var link: LinkEntity = LinkEntity(), - var isFixed: Boolean = false -) : Parcelable \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/entity/ToolBoxBlockEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/ToolBoxBlockEntity.kt index 90cdb72c62..6b21b3267c 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/ToolBoxBlockEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/ToolBoxBlockEntity.kt @@ -1,6 +1,7 @@ package com.gh.gamecenter.entity import android.os.Parcelable +import com.gh.gamecenter.common.entity.ToolBoxEntity import com.google.gson.annotations.SerializedName import kotlinx.android.parcel.Parcelize diff --git a/app/src/main/java/com/gh/gamecenter/entity/UnifiedGameDetailEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/UnifiedGameDetailEntity.kt index 70608d423c..72c52ea583 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/UnifiedGameDetailEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/UnifiedGameDetailEntity.kt @@ -1,6 +1,8 @@ package com.gh.gamecenter.entity import android.os.Parcelable +import com.gh.gamecenter.common.entity.CommunityEntity +import com.gh.gamecenter.common.entity.ToolBoxEntity import com.gh.gamecenter.qa.entity.AnswerEntity import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize @@ -14,12 +16,12 @@ import kotlinx.parcelize.Parcelize @Parcelize data class UnifiedGameDetailEntity( - var game: GameDetailEntity, - var articles: List?, - var toolkits: List?, - var libao: List?, - var community: CommunityEntity?, - @SerializedName("community_column_contents") + var game: GameDetailEntity, + var articles: List?, + var toolkits: List?, + var libao: List?, + var community: CommunityEntity?, + @SerializedName("community_column_contents") var communityColumnContents: List?) : Parcelable { companion object { const val TAG: String = "UnifiedGameDetailEntity" diff --git a/app/src/main/java/com/gh/gamecenter/entity/UnifiedUserTrendEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/UnifiedUserTrendEntity.kt index 05555bbf0f..7e01ff4290 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/UnifiedUserTrendEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/UnifiedUserTrendEntity.kt @@ -1,11 +1,12 @@ package com.gh.gamecenter.entity +import com.gh.gamecenter.common.entity.ToolBoxEntity import com.gh.gamecenter.qa.entity.AnswerEntity import com.google.gson.annotations.SerializedName data class UnifiedUserTrendEntity( - var game: List?, - var toolkit: List?, - var libao: List?, - @SerializedName("community_column_content") + var game: List?, + var toolkit: List?, + var libao: List?, + @SerializedName("community_column_content") var communityColumnContents: List?) \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/entity/UserEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/UserEntity.kt index eb7732b10f..ce3f883871 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/UserEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/UserEntity.kt @@ -1,6 +1,8 @@ package com.gh.gamecenter.entity import android.os.Parcelable +import com.gh.gamecenter.login.entity.Auth +import com.gh.gamecenter.login.entity.Badge import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/com/gh/gamecenter/entity/VersionVoteEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/VersionVoteEntity.kt index 3fae3082f7..bca8e9f3ec 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/VersionVoteEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/VersionVoteEntity.kt @@ -1,5 +1,6 @@ package com.gh.gamecenter.entity +import com.gh.gamecenter.common.entity.LinkEntity import com.google.gson.annotations.SerializedName /** diff --git a/app/src/main/java/com/gh/gamecenter/entity/VideoDraftEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/VideoDraftEntity.kt index af8eafc8e5..8d914ca699 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/VideoDraftEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/VideoDraftEntity.kt @@ -1,6 +1,7 @@ package com.gh.gamecenter.entity import android.os.Parcelable +import com.gh.gamecenter.common.entity.CommunityEntity import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/com/gh/gamecenter/entity/WelcomeDialogEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/WelcomeDialogEntity.kt index 5bfccc1edf..6fefebd161 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/WelcomeDialogEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/WelcomeDialogEntity.kt @@ -1,5 +1,6 @@ package com.gh.gamecenter.entity +import com.gh.gamecenter.common.entity.LinkEntity import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/com/gh/gamecenter/forum/detail/ForumArticleAskListAdapter.kt b/app/src/main/java/com/gh/gamecenter/forum/detail/ForumArticleAskListAdapter.kt index 769be39aec..98ca8a1759 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/detail/ForumArticleAskListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/detail/ForumArticleAskListAdapter.kt @@ -13,10 +13,10 @@ import com.gh.gamecenter.core.utils.MtaHelper import com.gh.common.util.NewLogUtils import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.goneIf import com.gh.gamecenter.databinding.CommunityAnswerItemBinding -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.forum.home.ForumArticleAskItemViewHolder import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity import com.gh.gamecenter.qa.entity.AnswerEntity diff --git a/app/src/main/java/com/gh/gamecenter/forum/detail/ForumArticleAskListFragment.kt b/app/src/main/java/com/gh/gamecenter/forum/detail/ForumArticleAskListFragment.kt index 31cdb894e6..f288c74030 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/detail/ForumArticleAskListFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/detail/ForumArticleAskListFragment.kt @@ -12,7 +12,7 @@ import com.gh.common.util.* import com.gh.common.util.NewLogUtils import com.gh.gamecenter.common.view.divider.HorizontalDividerItemDecoration import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.LazyListFragment +import com.gh.gamecenter.common.baselist.LazyListFragment import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.iinterface.IScrollable diff --git a/app/src/main/java/com/gh/gamecenter/forum/detail/ForumArticleAskListViewModel.kt b/app/src/main/java/com/gh/gamecenter/forum/detail/ForumArticleAskListViewModel.kt index c9defe8f2c..6261858a1e 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/detail/ForumArticleAskListViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/detail/ForumArticleAskListViewModel.kt @@ -4,7 +4,7 @@ import android.app.Application import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider import com.gh.gamecenter.core.utils.UrlFilterUtils -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.entity.ForumVideoEntity import com.gh.gamecenter.qa.entity.AnswerEntity import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/gamecenter/forum/detail/ForumDetailFragment.kt b/app/src/main/java/com/gh/gamecenter/forum/detail/ForumDetailFragment.kt index 230214d725..4f6b69ba95 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/detail/ForumDetailFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/detail/ForumDetailFragment.kt @@ -37,6 +37,7 @@ import com.gh.gamecenter.NewsDetailActivity import com.gh.gamecenter.R import com.gh.gamecenter.common.callback.BiCallback import com.gh.gamecenter.common.constant.EntranceConsts +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.common.view.SegmentedFilterView import com.gh.gamecenter.core.iinterface.IScrollable @@ -50,8 +51,9 @@ import com.gh.gamecenter.forum.moderator.ApplyModeratorActivity import com.gh.gamecenter.forum.moderator.ModeratorListActivity import com.gh.gamecenter.forum.search.ForumOrUserSearchActivity import com.gh.gamecenter.gamedetail.GameDetailFragment -import com.gh.gamecenter.manager.UserManager -import com.gh.gamecenter.mvvm.Status +import com.gh.gamecenter.login.user.UserManager +import com.gh.gamecenter.manager.CommunityManager +import com.gh.gamecenter.common.mvvm.Status import com.gh.gamecenter.qa.article.edit.ArticleEditActivity import com.gh.gamecenter.qa.entity.AnswerEntity import com.gh.gamecenter.qa.questions.edit.QuestionEditActivity @@ -159,7 +161,7 @@ class ForumDetailFragment : BaseLazyTabFragment(), IScrollable { mBinding.reuseNoConnection.reuseNoConnection.visibility = View.GONE if (it.data != null) { mForumDetail = it.data - mBbsType = if (it.data.type == "official_bbs") "综合论坛" else "游戏论坛" + mBbsType = if (it.data!!.type == "official_bbs") "综合论坛" else "游戏论坛" val userId = UserManager.getInstance().userId NewLogUtils.logForumDetailEnterOrClick( "view_forum_detail", @@ -173,7 +175,7 @@ class ForumDetailFragment : BaseLazyTabFragment(), IScrollable { } else { mBinding.communityEdit.visibility = View.GONE mBinding.forumContainer.visibility = View.GONE - if (it.exception != null && it.exception.code() == 404) { + if (it.exception != null && it.exception!!.code() == 404) { mBinding.reuseNoneData.reuseTvNoneData.text = "页面为空" mBinding.reuseNoneData.reuseNoneData.visibility = View.VISIBLE mBinding.reuseNoConnection.reuseNoConnection.visibility = View.GONE @@ -378,7 +380,7 @@ class ForumDetailFragment : BaseLazyTabFragment(), IScrollable { } mBinding.followTv.setTextColor(ContextCompat.getColor(requireContext(), if (me.isFollower) R.color.text_subtitleDesc else R.color.white)) mBinding.followTv.background = - ContextCompat.getDrawable(requireContext(), if (me.isFollower) R.drawable.bg_shape_f5_radius_999 else R.drawable.login_btn_bg) + ContextCompat.getDrawable(requireContext(), if (me.isFollower) R.drawable.bg_shape_f5_radius_999 else R.drawable.download_button_normal_style) mBinding.allOrderSfv.setItemList(mAllOrderList, 0) mBinding.videoOrderSfv.setItemList(mVideoOrderList, 0) @@ -648,7 +650,7 @@ class ForumDetailFragment : BaseLazyTabFragment(), IScrollable { requireContext(), R.style.DialogWindowTransparent, "论坛详情", - UserManager.getInstance().community.name, + CommunityManager.getInstance().community.name, null, "发布-空白", "发布-返回", @@ -727,7 +729,7 @@ class ForumDetailFragment : BaseLazyTabFragment(), IScrollable { }) } contentView.findViewById(R.id.community_edit_close).setOnClickListener { - MtaHelper.onEvent("论坛详情", UserManager.getInstance().community.name, "发布-关闭") + MtaHelper.onEvent("论坛详情", CommunityManager.getInstance().community.name, "发布-关闭") NewLogUtils.logBbsPostPanelCloseClick() dialog.dismiss() } diff --git a/app/src/main/java/com/gh/gamecenter/forum/detail/ForumDetailViewModel.kt b/app/src/main/java/com/gh/gamecenter/forum/detail/ForumDetailViewModel.kt index 532cbd6714..495aaef66a 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/detail/ForumDetailViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/detail/ForumDetailViewModel.kt @@ -3,12 +3,13 @@ package com.gh.gamecenter.forum.detail import android.annotation.SuppressLint import android.app.Application import androidx.lifecycle.* +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.common.utils.clearHtmlFormatCompletely import com.gh.gamecenter.common.utils.observableToMain import com.gh.gamecenter.common.utils.removeVideoContent import com.gh.gamecenter.common.utils.singleToMain import com.gh.gamecenter.eventbus.EBForumRecordChange -import com.gh.gamecenter.mvvm.Resource +import com.gh.gamecenter.common.mvvm.Resource import com.gh.gamecenter.qa.entity.* import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.common.retrofit.EmptyResponse diff --git a/app/src/main/java/com/gh/gamecenter/forum/home/CommunityHomeFragment.kt b/app/src/main/java/com/gh/gamecenter/forum/home/CommunityHomeFragment.kt index 20ce0dc489..6cdce029f4 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/home/CommunityHomeFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/home/CommunityHomeFragment.kt @@ -5,13 +5,11 @@ import android.content.Intent import android.content.res.ColorStateList import android.graphics.Bitmap import android.graphics.Typeface -import android.graphics.drawable.ColorDrawable import android.os.Build import android.os.Bundle import android.view.* import android.view.animation.AnimationUtils import android.widget.TextView -import androidx.annotation.ColorInt import androidx.core.graphics.ColorUtils import androidx.core.os.bundleOf import androidx.fragment.app.Fragment @@ -34,7 +32,7 @@ import com.gh.gamecenter.eventbus.EBTypeChange import com.gh.gamecenter.eventbus.EBUISwitch import com.gh.gamecenter.forum.search.ForumOrUserSearchActivity import com.gh.gamecenter.fragment.MainWrapperFragment -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.manager.CommunityManager import com.gh.gamecenter.qa.article.edit.ArticleEditActivity import com.gh.gamecenter.qa.entity.ArticleEntity import com.gh.gamecenter.qa.questions.edit.QuestionEditActivity @@ -383,7 +381,7 @@ class CommunityHomeFragment : LazyFragment() { requireContext(), R.style.DialogWindowTransparent, "社区", - UserManager.getInstance().community.name, + CommunityManager.getInstance().community.name, null, "发布-空白", "发布-返回", diff --git a/app/src/main/java/com/gh/gamecenter/forum/home/CommunityHomeViewModel.kt b/app/src/main/java/com/gh/gamecenter/forum/home/CommunityHomeViewModel.kt index 3daf5fad05..a6d622ebf5 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/home/CommunityHomeViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/home/CommunityHomeViewModel.kt @@ -2,6 +2,7 @@ package com.gh.gamecenter.forum.home import android.app.Application import androidx.lifecycle.* +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.common.utils.clearHtmlFormatCompletely import com.gh.gamecenter.common.utils.observableToMain import com.gh.gamecenter.common.utils.removeInsertedContent diff --git a/app/src/main/java/com/gh/gamecenter/forum/home/ForumActivityAdapter.kt b/app/src/main/java/com/gh/gamecenter/forum/home/ForumActivityAdapter.kt index b689767ad1..f954c18ec4 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/home/ForumActivityAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/home/ForumActivityAdapter.kt @@ -11,7 +11,7 @@ import com.gh.common.util.* import com.gh.common.util.NewLogUtils import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.ForumActivityItemBinding diff --git a/app/src/main/java/com/gh/gamecenter/forum/home/ForumActivityFragment.kt b/app/src/main/java/com/gh/gamecenter/forum/home/ForumActivityFragment.kt index c47f5c33e2..f8dc572782 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/home/ForumActivityFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/home/ForumActivityFragment.kt @@ -8,7 +8,7 @@ import androidx.recyclerview.widget.RecyclerView import com.ethanhua.skeleton.Skeleton import com.gh.common.util.NewLogUtils import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.LazyListFragment +import com.gh.gamecenter.common.baselist.LazyListFragment import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.common.view.SpacingItemDecoration diff --git a/app/src/main/java/com/gh/gamecenter/forum/home/ForumActivityViewModel.kt b/app/src/main/java/com/gh/gamecenter/forum/home/ForumActivityViewModel.kt index 8c1bf97640..c71527a215 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/home/ForumActivityViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/home/ForumActivityViewModel.kt @@ -4,7 +4,7 @@ import android.annotation.SuppressLint import android.app.Application import androidx.lifecycle.MutableLiveData import com.gh.gamecenter.common.utils.singleToMain -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.entity.ForumActivityCategoryEntity import com.gh.gamecenter.entity.ForumActivityEntity import com.gh.gamecenter.common.retrofit.BiResponse diff --git a/app/src/main/java/com/gh/gamecenter/forum/home/ForumArticleAskItemViewHolder.kt b/app/src/main/java/com/gh/gamecenter/forum/home/ForumArticleAskItemViewHolder.kt index 8e7a21c13d..4e55338eab 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/home/ForumArticleAskItemViewHolder.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/home/ForumArticleAskItemViewHolder.kt @@ -16,11 +16,12 @@ import com.gh.gamecenter.common.callback.ConfirmListener import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.CommunityAnswerItemBinding -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.entity.ForumVideoEntity import com.gh.gamecenter.eventbus.EBUserFollow import com.gh.gamecenter.forum.detail.ForumDetailActivity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager +import com.gh.gamecenter.manager.CommunityManager import com.gh.gamecenter.qa.answer.BaseAnswerOrArticleItemViewHolder import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity import com.gh.gamecenter.qa.entity.AnswerEntity @@ -363,7 +364,7 @@ class ForumArticleAskItemViewHolder(val binding: CommunityAnswerItemBinding) : B } when (entity.type) { "community_article" -> { - val communityId = if (entity.bbs.id.isNotEmpty()) entity.bbs.id else UserManager.getInstance().community.id + val communityId = if (entity.bbs.id.isNotEmpty()) entity.bbs.id else CommunityManager.getInstance().community.id val intent = ArticleDetailActivity.getCommentIntent( itemView.context, CommunityEntity(communityId, entity.communityName ?: ""), @@ -374,7 +375,7 @@ class ForumArticleAskItemViewHolder(val binding: CommunityAnswerItemBinding) : B MtaHelper.onEvent(getEventId(entrance), getKey(entrance), "评论图标") } "video" -> { - val communityId = if (entity.bbs.id.isNotEmpty()) entity.bbs.id else UserManager.getInstance().community.id + val communityId = if (entity.bbs.id.isNotEmpty()) entity.bbs.id else CommunityManager.getInstance().community.id itemView.context.startActivity( ForumVideoDetailActivity.getIntent( itemView.context, entity.id diff --git a/app/src/main/java/com/gh/gamecenter/forum/home/ForumArticleListAdapter.kt b/app/src/main/java/com/gh/gamecenter/forum/home/ForumArticleListAdapter.kt index 7e4750f149..ad3ef49547 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/home/ForumArticleListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/home/ForumArticleListAdapter.kt @@ -15,11 +15,11 @@ import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.utils.goneIf import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.common.utils.toDrawable import com.gh.gamecenter.databinding.CommunityAnswerItemBinding -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity import com.gh.gamecenter.qa.entity.ArticleEntity import com.gh.gamecenter.qa.questions.newdetail.NewQuestionDetailActivity diff --git a/app/src/main/java/com/gh/gamecenter/forum/home/ForumArticleListFragment.kt b/app/src/main/java/com/gh/gamecenter/forum/home/ForumArticleListFragment.kt index cd8ef1dfcb..781b7dd311 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/home/ForumArticleListFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/home/ForumArticleListFragment.kt @@ -9,7 +9,7 @@ import com.ethanhua.skeleton.Skeleton import com.gh.common.util.CheckLoginUtils import com.gh.common.util.NewLogUtils import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.LazyListFragment +import com.gh.gamecenter.common.baselist.LazyListFragment import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.* @@ -25,7 +25,7 @@ import com.gh.gamecenter.eventbus.EBUserFollow import com.gh.gamecenter.forum.home.ForumScrollCalculatorHelper.Companion.getPlaySchedule import com.gh.gamecenter.forum.home.ForumScrollCalculatorHelper.Companion.savePlaySchedule import com.gh.gamecenter.qa.entity.ArticleEntity -import com.gh.gamecenter.user.UserViewModel +import com.gh.gamecenter.login.user.UserViewModel import com.gh.gamecenter.video.detail.CustomManager import com.google.android.material.appbar.AppBarLayout import com.shuyu.gsyvideoplayer.video.base.GSYVideoView diff --git a/app/src/main/java/com/gh/gamecenter/forum/home/ForumArticleListViewModel.kt b/app/src/main/java/com/gh/gamecenter/forum/home/ForumArticleListViewModel.kt index 26ef01deee..e5656087a3 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/home/ForumArticleListViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/home/ForumArticleListViewModel.kt @@ -6,11 +6,11 @@ import androidx.lifecycle.MutableLiveData import com.gh.gamecenter.core.utils.UrlFilterUtils import com.gh.gamecenter.common.utils.createRequestBodyAny import com.gh.gamecenter.common.utils.singleToMain -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.entity.ForumEntity import com.gh.gamecenter.entity.ForumUnreadEntity import com.gh.gamecenter.entity.ForumVideoEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.qa.entity.ArticleEntity import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/gamecenter/forum/home/ForumBannerPageAdapter.java b/app/src/main/java/com/gh/gamecenter/forum/home/ForumBannerPageAdapter.java index 8dcb5e4471..8aa1dc5af4 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/home/ForumBannerPageAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/forum/home/ForumBannerPageAdapter.java @@ -14,7 +14,7 @@ import com.gh.gamecenter.common.utils.ImageUtils; import com.gh.gamecenter.core.utils.MtaHelper; import com.gh.gamecenter.adapter.RecyclingPagerAdapter; import com.gh.gamecenter.databinding.AskRecommendsSubjectItemBinding; -import com.gh.gamecenter.entity.LinkEntity; +import com.gh.gamecenter.common.entity.LinkEntity; import java.util.List; diff --git a/app/src/main/java/com/gh/gamecenter/forum/home/ForumFragment.kt b/app/src/main/java/com/gh/gamecenter/forum/home/ForumFragment.kt index 788c5c03be..5584969e49 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/home/ForumFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/home/ForumFragment.kt @@ -30,7 +30,7 @@ import com.gh.gamecenter.entity.ForumEntity import com.gh.gamecenter.eventbus.EBForumFollowChange import com.gh.gamecenter.eventbus.EBForumRecordChange import com.gh.gamecenter.forum.list.ForumListActivity -import com.gh.gamecenter.user.UserViewModel +import com.gh.gamecenter.login.user.UserViewModel import com.halo.assistant.HaloApp import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode diff --git a/app/src/main/java/com/gh/gamecenter/forum/home/ForumHomeViewModel.kt b/app/src/main/java/com/gh/gamecenter/forum/home/ForumHomeViewModel.kt index a92a8c5d36..030bdb659c 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/home/ForumHomeViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/home/ForumHomeViewModel.kt @@ -6,9 +6,9 @@ import androidx.lifecycle.MediatorLiveData import com.gh.gamecenter.common.utils.observableToMain import com.gh.gamecenter.common.utils.toRequestBody import com.gh.gamecenter.entity.ForumEntity -import com.gh.gamecenter.entity.LinkEntity +import com.gh.gamecenter.common.entity.LinkEntity import com.gh.gamecenter.manager.PackagesManager -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.retrofit.RetrofitManager import io.reactivex.Observable diff --git a/app/src/main/java/com/gh/gamecenter/forum/home/ForumViewModel.kt b/app/src/main/java/com/gh/gamecenter/forum/home/ForumViewModel.kt index 02eef20134..85b5b3da04 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/home/ForumViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/home/ForumViewModel.kt @@ -9,7 +9,7 @@ import com.gh.gamecenter.common.utils.singleToMain import com.gh.gamecenter.entity.ForumBannerEntity import com.gh.gamecenter.entity.ForumEntity import com.gh.gamecenter.entity.ForumUnreadEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/gamecenter/forum/list/ForumListAdapter.kt b/app/src/main/java/com/gh/gamecenter/forum/list/ForumListAdapter.kt index 41cf5fdaa3..d82bbeecc1 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/list/ForumListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/list/ForumListAdapter.kt @@ -9,7 +9,7 @@ import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.* import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.core.utils.ToastUtils import com.gh.gamecenter.common.utils.debounceActionWithInterval import com.gh.gamecenter.common.utils.toBinding diff --git a/app/src/main/java/com/gh/gamecenter/forum/list/ForumListFragment.kt b/app/src/main/java/com/gh/gamecenter/forum/list/ForumListFragment.kt index 3d725d1cb2..2c1f8e0f61 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/list/ForumListFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/list/ForumListFragment.kt @@ -3,7 +3,7 @@ package com.gh.gamecenter.forum.list import android.os.Bundle import com.gh.common.util.* import com.gh.gamecenter.common.view.SpacingItemDecoration -import com.gh.gamecenter.baselist.ListFragment +import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.utils.viewModelProvider diff --git a/app/src/main/java/com/gh/gamecenter/forum/list/ForumListVIewModel.kt b/app/src/main/java/com/gh/gamecenter/forum/list/ForumListVIewModel.kt index 55b47d8fca..73263f562e 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/list/ForumListVIewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/list/ForumListVIewModel.kt @@ -2,9 +2,9 @@ package com.gh.gamecenter.forum.list import android.annotation.SuppressLint import android.app.Application -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.entity.ForumEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.retrofit.RetrofitManager import io.reactivex.Observable diff --git a/app/src/main/java/com/gh/gamecenter/forum/moderator/ApplyModeratorFragment.kt b/app/src/main/java/com/gh/gamecenter/forum/moderator/ApplyModeratorFragment.kt index f0c46ff8ca..f2744f05f9 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/moderator/ApplyModeratorFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/moderator/ApplyModeratorFragment.kt @@ -22,7 +22,7 @@ import com.gh.gamecenter.databinding.FragmentApplyModeratorBinding import com.gh.gamecenter.entity.ApplyModeratorStatusEntity import com.gh.gamecenter.entity.ApplyModeratorTaskEntity import com.gh.gamecenter.forum.detail.ForumDetailActivity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.base.fragment.ToolbarFragment import com.gh.gamecenter.core.utils.ToastUtils import com.lightgame.utils.AppManager diff --git a/app/src/main/java/com/gh/gamecenter/forum/moderator/ModeratorListAdapter.kt b/app/src/main/java/com/gh/gamecenter/forum/moderator/ModeratorListAdapter.kt index 2076b7c78b..aa230c19cf 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/moderator/ModeratorListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/moderator/ModeratorListAdapter.kt @@ -12,7 +12,7 @@ import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.common.utils.ImageUtils import com.gh.gamecenter.databinding.ModeratorListItemBinding import com.gh.gamecenter.entity.PersonalEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.lightgame.adapter.BaseRecyclerAdapter class ModeratorListAdapter(context: Context, val mViewModel: ModeratorListViewModel?) : BaseRecyclerAdapter(context) { diff --git a/app/src/main/java/com/gh/gamecenter/forum/moderator/ModeratorTaskAdapter.kt b/app/src/main/java/com/gh/gamecenter/forum/moderator/ModeratorTaskAdapter.kt index 29cbace40b..1cafad099b 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/moderator/ModeratorTaskAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/moderator/ModeratorTaskAdapter.kt @@ -39,7 +39,7 @@ class ModeratorTaskAdapter(context: Context) : taskNameTv.text = taskEntity.taskName taskIconIv.setImageDrawable(taskEntity.taskIcon.toDrawable()) finishTv.background = - if (taskEntity.finishedTask) R.drawable.bg_moderator_task_disabled.toDrawable() else R.drawable.login_btn_bg.toDrawable() + if (taskEntity.finishedTask) R.drawable.bg_moderator_task_disabled.toDrawable() else R.drawable.download_button_normal_style.toDrawable() finishTv.text = if (taskEntity.finishedTask) "已完成" else "去完成" finishTv.setTextColor(if (taskEntity.finishedTask) R.color.text_subtitleDesc.toColor() else R.color.white.toColor()) finishTv.setOnClickListener(taskEntity.taskAction) diff --git a/app/src/main/java/com/gh/gamecenter/forum/search/ForumContentSearchListAdapter.kt b/app/src/main/java/com/gh/gamecenter/forum/search/ForumContentSearchListAdapter.kt index 1a87bebe1f..d719286f58 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/search/ForumContentSearchListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/search/ForumContentSearchListAdapter.kt @@ -17,14 +17,14 @@ import com.gh.common.util.* import com.gh.common.util.NewLogUtils import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.CommunityAnswerItemBinding import com.gh.gamecenter.databinding.ForumSearchContentListBinding -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.forum.home.ForumArticleAskItemViewHolder -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity import com.gh.gamecenter.qa.entity.AnswerEntity import com.gh.gamecenter.qa.entity.Questions diff --git a/app/src/main/java/com/gh/gamecenter/forum/search/ForumContentSearchListFragment.kt b/app/src/main/java/com/gh/gamecenter/forum/search/ForumContentSearchListFragment.kt index 236e30b13b..d13a39cf1e 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/search/ForumContentSearchListFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/search/ForumContentSearchListFragment.kt @@ -11,8 +11,8 @@ import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.viewModelProvider import com.gh.gamecenter.common.view.divider.HorizontalDividerItemDecoration import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.ListFragment +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.qa.entity.AnswerEntity class ForumContentSearchListFragment : ListFragment() { diff --git a/app/src/main/java/com/gh/gamecenter/forum/search/ForumContentSearchListViewModel.kt b/app/src/main/java/com/gh/gamecenter/forum/search/ForumContentSearchListViewModel.kt index df633f6483..426631ea73 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/search/ForumContentSearchListViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/search/ForumContentSearchListViewModel.kt @@ -3,8 +3,8 @@ package com.gh.gamecenter.forum.search import android.app.Application import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.qa.entity.AnswerEntity import com.gh.gamecenter.retrofit.RetrofitManager import com.halo.assistant.HaloApp diff --git a/app/src/main/java/com/gh/gamecenter/forum/search/UserSearchListAdapter.kt b/app/src/main/java/com/gh/gamecenter/forum/search/UserSearchListAdapter.kt index e284d66789..8b978f1d9d 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/search/UserSearchListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/search/UserSearchListAdapter.kt @@ -9,7 +9,7 @@ import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.* import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.callback.ConfirmListener import com.gh.gamecenter.common.utils.goneIf import com.gh.gamecenter.common.utils.toBinding @@ -19,7 +19,7 @@ import com.gh.gamecenter.common.utils.ImageUtils import com.gh.gamecenter.core.utils.MtaHelper import com.gh.gamecenter.databinding.UserSearchListItemBinding import com.gh.gamecenter.entity.FollowersOrFansEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager class UserSearchListAdapter(context: Context, val mEntrance: String, val mViewModel: UserSearchListViewModel) : ListAdapter(context) { diff --git a/app/src/main/java/com/gh/gamecenter/forum/search/UserSearchListFragment.kt b/app/src/main/java/com/gh/gamecenter/forum/search/UserSearchListFragment.kt index 5a89c45a9f..b4469e50c9 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/search/UserSearchListFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/search/UserSearchListFragment.kt @@ -7,8 +7,8 @@ import android.widget.TextView import androidx.core.content.ContextCompat import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.ListFragment +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.entity.FollowersOrFansEntity import com.gh.gamecenter.eventbus.EBUserFollow import org.greenrobot.eventbus.Subscribe diff --git a/app/src/main/java/com/gh/gamecenter/forum/search/UserSearchListViewModel.kt b/app/src/main/java/com/gh/gamecenter/forum/search/UserSearchListViewModel.kt index 2462eebc35..a95cbe5def 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/search/UserSearchListViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/search/UserSearchListViewModel.kt @@ -2,8 +2,8 @@ package com.gh.gamecenter.forum.search import android.app.Application import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.entity.FollowersOrFansEntity import com.gh.gamecenter.eventbus.EBUserFollow import com.gh.gamecenter.common.retrofit.Response diff --git a/app/src/main/java/com/gh/gamecenter/forum/select/ForumAdapter.kt b/app/src/main/java/com/gh/gamecenter/forum/select/ForumAdapter.kt index 778f979cc3..4036d85eb6 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/select/ForumAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/select/ForumAdapter.kt @@ -9,7 +9,7 @@ import com.gh.gamecenter.R import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.ForumItemBinding -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.entity.ForumEntity import com.gh.gamecenter.eventbus.EBForumFollowChange import com.gh.gamecenter.forum.detail.ForumDetailActivity diff --git a/app/src/main/java/com/gh/gamecenter/forum/select/ForumSelectFragment.kt b/app/src/main/java/com/gh/gamecenter/forum/select/ForumSelectFragment.kt index 919934232a..eb9d3df369 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/select/ForumSelectFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/select/ForumSelectFragment.kt @@ -7,10 +7,10 @@ import androidx.recyclerview.widget.LinearLayoutManager import com.gh.gamecenter.common.utils.viewModelProvider import com.gh.gamecenter.R import com.gh.gamecenter.databinding.FragmentForumSelectBinding -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.entity.ForumCategoryEntity import com.gh.gamecenter.eventbus.EBForumFollowChange -import com.gh.gamecenter.mvvm.Status +import com.gh.gamecenter.common.mvvm.Status import com.gh.gamecenter.common.base.fragment.ToolbarFragment import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode @@ -37,8 +37,8 @@ class ForumSelectFragment : ToolbarFragment() { val data = it.data as ArrayList if (onSelectCallback != null) data.add(0, ForumCategoryEntity("", "我的关注")) mForumCategoryAdapter?.setListData(data) - if (it.data.isNotEmpty()) { - selectCategory = it.data[0] + if (data.isNotEmpty()) { + selectCategory = data[0] mViewModel?.getForumList(selectCategory) } } @@ -56,7 +56,7 @@ class ForumSelectFragment : ToolbarFragment() { if (it.status == Status.SUCCESS) { if (!it.data.isNullOrEmpty()) { mBinding.reuseNoneData.root.visibility = View.GONE - mForumAdapter?.setListData(it.data) + mForumAdapter?.setListData(it.data!!) mBinding.forumRv.visibility = View.VISIBLE } else { mBinding.reuseNoneData.root.visibility = View.VISIBLE diff --git a/app/src/main/java/com/gh/gamecenter/forum/select/ForumSelectViewModel.kt b/app/src/main/java/com/gh/gamecenter/forum/select/ForumSelectViewModel.kt index 1b55f7aeb0..72583c9cef 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/select/ForumSelectViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/select/ForumSelectViewModel.kt @@ -6,8 +6,8 @@ import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.MutableLiveData import com.gh.gamecenter.entity.ForumCategoryEntity import com.gh.gamecenter.entity.ForumEntity -import com.gh.gamecenter.manager.UserManager -import com.gh.gamecenter.mvvm.Resource +import com.gh.gamecenter.login.user.UserManager +import com.gh.gamecenter.common.mvvm.Resource import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/gamecenter/fragment/MainWrapperFragment.java b/app/src/main/java/com/gh/gamecenter/fragment/MainWrapperFragment.java index dccbc380ab..3c962a6ab4 100644 --- a/app/src/main/java/com/gh/gamecenter/fragment/MainWrapperFragment.java +++ b/app/src/main/java/com/gh/gamecenter/fragment/MainWrapperFragment.java @@ -56,7 +56,7 @@ import com.gh.gamecenter.entity.SettingsEntity; import com.gh.gamecenter.entity.SubjectData; import com.gh.gamecenter.entity.SubjectRecommendEntity; import com.gh.gamecenter.entity.WelcomeDialogEntity; -import com.gh.gamecenter.eventbus.EBReuse; +import com.gh.gamecenter.common.eventbus.EBReuse; import com.gh.gamecenter.eventbus.EBSkip; import com.gh.gamecenter.eventbus.EBUISwitch; import com.gh.gamecenter.forum.home.CommunityHomeFragment; diff --git a/app/src/main/java/com/gh/gamecenter/fragment/MainWrapperViewModel.kt b/app/src/main/java/com/gh/gamecenter/fragment/MainWrapperViewModel.kt index f8aaf2bc22..effcb4f12c 100644 --- a/app/src/main/java/com/gh/gamecenter/fragment/MainWrapperViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/fragment/MainWrapperViewModel.kt @@ -16,7 +16,7 @@ import com.gh.gamecenter.entity.DialogEntity import com.gh.gamecenter.entity.SimpleGameEntity import com.gh.gamecenter.entity.SubjectRecommendEntity import com.gh.gamecenter.entity.WelcomeDialogEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.retrofit.RetrofitManager import com.halo.assistant.HaloApp import io.reactivex.android.schedulers.AndroidSchedulers diff --git a/app/src/main/java/com/gh/gamecenter/fragment/SearchToolWrapperFragment.java b/app/src/main/java/com/gh/gamecenter/fragment/SearchToolWrapperFragment.java index 0a169f3eaf..9c03a955eb 100644 --- a/app/src/main/java/com/gh/gamecenter/fragment/SearchToolWrapperFragment.java +++ b/app/src/main/java/com/gh/gamecenter/fragment/SearchToolWrapperFragment.java @@ -12,7 +12,7 @@ import com.gh.gamecenter.common.base.fragment.LazyFragment; import com.gh.gamecenter.common.base.fragment.ToolbarFragment; import com.gh.gamecenter.common.constant.EntranceConsts; import com.gh.gamecenter.core.utils.DisplayUtils; -import com.gh.gamecenter.eventbus.EBReuse; +import com.gh.gamecenter.common.eventbus.EBReuse; import com.gh.gamecenter.game.GameFragment; import org.greenrobot.eventbus.Subscribe; diff --git a/app/src/main/java/com/gh/gamecenter/fragment/SearchToolbarFragment.java b/app/src/main/java/com/gh/gamecenter/fragment/SearchToolbarFragment.java index 51b80c0a97..af8e882657 100644 --- a/app/src/main/java/com/gh/gamecenter/fragment/SearchToolbarFragment.java +++ b/app/src/main/java/com/gh/gamecenter/fragment/SearchToolbarFragment.java @@ -40,10 +40,10 @@ import com.gh.gamecenter.DownloadManagerActivity; import com.gh.gamecenter.MessageActivity; import com.gh.gamecenter.R; import com.gh.gamecenter.SearchActivity; -import com.gh.gamecenter.energy.EnergyCenterActivity; +import com.gh.gamecenter.energy.view.EnergyCenterActivity; import com.gh.gamecenter.entity.GameUpdateEntity; import com.gh.gamecenter.eventbus.EBDownloadStatus; -import com.gh.gamecenter.eventbus.EBReuse; +import com.gh.gamecenter.common.eventbus.EBReuse; import com.gh.gamecenter.message.MessageUnreadViewModel; import com.gh.gamecenter.packagehelper.PackageViewModel; import com.gh.gamecenter.teenagermode.TeenagerModeActivity; diff --git a/app/src/main/java/com/gh/gamecenter/fragment/WelcomeDialogFragment.kt b/app/src/main/java/com/gh/gamecenter/fragment/WelcomeDialogFragment.kt index 84f7308a3c..7295aa078e 100644 --- a/app/src/main/java/com/gh/gamecenter/fragment/WelcomeDialogFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/fragment/WelcomeDialogFragment.kt @@ -15,7 +15,7 @@ import com.gh.gamecenter.common.view.WrapContentDraweeView import com.gh.gamecenter.core.utils.MtaHelper import com.gh.gamecenter.core.utils.TimeElapsedHelper import com.gh.gamecenter.databinding.DialogWelcomeBinding -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.entity.WelcomeDialogEntity import com.halo.assistant.HaloApp diff --git a/app/src/main/java/com/gh/gamecenter/game/GameFragment.kt b/app/src/main/java/com/gh/gamecenter/game/GameFragment.kt index d2304afa3f..3e3b89f9df 100644 --- a/app/src/main/java/com/gh/gamecenter/game/GameFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/game/GameFragment.kt @@ -17,9 +17,9 @@ import com.gh.common.xapk.XapkInstaller import com.gh.common.xapk.XapkUnzipStatus import com.gh.download.DownloadManager import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.LoadStatus import com.gh.gamecenter.common.base.fragment.LazyFragment import com.gh.gamecenter.common.constant.Constants +import com.gh.gamecenter.common.baselist.LoadStatus import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.utils.goneIf @@ -29,8 +29,8 @@ import com.gh.gamecenter.common.view.FixLinearLayoutManager import com.gh.gamecenter.databinding.FragmentGameBinding import com.gh.gamecenter.eventbus.EBDownloadStatus import com.gh.gamecenter.eventbus.EBPackage -import com.gh.gamecenter.eventbus.EBReuse import com.gh.gamecenter.eventbus.EBUISwitch +import com.gh.gamecenter.common.eventbus.EBReuse import com.gh.gamecenter.fragment.MainWrapperFragment import com.gh.gamecenter.game.data.GameItemData import com.halo.assistant.HaloApp diff --git a/app/src/main/java/com/gh/gamecenter/game/GameFragmentAdapter.kt b/app/src/main/java/com/gh/gamecenter/game/GameFragmentAdapter.kt index ddc5408f03..08b86fae5c 100644 --- a/app/src/main/java/com/gh/gamecenter/game/GameFragmentAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/game/GameFragmentAdapter.kt @@ -24,12 +24,14 @@ import com.gh.gamecenter.MainActivity import com.gh.gamecenter.R import com.gh.gamecenter.adapter.ImagePagerAdapter import com.gh.gamecenter.adapter.viewholder.* -import com.gh.gamecenter.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.LoadStatus import com.gh.gamecenter.category.CategoryDirectoryActivity import com.gh.gamecenter.common.callback.OnViewClickListener import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.constant.ItemViewType +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.common.entity.ExposureEntity +import com.gh.gamecenter.common.entity.LinkEntity import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.common.view.FixGridLayoutManager import com.gh.gamecenter.common.view.GridSpacingItemDecoration diff --git a/app/src/main/java/com/gh/gamecenter/game/GameNavigationAdapter.kt b/app/src/main/java/com/gh/gamecenter/game/GameNavigationAdapter.kt index 00199e2fe9..501710e130 100644 --- a/app/src/main/java/com/gh/gamecenter/game/GameNavigationAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/game/GameNavigationAdapter.kt @@ -7,7 +7,7 @@ import androidx.recyclerview.widget.RecyclerView import com.gh.common.exposure.* import com.gh.common.util.* -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.base.BaseRecyclerViewHolder import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.common.entity.ExposureEntity diff --git a/app/src/main/java/com/gh/gamecenter/game/GameViewModel.kt b/app/src/main/java/com/gh/gamecenter/game/GameViewModel.kt index a0f2a37b4a..8818f2772b 100644 --- a/app/src/main/java/com/gh/gamecenter/game/GameViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/game/GameViewModel.kt @@ -10,8 +10,9 @@ import com.gh.common.filter.RegionSettingHelper import com.gh.gamecenter.core.iinterface.IOffsetable import com.gh.common.util.* import com.gh.download.DownloadManager -import com.gh.gamecenter.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.LoadStatus import com.gh.gamecenter.common.constant.EntranceConsts +import com.gh.gamecenter.common.entity.LinkEntity import com.gh.gamecenter.core.utils.RandomUtils import com.gh.gamecenter.core.utils.SPUtils import com.gh.gamecenter.common.utils.countOccurrences diff --git a/app/src/main/java/com/gh/gamecenter/game/bigimagerecommend/BigImageRecommendViewHolder.kt b/app/src/main/java/com/gh/gamecenter/game/bigimagerecommend/BigImageRecommendViewHolder.kt index 724f2cde0a..dd706ffc0b 100644 --- a/app/src/main/java/com/gh/gamecenter/game/bigimagerecommend/BigImageRecommendViewHolder.kt +++ b/app/src/main/java/com/gh/gamecenter/game/bigimagerecommend/BigImageRecommendViewHolder.kt @@ -5,7 +5,7 @@ import com.gh.gamecenter.common.base.BaseRecyclerViewHolder import com.gh.gamecenter.common.utils.ImageUtils import com.gh.gamecenter.common.utils.goneIf import com.gh.gamecenter.databinding.BigImageRecommendItemBinding -import com.gh.gamecenter.entity.LinkEntity +import com.gh.gamecenter.common.entity.LinkEntity import com.gh.gamecenter.entity.SubjectEntity class BigImageRecommendViewHolder(val binding: BigImageRecommendItemBinding) : BaseRecyclerViewHolder(binding.root) { diff --git a/app/src/main/java/com/gh/gamecenter/game/columncollection/detail/ColumnCollectionDetailAdapter.kt b/app/src/main/java/com/gh/gamecenter/game/columncollection/detail/ColumnCollectionDetailAdapter.kt index 54bd008f7c..2e7f2be7ee 100644 --- a/app/src/main/java/com/gh/gamecenter/game/columncollection/detail/ColumnCollectionDetailAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/game/columncollection/detail/ColumnCollectionDetailAdapter.kt @@ -14,9 +14,9 @@ import com.gh.gamecenter.core.utils.PageSwitchDataHelper import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameColumnCollectionItemViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.databinding.GameColumnCollectionItemBinding -import com.gh.gamecenter.entity.LinkEntity +import com.gh.gamecenter.common.entity.LinkEntity class ColumnCollectionDetailAdapter( context: Context, diff --git a/app/src/main/java/com/gh/gamecenter/game/columncollection/detail/ColumnCollectionDetailFragment.kt b/app/src/main/java/com/gh/gamecenter/game/columncollection/detail/ColumnCollectionDetailFragment.kt index ac9c75fa16..0782906ade 100644 --- a/app/src/main/java/com/gh/gamecenter/game/columncollection/detail/ColumnCollectionDetailFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/game/columncollection/detail/ColumnCollectionDetailFragment.kt @@ -11,9 +11,9 @@ import com.gh.gamecenter.common.utils.observeNonNull import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.common.view.GridSpacingItemDecoration import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.LazyListFragment +import com.gh.gamecenter.common.baselist.LazyListFragment import com.gh.gamecenter.databinding.FragmentColumnCollectionDetailBinding -import com.gh.gamecenter.entity.LinkEntity +import com.gh.gamecenter.common.entity.LinkEntity import com.gh.gamecenter.entity.SubjectData import com.gh.gamecenter.subject.tab.SubjectTabFragment diff --git a/app/src/main/java/com/gh/gamecenter/game/columncollection/detail/ColumnCollectionDetailViewModel.kt b/app/src/main/java/com/gh/gamecenter/game/columncollection/detail/ColumnCollectionDetailViewModel.kt index e6403fa293..2d697e7905 100644 --- a/app/src/main/java/com/gh/gamecenter/game/columncollection/detail/ColumnCollectionDetailViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/game/columncollection/detail/ColumnCollectionDetailViewModel.kt @@ -5,11 +5,11 @@ import android.app.Application import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.baselist.LoadStatus -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.entity.GameColumnCollection -import com.gh.gamecenter.entity.LinkEntity +import com.gh.gamecenter.common.entity.LinkEntity import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.retrofit.RetrofitManager import com.halo.assistant.HaloApp diff --git a/app/src/main/java/com/gh/gamecenter/game/commoncollection/CommonCollectionAdapter.kt b/app/src/main/java/com/gh/gamecenter/game/commoncollection/CommonCollectionAdapter.kt index 766d07b920..567d69b432 100644 --- a/app/src/main/java/com/gh/gamecenter/game/commoncollection/CommonCollectionAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/game/commoncollection/CommonCollectionAdapter.kt @@ -13,7 +13,7 @@ import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.common.utils.ImageUtils import com.gh.gamecenter.core.utils.DisplayUtils import com.gh.gamecenter.entity.CommonCollectionContentEntity -import com.gh.gamecenter.entity.LinkEntity +import com.gh.gamecenter.entity.ExposureLinkEntity import com.gh.gamecenter.entity.SubjectEntity import com.lightgame.adapter.BaseRecyclerAdapter @@ -21,7 +21,7 @@ class CommonCollectionAdapter( context: Context, private var mSubjectEntity: SubjectEntity, private var mClickClosure: (position: Int, contentEntity: CommonCollectionContentEntity) -> Unit, - private var mExposureClosure: (position: Int, entity: LinkEntity) -> Unit + private var mExposureClosure: (position: Int, entity: ExposureLinkEntity) -> Unit ) : BaseRecyclerAdapter(context) { diff --git a/app/src/main/java/com/gh/gamecenter/game/commoncollection/CommonCollectionViewHolder.kt b/app/src/main/java/com/gh/gamecenter/game/commoncollection/CommonCollectionViewHolder.kt index 6a5464dd3a..b93cc54284 100644 --- a/app/src/main/java/com/gh/gamecenter/game/commoncollection/CommonCollectionViewHolder.kt +++ b/app/src/main/java/com/gh/gamecenter/game/commoncollection/CommonCollectionViewHolder.kt @@ -10,7 +10,8 @@ import com.gh.gamecenter.common.view.GridSpacingItemDecoration import com.gh.gamecenter.common.view.SpacingItemDecoration import com.gh.gamecenter.databinding.CommonCollectionListBinding import com.gh.gamecenter.entity.CommonCollectionContentEntity -import com.gh.gamecenter.entity.LinkEntity +import com.gh.gamecenter.common.entity.LinkEntity +import com.gh.gamecenter.entity.ExposureLinkEntity import com.gh.gamecenter.entity.SubjectEntity class CommonCollectionViewHolder(val binding: CommonCollectionListBinding) : BaseRecyclerViewHolder(binding.root) { @@ -24,7 +25,7 @@ class CommonCollectionViewHolder(val binding: CommonCollectionListBinding) : Bas blockId: String, blockName: String, clickClosure: (position: Int, contentEntity: CommonCollectionContentEntity) -> Unit, - exposureClosure: (position: Int, linkEntity: LinkEntity) -> Unit + exposureClosure: (position: Int, linkEntity: ExposureLinkEntity) -> Unit ) { mCollection = collection binding.collectionList.apply { diff --git a/app/src/main/java/com/gh/gamecenter/game/commoncollection/detail/CommonCollectionDetailAdapter.kt b/app/src/main/java/com/gh/gamecenter/game/commoncollection/detail/CommonCollectionDetailAdapter.kt index 4fbead6f6a..55076e47bd 100644 --- a/app/src/main/java/com/gh/gamecenter/game/commoncollection/detail/CommonCollectionDetailAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/game/commoncollection/detail/CommonCollectionDetailAdapter.kt @@ -12,7 +12,7 @@ import com.gh.common.util.* import com.gh.gamecenter.adapter.viewholder.CommonCollectionDetailOneItemViewHolder import com.gh.gamecenter.adapter.viewholder.CommonCollectionDetailTwoItemViewHolder import com.gh.gamecenter.adapter.viewholder.CommonCollectionImageTextItemViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.goneIf import com.gh.gamecenter.common.utils.toBinding import com.gh.gamecenter.common.utils.ImageUtils diff --git a/app/src/main/java/com/gh/gamecenter/game/commoncollection/detail/CommonCollectionDetailFragment.kt b/app/src/main/java/com/gh/gamecenter/game/commoncollection/detail/CommonCollectionDetailFragment.kt index d6a405bcb9..752557cc76 100644 --- a/app/src/main/java/com/gh/gamecenter/game/commoncollection/detail/CommonCollectionDetailFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/game/commoncollection/detail/CommonCollectionDetailFragment.kt @@ -9,8 +9,8 @@ import com.gh.common.exposure.ExposureListener import com.gh.common.exposure.IExposable import com.gh.common.util.NewLogUtils import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.LazyListFragment -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.LazyListFragment +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.dip2px @@ -19,7 +19,7 @@ import com.gh.gamecenter.common.view.FixGridLayoutManager import com.gh.gamecenter.common.view.GridSpacingItemDecoration import com.gh.gamecenter.common.view.VerticalItemDecoration import com.gh.gamecenter.databinding.FragmentListBaseSkeletonBinding -import com.gh.gamecenter.entity.LinkEntity +import com.gh.gamecenter.common.entity.LinkEntity class CommonCollectionDetailFragment : LazyListFragment() { diff --git a/app/src/main/java/com/gh/gamecenter/game/commoncollection/detail/CommonCollectionDetailViewModel.kt b/app/src/main/java/com/gh/gamecenter/game/commoncollection/detail/CommonCollectionDetailViewModel.kt index e550e7081a..acd7497145 100644 --- a/app/src/main/java/com/gh/gamecenter/game/commoncollection/detail/CommonCollectionDetailViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/game/commoncollection/detail/CommonCollectionDetailViewModel.kt @@ -4,10 +4,9 @@ import android.app.Application import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.entity.CommonCollectionContentEntity import com.gh.gamecenter.entity.CommonCollectionEntity -import com.gh.gamecenter.entity.LinkEntity import com.gh.gamecenter.retrofit.RetrofitManager import com.halo.assistant.HaloApp import io.reactivex.Observable diff --git a/app/src/main/java/com/gh/gamecenter/game/data/GameItemData.kt b/app/src/main/java/com/gh/gamecenter/game/data/GameItemData.kt index a86c73932a..7052549dfd 100644 --- a/app/src/main/java/com/gh/gamecenter/game/data/GameItemData.kt +++ b/app/src/main/java/com/gh/gamecenter/game/data/GameItemData.kt @@ -1,6 +1,7 @@ package com.gh.gamecenter.game.data import com.gh.common.exposure.ExposureEvent +import com.gh.gamecenter.common.entity.LinkEntity import com.gh.gamecenter.entity.* import com.gh.gamecenter.gamecollection.square.GameCollectionListItemData diff --git a/app/src/main/java/com/gh/gamecenter/game/upload/GameUploadViewModel.kt b/app/src/main/java/com/gh/gamecenter/game/upload/GameUploadViewModel.kt index badf0f9cb9..796bf1e04e 100644 --- a/app/src/main/java/com/gh/gamecenter/game/upload/GameUploadViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/game/upload/GameUploadViewModel.kt @@ -6,7 +6,7 @@ import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/gamecenter/gamecollection/choose/AddUserPlayedGameFragment.kt b/app/src/main/java/com/gh/gamecenter/gamecollection/choose/AddUserPlayedGameFragment.kt index 2a4b2e913b..e0bf28c260 100644 --- a/app/src/main/java/com/gh/gamecenter/gamecollection/choose/AddUserPlayedGameFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/gamecollection/choose/AddUserPlayedGameFragment.kt @@ -7,11 +7,11 @@ import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.common.utils.viewModelProvider import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.ListFragment +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.common.utils.setRootBackgroundColor import com.gh.gamecenter.entity.GameEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.mygame.PlayedGameViewModel import com.gh.gamecenter.qa.editor.GameAdapter diff --git a/app/src/main/java/com/gh/gamecenter/gamecollection/choose/ChooseGamesAdapter.kt b/app/src/main/java/com/gh/gamecenter/gamecollection/choose/ChooseGamesAdapter.kt index bf24fdb4b2..c49a835cb8 100644 --- a/app/src/main/java/com/gh/gamecenter/gamecollection/choose/ChooseGamesAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/gamecollection/choose/ChooseGamesAdapter.kt @@ -9,7 +9,7 @@ import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.R import com.gh.gamecenter.common.base.BaseRecyclerViewHolder import com.gh.gamecenter.core.utils.PatternUtils -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.databinding.ItemChooseGamesBinding import com.gh.gamecenter.entity.GameEntity diff --git a/app/src/main/java/com/gh/gamecenter/gamecollection/detail/GameCollectionDetailFragment.kt b/app/src/main/java/com/gh/gamecenter/gamecollection/detail/GameCollectionDetailFragment.kt index 5352a83b4b..1d37fefc74 100644 --- a/app/src/main/java/com/gh/gamecenter/gamecollection/detail/GameCollectionDetailFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/gamecollection/detail/GameCollectionDetailFragment.kt @@ -20,8 +20,8 @@ import com.gh.common.xapk.XapkInstaller import com.gh.common.xapk.XapkUnzipStatus import com.gh.download.DownloadManager import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListFragment -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListFragment +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.entity.NormalShareEntity @@ -43,13 +43,13 @@ import com.gh.gamecenter.eventbus.EBPackage import com.gh.gamecenter.eventbus.EBUserFollow import com.gh.gamecenter.gamedetail.GameDetailFragment import com.gh.gamecenter.home.video.ScrollCalculatorHelper -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.qa.article.detail.CommentItemData import com.gh.gamecenter.qa.comment.CommentActivity import com.gh.gamecenter.qa.comment.base.BaseCommentAdapter import com.gh.gamecenter.qa.comment.base.BaseCommentViewModel import com.gh.gamecenter.setting.VideoSettingFragment -import com.gh.gamecenter.user.UserViewModel +import com.gh.gamecenter.login.user.UserViewModel import com.gh.gamecenter.video.detail.CustomManager import com.google.android.material.appbar.AppBarLayout import com.halo.assistant.HaloApp diff --git a/app/src/main/java/com/gh/gamecenter/gamecollection/detail/GameCollectionDetailViewModel.kt b/app/src/main/java/com/gh/gamecenter/gamecollection/detail/GameCollectionDetailViewModel.kt index 1ac8915def..ffe8e0fc37 100644 --- a/app/src/main/java/com/gh/gamecenter/gamecollection/detail/GameCollectionDetailViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/gamecollection/detail/GameCollectionDetailViewModel.kt @@ -14,7 +14,7 @@ import com.gh.gamecenter.common.syncpage.SyncFieldConstants import com.gh.gamecenter.common.syncpage.SyncPageRepository import com.gh.common.util.* import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.LoadStatus import com.gh.gamecenter.common.utils.observableToMain import com.gh.gamecenter.common.utils.singleToMain import com.gh.gamecenter.common.utils.toNewSimpleCount @@ -22,7 +22,7 @@ import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.entity.CommentEntity import com.gh.gamecenter.entity.GamesCollectionDetailEntity import com.gh.gamecenter.eventbus.EBUserFollow -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.qa.article.detail.CommentItemData import com.gh.gamecenter.qa.comment.base.BaseCommentViewModel import com.gh.gamecenter.common.retrofit.BiResponse diff --git a/app/src/main/java/com/gh/gamecenter/gamecollection/detail/GameCollectionPosterFragment.kt b/app/src/main/java/com/gh/gamecenter/gamecollection/detail/GameCollectionPosterFragment.kt index e509b8afbc..d8d7a17234 100644 --- a/app/src/main/java/com/gh/gamecenter/gamecollection/detail/GameCollectionPosterFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/gamecollection/detail/GameCollectionPosterFragment.kt @@ -5,17 +5,19 @@ import android.os.Build import android.os.Bundle import android.view.View import androidx.annotation.RequiresApi -import com.gh.common.util.DirectUtils +import com.gh.gamecenter.core.runOnUiThread +import com.gh.common.util.* import com.gh.gamecenter.R -import com.gh.gamecenter.common.base.fragment.ToolbarFragment import com.gh.gamecenter.common.callback.BiCallback import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.* -import com.gh.gamecenter.core.runOnUiThread +import com.gh.gamecenter.common.utils.ImageUtils +import com.gh.gamecenter.common.utils.BitmapUtils import com.gh.gamecenter.databinding.FragmentGameCollectionPosterBinding import com.gh.gamecenter.databinding.LayoutGameCollectionTagBinding import com.gh.gamecenter.entity.GamesCollectionDetailEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager +import com.gh.gamecenter.common.base.fragment.ToolbarFragment class GameCollectionPosterFragment : ToolbarFragment() { diff --git a/app/src/main/java/com/gh/gamecenter/gamecollection/detail/conversation/GameCollectionCommentConversationFragment.kt b/app/src/main/java/com/gh/gamecenter/gamecollection/detail/conversation/GameCollectionCommentConversationFragment.kt index 4cf9cc0d2e..d9ce0a5169 100644 --- a/app/src/main/java/com/gh/gamecenter/gamecollection/detail/conversation/GameCollectionCommentConversationFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/gamecollection/detail/conversation/GameCollectionCommentConversationFragment.kt @@ -16,14 +16,14 @@ import com.gh.gamecenter.common.syncpage.SyncDataEntity import com.gh.gamecenter.common.syncpage.SyncFieldConstants import com.gh.gamecenter.common.syncpage.SyncPageRepository import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.common.base.activity.ToolBarActivity import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.databinding.FragmentArticleDetailCommentBinding import com.gh.gamecenter.entity.CommentEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.qa.comment.base.BaseCommentAdapter import com.gh.gamecenter.qa.comment.base.BaseCommentFragment import com.gh.gamecenter.qa.comment.base.BaseCommentViewModel diff --git a/app/src/main/java/com/gh/gamecenter/gamecollection/mine/MyGameCollectionAdapter.kt b/app/src/main/java/com/gh/gamecenter/gamecollection/mine/MyGameCollectionAdapter.kt index 6165be8abe..31db573aec 100644 --- a/app/src/main/java/com/gh/gamecenter/gamecollection/mine/MyGameCollectionAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/gamecollection/mine/MyGameCollectionAdapter.kt @@ -9,7 +9,7 @@ import com.gh.gamecenter.core.utils.DisplayUtils import com.gh.gamecenter.common.utils.toBinding import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.entity.GamesCollectionEntity class MyGameCollectionAdapter( diff --git a/app/src/main/java/com/gh/gamecenter/gamecollection/mine/MyGameCollectionFragment.kt b/app/src/main/java/com/gh/gamecenter/gamecollection/mine/MyGameCollectionFragment.kt index f17b51fef9..b177df0384 100644 --- a/app/src/main/java/com/gh/gamecenter/gamecollection/mine/MyGameCollectionFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/gamecollection/mine/MyGameCollectionFragment.kt @@ -15,12 +15,12 @@ import com.gh.gamecenter.common.view.VerticalItemDecoration import com.gh.gamecenter.common.base.activity.ToolBarActivity import com.gh.gamecenter.R import com.gh.gamecenter.WebActivity -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.ListFragment -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListFragment +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.databinding.FragmentMyGameCollectionListBinding import com.gh.gamecenter.entity.GamesCollectionEntity -import com.gh.gamecenter.eventbus.EBReuse +import com.gh.gamecenter.common.eventbus.EBReuse import com.gh.gamecenter.gamecollection.publish.GameCollectionEditActivity import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode diff --git a/app/src/main/java/com/gh/gamecenter/gamecollection/mine/MyGameCollectionViewModel.kt b/app/src/main/java/com/gh/gamecenter/gamecollection/mine/MyGameCollectionViewModel.kt index fee5277cb5..d256531e5f 100644 --- a/app/src/main/java/com/gh/gamecenter/gamecollection/mine/MyGameCollectionViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/gamecollection/mine/MyGameCollectionViewModel.kt @@ -4,9 +4,9 @@ import android.app.Application import androidx.lifecycle.MutableLiveData import com.gh.gamecenter.core.utils.ToastUtils import com.gh.gamecenter.common.utils.observableToMain -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.entity.GamesCollectionEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.retrofit.RetrofitManager import io.reactivex.Observable diff --git a/app/src/main/java/com/gh/gamecenter/gamecollection/publish/GameCollectionActivityLabelFragment.kt b/app/src/main/java/com/gh/gamecenter/gamecollection/publish/GameCollectionActivityLabelFragment.kt index 7f27833828..34634e8135 100644 --- a/app/src/main/java/com/gh/gamecenter/gamecollection/publish/GameCollectionActivityLabelFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/gamecollection/publish/GameCollectionActivityLabelFragment.kt @@ -10,7 +10,7 @@ import com.gh.gamecenter.common.base.fragment.ToolbarFragment import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.utils.viewModelProvider import com.gh.gamecenter.common.view.divider.HorizontalDividerItemDecoration -import com.gh.gamecenter.databinding.FragmentListBaseBinding +import com.gh.gamecenter.common.databinding.FragmentListBaseBinding import com.gh.gamecenter.entity.ActivityLabelEntity import com.gh.gamecenter.video.label.VideoLabelActivity import com.gh.gamecenter.video.label.VideoLabelAdapter diff --git a/app/src/main/java/com/gh/gamecenter/gamecollection/publish/GameCollectionEditActivity.kt b/app/src/main/java/com/gh/gamecenter/gamecollection/publish/GameCollectionEditActivity.kt index 587692c2ac..8580b2aa90 100644 --- a/app/src/main/java/com/gh/gamecenter/gamecollection/publish/GameCollectionEditActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/gamecollection/publish/GameCollectionEditActivity.kt @@ -17,7 +17,6 @@ import com.gh.gamecenter.R import com.gh.gamecenter.WebActivity import com.gh.gamecenter.common.base.activity.ToolBarActivity import com.gh.gamecenter.common.base.fragment.WaitingDialogFragment -import com.gh.gamecenter.common.callback.ConfirmListener import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.* @@ -25,13 +24,12 @@ import com.gh.gamecenter.core.utils.PatternUtils import com.gh.gamecenter.databinding.ActivityGameCollectionEditBinding import com.gh.gamecenter.databinding.ItemGameCollectionFlexTagBinding import com.gh.gamecenter.entity.* -import com.gh.gamecenter.eventbus.EBReuse +import com.gh.gamecenter.common.eventbus.EBReuse import com.gh.gamecenter.gamecollection.choose.ChooseGamesActivity import com.gh.gamecenter.gamecollection.choose.ChooseGamesViewModel import com.gh.gamecenter.gamecollection.tag.GameCollectionTagSelectActivity import com.gh.gamecenter.gamecollection.tag.GameCollectionTagSelectFragment -import com.gh.gamecenter.mvvm.Status -import com.google.gson.JsonObject +import com.gh.gamecenter.common.mvvm.Status import com.zhihu.matisse.Matisse import com.zhihu.matisse.internal.utils.PathUtils import org.greenrobot.eventbus.EventBus diff --git a/app/src/main/java/com/gh/gamecenter/gamecollection/publish/GameCollectionEditViewModel.kt b/app/src/main/java/com/gh/gamecenter/gamecollection/publish/GameCollectionEditViewModel.kt index 9f6d448450..d54ac59811 100644 --- a/app/src/main/java/com/gh/gamecenter/gamecollection/publish/GameCollectionEditViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/gamecollection/publish/GameCollectionEditViewModel.kt @@ -18,7 +18,7 @@ import com.gh.gamecenter.common.utils.toRequestBody import com.gh.gamecenter.core.runOnIoThread import com.gh.gamecenter.core.utils.ToastUtils import com.gh.gamecenter.entity.* -import com.gh.gamecenter.mvvm.Resource +import com.gh.gamecenter.common.mvvm.Resource import com.gh.gamecenter.retrofit.RetrofitManager import com.gh.gamecenter.room.AppDatabase import io.reactivex.android.schedulers.AndroidSchedulers diff --git a/app/src/main/java/com/gh/gamecenter/gamecollection/square/GameCollectionSquareAdapter.kt b/app/src/main/java/com/gh/gamecenter/gamecollection/square/GameCollectionSquareAdapter.kt index 4cc2dc446c..bbcae66db6 100644 --- a/app/src/main/java/com/gh/gamecenter/gamecollection/square/GameCollectionSquareAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/gamecollection/square/GameCollectionSquareAdapter.kt @@ -28,8 +28,8 @@ import com.gh.common.util.NewLogUtils import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.LoadStatus import com.gh.gamecenter.common.entity.ExposureEntity import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.common.view.ScrollEventListener diff --git a/app/src/main/java/com/gh/gamecenter/gamecollection/square/GameCollectionSquareFragment.kt b/app/src/main/java/com/gh/gamecenter/gamecollection/square/GameCollectionSquareFragment.kt index e982211152..075e32a922 100644 --- a/app/src/main/java/com/gh/gamecenter/gamecollection/square/GameCollectionSquareFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/gamecollection/square/GameCollectionSquareFragment.kt @@ -27,9 +27,9 @@ import com.gh.common.exposure.* import com.gh.common.util.* import com.gh.common.util.NewLogUtils import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.LazyListFragment -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.LazyListFragment +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.entity.ExposureEntity @@ -42,7 +42,7 @@ import com.gh.gamecenter.databinding.FragmentGameCollectionSquareAlBinding import com.gh.gamecenter.databinding.FragmentGameCollectionSquareBinding import com.gh.gamecenter.entity.GamesCollectionEntity import com.gh.gamecenter.entity.TagInfoEntity -import com.gh.gamecenter.eventbus.EBReuse +import com.gh.gamecenter.common.eventbus.EBReuse import com.gh.gamecenter.fragment.HomeSearchToolWrapperFragment import com.gh.gamecenter.gamecollection.publish.GameCollectionEditActivity import com.gh.gamecenter.gamecollection.tag.GameCollectionTagSelectActivity @@ -548,7 +548,7 @@ class GameCollectionSquareFragment : LazyListFragment(), IScrollable { gameDetailViewModel.gameDetailLiveData.observeNonNull(this) { gameDetail -> if (gameDetail.data == null) return@observeNonNull - mAdapter.updateDescItemList(mViewModel.decorateList(gameDetail.data.detailEntity)) + mAdapter.updateDescItemList(mViewModel.decorateList(gameDetail.data!!.detailEntity)) // 非镜像游戏获取大家都在玩 (数据来源看具体方法内容) 数据 if (mGameEntity?.shouldUseMirrorInfo() == false) { - mViewModel.generateRecommendedGamesItem(gameDetail.data.detailEntity) + mViewModel.generateRecommendedGamesItem(gameDetail.data!!.detailEntity) } if (openVideoStreaming) { - gameDetail.data.detailEntity.forEach { entity -> + gameDetail.data!!.detailEntity.forEach { entity -> if (entity.video != null && !RunningUtils.isEqualsTop(context, VideoDetailActivity::class.java.name)) { DirectUtils.directToVideoDetail( requireContext(), entity.video!![0].videoId, entity.video!![0].videoId, path = "游戏详情-介绍视频" diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/desc/DescViewModel.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/desc/DescViewModel.kt index b2eb183847..1b66cb40d7 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/desc/DescViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/desc/DescViewModel.kt @@ -23,6 +23,7 @@ import com.gh.gamecenter.gamedetail.entity.CustomColumn import com.gh.gamecenter.gamedetail.entity.DetailEntity import com.gh.gamecenter.gamedetail.entity.GameInfo import com.gh.gamecenter.common.retrofit.Response +import com.gh.gamecenter.energy.utils.EnergyTaskHelper import com.gh.gamecenter.retrofit.RetrofitManager import com.halo.assistant.HaloApp import com.lightgame.utils.Utils diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/desc/GameLibaoAdapter.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/desc/GameLibaoAdapter.kt index afba889775..28a2d1ad45 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/desc/GameLibaoAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/desc/GameLibaoAdapter.kt @@ -16,7 +16,7 @@ import com.gh.gamecenter.core.utils.MtaHelper import com.gh.gamecenter.databinding.ItemGameDetailMoreBinding import com.gh.gamecenter.databinding.ItemGameLibaoBinding import com.gh.gamecenter.entity.LibaoEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager class GameLibaoAdapter( val context: Context, diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/dialog/GameDetailMoreDialog.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/dialog/GameDetailMoreDialog.kt index b8a220f590..b0ff06d7b1 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/dialog/GameDetailMoreDialog.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/dialog/GameDetailMoreDialog.kt @@ -9,7 +9,6 @@ import android.widget.TextView import androidx.appcompat.app.AppCompatActivity import androidx.core.view.children import com.gh.common.util.DirectUtils -import com.gh.common.util.EnergyTaskHelper.postEnergyTask import com.gh.gamecenter.R import com.gh.gamecenter.WebActivity import com.gh.gamecenter.common.base.fragment.BaseDraggableDialogFragment @@ -17,6 +16,7 @@ import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.MtaHelper import com.gh.gamecenter.databinding.DialogGameDetailMoreBinding +import com.gh.gamecenter.energy.utils.EnergyTaskHelper.postEnergyTask import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.gamedetail.GameDetailViewModel diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/entity/DetailEntity.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/entity/DetailEntity.kt index cc1c8bd9ca..f25032d01a 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/entity/DetailEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/entity/DetailEntity.kt @@ -2,6 +2,7 @@ package com.gh.gamecenter.gamedetail.entity import android.os.Parcelable import androidx.annotation.Keep +import com.gh.gamecenter.common.entity.LinkEntity import com.gh.gamecenter.entity.* import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/entity/NewGameDetailEntity.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/entity/NewGameDetailEntity.kt index 8cdd272a4f..7a717ed786 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/entity/NewGameDetailEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/entity/NewGameDetailEntity.kt @@ -1,6 +1,7 @@ package com.gh.gamecenter.gamedetail.entity import androidx.annotation.Keep +import com.gh.gamecenter.common.entity.LinkEntity import com.gh.gamecenter.entity.* import com.google.gson.annotations.SerializedName diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/entity/ZoneEntity.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/entity/ZoneEntity.kt index 855b7da5b9..ce735cb32e 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/entity/ZoneEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/entity/ZoneEntity.kt @@ -2,9 +2,9 @@ package com.gh.gamecenter.gamedetail.entity import android.os.Parcelable import androidx.annotation.Keep -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.entity.NewsEntity -import com.gh.gamecenter.entity.ToolBoxEntity +import com.gh.gamecenter.common.entity.ToolBoxEntity import com.gh.gamecenter.qa.entity.AnswerEntity import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize @@ -21,11 +21,11 @@ data class ZoneEntity( @Parcelize @Keep data class ZoneContentEntity( - var type: String = "", - var notice: ArrayList? = null, - var article: ArrayList? = null, - var toolkit: ArrayList? = null, - var community: CommunityEntity?=null, - @SerializedName("community_column_content") + var type: String = "", + var notice: ArrayList? = null, + var article: ArrayList? = null, + var toolkit: ArrayList? = null, + var community: CommunityEntity?=null, + @SerializedName("community_column_content") var answer: ArrayList? = null ) : Parcelable \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/FuLiFragment.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/FuLiFragment.kt index 44b3cdf686..80858f2db0 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/FuLiFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/FuLiFragment.kt @@ -10,18 +10,17 @@ import com.ethanhua.skeleton.Skeleton import com.ethanhua.skeleton.ViewSkeletonScreen import com.gh.gamecenter.common.base.fragment.LazyFragment import com.gh.gamecenter.core.iinterface.IScrollable -import com.gh.common.util.* import com.gh.common.util.NewLogUtils import com.gh.gamecenter.R import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.databinding.FragmentFuliBinding import com.gh.gamecenter.entity.GameEntity -import com.gh.gamecenter.eventbus.EBReuse +import com.gh.gamecenter.common.eventbus.EBReuse import com.gh.gamecenter.eventbus.EBTypeChange import com.gh.gamecenter.gamedetail.GameDetailFragment import com.gh.gamecenter.gamedetail.GameDetailViewModel -import com.gh.gamecenter.mvvm.Status +import com.gh.gamecenter.common.mvvm.Status import com.halo.assistant.HaloApp import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.Subscribe diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/FuLiItemData.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/FuLiItemData.kt index 3a9f772477..0f0a9de5b1 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/FuLiItemData.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/FuLiItemData.kt @@ -1,14 +1,15 @@ package com.gh.gamecenter.gamedetail.fuli +import com.gh.gamecenter.common.entity.ToolBoxEntity import com.gh.gamecenter.entity.* import com.gh.gamecenter.qa.entity.AnswerEntity data class FuLiItemData( - var notice: List? = null, - var article: List? = null, - var fuLiDesc: GameDetailContact? = null, - var tools: List? = null, - var libao: List? = null, - var server: GameDetailServer? = null, - var answer: List? = null, - var update: String? = "") + var notice: List? = null, + var article: List? = null, + var fuLiDesc: GameDetailContact? = null, + var tools: List? = null, + var libao: List? = null, + var server: GameDetailServer? = null, + var answer: List? = null, + var update: String? = "") diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/FuLiViewModel.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/FuLiViewModel.kt index 01ada55019..3d0b3ca7d1 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/FuLiViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/FuLiViewModel.kt @@ -2,12 +2,12 @@ package com.gh.gamecenter.gamedetail.fuli import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.entity.UnifiedGameDetailEntity import com.gh.gamecenter.gamedetail.entity.ZoneContentEntity import com.gh.gamecenter.gamedetail.entity.ZoneEntity -import com.gh.gamecenter.mvvm.Resource +import com.gh.gamecenter.common.mvvm.Resource class FuLiViewModel : ViewModel() { diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/answer/GameDetailAnswerAdapter.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/answer/GameDetailAnswerAdapter.kt index b7fe6826be..9e21731a86 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/answer/GameDetailAnswerAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/answer/GameDetailAnswerAdapter.kt @@ -11,7 +11,7 @@ import com.gh.gamecenter.core.utils.StringUtils import com.gh.gamecenter.common.utils.visibleIf import com.gh.gamecenter.R import com.gh.gamecenter.databinding.CommunityAnswerItemBinding -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.gamedetail.fuli.FuLiViewModel import com.gh.gamecenter.qa.answer.CommunityAnswerItemViewHolder import com.gh.gamecenter.qa.answer.detail.SimpleAnswerDetailActivity diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/tools/GameDetailToolsAdapter.java b/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/tools/GameDetailToolsAdapter.java index 4e6d5fd12b..532965f4d6 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/tools/GameDetailToolsAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/tools/GameDetailToolsAdapter.java @@ -7,7 +7,6 @@ import android.view.View; import android.view.ViewGroup; import com.gh.common.constant.Config; -import com.gh.common.util.DataUtils; import com.gh.gamecenter.core.utils.DisplayUtils; import com.gh.gamecenter.common.utils.ImageUtils; import com.gh.gamecenter.core.utils.MtaHelper; @@ -16,7 +15,7 @@ import com.gh.gamecenter.R; import com.gh.gamecenter.WebActivity; import com.gh.gamecenter.adapter.viewholder.ToolBoxViewHolder; import com.gh.gamecenter.databinding.ToolboxItemBinding; -import com.gh.gamecenter.entity.ToolBoxEntity; +import com.gh.gamecenter.common.entity.ToolBoxEntity; import com.lightgame.adapter.BaseRecyclerAdapter; import java.util.List; diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/history/HistoryApkListAdapter.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/history/HistoryApkListAdapter.kt index 259ae7433c..17b63dfc06 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/history/HistoryApkListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/history/HistoryApkListAdapter.kt @@ -22,7 +22,7 @@ import com.gh.common.xapk.XapkInstaller import com.gh.common.xapk.XapkUnzipStatus import com.gh.download.DownloadManager import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.DialogHelper import com.gh.gamecenter.core.utils.TimeUtils import com.gh.gamecenter.common.utils.getMetaExtra diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/history/HistoryApkListFragment.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/history/HistoryApkListFragment.kt index e6d1b846fe..a7b2a8f56d 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/history/HistoryApkListFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/history/HistoryApkListFragment.kt @@ -10,8 +10,8 @@ import com.gh.common.util.NewLogUtils import com.gh.gamecenter.common.view.CustomDividerItemDecoration import com.gh.download.DownloadManager import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.ListFragment +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.goneIf import com.gh.gamecenter.common.utils.observeNonNull diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/history/HistoryApkListViewModel.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/history/HistoryApkListViewModel.kt index f11a0fdff2..7903e7d658 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/history/HistoryApkListViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/history/HistoryApkListViewModel.kt @@ -5,8 +5,8 @@ import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider import com.gh.gamecenter.common.constant.Constants -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.entity.ApkEntity import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.common.retrofit.Response diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/myrating/MyRatingAdapter.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/myrating/MyRatingAdapter.kt index 1f161f8a78..6e8faad16e 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/myrating/MyRatingAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/myrating/MyRatingAdapter.kt @@ -9,7 +9,7 @@ import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.* import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.copyTextAndToast import com.gh.gamecenter.common.utils.goneIf import com.gh.gamecenter.common.utils.ifLogin diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/myrating/MyRatingFragment.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/myrating/MyRatingFragment.kt index 9c053a4f25..d8723201c1 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/myrating/MyRatingFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/myrating/MyRatingFragment.kt @@ -13,8 +13,8 @@ import com.gh.gamecenter.common.utils.toDrawable import com.gh.gamecenter.common.view.CustomDividerItemDecoration import com.gh.gamecenter.MainActivity import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.ListFragment +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.databinding.FragmentListNodataSkipNewBinding import com.gh.gamecenter.entity.RatingComment import com.gh.gamecenter.fragment.MainWrapperFragment diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/myrating/MyRatingViewModel.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/myrating/MyRatingViewModel.kt index 24a5777741..130a9be449 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/myrating/MyRatingViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/myrating/MyRatingViewModel.kt @@ -2,11 +2,11 @@ package com.gh.gamecenter.gamedetail.myrating import android.app.Application import com.gh.common.util.ErrorHelper -import com.gh.common.util.EnergyTaskHelper +import com.gh.gamecenter.energy.utils.EnergyTaskHelper import com.gh.gamecenter.common.utils.toObject -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.entity.ErrorEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.personalhome.rating.MyRating import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingAdapter.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingAdapter.kt index 42ef1c0c75..ee5207b8ea 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingAdapter.kt @@ -15,7 +15,7 @@ import com.gh.common.util.DialogUtils import com.gh.common.util.NewLogUtils import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.MtaHelper import com.gh.gamecenter.databinding.RatingCommentItemBinding diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingCommentItemViewHolder.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingCommentItemViewHolder.kt index f641e6f3b2..d1ab2ff0d0 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingCommentItemViewHolder.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingCommentItemViewHolder.kt @@ -37,7 +37,7 @@ import com.gh.gamecenter.entity.RatingComment import com.gh.gamecenter.gamedetail.rating.edit.RatingEditActivity import com.gh.gamecenter.gamedetail.rating.edit.RatingEditActivity.Companion.LABEL_REGEX import com.gh.gamecenter.gamedetail.rating.logs.CommentLogsActivity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.squareup.picasso.Picasso import io.reactivex.Single import io.reactivex.android.schedulers.AndroidSchedulers diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingFragment.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingFragment.kt index fe28062dd1..9b6fe89fe2 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingFragment.kt @@ -15,9 +15,10 @@ import com.gh.common.util.* import com.gh.gamecenter.common.view.VerticalItemDecoration import com.gh.gamecenter.R import com.gh.gamecenter.WebActivity -import com.gh.gamecenter.baselist.LazyListFragment -import com.gh.gamecenter.baselist.LoadStatus -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.LazyListFragment +import com.gh.gamecenter.common.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.LoadType +import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.toDrawable import com.gh.gamecenter.core.utils.SpanBuilder @@ -25,7 +26,7 @@ import com.gh.gamecenter.common.utils.toPx import com.gh.gamecenter.core.utils.MtaHelper import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.entity.RatingComment -import com.gh.gamecenter.eventbus.EBReuse +import com.gh.gamecenter.common.eventbus.EBReuse import com.gh.gamecenter.eventbus.EBTypeChange import com.gh.gamecenter.gamedetail.GameDetailFragment import com.gh.gamecenter.personal.PersonalFragment @@ -213,7 +214,7 @@ class RatingFragment : LazyListFragment(), IScro @Subscribe(threadMode = ThreadMode.MAIN) fun onEventMainThread(changed: EBReuse) { - if (PersonalFragment.LOGIN_TAG == changed.type) { // 登入 + if (Constants.LOGIN_TAG == changed.type) { // 登入 onLoadRefresh() } } diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingReplyActivity.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingReplyActivity.kt index fd783ab392..2f11f35ba4 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingReplyActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingReplyActivity.kt @@ -16,7 +16,7 @@ import com.gh.common.util.NewLogUtils import com.gh.common.util.SyncDataBetweenPageHelper import com.gh.download.DownloadManager import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListActivity +import com.gh.gamecenter.common.baselist.ListActivity import com.gh.gamecenter.common.base.fragment.WaitingDialogFragment import com.gh.gamecenter.common.callback.ConfirmListener import com.gh.gamecenter.common.constant.EntranceConsts diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingReplyAdapter.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingReplyAdapter.kt index ad39d1eea3..40d8b96e21 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingReplyAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingReplyAdapter.kt @@ -29,8 +29,8 @@ import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.ListSectionItemViewHolder -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.common.callback.ConfirmListener import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* @@ -43,7 +43,7 @@ import com.gh.gamecenter.entity.RatingComment import com.gh.gamecenter.entity.RatingReplyEntity import com.gh.gamecenter.entity.UserEntity import com.gh.gamecenter.gamedetail.rating.edit.RatingEditActivity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.lightgame.utils.Utils import com.squareup.picasso.Picasso import io.reactivex.Single diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingReplyViewModel.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingReplyViewModel.kt index a6e24a0248..a218bdd8a3 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingReplyViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingReplyViewModel.kt @@ -11,13 +11,14 @@ import com.gh.gamecenter.common.json.json import com.gh.common.util.* import com.gh.gamecenter.BuildConfig import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.baselist.LoadStatus -import com.gh.gamecenter.baselist.LoadType import com.gh.gamecenter.common.callback.ConfirmListener +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.common.utils.toObject import com.gh.gamecenter.common.utils.toRequestBody import com.gh.gamecenter.common.retrofit.Response +import com.gh.gamecenter.energy.utils.EnergyTaskHelper import com.gh.gamecenter.entity.* import com.gh.gamecenter.retrofit.RetrofitManager import com.halo.assistant.HaloApp diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingViewModel.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingViewModel.kt index fe8f32044b..bbdfbb1eac 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingViewModel.kt @@ -8,10 +8,10 @@ import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider import com.gh.gamecenter.core.AppExecutor import com.gh.common.util.* -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.baselist.LoadParams -import com.gh.gamecenter.baselist.LoadStatus -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.LoadParams +import com.gh.gamecenter.common.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.common.utils.toObject import com.gh.gamecenter.core.utils.UrlFilterUtils import com.gh.gamecenter.entity.ErrorEntity @@ -19,6 +19,7 @@ import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.entity.Rating import com.gh.gamecenter.entity.RatingComment import com.gh.gamecenter.common.retrofit.Response +import com.gh.gamecenter.energy.utils.EnergyTaskHelper import com.gh.gamecenter.retrofit.RetrofitManager import com.lightgame.utils.Utils import io.reactivex.Observable diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/edit/RatingEditActivity.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/edit/RatingEditActivity.kt index 2e4f409632..e804ee3ce4 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/edit/RatingEditActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/edit/RatingEditActivity.kt @@ -35,8 +35,8 @@ import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.ActivityRatingEditBinding import com.gh.gamecenter.entity.* -import com.gh.gamecenter.manager.UserManager -import com.gh.gamecenter.mvvm.Status +import com.gh.gamecenter.login.user.UserManager +import com.gh.gamecenter.common.mvvm.Status import com.gh.gamecenter.suggest.SuggestType import com.halo.assistant.HaloApp import com.lightgame.utils.Utils @@ -290,7 +290,7 @@ class RatingEditActivity : ToolBarActivity(), KeyboardHeightObserver { var errorString: String? = null try { if (it.exception is HttpException) { - errorString = it.exception.response()?.errorBody()?.string() + errorString = it.exception!!.response()?.errorBody()?.string() } } catch (e1: Exception) { e1.printStackTrace() diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/edit/RatingEditViewModel.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/edit/RatingEditViewModel.kt index 976de7f06c..64e28f36fd 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/edit/RatingEditViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/edit/RatingEditViewModel.kt @@ -6,16 +6,16 @@ import android.content.Context import android.os.Build import androidx.lifecycle.* import com.gh.gamecenter.common.base.fragment.WaitingDialogFragment -import com.gh.common.util.* import com.gh.gamecenter.core.utils.SPUtils import com.gh.gamecenter.common.utils.toJson import com.gh.gamecenter.common.utils.toObject import com.gh.gamecenter.common.utils.tryWithDefaultCatch import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.entity.RatingComment -import com.gh.gamecenter.mvvm.Resource +import com.gh.gamecenter.common.mvvm.Resource import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.common.retrofit.Response +import com.gh.gamecenter.energy.utils.EnergyTaskHelper import com.gh.gamecenter.retrofit.RetrofitManager import com.lightgame.utils.Utils import io.reactivex.android.schedulers.AndroidSchedulers diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/logs/CommentLogsActivity.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/logs/CommentLogsActivity.kt index a1e2c551d2..1add3c5ef3 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/logs/CommentLogsActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/logs/CommentLogsActivity.kt @@ -10,8 +10,8 @@ import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.view.VerticalItemDecoration import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListActivity -import com.gh.gamecenter.baselist.NormalListViewModel +import com.gh.gamecenter.common.baselist.ListActivity +import com.gh.gamecenter.common.baselist.NormalListViewModel import com.gh.gamecenter.common.utils.setRootBackgroundColor import com.gh.gamecenter.databinding.ActivityGameCommentLogsBinding import com.gh.gamecenter.entity.RatingComment diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/logs/CommentLogsAdapter.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/logs/CommentLogsAdapter.kt index c100aff81d..6f380dd163 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/logs/CommentLogsAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/logs/CommentLogsAdapter.kt @@ -16,8 +16,8 @@ import com.gh.gamecenter.common.utils.ImageUtils import com.gh.common.util.NewsUtils import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.NormalListViewModel +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.NormalListViewModel import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.databinding.GameCommentLogItemBinding import com.gh.gamecenter.entity.RatingComment diff --git a/app/src/main/java/com/gh/gamecenter/help/HelpContainerFragment.kt b/app/src/main/java/com/gh/gamecenter/help/HelpContainerFragment.kt index ea87dca945..14b14ec273 100644 --- a/app/src/main/java/com/gh/gamecenter/help/HelpContainerFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/help/HelpContainerFragment.kt @@ -16,7 +16,7 @@ import com.gh.gamecenter.common.utils.TextHelper import com.gh.gamecenter.R import com.gh.gamecenter.databinding.FragmentHelpContaierBinding import com.gh.gamecenter.eventbus.EBNetworkState -import com.gh.gamecenter.mvvm.Status +import com.gh.gamecenter.common.mvvm.Status import com.gh.gamecenter.common.base.fragment.ToolbarFragment import com.gh.gamecenter.common.utils.toColor import com.halo.assistant.HaloApp diff --git a/app/src/main/java/com/gh/gamecenter/help/HelpContainerViewModel.kt b/app/src/main/java/com/gh/gamecenter/help/HelpContainerViewModel.kt index 1798a1a37e..f4249c31d5 100644 --- a/app/src/main/java/com/gh/gamecenter/help/HelpContainerViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/help/HelpContainerViewModel.kt @@ -7,7 +7,7 @@ import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider import com.gh.gamecenter.entity.HelpCategoryEntity -import com.gh.gamecenter.mvvm.Resource +import com.gh.gamecenter.common.mvvm.Resource import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.retrofit.RetrofitManager import io.reactivex.android.schedulers.AndroidSchedulers diff --git a/app/src/main/java/com/gh/gamecenter/help/HelpContentAdapter.kt b/app/src/main/java/com/gh/gamecenter/help/HelpContentAdapter.kt index a49c40f31d..188711c866 100644 --- a/app/src/main/java/com/gh/gamecenter/help/HelpContentAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/help/HelpContentAdapter.kt @@ -13,8 +13,8 @@ import com.gh.gamecenter.QaActivity import com.gh.gamecenter.R import com.gh.gamecenter.WebActivity import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.NormalListViewModel +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.NormalListViewModel import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.utils.fromHtml import com.gh.gamecenter.common.utils.toColor diff --git a/app/src/main/java/com/gh/gamecenter/help/HelpContentFragment.kt b/app/src/main/java/com/gh/gamecenter/help/HelpContentFragment.kt index 7c8f9a42ef..605841b01b 100644 --- a/app/src/main/java/com/gh/gamecenter/help/HelpContentFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/help/HelpContentFragment.kt @@ -10,10 +10,10 @@ import com.gh.common.util.NewLogUtils import com.gh.gamecenter.core.utils.UrlFilterUtils import com.gh.gamecenter.HelpAndFeedbackActivity import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListFragment -import com.gh.gamecenter.baselist.LoadStatus -import com.gh.gamecenter.baselist.LoadType -import com.gh.gamecenter.baselist.NormalListViewModel +import com.gh.gamecenter.common.baselist.ListFragment +import com.gh.gamecenter.common.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.LoadType +import com.gh.gamecenter.common.baselist.NormalListViewModel import com.gh.gamecenter.entity.HelpCategoryEntity import com.gh.gamecenter.entity.HelpEntity import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/gamecenter/help/HelpQaCategoryFragment.kt b/app/src/main/java/com/gh/gamecenter/help/HelpQaCategoryFragment.kt index b010b1f165..ab79e1e581 100644 --- a/app/src/main/java/com/gh/gamecenter/help/HelpQaCategoryFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/help/HelpQaCategoryFragment.kt @@ -14,7 +14,7 @@ import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.R import com.gh.gamecenter.databinding.FragmentQaCategoryBinding import com.gh.gamecenter.entity.ErrorEntity -import com.gh.gamecenter.mvvm.Status +import com.gh.gamecenter.common.mvvm.Status import com.gh.gamecenter.common.base.fragment.ToolbarFragment class HelpQaCategoryFragment : ToolbarFragment() { @@ -47,7 +47,7 @@ class HelpQaCategoryFragment : ToolbarFragment() { mBinding.includeNoneData.root.visibility = View.VISIBLE } else { mBinding.includeNoneData.root.visibility = View.GONE - mAdapter?.setListData(it.data) + mAdapter?.setListData(it.data!!) } mBinding.includeNoConnection.root.visibility = View.GONE } else { diff --git a/app/src/main/java/com/gh/gamecenter/help/HelpQaCategoryViewModel.kt b/app/src/main/java/com/gh/gamecenter/help/HelpQaCategoryViewModel.kt index c305add261..ed54597efa 100644 --- a/app/src/main/java/com/gh/gamecenter/help/HelpQaCategoryViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/help/HelpQaCategoryViewModel.kt @@ -7,7 +7,7 @@ import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider import com.gh.gamecenter.entity.HelpCategoryEntity -import com.gh.gamecenter.mvvm.Resource +import com.gh.gamecenter.common.mvvm.Resource import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.retrofit.RetrofitManager import com.halo.assistant.HaloApp diff --git a/app/src/main/java/com/gh/gamecenter/help/QaFeedbackDialogFragment.kt b/app/src/main/java/com/gh/gamecenter/help/QaFeedbackDialogFragment.kt index 63e5763bca..dbf829e46a 100644 --- a/app/src/main/java/com/gh/gamecenter/help/QaFeedbackDialogFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/help/QaFeedbackDialogFragment.kt @@ -25,7 +25,7 @@ import com.gh.gamecenter.common.utils.TextHelper import com.gh.gamecenter.common.utils.viewModelProvider import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.DialogQaFeedbackBinding -import com.gh.gamecenter.eventbus.EBReuse +import com.gh.gamecenter.common.eventbus.EBReuse import com.gh.gamecenter.suggest.SuggestType import com.halo.assistant.HaloApp import com.lightgame.dialog.BaseDialogFragment diff --git a/app/src/main/java/com/gh/gamecenter/history/HistoryGameListAdapter.kt b/app/src/main/java/com/gh/gamecenter/history/HistoryGameListAdapter.kt index acdd62e36f..325c87b42c 100644 --- a/app/src/main/java/com/gh/gamecenter/history/HistoryGameListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/history/HistoryGameListAdapter.kt @@ -14,7 +14,7 @@ import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.GameItemBinding diff --git a/app/src/main/java/com/gh/gamecenter/history/HistoryGameListFragment.kt b/app/src/main/java/com/gh/gamecenter/history/HistoryGameListFragment.kt index 8628af8eb7..0a4b91e3fb 100644 --- a/app/src/main/java/com/gh/gamecenter/history/HistoryGameListFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/history/HistoryGameListFragment.kt @@ -9,7 +9,7 @@ import com.gh.gamecenter.common.utils.toDrawable import com.gh.gamecenter.common.utils.viewModelProvider import com.gh.gamecenter.common.view.CustomDividerItemDecoration import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListFragment +import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.databinding.FragmentListBaseSkeletonBinding import com.gh.gamecenter.entity.GameEntity diff --git a/app/src/main/java/com/gh/gamecenter/history/HistoryGameListViewModel.kt b/app/src/main/java/com/gh/gamecenter/history/HistoryGameListViewModel.kt index 648e98de5a..98e166ea5e 100644 --- a/app/src/main/java/com/gh/gamecenter/history/HistoryGameListViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/history/HistoryGameListViewModel.kt @@ -4,8 +4,8 @@ import android.app.Application import com.gh.gamecenter.core.AppExecutor import com.gh.common.history.HistoryDatabase import com.gh.common.history.HistoryHelper -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.entity.GameEntity import io.reactivex.Observable import io.reactivex.Single diff --git a/app/src/main/java/com/gh/gamecenter/history/HistoryWrapperFragment.kt b/app/src/main/java/com/gh/gamecenter/history/HistoryWrapperFragment.kt index 36b71706c4..c25011341d 100644 --- a/app/src/main/java/com/gh/gamecenter/history/HistoryWrapperFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/history/HistoryWrapperFragment.kt @@ -11,7 +11,7 @@ import com.gh.gamecenter.core.utils.MtaHelper import com.gh.gamecenter.common.utils.viewModelProvider import com.gh.gamecenter.R import com.gh.gamecenter.collection.* -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager class HistoryWrapperFragment : BaseFragment_TabLayout() { diff --git a/app/src/main/java/com/gh/gamecenter/home/HomeFragment.kt b/app/src/main/java/com/gh/gamecenter/home/HomeFragment.kt index 2ed211ed8b..31ad78849f 100644 --- a/app/src/main/java/com/gh/gamecenter/home/HomeFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/home/HomeFragment.kt @@ -12,7 +12,7 @@ import com.gh.common.xapk.XapkInstaller import com.gh.common.xapk.XapkUnzipStatus import com.gh.download.DownloadManager import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.LoadStatus import com.gh.gamecenter.common.base.fragment.LazyFragment import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.common.constant.EntranceConsts @@ -25,7 +25,7 @@ import com.gh.gamecenter.core.utils.SPUtils import com.gh.gamecenter.databinding.FragmentMainHomeBinding import com.gh.gamecenter.eventbus.EBDownloadStatus import com.gh.gamecenter.eventbus.EBPackage -import com.gh.gamecenter.eventbus.EBReuse +import com.gh.gamecenter.common.eventbus.EBReuse import com.gh.gamecenter.eventbus.EBUISwitch import com.gh.gamecenter.fragment.HomeSearchToolWrapperFragment import com.gh.gamecenter.fragment.HomeSearchToolWrapperViewModel diff --git a/app/src/main/java/com/gh/gamecenter/home/HomeFragmentAdapter.kt b/app/src/main/java/com/gh/gamecenter/home/HomeFragmentAdapter.kt index ae78ad606e..470947676f 100644 --- a/app/src/main/java/com/gh/gamecenter/home/HomeFragmentAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/home/HomeFragmentAdapter.kt @@ -16,9 +16,9 @@ import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.ReuseViewHolder -import com.gh.gamecenter.baselist.DiffUtilAdapter -import com.gh.gamecenter.baselist.LoadStatus import com.gh.gamecenter.common.constant.ItemViewType +import com.gh.gamecenter.common.baselist.DiffUtilAdapter +import com.gh.gamecenter.common.baselist.LoadStatus import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.runOnIoThread import com.gh.gamecenter.core.utils.MtaHelper diff --git a/app/src/main/java/com/gh/gamecenter/home/HomeViewModel.kt b/app/src/main/java/com/gh/gamecenter/home/HomeViewModel.kt index 9e1c7476e7..9f82bb0a95 100644 --- a/app/src/main/java/com/gh/gamecenter/home/HomeViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/home/HomeViewModel.kt @@ -14,8 +14,8 @@ import com.gh.common.util.GameUtils import com.gh.common.util.HomePluggableHelper import com.gh.download.DownloadManager import com.gh.gamecenter.BuildConfig -import com.gh.gamecenter.baselist.LoadStatus import com.gh.gamecenter.common.constant.Constants +import com.gh.gamecenter.common.baselist.LoadStatus import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.core.runOnIoThread diff --git a/app/src/main/java/com/gh/gamecenter/home/LegacyHomeFragmentAdapterAssistant.kt b/app/src/main/java/com/gh/gamecenter/home/LegacyHomeFragmentAdapterAssistant.kt index 043923d254..d850281b75 100644 --- a/app/src/main/java/com/gh/gamecenter/home/LegacyHomeFragmentAdapterAssistant.kt +++ b/app/src/main/java/com/gh/gamecenter/home/LegacyHomeFragmentAdapterAssistant.kt @@ -28,7 +28,7 @@ import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.ItemBlankDividerBinding import com.gh.gamecenter.entity.CommonCollectionContentEntity import com.gh.gamecenter.entity.GameEntity -import com.gh.gamecenter.entity.LinkEntity +import com.gh.gamecenter.common.entity.LinkEntity import com.gh.gamecenter.game.GameAndPosition import com.gh.gamecenter.game.GameItemViewHolder import com.gh.gamecenter.game.bigimagerecommend.BigImageRecommendViewHolder diff --git a/app/src/main/java/com/gh/gamecenter/home/LegacyHomeSubjectTransformer.kt b/app/src/main/java/com/gh/gamecenter/home/LegacyHomeSubjectTransformer.kt index 3f1203dd1f..87d98ac1ce 100644 --- a/app/src/main/java/com/gh/gamecenter/home/LegacyHomeSubjectTransformer.kt +++ b/app/src/main/java/com/gh/gamecenter/home/LegacyHomeSubjectTransformer.kt @@ -1,7 +1,7 @@ package com.gh.gamecenter.home import com.gh.gamecenter.entity.GameEntity -import com.gh.gamecenter.entity.LinkEntity +import com.gh.gamecenter.common.entity.LinkEntity import com.gh.gamecenter.entity.SubjectEntity import com.gh.gamecenter.game.data.GameSubjectData diff --git a/app/src/main/java/com/gh/gamecenter/info/ConcernAdapter.java b/app/src/main/java/com/gh/gamecenter/info/ConcernAdapter.java index 092ea6bb1a..7155dc588e 100644 --- a/app/src/main/java/com/gh/gamecenter/info/ConcernAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/info/ConcernAdapter.java @@ -32,7 +32,7 @@ import com.gh.gamecenter.entity.MeEntity; import com.gh.gamecenter.entity.UserDataLibaoEntity; import com.gh.gamecenter.entity.ViewsEntity; import com.gh.gamecenter.manager.CommentManager; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.user.UserManager; import com.gh.gamecenter.manager.VisitManager; import com.gh.gamecenter.common.retrofit.JSONObjectResponse; import com.gh.gamecenter.common.retrofit.ObservableUtil; diff --git a/app/src/main/java/com/gh/gamecenter/info/ConcernFragment.java b/app/src/main/java/com/gh/gamecenter/info/ConcernFragment.java index 997a1a0841..5193aa1bec 100644 --- a/app/src/main/java/com/gh/gamecenter/info/ConcernFragment.java +++ b/app/src/main/java/com/gh/gamecenter/info/ConcernFragment.java @@ -1,6 +1,6 @@ package com.gh.gamecenter.info; -import static com.gh.gamecenter.personal.PersonalFragment.LOGIN_TAG; +import static com.gh.gamecenter.common.constant.Constants.LOGIN_TAG; import android.app.Activity; import android.content.Intent; @@ -44,8 +44,8 @@ import com.gh.gamecenter.entity.MeEntity; import com.gh.gamecenter.entity.UserDataLibaoEntity; import com.gh.gamecenter.eventbus.EBConcernChanged; import com.gh.gamecenter.eventbus.EBNetworkState; -import com.gh.gamecenter.eventbus.EBReuse; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.common.eventbus.EBReuse; +import com.gh.gamecenter.login.user.UserManager; import com.gh.gamecenter.common.base.fragment.ToolbarFragment; import com.gh.gamecenter.common.retrofit.Response; import com.gh.gamecenter.retrofit.RetrofitManager; diff --git a/app/src/main/java/com/gh/gamecenter/info/InfoAdapter.java b/app/src/main/java/com/gh/gamecenter/info/InfoAdapter.java index c19d5644c2..58c0ab3546 100644 --- a/app/src/main/java/com/gh/gamecenter/info/InfoAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/info/InfoAdapter.java @@ -21,7 +21,7 @@ import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; import com.gh.gamecenter.adapter.viewholder.NewsImage1ViewHolder; import com.gh.gamecenter.adapter.viewholder.NewsImage2ViewHolder; import com.gh.gamecenter.adapter.viewholder.NewsImage3ViewHolder; -import com.gh.gamecenter.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.ListAdapter; import com.gh.gamecenter.databinding.NewsImage1ItemBinding; import com.gh.gamecenter.databinding.NewsImage2ItemBinding; import com.gh.gamecenter.databinding.NewsImage3ItemBinding; diff --git a/app/src/main/java/com/gh/gamecenter/info/InfoFragment.java b/app/src/main/java/com/gh/gamecenter/info/InfoFragment.java index 756dfbefcf..266500df9a 100644 --- a/app/src/main/java/com/gh/gamecenter/info/InfoFragment.java +++ b/app/src/main/java/com/gh/gamecenter/info/InfoFragment.java @@ -17,9 +17,9 @@ import com.gh.gamecenter.core.utils.StringUtils; import com.gh.gamecenter.common.view.CustomDividerItemDecoration; import com.gh.gamecenter.NewsDetailActivity; import com.gh.gamecenter.R; -import com.gh.gamecenter.baselist.ListAdapter; -import com.gh.gamecenter.baselist.ListFragment; -import com.gh.gamecenter.baselist.LoadType; +import com.gh.gamecenter.common.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.ListFragment; +import com.gh.gamecenter.common.baselist.LoadType; import com.gh.gamecenter.databinding.FragmentListBaseSkeletonBinding; import com.gh.gamecenter.entity.NewsEntity; diff --git a/app/src/main/java/com/gh/gamecenter/info/InfoViewModel.java b/app/src/main/java/com/gh/gamecenter/info/InfoViewModel.java index 3000c62401..48d35c8d29 100644 --- a/app/src/main/java/com/gh/gamecenter/info/InfoViewModel.java +++ b/app/src/main/java/com/gh/gamecenter/info/InfoViewModel.java @@ -6,7 +6,7 @@ import androidx.annotation.NonNull; import com.gh.common.constant.Config; import com.gh.gamecenter.core.utils.UrlFilterUtils; -import com.gh.gamecenter.baselist.ListViewModel; +import com.gh.gamecenter.common.baselist.ListViewModel; import com.gh.gamecenter.entity.NewsEntity; import com.gh.gamecenter.entity.ViewsEntity; import com.gh.gamecenter.retrofit.RetrofitManager; diff --git a/app/src/main/java/com/gh/gamecenter/info/OriginalAdapter.java b/app/src/main/java/com/gh/gamecenter/info/OriginalAdapter.java index 7273792c7f..97d9ce9d4f 100644 --- a/app/src/main/java/com/gh/gamecenter/info/OriginalAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/info/OriginalAdapter.java @@ -20,7 +20,7 @@ import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; import com.gh.gamecenter.adapter.viewholder.NewsImage1ViewHolder; import com.gh.gamecenter.adapter.viewholder.NewsImage2ViewHolder; import com.gh.gamecenter.adapter.viewholder.NewsImage3ViewHolder; -import com.gh.gamecenter.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.ListAdapter; import com.gh.gamecenter.databinding.NewsImage1ItemBinding; import com.gh.gamecenter.databinding.NewsImage2ItemBinding; import com.gh.gamecenter.databinding.NewsImage3ItemBinding; diff --git a/app/src/main/java/com/gh/gamecenter/info/OriginalFragment.java b/app/src/main/java/com/gh/gamecenter/info/OriginalFragment.java index fb954dfcfb..06f246833a 100644 --- a/app/src/main/java/com/gh/gamecenter/info/OriginalFragment.java +++ b/app/src/main/java/com/gh/gamecenter/info/OriginalFragment.java @@ -14,10 +14,10 @@ import com.gh.gamecenter.core.utils.StringUtils; import com.gh.gamecenter.common.view.CustomDividerItemDecoration; import com.gh.gamecenter.NewsDetailActivity; import com.gh.gamecenter.R; -import com.gh.gamecenter.baselist.ListAdapter; -import com.gh.gamecenter.baselist.ListFragment; -import com.gh.gamecenter.baselist.LoadType; -import com.gh.gamecenter.databinding.FragmentListBaseBinding; +import com.gh.gamecenter.common.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.ListFragment; +import com.gh.gamecenter.common.baselist.LoadType; +import com.gh.gamecenter.common.databinding.FragmentListBaseBinding; import com.gh.gamecenter.entity.NewsEntity; /** diff --git a/app/src/main/java/com/gh/gamecenter/info/OriginalViewModel.java b/app/src/main/java/com/gh/gamecenter/info/OriginalViewModel.java index 2a5fcf622b..220f892ca7 100644 --- a/app/src/main/java/com/gh/gamecenter/info/OriginalViewModel.java +++ b/app/src/main/java/com/gh/gamecenter/info/OriginalViewModel.java @@ -6,7 +6,7 @@ import androidx.annotation.NonNull; import com.gh.common.constant.Config; import com.gh.gamecenter.core.utils.UrlFilterUtils; -import com.gh.gamecenter.baselist.ListViewModel; +import com.gh.gamecenter.common.baselist.ListViewModel; import com.gh.gamecenter.entity.NewsEntity; import com.gh.gamecenter.entity.ViewsEntity; import com.gh.gamecenter.retrofit.RetrofitManager; diff --git a/app/src/main/java/com/gh/gamecenter/info/StrategyFragment.java b/app/src/main/java/com/gh/gamecenter/info/StrategyFragment.java index 4a6d68b316..a7633b2330 100644 --- a/app/src/main/java/com/gh/gamecenter/info/StrategyFragment.java +++ b/app/src/main/java/com/gh/gamecenter/info/StrategyFragment.java @@ -18,6 +18,7 @@ import com.gh.gamecenter.common.base.fragment.BaseFragment; import com.gh.common.filter.RegionSettingHelper; import com.gh.common.util.ApkActiveUtils; import com.gh.common.util.CheckLoginUtils; +import com.gh.gamecenter.common.constant.Constants; import com.gh.gamecenter.core.utils.DisplayUtils; import com.gh.common.util.NewsUtils; import com.gh.gamecenter.core.utils.StringUtils; @@ -30,11 +31,10 @@ import com.gh.gamecenter.databinding.FragmentInfoStrategyBinding; import com.gh.gamecenter.entity.GameEntity; import com.gh.gamecenter.entity.NewsEntity; import com.gh.gamecenter.eventbus.EBConcernChanged; -import com.gh.gamecenter.eventbus.EBReuse; +import com.gh.gamecenter.common.eventbus.EBReuse; import com.gh.gamecenter.eventbus.EBUISwitch; import com.gh.gamecenter.manager.DataCollectionManager; -import com.gh.gamecenter.manager.UserManager; -import com.gh.gamecenter.personal.PersonalFragment; +import com.gh.gamecenter.login.user.UserManager; import com.gh.gamecenter.common.retrofit.Response; import com.gh.gamecenter.retrofit.RetrofitManager; import com.jakewharton.rxbinding2.view.RxView; @@ -260,7 +260,7 @@ public class StrategyFragment extends BaseFragment implements SwipeRefreshLayout @Subscribe(threadMode = ThreadMode.MAIN) public void onEventMainThread(EBReuse reuse) { - if (PersonalFragment.LOGIN_TAG.equals(reuse.getType()) || PersonalFragment.LOGOUT_TAG.equals(reuse.getType())) { + if (Constants.LOGIN_TAG.equals(reuse.getType()) || Constants.LOGOUT_TAG.equals(reuse.getType())) { getConcernGame(); } } diff --git a/app/src/main/java/com/gh/gamecenter/libao/Libao1Fragment.java b/app/src/main/java/com/gh/gamecenter/libao/Libao1Fragment.java index 6119edebdb..5637d842b4 100644 --- a/app/src/main/java/com/gh/gamecenter/libao/Libao1Fragment.java +++ b/app/src/main/java/com/gh/gamecenter/libao/Libao1Fragment.java @@ -19,7 +19,7 @@ import com.gh.gamecenter.common.utils.ExtensionsKt; import com.gh.gamecenter.common.utils.TextHelper; import com.gh.gamecenter.core.utils.MtaHelper; import com.gh.gamecenter.databinding.FragmentLibao1Binding; -import com.gh.gamecenter.eventbus.EBReuse; +import com.gh.gamecenter.common.eventbus.EBReuse; import com.lightgame.utils.Util_System_Keyboard; import com.lightgame.utils.Utils; diff --git a/app/src/main/java/com/gh/gamecenter/libao/Libao2Fragment.java b/app/src/main/java/com/gh/gamecenter/libao/Libao2Fragment.java index 9c10a7fd30..6c2ba380b3 100644 --- a/app/src/main/java/com/gh/gamecenter/libao/Libao2Fragment.java +++ b/app/src/main/java/com/gh/gamecenter/libao/Libao2Fragment.java @@ -1,6 +1,6 @@ package com.gh.gamecenter.libao; -import static com.gh.gamecenter.personal.PersonalFragment.LOGIN_TAG; +import static com.gh.gamecenter.common.constant.Constants.LOGIN_TAG; import android.content.Intent; import android.graphics.drawable.Drawable; @@ -23,7 +23,7 @@ import com.gh.gamecenter.common.view.CustomDividerItemDecoration; import com.gh.gamecenter.databinding.FragmentLibao2Binding; import com.gh.gamecenter.entity.LibaoEntity; import com.gh.gamecenter.eventbus.EBConcernChanged; -import com.gh.gamecenter.eventbus.EBReuse; +import com.gh.gamecenter.common.eventbus.EBReuse; import com.gh.gamecenter.eventbus.EBUISwitch; import org.greenrobot.eventbus.Subscribe; diff --git a/app/src/main/java/com/gh/gamecenter/libao/Libao2FragmentAdapter.java b/app/src/main/java/com/gh/gamecenter/libao/Libao2FragmentAdapter.java index b6cfce3a6e..bb42577ed5 100644 --- a/app/src/main/java/com/gh/gamecenter/libao/Libao2FragmentAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/libao/Libao2FragmentAdapter.java @@ -24,7 +24,7 @@ import com.gh.gamecenter.common.utils.ExtensionsKt; import com.gh.gamecenter.databinding.LibaoItemBinding; import com.gh.gamecenter.entity.LibaoEntity; import com.gh.gamecenter.entity.LibaoStatusEntity; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.user.UserManager; import com.gh.gamecenter.common.retrofit.Response; import com.gh.gamecenter.retrofit.RetrofitManager; import com.lightgame.adapter.BaseRecyclerAdapter; diff --git a/app/src/main/java/com/gh/gamecenter/libao/Libao3Fragment.java b/app/src/main/java/com/gh/gamecenter/libao/Libao3Fragment.java index 85b46ca449..be442b6d92 100644 --- a/app/src/main/java/com/gh/gamecenter/libao/Libao3Fragment.java +++ b/app/src/main/java/com/gh/gamecenter/libao/Libao3Fragment.java @@ -1,6 +1,6 @@ package com.gh.gamecenter.libao; -import static com.gh.gamecenter.personal.PersonalFragment.LOGIN_TAG; +import static com.gh.gamecenter.common.constant.Constants.LOGIN_TAG; import android.graphics.drawable.Drawable; import android.os.Bundle; @@ -18,7 +18,7 @@ import com.gh.gamecenter.common.base.fragment.BaseFragment; import com.gh.gamecenter.common.utils.ExtensionsKt; import com.gh.gamecenter.common.view.CustomDividerItemDecoration; import com.gh.gamecenter.databinding.FragmentLibao3Binding; -import com.gh.gamecenter.eventbus.EBReuse; +import com.gh.gamecenter.common.eventbus.EBReuse; import com.gh.gamecenter.eventbus.EBUISwitch; import org.greenrobot.eventbus.Subscribe; diff --git a/app/src/main/java/com/gh/gamecenter/libao/Libao3FragmentAdapter.java b/app/src/main/java/com/gh/gamecenter/libao/Libao3FragmentAdapter.java index a464f4bf36..232d619966 100644 --- a/app/src/main/java/com/gh/gamecenter/libao/Libao3FragmentAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/libao/Libao3FragmentAdapter.java @@ -28,7 +28,7 @@ import com.gh.gamecenter.entity.LibaoEntity; import com.gh.gamecenter.entity.LibaoStatusEntity; import com.gh.gamecenter.entity.MeEntity; import com.gh.gamecenter.entity.UserDataLibaoEntity; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.user.UserManager; import com.gh.gamecenter.common.retrofit.Response; import com.gh.gamecenter.retrofit.RetrofitManager; import com.lightgame.adapter.BaseRecyclerAdapter; diff --git a/app/src/main/java/com/gh/gamecenter/libao/LibaoFragment.java b/app/src/main/java/com/gh/gamecenter/libao/LibaoFragment.java index 1148c38031..592a966916 100644 --- a/app/src/main/java/com/gh/gamecenter/libao/LibaoFragment.java +++ b/app/src/main/java/com/gh/gamecenter/libao/LibaoFragment.java @@ -22,7 +22,7 @@ import com.gh.gamecenter.common.base.fragment.BaseFragment_TabLayout; import com.gh.gamecenter.common.utils.ExtensionsKt; import com.gh.gamecenter.core.utils.MtaHelper; import com.gh.gamecenter.databinding.FragmentLibaoWrapperBinding; -import com.gh.gamecenter.eventbus.EBReuse; +import com.gh.gamecenter.common.eventbus.EBReuse; import com.gh.gamecenter.eventbus.EBUISwitch; import com.google.android.material.tabs.TabLayout; diff --git a/app/src/main/java/com/gh/gamecenter/libao/LibaoNewFragment.java b/app/src/main/java/com/gh/gamecenter/libao/LibaoNewFragment.java index 200dd14802..252659e49d 100644 --- a/app/src/main/java/com/gh/gamecenter/libao/LibaoNewFragment.java +++ b/app/src/main/java/com/gh/gamecenter/libao/LibaoNewFragment.java @@ -23,7 +23,7 @@ import com.gh.gamecenter.LibaoDetailActivity; import com.gh.gamecenter.R; import com.gh.gamecenter.databinding.FragmentLibaoNewBinding; import com.gh.gamecenter.entity.LibaoEntity; -import com.gh.gamecenter.eventbus.EBReuse; +import com.gh.gamecenter.common.eventbus.EBReuse; import org.greenrobot.eventbus.EventBus; diff --git a/app/src/main/java/com/gh/gamecenter/libao/LibaoSearchFragment.java b/app/src/main/java/com/gh/gamecenter/libao/LibaoSearchFragment.java index 3176110e76..0ee0b883ec 100644 --- a/app/src/main/java/com/gh/gamecenter/libao/LibaoSearchFragment.java +++ b/app/src/main/java/com/gh/gamecenter/libao/LibaoSearchFragment.java @@ -19,7 +19,7 @@ import com.gh.gamecenter.common.utils.ExtensionsKt; import com.gh.gamecenter.common.view.CustomDividerItemDecoration; import com.gh.gamecenter.databinding.FragmentLibaoSerachBinding; import com.gh.gamecenter.entity.LibaoEntity; -import com.gh.gamecenter.eventbus.EBReuse; +import com.gh.gamecenter.common.eventbus.EBReuse; import org.greenrobot.eventbus.EventBus; diff --git a/app/src/main/java/com/gh/gamecenter/message/KeFuFragment.java b/app/src/main/java/com/gh/gamecenter/message/KeFuFragment.java index 86decdae19..abb5043193 100644 --- a/app/src/main/java/com/gh/gamecenter/message/KeFuFragment.java +++ b/app/src/main/java/com/gh/gamecenter/message/KeFuFragment.java @@ -10,8 +10,8 @@ import android.view.View; import com.gh.gamecenter.core.utils.MtaHelper; import com.gh.gamecenter.R; -import com.gh.gamecenter.baselist.ListAdapter; -import com.gh.gamecenter.baselist.ListFragment; +import com.gh.gamecenter.common.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.ListFragment; import com.gh.gamecenter.entity.MessageKeFuEntity; import com.halo.assistant.HaloApp; diff --git a/app/src/main/java/com/gh/gamecenter/message/KeFuFragmentAdapter.java b/app/src/main/java/com/gh/gamecenter/message/KeFuFragmentAdapter.java index b4318a5a75..d5df0928c5 100644 --- a/app/src/main/java/com/gh/gamecenter/message/KeFuFragmentAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/message/KeFuFragmentAdapter.java @@ -32,13 +32,13 @@ import com.gh.gamecenter.ImageViewerActivity; import com.gh.gamecenter.NewsDetailActivity; import com.gh.gamecenter.R; import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; -import com.gh.gamecenter.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.ListAdapter; import com.gh.gamecenter.databinding.MessageKefuItemBinding; -import com.gh.gamecenter.energy.EnergyCenterActivity; -import com.gh.gamecenter.entity.LinkEntity; +import com.gh.gamecenter.energy.view.EnergyCenterActivity; +import com.gh.gamecenter.common.entity.LinkEntity; import com.gh.gamecenter.entity.MessageKeFuEntity; import com.gh.gamecenter.entity.MessageLinkEntity; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.user.UserManager; import com.gh.gamecenter.qa.questions.newdetail.NewQuestionDetailActivity; import com.gh.gamecenter.subject.SubjectActivity; import com.gh.gamecenter.video.detail.VideoDetailContainerViewModel; diff --git a/app/src/main/java/com/gh/gamecenter/message/KeFuViewModel.kt b/app/src/main/java/com/gh/gamecenter/message/KeFuViewModel.kt index f2ac7e3576..b0645b9a5b 100644 --- a/app/src/main/java/com/gh/gamecenter/message/KeFuViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/message/KeFuViewModel.kt @@ -1,9 +1,9 @@ package com.gh.gamecenter.message import android.app.Application -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.entity.MessageKeFuEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.retrofit.RetrofitManager import io.reactivex.Observable diff --git a/app/src/main/java/com/gh/gamecenter/message/MessageAdapter.java b/app/src/main/java/com/gh/gamecenter/message/MessageAdapter.java index 5d06753f90..2e0aa914b8 100644 --- a/app/src/main/java/com/gh/gamecenter/message/MessageAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/message/MessageAdapter.java @@ -13,7 +13,7 @@ import com.gh.common.databind.BindingAdapters; import com.gh.gamecenter.common.utils.DialogHelper; import com.gh.gamecenter.R; import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; -import com.gh.gamecenter.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.ListAdapter; import com.gh.gamecenter.databinding.MessageItemBinding; import com.gh.gamecenter.databinding.MessageItemTopBinding; import com.gh.gamecenter.entity.MessageEntity; diff --git a/app/src/main/java/com/gh/gamecenter/message/MessageDetailFragment.java b/app/src/main/java/com/gh/gamecenter/message/MessageDetailFragment.java index cba0cf2ac1..017ea5aaa5 100644 --- a/app/src/main/java/com/gh/gamecenter/message/MessageDetailFragment.java +++ b/app/src/main/java/com/gh/gamecenter/message/MessageDetailFragment.java @@ -1,6 +1,6 @@ package com.gh.gamecenter.message; -import static com.gh.gamecenter.personal.PersonalFragment.LOGIN_TAG; +import static com.gh.gamecenter.common.constant.Constants.LOGIN_TAG; import android.app.Activity; import android.app.Dialog; @@ -40,11 +40,11 @@ import com.gh.gamecenter.databinding.FragmentMessageDetailBinding; import com.gh.gamecenter.entity.CommentEntity; import com.gh.gamecenter.entity.CommentnumEntity; import com.gh.gamecenter.entity.ConcernEntity; -import com.gh.gamecenter.entity.UserInfoEntity; +import com.gh.gamecenter.login.entity.UserInfoEntity; import com.gh.gamecenter.entity.ViewsEntity; -import com.gh.gamecenter.eventbus.EBReuse; +import com.gh.gamecenter.common.eventbus.EBReuse; import com.gh.gamecenter.manager.CommentManager; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.user.UserManager; import com.gh.gamecenter.common.base.fragment.ToolbarFragment; import com.gh.gamecenter.common.retrofit.OkHttpCache; import com.gh.gamecenter.common.retrofit.Response; diff --git a/app/src/main/java/com/gh/gamecenter/message/MessageFragment.java b/app/src/main/java/com/gh/gamecenter/message/MessageFragment.java index 0f3d4dab72..0a01cea837 100644 --- a/app/src/main/java/com/gh/gamecenter/message/MessageFragment.java +++ b/app/src/main/java/com/gh/gamecenter/message/MessageFragment.java @@ -15,9 +15,9 @@ import com.gh.gamecenter.MessageInviteActivity; import com.gh.gamecenter.MessageKeFuActivity; import com.gh.gamecenter.MessageVoteActivity; import com.gh.gamecenter.R; -import com.gh.gamecenter.baselist.ListFragment; -import com.gh.gamecenter.baselist.LoadStatus; -import com.gh.gamecenter.baselist.LoadType; +import com.gh.gamecenter.common.baselist.ListFragment; +import com.gh.gamecenter.common.baselist.LoadStatus; +import com.gh.gamecenter.common.baselist.LoadType; import com.gh.gamecenter.entity.MessageEntity; import com.gh.gamecenter.entity.MessageUnreadEntity; import com.halo.assistant.HaloApp; diff --git a/app/src/main/java/com/gh/gamecenter/message/MessageItemViewHolder.java b/app/src/main/java/com/gh/gamecenter/message/MessageItemViewHolder.java index 655d226c49..4daeef4dda 100644 --- a/app/src/main/java/com/gh/gamecenter/message/MessageItemViewHolder.java +++ b/app/src/main/java/com/gh/gamecenter/message/MessageItemViewHolder.java @@ -33,13 +33,13 @@ import com.gh.gamecenter.common.base.BaseRecyclerViewHolder; import com.gh.gamecenter.common.callback.OnListClickListener; import com.gh.gamecenter.common.retrofit.Response; import com.gh.gamecenter.databinding.MessageItemBinding; -import com.gh.gamecenter.entity.CommunityEntity; +import com.gh.gamecenter.common.entity.CommunityEntity; import com.gh.gamecenter.entity.MessageEntity; import com.gh.gamecenter.entity.MessageFold; import com.gh.gamecenter.entity.UserEntity; import com.gh.gamecenter.gamecollection.detail.GameCollectionDetailActivity; import com.gh.gamecenter.gamedetail.rating.RatingReplyActivity; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.user.UserManager; import com.gh.gamecenter.qa.answer.detail.SimpleAnswerDetailActivity; import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity; import com.gh.gamecenter.qa.comment.NewCommentDetailActivity; diff --git a/app/src/main/java/com/gh/gamecenter/message/MessageNormalAdapter.java b/app/src/main/java/com/gh/gamecenter/message/MessageNormalAdapter.java index 5295d20d5c..16f5cfb147 100644 --- a/app/src/main/java/com/gh/gamecenter/message/MessageNormalAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/message/MessageNormalAdapter.java @@ -11,7 +11,7 @@ import com.gh.gamecenter.common.constant.ItemViewType; import com.gh.gamecenter.common.utils.DialogHelper; import com.gh.gamecenter.R; import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; -import com.gh.gamecenter.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.ListAdapter; import com.gh.gamecenter.databinding.MessageItemBinding; import com.gh.gamecenter.entity.MessageEntity; diff --git a/app/src/main/java/com/gh/gamecenter/message/MessageNormalFragment.java b/app/src/main/java/com/gh/gamecenter/message/MessageNormalFragment.java index ae2c81045f..ff27dd6b43 100644 --- a/app/src/main/java/com/gh/gamecenter/message/MessageNormalFragment.java +++ b/app/src/main/java/com/gh/gamecenter/message/MessageNormalFragment.java @@ -12,9 +12,9 @@ import android.view.View; import com.gh.gamecenter.common.constant.EntranceConsts; import com.gh.gamecenter.R; -import com.gh.gamecenter.baselist.ListAdapter; -import com.gh.gamecenter.baselist.ListFragment; -import com.gh.gamecenter.baselist.LoadType; +import com.gh.gamecenter.common.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.ListFragment; +import com.gh.gamecenter.common.baselist.LoadType; import com.gh.gamecenter.common.view.CustomDividerItemDecoration; import com.gh.gamecenter.entity.MessageEntity; import com.halo.assistant.HaloApp; diff --git a/app/src/main/java/com/gh/gamecenter/message/MessageNormalViewModel.kt b/app/src/main/java/com/gh/gamecenter/message/MessageNormalViewModel.kt index 8bd9ad5b75..4c09977207 100644 --- a/app/src/main/java/com/gh/gamecenter/message/MessageNormalViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/message/MessageNormalViewModel.kt @@ -3,9 +3,9 @@ package com.gh.gamecenter.message import android.app.Application import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.entity.MessageEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.retrofit.RetrofitManager import com.lightgame.utils.Utils diff --git a/app/src/main/java/com/gh/gamecenter/message/MessageUnreadRepository.kt b/app/src/main/java/com/gh/gamecenter/message/MessageUnreadRepository.kt index a1174f4c20..0873235871 100644 --- a/app/src/main/java/com/gh/gamecenter/message/MessageUnreadRepository.kt +++ b/app/src/main/java/com/gh/gamecenter/message/MessageUnreadRepository.kt @@ -14,7 +14,7 @@ import com.gh.gamecenter.entity.AddonsUnreadEntity import com.gh.gamecenter.entity.ConcernEntity import com.gh.gamecenter.entity.FunctionalGroupEntity import com.gh.gamecenter.entity.MessageUnreadEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/gamecenter/mygame/MyFollowedGameAdapter.kt b/app/src/main/java/com/gh/gamecenter/mygame/MyFollowedGameAdapter.kt index 6c0cdd2c77..91e70c8a40 100644 --- a/app/src/main/java/com/gh/gamecenter/mygame/MyFollowedGameAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/mygame/MyFollowedGameAdapter.kt @@ -17,8 +17,8 @@ import com.gh.gamecenter.common.view.DrawableView import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.MtaHelper import com.gh.gamecenter.databinding.ItemFollowedGameBinding diff --git a/app/src/main/java/com/gh/gamecenter/mygame/MyFollowedGameFragment.kt b/app/src/main/java/com/gh/gamecenter/mygame/MyFollowedGameFragment.kt index c70b6a4a23..4805c76e8a 100644 --- a/app/src/main/java/com/gh/gamecenter/mygame/MyFollowedGameFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/mygame/MyFollowedGameFragment.kt @@ -10,14 +10,15 @@ import com.gh.common.exposure.ExposureListener import com.gh.gamecenter.common.view.CustomDividerItemDecoration import com.gh.gamecenter.ConcernActivity import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.ListFragment +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListFragment +import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.databinding.FragmentFollowedGameBinding import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.eventbus.EBConcernChanged -import com.gh.gamecenter.eventbus.EBReuse -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.common.eventbus.EBReuse +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.personal.PersonalFragment import com.halo.assistant.fragment.myconcern.MyConcernRecommendAdapter import org.greenrobot.eventbus.Subscribe @@ -171,7 +172,7 @@ class MyFollowedGameFragment : ListFragment @Subscribe(threadMode = ThreadMode.MAIN) fun onEventMainThread(changed: EBReuse) { - if (PersonalFragment.LOGIN_TAG == changed.type) { // 登入 + if (Constants.LOGIN_TAG == changed.type) { // 登入 onLoadRefresh() } } diff --git a/app/src/main/java/com/gh/gamecenter/mygame/MyFollowedGameViewModel.kt b/app/src/main/java/com/gh/gamecenter/mygame/MyFollowedGameViewModel.kt index 5185758d73..9d8d6a8336 100644 --- a/app/src/main/java/com/gh/gamecenter/mygame/MyFollowedGameViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/mygame/MyFollowedGameViewModel.kt @@ -5,17 +5,15 @@ import com.gh.common.filter.RegionSettingHelper import com.gh.common.util.ApkActiveUtils import com.gh.common.util.ConcernUtils import com.gh.common.util.DataCollectionUtils -import com.gh.common.util.DataUtils import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.entity.GameEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.retrofit.RetrofitManager import com.halo.assistant.HaloApp import com.lightgame.utils.Utils import io.reactivex.Observable -import java.util.* class MyFollowedGameViewModel(application: Application) : ListViewModel(application) { diff --git a/app/src/main/java/com/gh/gamecenter/mygame/MyPlayedGameFragment.kt b/app/src/main/java/com/gh/gamecenter/mygame/MyPlayedGameFragment.kt index b41d6df39b..d08e7981a4 100644 --- a/app/src/main/java/com/gh/gamecenter/mygame/MyPlayedGameFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/mygame/MyPlayedGameFragment.kt @@ -15,7 +15,7 @@ import com.gh.gamecenter.common.utils.toDrawable import com.gh.gamecenter.common.view.CustomDividerItemDecoration import com.gh.download.DownloadManager import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.entity.GameInstall import com.gh.gamecenter.manager.PackagesManager diff --git a/app/src/main/java/com/gh/gamecenter/mygame/MyReservationAdapter.kt b/app/src/main/java/com/gh/gamecenter/mygame/MyReservationAdapter.kt index c0600cafd4..6dc5d61600 100644 --- a/app/src/main/java/com/gh/gamecenter/mygame/MyReservationAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/mygame/MyReservationAdapter.kt @@ -18,7 +18,7 @@ import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.ItemFollowedGameBinding diff --git a/app/src/main/java/com/gh/gamecenter/mygame/MyReservationFragment.kt b/app/src/main/java/com/gh/gamecenter/mygame/MyReservationFragment.kt index 606d4d1307..f18edb489b 100644 --- a/app/src/main/java/com/gh/gamecenter/mygame/MyReservationFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/mygame/MyReservationFragment.kt @@ -13,15 +13,15 @@ import com.gh.gamecenter.common.utils.viewModelProvider import com.gh.gamecenter.common.view.CustomDividerItemDecoration import com.gh.download.DownloadManager import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.ListFragment -import com.gh.gamecenter.databinding.FragmentListBaseBinding +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListFragment +import com.gh.gamecenter.common.constant.Constants +import com.gh.gamecenter.common.databinding.FragmentListBaseBinding import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.eventbus.EBDownloadStatus import com.gh.gamecenter.eventbus.EBPackage -import com.gh.gamecenter.eventbus.EBReuse -import com.gh.gamecenter.manager.UserManager -import com.gh.gamecenter.personal.PersonalFragment +import com.gh.gamecenter.common.eventbus.EBReuse +import com.gh.gamecenter.login.user.UserManager import com.lightgame.download.DataWatcher import com.lightgame.download.DownloadEntity import org.greenrobot.eventbus.Subscribe @@ -118,7 +118,7 @@ class MyReservationFragment : ListFragment() @Subscribe(threadMode = ThreadMode.MAIN) fun onEventMainThread(changed: EBReuse) { - if (PersonalFragment.LOGIN_TAG == changed.type) { // 登入 + if (Constants.LOGIN_TAG == changed.type) { // 登入 onLoadRefresh() } } diff --git a/app/src/main/java/com/gh/gamecenter/mygame/MyReservationViewModel.kt b/app/src/main/java/com/gh/gamecenter/mygame/MyReservationViewModel.kt index 3ce9d7d9c9..c8720fcb2d 100644 --- a/app/src/main/java/com/gh/gamecenter/mygame/MyReservationViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/mygame/MyReservationViewModel.kt @@ -6,10 +6,10 @@ import com.gh.common.repository.ReservationRepository import com.gh.gamecenter.core.runOnUiThread import com.gh.gamecenter.common.utils.createRequestBody import com.gh.download.DownloadManager -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.entity.GameEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.retrofit.RetrofitManager import com.lightgame.utils.Utils diff --git a/app/src/main/java/com/gh/gamecenter/mygame/PlayedGameAdapter.kt b/app/src/main/java/com/gh/gamecenter/mygame/PlayedGameAdapter.kt index 7010c26614..f7bfd35bcb 100644 --- a/app/src/main/java/com/gh/gamecenter/mygame/PlayedGameAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/mygame/PlayedGameAdapter.kt @@ -28,12 +28,12 @@ import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.callback.ConfirmListener import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.ItemPlayedGameBinding -import com.gh.gamecenter.databinding.ViewSimpleToggleBinding +import com.gh.gamecenter.energy.utils.EnergyTaskHelper import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.eventbus.EBDownloadStatus import com.lightgame.download.DownloadEntity diff --git a/app/src/main/java/com/gh/gamecenter/mygame/PlayedGameFragment.kt b/app/src/main/java/com/gh/gamecenter/mygame/PlayedGameFragment.kt index 75fa380046..1bbd08e018 100644 --- a/app/src/main/java/com/gh/gamecenter/mygame/PlayedGameFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/mygame/PlayedGameFragment.kt @@ -6,14 +6,14 @@ import com.gh.common.exposure.ExposureListener import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.viewModelProvider import com.gh.download.DownloadManager -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.ListFragment +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListFragment +import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.eventbus.EBDownloadStatus import com.gh.gamecenter.eventbus.EBPackage -import com.gh.gamecenter.eventbus.EBReuse -import com.gh.gamecenter.manager.UserManager -import com.gh.gamecenter.personal.PersonalFragment +import com.gh.gamecenter.common.eventbus.EBReuse +import com.gh.gamecenter.login.user.UserManager import com.lightgame.download.DataWatcher import com.lightgame.download.DownloadEntity import org.greenrobot.eventbus.Subscribe @@ -65,7 +65,7 @@ open class PlayedGameFragment : ListFragment() @Subscribe(threadMode = ThreadMode.MAIN) fun onEventMainThread(changed: EBReuse) { - if (PersonalFragment.LOGIN_TAG == changed.type) { // 登入 + if (Constants.LOGIN_TAG == changed.type) { // 登入 onLoadRefresh() } } diff --git a/app/src/main/java/com/gh/gamecenter/mygame/PlayedGameViewModel.kt b/app/src/main/java/com/gh/gamecenter/mygame/PlayedGameViewModel.kt index 51501b5fb5..d1c18163a2 100644 --- a/app/src/main/java/com/gh/gamecenter/mygame/PlayedGameViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/mygame/PlayedGameViewModel.kt @@ -4,7 +4,7 @@ import android.annotation.SuppressLint import android.app.Application import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/gamecenter/packagehelper/PackageRepository.kt b/app/src/main/java/com/gh/gamecenter/packagehelper/PackageRepository.kt index 56025baaf3..de46ceddf3 100644 --- a/app/src/main/java/com/gh/gamecenter/packagehelper/PackageRepository.kt +++ b/app/src/main/java/com/gh/gamecenter/packagehelper/PackageRepository.kt @@ -19,7 +19,7 @@ import com.gh.gamecenter.core.runOnIoThread import com.gh.gamecenter.core.utils.SPUtils import com.gh.gamecenter.entity.* import com.gh.gamecenter.manager.PackagesManager -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.packagehelper.PackageRepository.gameInstalled import com.gh.gamecenter.packagehelper.PackageRepository.gameUpdate import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/gamecenter/personal/NewPersonalFragment.kt b/app/src/main/java/com/gh/gamecenter/personal/NewPersonalFragment.kt index 5f8fd219a0..90542c204f 100644 --- a/app/src/main/java/com/gh/gamecenter/personal/NewPersonalFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/personal/NewPersonalFragment.kt @@ -20,8 +20,8 @@ import com.gh.common.util.DirectUtils.directToHomeActivity import com.gh.gamecenter.common.utils.ImageUtils.display import com.gh.gamecenter.common.utils.ImageUtils.displayIcon import com.gh.common.util.IntegralLogHelper.log -import com.gh.common.util.LoginHelper.onQQLoginCallback -import com.gh.common.util.LoginHelper.onWeiboLoginCallback +import com.gh.gamecenter.login.utils.LoginHelper.onQQLoginCallback +import com.gh.gamecenter.login.utils.LoginHelper.onWeiboLoginCallback import com.gh.gamecenter.core.utils.MtaHelper.onEvent import com.gh.gamecenter.core.utils.SPUtils.getLong import com.gh.gamecenter.core.utils.SPUtils.setLong @@ -38,19 +38,22 @@ import com.gh.gamecenter.common.utils.tryCatchInRelease import com.gh.gamecenter.core.utils.DisplayUtils import com.gh.gamecenter.databinding.FragmentNewPersonalBinding import com.gh.gamecenter.databinding.FragmentNewPersonalStubBinding -import com.gh.gamecenter.energy.EnergyCenterActivity -import com.gh.gamecenter.energy.EnergyHouseActivity +import com.gh.gamecenter.energy.view.EnergyCenterActivity +import com.gh.gamecenter.energy.view.EnergyHouseActivity import com.gh.gamecenter.entity.* import com.gh.gamecenter.eventbus.EBConcernChanged import com.gh.gamecenter.eventbus.EBNetworkState -import com.gh.gamecenter.eventbus.EBReuse -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.common.eventbus.EBReuse +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.message.MessageUnreadRepository.loadMessageUnreadTotal import com.gh.gamecenter.message.MessageUnreadViewModel import com.gh.gamecenter.personalhome.UserHomeViewModel import com.gh.gamecenter.room.AppDatabase import com.gh.gamecenter.common.retrofit.ApiResponse -import com.gh.gamecenter.user.UserViewModel +import com.gh.gamecenter.energy.view.EnergyUserViewModel +import com.gh.gamecenter.login.entity.Badge +import com.gh.gamecenter.login.entity.UserInfoEntity +import com.gh.gamecenter.login.user.UserViewModel import com.google.android.material.appbar.AppBarLayout import com.halo.assistant.HaloApp import com.tencent.connect.common.Constants @@ -70,6 +73,7 @@ class NewPersonalFragment : BaseLazyFragment() { private lateinit var mUnreadViewModel: MessageUnreadViewModel private lateinit var mUserHomeViewModel: UserHomeViewModel private lateinit var mPersonalViewModel: PersonalViewModel + private lateinit var mEnergyUserViewModel: EnergyUserViewModel private lateinit var mPersonalFuncGroupAdapter: NewPersonalFunctionGroupAdapter @@ -250,6 +254,12 @@ class NewPersonalFragment : BaseLazyFragment() { MessageUnreadViewModel.Factory(HaloApp.getInstance().application) ).get(MessageUnreadViewModel::class.java) mPersonalViewModel = ViewModelProvider(this).get(PersonalViewModel::class.java) + mEnergyUserViewModel = ViewModelProvider( + this, EnergyUserViewModel.Factory( + HaloApp.getInstance().application, + UserManager.getInstance().userId + ) + ).get(EnergyUserViewModel::class.java) observeNoneUIRelatedChanges() } @@ -268,8 +278,8 @@ class NewPersonalFragment : BaseLazyFragment() { mUserHomeViewModel.getBadgeList() mUserHomeViewModel.availableBadges() if (CheckLoginUtils.isLogin()) { - mUserHomeViewModel.getUserEnergy() - mUserHomeViewModel.getSignInfo() + mEnergyUserViewModel.getUserEnergy() + mEnergyUserViewModel.getSignInfo() } } // val currentItem = (parentFragment as MainWrapperFragment).currentItem @@ -380,7 +390,7 @@ class NewPersonalFragment : BaseLazyFragment() { } } - mUserHomeViewModel.energy.observe(this) { energy: Long -> + mEnergyUserViewModel.energy.observe(this) { energy: Long -> mEnergy = energy if (energy > 9999) { mStubBinding.personalEnergyTv.text = "9999+" @@ -389,16 +399,15 @@ class NewPersonalFragment : BaseLazyFragment() { } } - mUserHomeViewModel.signStatus.observe(this, - { (todaySignIn) -> - if (todaySignIn) { - mStubBinding.personalEnergy.visibility = View.VISIBLE - mStubBinding.personalReceiveEnergy.visibility = View.GONE - } else { - mStubBinding.personalEnergy.visibility = View.GONE - mStubBinding.personalReceiveEnergy.visibility = View.VISIBLE - } - }) + mEnergyUserViewModel.signStatus.observe(this) { (todaySignIn) -> + if (todaySignIn) { + mStubBinding.personalEnergy.visibility = View.VISIBLE + mStubBinding.personalReceiveEnergy.visibility = View.GONE + } else { + mStubBinding.personalEnergy.visibility = View.GONE + mStubBinding.personalReceiveEnergy.visibility = View.VISIBLE + } + } mPersonalViewModel.haloAddData.observe( this, @@ -485,8 +494,8 @@ class NewPersonalFragment : BaseLazyFragment() { mUserHomeViewModel.userId = UserManager.getInstance().userId mUserHomeViewModel.getBadgeList() mUserHomeViewModel.availableBadges() - mUserHomeViewModel.getUserEnergy() - mUserHomeViewModel.getSignInfo() + mEnergyUserViewModel.getUserEnergy() + mEnergyUserViewModel.getSignInfo() loadMessageUnreadTotal(true) } else { mStubBinding.personalReceiveEnergy.visibility = View.VISIBLE @@ -663,9 +672,6 @@ class NewPersonalFragment : BaseLazyFragment() { } companion object { - const val LOGIN_TAG = "login_tag" //登入标识 - const val LOGOUT_TAG = "logout_tag" // 登出标识 - private const val MESSAGE_READ_OVER = "MESSAGE_READ_OVER" private const val SP_BADGE_RECORD_SEVEN_DAY = "badgeRecordSevenDay" private const val REQUEST_MESSAGE = 199 diff --git a/app/src/main/java/com/gh/gamecenter/personal/PersonalFragment.kt b/app/src/main/java/com/gh/gamecenter/personal/PersonalFragment.kt index 33064af33c..8dcb30bae2 100644 --- a/app/src/main/java/com/gh/gamecenter/personal/PersonalFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/personal/PersonalFragment.kt @@ -17,42 +17,44 @@ import com.gh.common.util.* import com.gh.common.util.DirectUtils.directToBadgeDetail import com.gh.common.util.DirectUtils.directToBadgeWall import com.gh.common.util.DirectUtils.directToHomeActivity -import com.gh.common.util.LoginHelper.onQQLoginCallback -import com.gh.common.util.LoginHelper.onWeiboLoginCallback +import com.gh.gamecenter.common.utils.ImageUtils.display +import com.gh.gamecenter.common.utils.ImageUtils.displayIcon +import com.gh.gamecenter.login.utils.LoginHelper.onQQLoginCallback +import com.gh.gamecenter.login.utils.LoginHelper.onWeiboLoginCallback +import com.gh.gamecenter.core.utils.MtaHelper.onEvent +import com.gh.gamecenter.core.utils.SPUtils.getLong +import com.gh.gamecenter.core.utils.SPUtils.setLong +import com.gh.gamecenter.core.utils.TimeUtils.getStartTimeOfDay +import com.gh.gamecenter.core.utils.ToastUtils.showToast +import com.gh.gamecenter.common.view.VerticalItemDecoration import com.gh.gamecenter.MessageActivity import com.gh.gamecenter.R import com.gh.gamecenter.common.base.activity.BaseActivity import com.gh.gamecenter.common.base.fragment.BaseLazyFragment import com.gh.gamecenter.common.callback.ConfirmListener import com.gh.gamecenter.common.retrofit.ApiResponse -import com.gh.gamecenter.common.utils.ImageUtils.display -import com.gh.gamecenter.common.utils.ImageUtils.displayIcon import com.gh.gamecenter.common.utils.NetworkUtils import com.gh.gamecenter.common.utils.PackageFlavorHelper import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.common.utils.tryCatchInRelease -import com.gh.gamecenter.common.view.VerticalItemDecoration import com.gh.gamecenter.core.utils.DisplayUtils -import com.gh.gamecenter.core.utils.MtaHelper.onEvent -import com.gh.gamecenter.core.utils.SPUtils.getLong -import com.gh.gamecenter.core.utils.SPUtils.setLong -import com.gh.gamecenter.core.utils.TimeUtils.getStartTimeOfDay -import com.gh.gamecenter.core.utils.ToastUtils.showToast import com.gh.gamecenter.databinding.FragmentPersonalBinding import com.gh.gamecenter.databinding.FragmentPersonalStubBinding import com.gh.gamecenter.entity.* import com.gh.gamecenter.eventbus.EBConcernChanged import com.gh.gamecenter.eventbus.EBNetworkState -import com.gh.gamecenter.eventbus.EBReuse import com.gh.gamecenter.fragment.MainWrapperFragment -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.common.eventbus.EBReuse import com.gh.gamecenter.message.MessageUnreadRepository.loadMessageUnreadTotal +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.message.MessageUnreadViewModel import com.gh.gamecenter.personal.NewPersonalActivity.Companion.getIntent import com.gh.gamecenter.personalhome.UserHomeViewModel import com.gh.gamecenter.room.AppDatabase -import com.gh.gamecenter.user.UserViewModel import com.google.android.material.appbar.AppBarLayout +import com.gh.gamecenter.login.entity.Badge +import com.gh.gamecenter.login.entity.UserInfoEntity +import com.gh.gamecenter.login.user.UserViewModel import com.halo.assistant.HaloApp import com.jakewharton.rxbinding2.view.RxView import com.tencent.connect.common.Constants @@ -723,9 +725,6 @@ class PersonalFragment : BaseLazyFragment() { } companion object { - const val LOGIN_TAG = "login_tag" //登入标识 - const val LOGOUT_TAG = "logout_tag" // 登出标识 - private const val MESSAGE_READ_OVER = "MESSAGE_READ_OVER" private const val SP_BADGE_RECORD_SEVEN_DAY = "badgeRecordSevenDay" private const val REQUEST_MESSAGE = 199 diff --git a/app/src/main/java/com/gh/gamecenter/personal/PersonalFunctionAdapter.kt b/app/src/main/java/com/gh/gamecenter/personal/PersonalFunctionAdapter.kt index 44ca6953e5..f83b611194 100644 --- a/app/src/main/java/com/gh/gamecenter/personal/PersonalFunctionAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/personal/PersonalFunctionAdapter.kt @@ -9,6 +9,7 @@ import android.view.ViewGroup import android.widget.ImageView import android.widget.TextView import androidx.recyclerview.widget.RecyclerView +import com.alibaba.android.arouter.launcher.ARouter import com.facebook.drawee.view.SimpleDraweeView import com.gh.common.util.CheckLoginUtils import com.gh.common.util.DataCollectionUtils @@ -16,6 +17,8 @@ import com.gh.common.util.DirectUtils import com.gh.common.util.NewLogUtils import com.gh.gamecenter.* import com.gh.gamecenter.common.constant.Constants +import com.gh.gamecenter.common.constant.EntranceConsts +import com.gh.gamecenter.common.constant.RouteConsts import com.gh.gamecenter.common.utils.DialogHelper import com.gh.gamecenter.common.utils.ImageUtils import com.gh.gamecenter.common.utils.PermissionHelper @@ -31,7 +34,7 @@ import com.gh.gamecenter.game.upload.GameSubmissionActivity import com.gh.gamecenter.gamecollection.mine.MyGameCollectionActivity import com.gh.gamecenter.gamedetail.myrating.MyRatingActivity import com.gh.gamecenter.history.HistoryActivity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.message.MessageUnreadRepository import com.gh.gamecenter.mygame.MyGameActivity import com.gh.gamecenter.qa.myqa.MyAskActivity diff --git a/app/src/main/java/com/gh/gamecenter/personal/PersonalViewModel.kt b/app/src/main/java/com/gh/gamecenter/personal/PersonalViewModel.kt index a17ea29c00..01c577f425 100644 --- a/app/src/main/java/com/gh/gamecenter/personal/PersonalViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/personal/PersonalViewModel.kt @@ -11,12 +11,13 @@ import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.MainActivity import com.gh.gamecenter.NewsDetailActivity import com.gh.gamecenter.R +import com.gh.gamecenter.common.entity.LinkEntity import com.gh.gamecenter.core.utils.SPUtils import com.gh.gamecenter.core.utils.ToastUtils import com.gh.gamecenter.entity.* import com.gh.gamecenter.eventbus.EBSkip import com.gh.gamecenter.fragment.MainWrapperFragment -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/FollowersOrFansAdapter.kt b/app/src/main/java/com/gh/gamecenter/personalhome/FollowersOrFansAdapter.kt index f1b2326f3b..a67a3dcfbe 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/FollowersOrFansAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/FollowersOrFansAdapter.kt @@ -8,7 +8,7 @@ import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.* import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.callback.ConfirmListener import com.gh.gamecenter.common.utils.DialogHelper import com.gh.gamecenter.core.utils.NumberUtils @@ -18,7 +18,7 @@ import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.common.utils.ImageUtils import com.gh.gamecenter.databinding.FollowersOrFansItemBinding import com.gh.gamecenter.entity.FollowersOrFansEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager class FollowersOrFansAdapter(context: Context, val mViewModel: FollowersOrFansViewModel, val entrance: String) : ListAdapter(context) { diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/FollowersOrFansFragment.kt b/app/src/main/java/com/gh/gamecenter/personalhome/FollowersOrFansFragment.kt index 0cd01ac675..611e367d5c 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/FollowersOrFansFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/FollowersOrFansFragment.kt @@ -8,9 +8,9 @@ import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.core.utils.MtaHelper import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.view.SpacingItemDecoration -import com.gh.gamecenter.baselist.ListFragment +import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.entity.FollowersOrFansEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.message.MessageUnreadViewModel import com.gh.gamecenter.personalhome.fans.FansActivity import com.halo.assistant.HaloApp diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/FollowersOrFansViewModel.kt b/app/src/main/java/com/gh/gamecenter/personalhome/FollowersOrFansViewModel.kt index d14365c26f..e830783f90 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/FollowersOrFansViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/FollowersOrFansViewModel.kt @@ -5,7 +5,7 @@ import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.entity.FollowersOrFansEntity import com.gh.gamecenter.eventbus.EBUserFollow import com.gh.gamecenter.personalhome.fans.FansActivity diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/InstalledGameDialog.kt b/app/src/main/java/com/gh/gamecenter/personalhome/InstalledGameDialog.kt index 994ded30f1..8775a03194 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/InstalledGameDialog.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/InstalledGameDialog.kt @@ -15,7 +15,7 @@ import com.gh.gamecenter.common.view.SpacingItemDecoration import com.gh.gamecenter.R import com.gh.gamecenter.databinding.DialogInstalledGameBinding import com.gh.gamecenter.entity.GameInstall -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.retrofit.RetrofitManager import io.reactivex.android.schedulers.AndroidSchedulers diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/UserHomeFragment.kt b/app/src/main/java/com/gh/gamecenter/personalhome/UserHomeFragment.kt index a20dc06167..e3bfe54b07 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/UserHomeFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/UserHomeFragment.kt @@ -32,16 +32,17 @@ import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.FragmentHomeBinding import com.gh.gamecenter.entity.* -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.message.MessageUnreadViewModel import com.gh.gamecenter.common.base.fragment.ToolbarFragment +import com.gh.gamecenter.login.entity.Badge import com.gh.gamecenter.personalhome.background.PersonalityBackgroundActivity import com.gh.gamecenter.personalhome.border.AvatarBorderActivity import com.gh.gamecenter.personalhome.fans.FansActivity import com.gh.gamecenter.personalhome.followers.FollowersActivity import com.gh.gamecenter.personalhome.home.* import com.gh.gamecenter.personalhome.home.game.UserGameFragment -import com.gh.gamecenter.user.UserViewModel +import com.gh.gamecenter.login.user.UserViewModel import com.google.android.material.appbar.AppBarLayout import com.google.android.material.appbar.AppBarLayout.OnOffsetChangedListener import com.halo.assistant.HaloApp diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/UserHomeViewModel.kt b/app/src/main/java/com/gh/gamecenter/personalhome/UserHomeViewModel.kt index 995623a62b..6bca7aa0bf 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/UserHomeViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/UserHomeViewModel.kt @@ -7,7 +7,6 @@ import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider -import com.gh.common.util.EnergyTaskHelper import com.gh.common.util.ErrorHelper import com.gh.gamecenter.core.utils.ToastUtils import com.gh.gamecenter.common.utils.createRequestBody @@ -15,6 +14,7 @@ import com.gh.gamecenter.R import com.gh.gamecenter.entity.* import com.gh.gamecenter.eventbus.EBUserFollow import com.gh.gamecenter.common.retrofit.BiResponse +import com.gh.gamecenter.energy.entity.SignStatusEntity import com.gh.gamecenter.retrofit.RetrofitManager import com.google.gson.JsonObject import com.halo.assistant.HaloApp @@ -33,10 +33,7 @@ class UserHomeViewModel(application: Application, var userId: String) : AndroidV var availableBadge = MutableLiveData() var availableBadgeCount = MutableLiveData() var playGamesCount = MutableLiveData() - var energy = MutableLiveData() var level = MutableLiveData() - var sign = MutableLiveData() - var signStatus = MutableLiveData() fun getUserInfo() { RetrofitManager.getInstance() @@ -136,19 +133,6 @@ class UserHomeViewModel(application: Application, var userId: String) : AndroidV }) } - @SuppressLint("CheckResult") - fun getUserEnergy() { - RetrofitManager.getInstance() - .api.getUserEnergies(userId) - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribe(object : BiResponse() { - override fun onSuccess(data: JsonObject) { - energy.postValue(data["energy"].asLong) - } - }) - } - @SuppressLint("CheckResult") fun getUserLevel() { RetrofitManager.getInstance() @@ -187,34 +171,6 @@ class UserHomeViewModel(application: Application, var userId: String) : AndroidV }) } - @SuppressLint("CheckResult") - fun signIn() { - RetrofitManager.getInstance() - .api.signIn(userId) - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribe(object : BiResponse() { - override fun onSuccess(data: SignStatusEntity) { - EnergyTaskHelper.postEnergyTask("sign_in_cumulatively") - EnergyTaskHelper.postEnergyTask("sign_in_continuously") - sign.postValue(data) - } - }) - } - - @SuppressLint("CheckResult") - fun getSignInfo() { - RetrofitManager.getInstance() - .api.getSignStatus(userId) - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribe(object : BiResponse() { - override fun onSuccess(data: SignStatusEntity) { - signStatus.postValue(data) - } - }) - } - class Factory(private val mApplication: Application, private val mUserId: String) : ViewModelProvider.NewInstanceFactory() { override fun create(modelClass: Class): T { diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/background/BackgroundPreviewActivity.kt b/app/src/main/java/com/gh/gamecenter/personalhome/background/BackgroundPreviewActivity.kt index 6184a2ee40..8a1ec047ee 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/background/BackgroundPreviewActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/background/BackgroundPreviewActivity.kt @@ -7,7 +7,7 @@ import com.gh.gamecenter.common.base.activity.BaseActivity import com.gh.gamecenter.core.utils.DisplayUtils import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.R -import com.gh.gamecenter.entity.BackgroundImageEntity +import com.gh.gamecenter.login.entity.BackgroundImageEntity class BackgroundPreviewActivity : BaseActivity() { diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/background/BackgroundPreviewFragment.kt b/app/src/main/java/com/gh/gamecenter/personalhome/background/BackgroundPreviewFragment.kt index 4bdf9ab1de..c87075fea0 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/background/BackgroundPreviewFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/background/BackgroundPreviewFragment.kt @@ -11,20 +11,20 @@ import android.view.View import androidx.annotation.RequiresApi import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.content.ContextCompat -import com.gh.common.util.EnergyTaskHelper -import com.gh.common.util.GhMatisseFilter +import com.gh.gamecenter.common.base.fragment.WaitingDialogFragment +import com.gh.common.util.* import com.gh.gamecenter.CropImageActivity import com.gh.gamecenter.R -import com.gh.gamecenter.common.base.fragment.ToolbarFragment -import com.gh.gamecenter.common.base.fragment.WaitingDialogFragment import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.FragmentBackgroundPreviewBinding -import com.gh.gamecenter.entity.BackgroundImageEntity import com.gh.gamecenter.entity.ErrorEntity -import com.gh.gamecenter.manager.UserManager -import com.gh.gamecenter.user.UserViewModel +import com.gh.gamecenter.login.user.UserManager +import com.gh.gamecenter.common.base.fragment.ToolbarFragment +import com.gh.gamecenter.energy.utils.EnergyTaskHelper +import com.gh.gamecenter.login.entity.BackgroundImageEntity +import com.gh.gamecenter.login.user.UserViewModel import com.halo.assistant.HaloApp import com.zhihu.matisse.Matisse import com.zhihu.matisse.MimeType diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/background/PersonalityBackgroundAdapter.kt b/app/src/main/java/com/gh/gamecenter/personalhome/background/PersonalityBackgroundAdapter.kt index 55884688dc..f23b0e999b 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/background/PersonalityBackgroundAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/background/PersonalityBackgroundAdapter.kt @@ -8,8 +8,8 @@ import com.gh.gamecenter.common.utils.ImageUtils import com.gh.gamecenter.common.utils.visibleIf import com.gh.gamecenter.R import com.gh.gamecenter.databinding.AvatarBackgroundItemBinding -import com.gh.gamecenter.entity.BackgroundImageEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.entity.BackgroundImageEntity +import com.gh.gamecenter.login.user.UserManager import com.lightgame.adapter.BaseRecyclerAdapter import java.util.ArrayList diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/background/PersonalityBackgroundFragment.kt b/app/src/main/java/com/gh/gamecenter/personalhome/background/PersonalityBackgroundFragment.kt index 03fdf39643..6e84b19c38 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/background/PersonalityBackgroundFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/background/PersonalityBackgroundFragment.kt @@ -19,7 +19,7 @@ import com.gh.gamecenter.CropImageActivity import com.gh.gamecenter.R import com.gh.gamecenter.databinding.PersonalityBackgroundFragmentBinding import com.gh.gamecenter.common.base.fragment.ToolbarFragment -import com.gh.gamecenter.user.UserViewModel +import com.gh.gamecenter.login.user.UserViewModel import com.halo.assistant.HaloApp import com.zhihu.matisse.Matisse import com.zhihu.matisse.MimeType diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/background/PersonalityBackgroundViewModel.kt b/app/src/main/java/com/gh/gamecenter/personalhome/background/PersonalityBackgroundViewModel.kt index aade0b39cb..67f9c55806 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/background/PersonalityBackgroundViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/background/PersonalityBackgroundViewModel.kt @@ -10,8 +10,8 @@ import androidx.lifecycle.MutableLiveData import com.gh.gamecenter.common.callback.BiCallback import com.gh.gamecenter.common.utils.BitmapUtils import com.gh.gamecenter.common.utils.ImageUtils -import com.gh.gamecenter.entity.BackgroundImageEntity import com.gh.gamecenter.common.retrofit.Response +import com.gh.gamecenter.login.entity.BackgroundImageEntity import com.gh.gamecenter.retrofit.RetrofitManager import io.reactivex.Single import io.reactivex.android.schedulers.AndroidSchedulers diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/border/AvatarBorderFragment.kt b/app/src/main/java/com/gh/gamecenter/personalhome/border/AvatarBorderFragment.kt index 3fedd40c96..81c6758b14 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/border/AvatarBorderFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/border/AvatarBorderFragment.kt @@ -25,10 +25,11 @@ import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.FragmentAvatarBorderBinding import com.gh.gamecenter.entity.AvatarBorderCategoryEntity -import com.gh.gamecenter.entity.AvatarBorderEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.base.fragment.ToolbarFragment -import com.gh.gamecenter.user.UserViewModel +import com.gh.gamecenter.energy.utils.EnergyTaskHelper +import com.gh.gamecenter.login.entity.AvatarBorderEntity +import com.gh.gamecenter.login.user.UserViewModel import com.google.android.material.tabs.TabLayout import com.halo.assistant.HaloApp import org.json.JSONObject diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/border/ChooseAvatarBorderAdapter.kt b/app/src/main/java/com/gh/gamecenter/personalhome/border/ChooseAvatarBorderAdapter.kt index 60a428b0b5..698f45ccbe 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/border/ChooseAvatarBorderAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/border/ChooseAvatarBorderAdapter.kt @@ -12,9 +12,9 @@ import com.gh.gamecenter.R import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.AvatarItemBinding -import com.gh.gamecenter.energy.EnergyHouseActivity -import com.gh.gamecenter.entity.AvatarBorderEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.energy.view.EnergyHouseActivity +import com.gh.gamecenter.login.entity.AvatarBorderEntity +import com.gh.gamecenter.login.user.UserManager import com.lightgame.adapter.BaseRecyclerAdapter class ChooseAvatarBorderAdapter(context: Context, diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/border/ChooseAvatarBorderViewModel.kt b/app/src/main/java/com/gh/gamecenter/personalhome/border/ChooseAvatarBorderViewModel.kt index 90dc0c7419..2edb1f74f3 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/border/ChooseAvatarBorderViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/border/ChooseAvatarBorderViewModel.kt @@ -7,8 +7,8 @@ import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider import com.gh.gamecenter.core.utils.UrlFilterUtils -import com.gh.gamecenter.entity.AvatarBorderEntity import com.gh.gamecenter.common.retrofit.BiResponse +import com.gh.gamecenter.login.entity.AvatarBorderEntity import com.gh.gamecenter.retrofit.RetrofitManager import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.schedulers.Schedulers diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/home/UserHistoryAdapter.kt b/app/src/main/java/com/gh/gamecenter/personalhome/home/UserHistoryAdapter.kt index bbd8b88ea8..06a7522157 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/home/UserHistoryAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/home/UserHistoryAdapter.kt @@ -13,7 +13,7 @@ import com.gh.common.util.DialogUtils import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.PersonalHomeRatingViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.callback.ConfirmListener import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/home/UserHistoryFragment.kt b/app/src/main/java/com/gh/gamecenter/personalhome/home/UserHistoryFragment.kt index f4f6c7a5af..f0e66b1840 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/home/UserHistoryFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/home/UserHistoryFragment.kt @@ -10,8 +10,8 @@ import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.core.AppExecutor import com.gh.common.util.* import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.ListFragment +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.MD5Utils import com.gh.gamecenter.databinding.FragmentUserPublishBinding diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/home/UserHistoryViewModel.kt b/app/src/main/java/com/gh/gamecenter/personalhome/home/UserHistoryViewModel.kt index c3d3c4dc37..b84d983c18 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/home/UserHistoryViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/home/UserHistoryViewModel.kt @@ -6,12 +6,12 @@ import android.text.TextUtils import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider -import com.gh.common.util.EnergyTaskHelper +import com.gh.gamecenter.energy.utils.EnergyTaskHelper import com.gh.common.util.ErrorHelper import com.gh.gamecenter.core.utils.UrlFilterUtils import com.gh.gamecenter.common.utils.toObject -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.common.utils.singleToMain import com.gh.gamecenter.entity.ErrorEntity import com.gh.gamecenter.entity.ForumVideoEntity diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/home/UserVideoHistoryAdapter.kt b/app/src/main/java/com/gh/gamecenter/personalhome/home/UserVideoHistoryAdapter.kt index 0fb648bd31..ea02ffe549 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/home/UserVideoHistoryAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/home/UserVideoHistoryAdapter.kt @@ -9,7 +9,7 @@ import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.DirectUtils import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.databinding.VideoNewItemBinding import com.gh.gamecenter.entity.MyVideoEntity import com.gh.gamecenter.video.VideoItemViewHolder diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/home/UserVideoHistoryFragment.kt b/app/src/main/java/com/gh/gamecenter/personalhome/home/UserVideoHistoryFragment.kt index 4e4c813b6b..48061ac816 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/home/UserVideoHistoryFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/home/UserVideoHistoryFragment.kt @@ -11,8 +11,8 @@ //import com.gh.gamecenter.common.view.FixGridLayoutManager //import com.gh.gamecenter.common.view.GridSpacingItemDecoration //import com.gh.gamecenter.R -//import com.gh.gamecenter.baselist.ListAdapter -//import com.gh.gamecenter.baselist.ListFragment +//import com.gh.gamecenter.common.baselist.ListAdapter +//import com.gh.gamecenter.common.baselist.ListFragment //import com.gh.gamecenter.entity.PersonalEntity //import com.gh.gamecenter.entity.PersonalHistoryEntity //import com.halo.assistant.HaloApp diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/home/UserVideoHistoryViewModel.kt b/app/src/main/java/com/gh/gamecenter/personalhome/home/UserVideoHistoryViewModel.kt index 32f0a31115..f7272495d3 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/home/UserVideoHistoryViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/home/UserVideoHistoryViewModel.kt @@ -4,7 +4,7 @@ import android.app.Application import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider import com.gh.common.constant.Config -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.entity.MyVideoEntity import com.gh.gamecenter.retrofit.RetrofitManager import io.reactivex.Observable diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserCommentHistoryAdapter.kt b/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserCommentHistoryAdapter.kt index 7f45ee1da4..4613bab107 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserCommentHistoryAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserCommentHistoryAdapter.kt @@ -12,7 +12,7 @@ import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.* import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.ItemUserCommentHistoryBinding diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserCommentHistoryFragment.kt b/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserCommentHistoryFragment.kt index 9c7001bb37..3cbdf6852d 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserCommentHistoryFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserCommentHistoryFragment.kt @@ -7,8 +7,8 @@ import android.view.View import androidx.core.content.ContextCompat import androidx.core.os.bundleOf import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.ListFragment +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.common.utils.viewModelProvider import com.gh.gamecenter.entity.RatingComment diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserCommentHistoryViewModel.kt b/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserCommentHistoryViewModel.kt index 0f8f64c8ed..834b1466dd 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserCommentHistoryViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserCommentHistoryViewModel.kt @@ -4,13 +4,14 @@ import android.app.Application import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider import com.gh.common.util.* -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.common.utils.toObject import com.gh.gamecenter.core.utils.UrlFilterUtils import com.gh.gamecenter.entity.ErrorEntity import com.gh.gamecenter.personalhome.rating.MyRating import com.gh.gamecenter.common.retrofit.Response +import com.gh.gamecenter.energy.utils.EnergyTaskHelper import com.gh.gamecenter.retrofit.RetrofitManager import com.lightgame.utils.Utils import io.reactivex.Observable diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserPlayedGameAdapter.kt b/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserPlayedGameAdapter.kt index 13bc953088..19bb502bea 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserPlayedGameAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserPlayedGameAdapter.kt @@ -13,7 +13,7 @@ import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.core.utils.NumberUtils import com.gh.gamecenter.core.utils.StringUtils import com.gh.gamecenter.common.utils.dip2px diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserPlayedGameFragment.kt b/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserPlayedGameFragment.kt index be1a462caf..03e9b4fac8 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserPlayedGameFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserPlayedGameFragment.kt @@ -12,13 +12,13 @@ import com.gh.common.xapk.XapkInstaller import com.gh.common.xapk.XapkUnzipStatus import com.gh.download.DownloadManager import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListFragment +import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.entity.GameInstall import com.gh.gamecenter.eventbus.EBDownloadStatus import com.gh.gamecenter.eventbus.EBPackage import com.gh.gamecenter.manager.PackagesManager -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.mygame.PlayedGameViewModel import com.gh.gamecenter.personalhome.InstalledGameDialog import com.lightgame.download.DataWatcher diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/rating/RatingActivity.kt b/app/src/main/java/com/gh/gamecenter/personalhome/rating/RatingActivity.kt index 1261aef6b2..fd290af0bf 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/rating/RatingActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/rating/RatingActivity.kt @@ -7,10 +7,10 @@ import androidx.lifecycle.ViewModelProviders import com.gh.gamecenter.common.base.activity.BaseActivity import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListActivity -import com.gh.gamecenter.baselist.NormalListViewModel +import com.gh.gamecenter.common.baselist.ListActivity +import com.gh.gamecenter.common.baselist.NormalListViewModel import com.gh.gamecenter.common.utils.updateStatusBarColor -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.retrofit.RetrofitManager import com.halo.assistant.HaloApp import io.reactivex.Single diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/rating/RatingAdapter.kt b/app/src/main/java/com/gh/gamecenter/personalhome/rating/RatingAdapter.kt index ddeda00f62..1912a35618 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/rating/RatingAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/rating/RatingAdapter.kt @@ -13,8 +13,8 @@ import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.PersonalHomeRatingViewHolder -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.NormalListViewModel +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.NormalListViewModel import com.gh.gamecenter.databinding.PersonalHomeRatingBinding class RatingAdapter( diff --git a/app/src/main/java/com/gh/gamecenter/provider/GhContentProvider.kt b/app/src/main/java/com/gh/gamecenter/provider/GhContentProvider.kt index 91129dcc8b..869ba86e8f 100644 --- a/app/src/main/java/com/gh/gamecenter/provider/GhContentProvider.kt +++ b/app/src/main/java/com/gh/gamecenter/provider/GhContentProvider.kt @@ -13,8 +13,8 @@ import com.gh.gamecenter.BuildConfig import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.core.utils.GsonUtils import com.gh.gamecenter.core.utils.SPUtils -import com.gh.gamecenter.entity.UserInfoEntity -import com.gh.gamecenter.user.UserRepository +import com.gh.gamecenter.login.entity.UserInfoEntity +import com.gh.gamecenter.login.user.UserRepository import com.lightgame.utils.Utils class GhContentProvider : ContentProvider() { diff --git a/app/src/main/java/com/gh/gamecenter/qa/CommunityFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/CommunityFragment.kt index 8d281598c3..ff6a27ba81 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/CommunityFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/CommunityFragment.kt @@ -26,11 +26,11 @@ //import com.gh.common.view.GameIconView //import com.gh.gamecenter.R //import com.gh.gamecenter.entity.ResultEntity -//import com.gh.gamecenter.eventbus.EBReuse +//import com.gh.gamecenter.common.eventbus.EBReuse //import com.gh.gamecenter.eventbus.EBTypeChange //import com.gh.gamecenter.eventbus.EBUISwitch //import com.gh.gamecenter.fragment.MainWrapperFragment -//import com.gh.gamecenter.manager.UserManager +//import com.gh.gamecenter.login.user.UserManager //import com.gh.gamecenter.personal.PersonalFragment //import com.gh.gamecenter.qa.all.AskAllFragment //import com.gh.gamecenter.qa.article.edit.ArticleEditActivity @@ -126,11 +126,11 @@ // status?.let { // val channel = HaloApp.getInstance().channel // // MARK:只要是测试社区都忽略隐藏判断 -// if (TextUtils.isEmpty(UserManager.getInstance().community.id) +// if (TextUtils.isEmpty(CommunityManager.getInstance().community.id) // || (!status.isActive && !channel.contains("TEST"))) { // showCommunitySelectFragment() // } else { -// mAskSelectCommunity.displayGameIcon(UserManager.getInstance().community.icon, UserManager.getInstance().community.iconSubscript) +// mAskSelectCommunity.displayGameIcon(CommunityManager.getInstance().community.icon, CommunityManager.getInstance().community.iconSubscript) // showAvailableInfo() // mViewPager.currentItem = INDEX_RECOMMEND // @@ -196,7 +196,7 @@ // } // // if (tab.text == TAB_TITLE_ALL) mViewPager.currentItem = INDEX_ALL -// MtaHelper.onEvent("问答页面", UserManager.getInstance().community.name, tab.text.toString() + "Tab") +// MtaHelper.onEvent("问答页面", CommunityManager.getInstance().community.name, tab.text.toString() + "Tab") // } // // override fun onTabUnselected(tab: TabLayout.Tab) {} @@ -278,7 +278,7 @@ // // override fun onResume() { // super.onResume() -// if (!TextUtils.isEmpty(UserManager.getInstance().community.id)) { +// if (!TextUtils.isEmpty(CommunityManager.getInstance().community.id)) { // mSelectGameHint.visibility = if (!mHasClickedSelectGame) View.VISIBLE else View.GONE // } // DisplayUtils.setLightStatusBar(requireActivity(), true) @@ -312,11 +312,11 @@ // sp.edit().putBoolean(SP_KEY_CLICKED_SELECT_GAME, mHasClickedSelectGame).apply() // } // -// MtaHelper.onEvent("问答页面", UserManager.getInstance().community.name, "选择游戏") +// MtaHelper.onEvent("问答页面", CommunityManager.getInstance().community.name, "选择游戏") // startActivityForResult(CommunitiesSelectActivity.getIntent(context), COMMUNITIES_SELECT_REQUEST) // } // R.id.community_search_container -> { -// MtaHelper.onEvent("问答页面", UserManager.getInstance().community.name, "搜索") +// MtaHelper.onEvent("问答页面", CommunityManager.getInstance().community.name, "搜索") // startActivity(AskSearchActivity.getIntent(context, "(首页-问答)")) // } // R.id.reuse_no_connection -> { @@ -330,7 +330,7 @@ // else -> "推荐-发布" // } // MtaHelper.onEvent("问答页面", "问答页面", positionType) -// MtaHelper.onEvent("问答页面", UserManager.getInstance().community.name, positionType) +// MtaHelper.onEvent("问答页面", CommunityManager.getInstance().community.name, positionType) // // showCommunityEditWindow() // } @@ -365,7 +365,7 @@ // } // } // -// PersonalFragment.LOGIN_TAG -> { +// Constants.LOGIN_TAG -> { // mAskFollowFragment?.onRefresh() // } // @@ -456,7 +456,7 @@ // requireContext(), // R.style.DialogWindowTransparent, // "问答页面", -// UserManager.getInstance().community.name, +// CommunityManager.getInstance().community.name, // null, // "发布-空白", // "发布-返回", @@ -469,8 +469,8 @@ // contentView.findViewById(R.id.community_edit_article).setOnClickListener { // context?.ifLogin("(首页-问答)", action = { // checkStoragePermissionBeforeAction { -// MtaHelper.onEvent("问答页面", UserManager.getInstance().community.name, "发布-发文章") -// startActivity(ArticleEditActivity.getIntent(requireContext(), UserManager.getInstance().community)) +// MtaHelper.onEvent("问答页面", CommunityManager.getInstance().community.name, "发布-发文章") +// startActivity(ArticleEditActivity.getIntent(requireContext(), CommunityManager.getInstance().community)) // dialog.dismiss() // } // }) @@ -478,14 +478,14 @@ // contentView.findViewById(R.id.community_edit_question).setOnClickListener { // context?.ifLogin("(首页-问答)", action = { // checkStoragePermissionBeforeAction { -// MtaHelper.onEvent("问答页面", UserManager.getInstance().community.name, "发布-提问题") +// MtaHelper.onEvent("问答页面", CommunityManager.getInstance().community.name, "发布-提问题") // startActivity(QuestionEditActivity.getIntent(requireContext())) // dialog.dismiss() // } // }) // } // contentView.findViewById(R.id.community_edit_close).setOnClickListener { -// MtaHelper.onEvent("问答页面", UserManager.getInstance().community.name, "发布-关闭") +// MtaHelper.onEvent("问答页面", CommunityManager.getInstance().community.name, "发布-关闭") // dialog.dismiss() // } // } diff --git a/app/src/main/java/com/gh/gamecenter/qa/CommunityViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/CommunityViewModel.kt index 351e4d82d1..4590afa639 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/CommunityViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/CommunityViewModel.kt @@ -5,7 +5,7 @@ //import androidx.lifecycle.MutableLiveData //import android.text.TextUtils //import com.gh.gamecenter.entity.ResultEntity -//import com.gh.gamecenter.manager.UserManager +//import com.gh.gamecenter.login.user.UserManager //import com.gh.gamecenter.qa.entity.CommunitySelectEntity //import com.gh.gamecenter.qa.entity.CommunityStatusEntity //import com.gh.gamecenter.retrofit.Response @@ -36,7 +36,7 @@ // mTimer = fixedRateTimer("checkUnreadFollowTimeline", false, 0, 2 * 60 * 1000L) { // RetrofitManager.getInstance() // .api -// .getUnreadCommunityTimeline(UserManager.getInstance().community.id, UserManager.getInstance().userId) +// .getUnreadCommunityTimeline(CommunityManager.getInstance().community.id, UserManager.getInstance().userId) // .subscribeOn(Schedulers.io()) // .subscribe(object : Response() { // override fun onResponse(response: ResponseBody?) { @@ -59,7 +59,7 @@ // fun checkCommunity(data: ResultEntity?) { // getCommunityDefaultSearch() // -// val id = UserManager.getInstance().community.id +// val id = CommunityManager.getInstance().community.id // if (TextUtils.isEmpty(id)) { // communityStatus.postValue(CommunityStatusEntity(false, data)) // return @@ -71,7 +71,7 @@ // .observeOn(AndroidSchedulers.mainThread()) // .subscribe(object : Response() { // override fun onResponse(response: CommunitySelectEntity?) { -// val community = UserManager.getInstance().community +// val community = CommunityManager.getInstance().community // if (community.icon.isNullOrEmpty()) { // community.icon = response?.game?.getRawIconIfExisted() // community.iconSubscript = response?.game?.iconSubscript @@ -93,7 +93,7 @@ // // private fun getCommunityDefaultSearch() { // RetrofitManager.getInstance() -// .api.getCommunityDefaultSearch(UserManager.getInstance().community.id) +// .api.getCommunityDefaultSearch(CommunityManager.getInstance().community.id) // .subscribeOn(Schedulers.io()) // .observeOn(AndroidSchedulers.mainThread()) // .subscribe(object : Response() { diff --git a/app/src/main/java/com/gh/gamecenter/qa/all/AskAllFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/all/AskAllFragment.kt index 4d5049a723..f4981f01ac 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/all/AskAllFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/all/AskAllFragment.kt @@ -11,7 +11,7 @@ //import com.gh.gamecenter.common.view.DrawableView //import com.gh.gamecenter.R //import com.gh.gamecenter.databinding.FragmentAskAllBinding -//import com.gh.gamecenter.manager.UserManager +//import com.gh.gamecenter.login.user.UserManager //import com.gh.gamecenter.qa.article.SimpleArticleListFragment //import com.gh.gamecenter.qa.newest.AskQuestionsNewBodyFragment // @@ -64,9 +64,9 @@ // mBinding.articleButton.isChecked = !mBinding.questionButton.isChecked // // if (position == 0) { -// MtaHelper.onEvent("问答页面", UserManager.getInstance().community.name, "全部-问题") +// MtaHelper.onEvent("问答页面", CommunityManager.getInstance().community.name, "全部-问题") // } else { -// MtaHelper.onEvent("问答页面", UserManager.getInstance().community.name, "全部-文章") +// MtaHelper.onEvent("问答页面", CommunityManager.getInstance().community.name, "全部-文章") // } // } // }) diff --git a/app/src/main/java/com/gh/gamecenter/qa/answer/BaseAnswerOrArticleItemViewHolder.kt b/app/src/main/java/com/gh/gamecenter/qa/answer/BaseAnswerOrArticleItemViewHolder.kt index 2e84e8ca0d..e4ac3637c2 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/answer/BaseAnswerOrArticleItemViewHolder.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/answer/BaseAnswerOrArticleItemViewHolder.kt @@ -12,10 +12,10 @@ import com.gh.gamecenter.common.utils.debounceActionWithInterval import com.gh.gamecenter.common.utils.doOnAnimationEnd import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.core.utils.* -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.entity.VoteEntity import com.gh.gamecenter.forum.detail.ForumDetailActivity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity import com.gh.gamecenter.qa.comment.CommentActivity import com.gh.gamecenter.qa.entity.AnswerEntity @@ -26,6 +26,8 @@ import com.gh.gamecenter.qa.questions.newdetail.NewQuestionDetailActivity import com.gh.gamecenter.qa.video.detail.ForumVideoDetailActivity import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.common.retrofit.Response +import com.gh.gamecenter.energy.utils.EnergyTaskHelper +import com.gh.gamecenter.manager.CommunityManager import com.gh.gamecenter.retrofit.RetrofitManager import com.lightgame.utils.Utils import com.lightgame.view.CheckableImageView @@ -215,7 +217,7 @@ open class BaseAnswerOrArticleItemViewHolder(itemView: View) : BaseRecyclerViewH } else -> { val communityId = if (entity.community.id.isNotEmpty()) entity.community.id - else UserManager.getInstance().community.id + else CommunityManager.getInstance().community.id val intent = ArticleDetailActivity.getCommentIntent( itemView.context, CommunityEntity(communityId, entity.community.name), diff --git a/app/src/main/java/com/gh/gamecenter/qa/answer/CommunityAnswerItemViewHolder.kt b/app/src/main/java/com/gh/gamecenter/qa/answer/CommunityAnswerItemViewHolder.kt index ad4ffe3e56..6831ba4eb1 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/answer/CommunityAnswerItemViewHolder.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/answer/CommunityAnswerItemViewHolder.kt @@ -19,7 +19,7 @@ import com.gh.gamecenter.core.utils.SpanBuilder import com.gh.gamecenter.core.utils.DisplayUtils import com.gh.gamecenter.core.utils.MtaHelper import com.gh.gamecenter.databinding.CommunityAnswerItemBinding -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.qa.entity.AnswerEntity import com.gh.gamecenter.qa.entity.ArticleEntity diff --git a/app/src/main/java/com/gh/gamecenter/qa/answer/detail/AnswerDetailFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/answer/detail/AnswerDetailFragment.kt index 8eedb1e820..bed940b7f0 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/answer/detail/AnswerDetailFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/answer/detail/AnswerDetailFragment.kt @@ -32,6 +32,7 @@ import com.gh.gamecenter.SuggestionActivity import com.gh.gamecenter.common.base.fragment.BaseFragment import com.gh.gamecenter.common.base.fragment.ToolbarFragment import com.gh.gamecenter.common.callback.ConfirmListener +import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.common.constant.Constants.GAME_DETAIL_COME_IN import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.entity.NormalShareEntity @@ -42,8 +43,8 @@ import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.FragmentAnswerDetailBinding import com.gh.gamecenter.databinding.PieceQuestionContentBinding import com.gh.gamecenter.entity.* -import com.gh.gamecenter.eventbus.EBReuse -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.common.eventbus.EBReuse +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.personal.PersonalFragment import com.gh.gamecenter.qa.answer.edit.AnswerEditActivity import com.gh.gamecenter.qa.comment.CommentActivity @@ -1224,7 +1225,7 @@ open class AnswerDetailFragment : ToolbarFragment() { @Subscribe(threadMode = ThreadMode.MAIN) fun onEventMainThread(reuse: EBReuse) { - if (reuse.type == PersonalFragment.LOGIN_TAG && !TextUtils.isEmpty(mAnswerId)) { // 登入 + if (reuse.type == Constants.LOGIN_TAG && !TextUtils.isEmpty(mAnswerId)) { // 登入 mViewModel.getAnswerDetail(mAnswerId) } } diff --git a/app/src/main/java/com/gh/gamecenter/qa/answer/detail/AnswerDetailViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/answer/detail/AnswerDetailViewModel.kt index 2aa7b0eb46..227f21523c 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/answer/detail/AnswerDetailViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/answer/detail/AnswerDetailViewModel.kt @@ -6,7 +6,7 @@ import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import com.gh.common.history.HistoryHelper import com.gh.common.util.CollectionUtils -import com.gh.common.util.EnergyTaskHelper +import com.gh.gamecenter.energy.utils.EnergyTaskHelper import com.gh.common.util.ErrorHelper import com.gh.common.util.LogUtils import com.gh.gamecenter.R diff --git a/app/src/main/java/com/gh/gamecenter/qa/answer/draft/AnswerDraftAdapter.java b/app/src/main/java/com/gh/gamecenter/qa/answer/draft/AnswerDraftAdapter.java index 1f59afbc0b..81a187b584 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/answer/draft/AnswerDraftAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/qa/answer/draft/AnswerDraftAdapter.java @@ -16,11 +16,11 @@ import com.gh.gamecenter.common.utils.ImageUtils; import com.gh.gamecenter.common.utils.PermissionHelper; import com.gh.gamecenter.R; import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; -import com.gh.gamecenter.baselist.ListAdapter; -import com.gh.gamecenter.baselist.ListViewModel; -import com.gh.gamecenter.baselist.LoadType; +import com.gh.gamecenter.common.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.ListViewModel; +import com.gh.gamecenter.common.baselist.LoadType; import com.gh.gamecenter.databinding.AnswerDraftItemBinding; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.user.UserManager; import com.gh.gamecenter.qa.answer.edit.AnswerEditActivity; import com.gh.gamecenter.qa.entity.AnswerEntity; import com.gh.gamecenter.qa.myqa.AnswerDraftViewHolder; diff --git a/app/src/main/java/com/gh/gamecenter/qa/answer/draft/AnswerDraftFragment.java b/app/src/main/java/com/gh/gamecenter/qa/answer/draft/AnswerDraftFragment.java index eda0dc33e8..8239b94ef6 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/answer/draft/AnswerDraftFragment.java +++ b/app/src/main/java/com/gh/gamecenter/qa/answer/draft/AnswerDraftFragment.java @@ -9,12 +9,12 @@ import com.gh.gamecenter.common.constant.EntranceConsts; import com.gh.gamecenter.core.utils.UrlFilterUtils; import com.gh.gamecenter.common.view.CustomDividerItemDecoration; import com.gh.gamecenter.R; -import com.gh.gamecenter.baselist.ListAdapter; -import com.gh.gamecenter.baselist.ListFragment; -import com.gh.gamecenter.baselist.LoadType; -import com.gh.gamecenter.baselist.NormalListViewModel; -import com.gh.gamecenter.eventbus.EBReuse; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.common.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.ListFragment; +import com.gh.gamecenter.common.baselist.LoadType; +import com.gh.gamecenter.common.baselist.NormalListViewModel; +import com.gh.gamecenter.common.eventbus.EBReuse; +import com.gh.gamecenter.login.user.UserManager; import com.gh.gamecenter.qa.answer.edit.AnswerEditActivity; import com.gh.gamecenter.qa.entity.AnswerEntity; import com.gh.gamecenter.retrofit.RetrofitManager; diff --git a/app/src/main/java/com/gh/gamecenter/qa/answer/edit/AnswerEditActivity.kt b/app/src/main/java/com/gh/gamecenter/qa/answer/edit/AnswerEditActivity.kt index c067aabcf0..c3970b0039 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/answer/edit/AnswerEditActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/answer/edit/AnswerEditActivity.kt @@ -28,8 +28,8 @@ import com.gh.gamecenter.common.utils.DialogUtils import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.FragmentAnswerEditBinding import com.gh.gamecenter.common.entity.NotificationUgc -import com.gh.gamecenter.manager.UserManager -import com.gh.gamecenter.mvvm.Status +import com.gh.gamecenter.login.user.UserManager +import com.gh.gamecenter.common.mvvm.Status import com.gh.gamecenter.qa.answer.detail.AnswerDetailActivity import com.gh.gamecenter.qa.answer.draft.AnswerDraftActivity import com.gh.gamecenter.qa.entity.Questions diff --git a/app/src/main/java/com/gh/gamecenter/qa/answer/edit/AnswerEditViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/answer/edit/AnswerEditViewModel.kt index d249b4a3ac..4ff3b2fc21 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/answer/edit/AnswerEditViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/answer/edit/AnswerEditViewModel.kt @@ -7,11 +7,10 @@ import com.gh.gamecenter.common.base.fragment.WaitingDialogFragment import com.gh.gamecenter.common.syncpage.SyncDataEntity import com.gh.gamecenter.common.syncpage.SyncFieldConstants import com.gh.gamecenter.common.syncpage.SyncPageRepository -import com.gh.common.util.* import com.gh.gamecenter.R -import com.gh.gamecenter.eventbus.EBReuse -import com.gh.gamecenter.manager.UserManager -import com.gh.gamecenter.mvvm.Resource +import com.gh.gamecenter.common.eventbus.EBReuse +import com.gh.gamecenter.login.user.UserManager +import com.gh.gamecenter.common.mvvm.Resource import com.gh.base.BaseRichEditorViewModel import com.gh.base.RichType import com.gh.gamecenter.common.utils.tryWithDefaultCatch @@ -19,6 +18,7 @@ import com.gh.gamecenter.core.utils.UrlFilterUtils import com.gh.gamecenter.qa.entity.AnswerDraftEntity import com.gh.gamecenter.qa.entity.Questions import com.gh.gamecenter.common.retrofit.Response +import com.gh.gamecenter.energy.utils.EnergyTaskHelper import com.lightgame.utils.Utils import io.reactivex.Single import io.reactivex.android.schedulers.AndroidSchedulers diff --git a/app/src/main/java/com/gh/gamecenter/qa/answer/fold/AnswerFoldAdapter.java b/app/src/main/java/com/gh/gamecenter/qa/answer/fold/AnswerFoldAdapter.java index f43eb6c06e..5c841c0b2c 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/answer/fold/AnswerFoldAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/qa/answer/fold/AnswerFoldAdapter.java @@ -9,7 +9,7 @@ import com.gh.gamecenter.common.constant.ItemViewType; import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler; import com.gh.gamecenter.R; import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; -import com.gh.gamecenter.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.ListAdapter; import com.gh.gamecenter.databinding.CommunityAnswerItemBinding; import com.gh.gamecenter.qa.answer.CommunityAnswerItemViewHolder; import com.gh.gamecenter.qa.answer.detail.AnswerDetailActivity; diff --git a/app/src/main/java/com/gh/gamecenter/qa/answer/fold/AnswerFoldFragment.java b/app/src/main/java/com/gh/gamecenter/qa/answer/fold/AnswerFoldFragment.java index 7b1e18b1aa..a5b9df56fd 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/answer/fold/AnswerFoldFragment.java +++ b/app/src/main/java/com/gh/gamecenter/qa/answer/fold/AnswerFoldFragment.java @@ -11,10 +11,10 @@ import com.gh.gamecenter.core.utils.UrlFilterUtils; import com.gh.gamecenter.common.view.VerticalItemDecoration; import com.gh.gamecenter.NewsDetailActivity; import com.gh.gamecenter.R; -import com.gh.gamecenter.baselist.ListAdapter; -import com.gh.gamecenter.baselist.ListFragment; -import com.gh.gamecenter.baselist.LoadType; -import com.gh.gamecenter.baselist.NormalListViewModel; +import com.gh.gamecenter.common.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.ListFragment; +import com.gh.gamecenter.common.baselist.LoadType; +import com.gh.gamecenter.common.baselist.NormalListViewModel; import com.gh.gamecenter.databinding.FragmentQuestionsdetailFoldBinding; import com.gh.gamecenter.qa.answer.detail.AnswerDetailActivity; import com.gh.gamecenter.qa.entity.AnswerEntity; diff --git a/app/src/main/java/com/gh/gamecenter/qa/article/MyArticleAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/article/MyArticleAdapter.kt index 66e451fd08..7835c57b61 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/article/MyArticleAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/article/MyArticleAdapter.kt @@ -8,7 +8,7 @@ import com.gh.gamecenter.common.constant.ItemViewType import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.databinding.CommunityAnswerItemBinding import com.gh.gamecenter.forum.home.ForumArticleAskItemViewHolder diff --git a/app/src/main/java/com/gh/gamecenter/qa/article/MyArticleFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/article/MyArticleFragment.kt index 1a7e820916..51467f992f 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/article/MyArticleFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/article/MyArticleFragment.kt @@ -8,16 +8,16 @@ import android.view.View import androidx.lifecycle.ViewModelProviders import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListFragment -import com.gh.gamecenter.baselist.LoadType -import com.gh.gamecenter.baselist.NormalListViewModel +import com.gh.gamecenter.common.baselist.ListFragment +import com.gh.gamecenter.common.baselist.LoadType +import com.gh.gamecenter.common.baselist.NormalListViewModel import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.checkStoragePermissionBeforeAction import com.gh.gamecenter.common.utils.ifLogin import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.common.utils.toDrawable import com.gh.gamecenter.common.view.CustomDividerItemDecoration -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.qa.article.edit.ArticleEditActivity import com.gh.gamecenter.qa.entity.ArticleEntity import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/gamecenter/qa/article/SimpleArticleListAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/article/SimpleArticleListAdapter.kt index 31c1041d39..6f1843e72e 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/article/SimpleArticleListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/article/SimpleArticleListAdapter.kt @@ -8,9 +8,9 @@ //import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler //import com.gh.gamecenter.R //import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -//import com.gh.gamecenter.baselist.ListAdapter +//import com.gh.gamecenter.common.baselist.ListAdapter //import com.gh.gamecenter.databinding.CommunityAnswerItemBinding -//import com.gh.gamecenter.manager.UserManager +//import com.gh.gamecenter.login.user.UserManager //import com.gh.gamecenter.qa.answer.CommunityAnswerItemViewHolder //import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity //import com.gh.gamecenter.qa.entity.ArticleEntity @@ -54,7 +54,7 @@ // questions.title = articleEntity.title // viewHolder.bindArticleItem(articleEntity, "", getPath()) // viewHolder.itemView.setOnClickListener { -// mContext.startActivity(ArticleDetailActivity.getIntent(mContext, UserManager.getInstance().community, articleEntity.id, "", getPath())) +// mContext.startActivity(ArticleDetailActivity.getIntent(mContext, CommunityManager.getInstance().community, articleEntity.id, "", getPath())) // } // } // ItemViewType.ITEM_FOOTER -> { diff --git a/app/src/main/java/com/gh/gamecenter/qa/article/SimpleArticleListFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/article/SimpleArticleListFragment.kt index 24867d07b6..ed339d81c0 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/article/SimpleArticleListFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/article/SimpleArticleListFragment.kt @@ -8,13 +8,13 @@ //import com.gh.common.util.EntranceUtils //import com.gh.gamecenter.common.utils.viewModelProvider //import com.gh.gamecenter.common.view.VerticalItemDecoration -//import com.gh.gamecenter.baselist.ListFragment -//import com.gh.gamecenter.baselist.LoadStatus -//import com.gh.gamecenter.baselist.LoadType -//import com.gh.gamecenter.eventbus.EBReuse +//import com.gh.gamecenter.common.baselist.ListFragment +//import com.gh.gamecenter.common.baselist.LoadStatus +//import com.gh.gamecenter.common.baselist.LoadType +//import com.gh.gamecenter.common.eventbus.EBReuse //import com.gh.gamecenter.eventbus.EBTypeChange //import com.gh.gamecenter.forum.home.CommunityHomeFragment -//import com.gh.gamecenter.manager.UserManager +//import com.gh.gamecenter.login.user.UserManager //import com.gh.gamecenter.qa.CommunityFragment //import com.gh.gamecenter.qa.article.edit.ArticleEditActivity //import com.gh.gamecenter.qa.entity.ArticleEntity @@ -31,14 +31,14 @@ // // override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { // super.onActivityResult(requestCode, resultCode, data) -// if (UserManager.getInstance().community.id != mCommunityId) { -// mCommunityId = UserManager.getInstance().community.id +// if (CommunityManager.getInstance().community.id != mCommunityId) { +// mCommunityId = CommunityManager.getInstance().community.id // onRefresh() // } // } // // override fun onCreate(savedInstanceState: Bundle?) { -// mCommunityId = UserManager.getInstance().community.id +// mCommunityId = CommunityManager.getInstance().community.id // mViewModel = provideListViewModel() // mViewModel.sortType = arguments?.getString(EntranceUtils.KEY_TYPE) ?: "" // diff --git a/app/src/main/java/com/gh/gamecenter/qa/article/SimpleArticleListViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/article/SimpleArticleListViewModel.kt index df3737f789..1393cb00df 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/article/SimpleArticleListViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/article/SimpleArticleListViewModel.kt @@ -1,8 +1,8 @@ //package com.gh.gamecenter.qa.article // //import android.app.Application -//import com.gh.gamecenter.baselist.ListViewModel -//import com.gh.gamecenter.manager.UserManager +//import com.gh.gamecenter.common.baselist.ListViewModel +//import com.gh.gamecenter.login.user.UserManager //import com.gh.gamecenter.qa.entity.ArticleEntity //import com.gh.gamecenter.retrofit.RetrofitManager //import com.lightgame.utils.Utils @@ -29,7 +29,7 @@ // } // return RetrofitManager.getInstance() // .api -// .getAllCommunityArticles(UserManager.getInstance().community.id, mSortType.value, page, Utils.getTime(getApplication())) +// .getAllCommunityArticles(CommunityManager.getInstance().community.id, mSortType.value, page, Utils.getTime(getApplication())) // } // // override fun mergeResultLiveData() { diff --git a/app/src/main/java/com/gh/gamecenter/qa/article/detail/ArticleDetailActivity.kt b/app/src/main/java/com/gh/gamecenter/qa/article/detail/ArticleDetailActivity.kt index 42a9c35dc3..d86c5b2c26 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/article/detail/ArticleDetailActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/article/detail/ArticleDetailActivity.kt @@ -7,7 +7,7 @@ import com.gh.gamecenter.common.base.activity.ToolBarActivity import com.gh.gamecenter.R import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.updateStatusBarColor -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.entity.SpecialColumn class ArticleDetailActivity : ToolBarActivity() { diff --git a/app/src/main/java/com/gh/gamecenter/qa/article/detail/ArticleDetailAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/article/detail/ArticleDetailAdapter.kt index d9f8f9385e..18d73dac05 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/article/detail/ArticleDetailAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/article/detail/ArticleDetailAdapter.kt @@ -3,7 +3,7 @@ package com.gh.gamecenter.qa.article.detail import android.content.Context import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView -import com.gh.gamecenter.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.LoadStatus import com.gh.gamecenter.databinding.ItemArticleDetailContentBinding import com.gh.gamecenter.qa.comment.base.BaseCommentAdapter diff --git a/app/src/main/java/com/gh/gamecenter/qa/article/detail/ArticleDetailContentViewHolder.kt b/app/src/main/java/com/gh/gamecenter/qa/article/detail/ArticleDetailContentViewHolder.kt index 9b1a978a7f..4325e0c36d 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/article/detail/ArticleDetailContentViewHolder.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/article/detail/ArticleDetailContentViewHolder.kt @@ -21,7 +21,7 @@ import com.gh.gamecenter.common.callback.ConfirmListener import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.ItemArticleDetailContentBinding -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.qa.editor.OnLinkClickListener import com.gh.gamecenter.qa.entity.ArticleDetailEntity import java.util.* diff --git a/app/src/main/java/com/gh/gamecenter/qa/article/detail/ArticleDetailFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/article/detail/ArticleDetailFragment.kt index e2672d90ef..5c0097c5cd 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/article/detail/ArticleDetailFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/article/detail/ArticleDetailFragment.kt @@ -27,10 +27,11 @@ import com.gh.common.util.LogUtils import com.gh.common.util.NewLogUtils import com.gh.gamecenter.ImageViewerActivity import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.entity.AdditionalParamsEntity +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.common.entity.NormalShareEntity import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* @@ -38,8 +39,8 @@ import com.gh.gamecenter.databinding.FragmentArticleDetailBinding import com.gh.gamecenter.entity.* import com.gh.gamecenter.eventbus.EBDeleteCommentDetail import com.gh.gamecenter.eventbus.EBDeleteDetail -import com.gh.gamecenter.eventbus.EBReuse -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.common.eventbus.EBReuse +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.personal.PersonalFragment import com.gh.gamecenter.qa.article.edit.ArticleEditActivity import com.gh.gamecenter.qa.comment.CommentActivity @@ -903,7 +904,7 @@ class ArticleDetailFragment : BaseCommentFragment(), Keyb onBackPressed() } mBinding.articleGameName.setOnClickListener { - MtaHelper.onEvent("发表文章", "指定游戏", UserManager.getInstance().community.name) + MtaHelper.onEvent("发表文章", "指定游戏", CommunityManager.getInstance().community.name) showSelectGameDialog() } mBinding.chooseActivityContainer.setOnClickListener { @@ -576,7 +577,7 @@ class ArticleEditActivity : BaseRichEditorActivity(), Keyb } } } else if (item?.itemId == R.id.menu_draft) { - MtaHelper.onEvent("发表文章", "文章草稿", UserManager.getInstance().community.name) + MtaHelper.onEvent("发表文章", "文章草稿", CommunityManager.getInstance().community.name) if (checkDraft(SaveDraftType.SKIP)) { NewLogUtils.logArticleDraftClick() val intent = ArticleDraftActivity.getIntent( diff --git a/app/src/main/java/com/gh/gamecenter/qa/article/edit/ArticleEditViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/article/edit/ArticleEditViewModel.kt index 6a7ecc131e..22f51e28d6 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/article/edit/ArticleEditViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/article/edit/ArticleEditViewModel.kt @@ -8,9 +8,9 @@ import androidx.lifecycle.MutableLiveData import com.gh.gamecenter.common.base.fragment.WaitingDialogFragment import com.gh.common.util.* import com.gh.gamecenter.R -import com.gh.gamecenter.entity.CommunityEntity -import com.gh.gamecenter.eventbus.EBReuse -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.common.entity.CommunityEntity +import com.gh.gamecenter.common.eventbus.EBReuse +import com.gh.gamecenter.login.user.UserManager import com.gh.base.BaseRichEditorViewModel import com.gh.base.RichType import com.gh.gamecenter.core.utils.ToastUtils @@ -23,6 +23,8 @@ import com.gh.gamecenter.qa.entity.ArticleDetailEntity import com.gh.gamecenter.qa.entity.ArticleDraftEntity import com.gh.gamecenter.qa.questions.edit.QuestionEditViewModel import com.gh.gamecenter.common.retrofit.Response +import com.gh.gamecenter.energy.utils.EnergyTaskHelper +import com.gh.gamecenter.manager.CommunityManager import com.lightgame.utils.Utils import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.schedulers.Schedulers @@ -162,7 +164,7 @@ class ArticleEditViewModel(application: Application) : BaseRichEditorViewModel(a detailEntity?.time?.edit = Utils.getTime(getApplication()) } processDialog.postValue(WaitingDialogFragment.WaitingDialogData("上传中...", false)) - MtaHelper.onEvent("发表文章", "发布成功", UserManager.getInstance().community.name) + MtaHelper.onEvent("发表文章", "发布成功", CommunityManager.getInstance().community.name) val data = response?.string() postArticle.postValue(data) @@ -187,7 +189,7 @@ class ArticleEditViewModel(application: Application) : BaseRichEditorViewModel(a e1.printStackTrace() } error.postValue(errorString) - MtaHelper.onEvent("发表文章", "发布失败", UserManager.getInstance().community.name) + MtaHelper.onEvent("发表文章", "发布失败", CommunityManager.getInstance().community.name) } }) } diff --git a/app/src/main/java/com/gh/gamecenter/qa/column/AskColumnAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/column/AskColumnAdapter.kt index 7fcdb734a9..cccba1b17d 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/column/AskColumnAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/column/AskColumnAdapter.kt @@ -6,7 +6,7 @@ //import com.gh.common.util.DataUtils //import com.gh.gamecenter.R //import com.gh.gamecenter.databinding.AskColumnTagItemBinding -//import com.gh.gamecenter.manager.UserManager +//import com.gh.gamecenter.login.user.UserManager //import com.gh.gamecenter.qa.column.detail.AskColumnDetailActivity //import com.gh.gamecenter.qa.column.order.AskTabOrderActivity //import com.gh.gamecenter.qa.entity.AskTagGroupsEntity @@ -39,12 +39,12 @@ // holder.itemView.setOnClickListener { // if (position == itemCount - 1) { // DataUtils.onMtaEvent(mContext, "问答页面", -// UserManager.getInstance().community.name, "专栏-调整排序") +// CommunityManager.getInstance().community.name, "专栏-调整排序") // mContext.startActivity(AskTabOrderActivity.getIntent(mContext)) // } else { // DataUtils.onMtaEvent(mContext, "问答页面", -// UserManager.getInstance().community.name, "专栏-" + entity?.name) -// mContext.startActivity(AskColumnDetailActivity.getIntentByColumn(mContext, entity!!, UserManager.getInstance().community, "", "问答-专栏")) +// CommunityManager.getInstance().community.name, "专栏-" + entity?.name) +// mContext.startActivity(AskColumnDetailActivity.getIntentByColumn(mContext, entity!!, CommunityManager.getInstance().community, "", "问答-专栏")) // } // } // } diff --git a/app/src/main/java/com/gh/gamecenter/qa/column/AskColumnRepository.java b/app/src/main/java/com/gh/gamecenter/qa/column/AskColumnRepository.java index 70e2f83131..b61988b1d5 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/column/AskColumnRepository.java +++ b/app/src/main/java/com/gh/gamecenter/qa/column/AskColumnRepository.java @@ -6,7 +6,8 @@ import android.text.TextUtils; import com.gh.common.util.ErrorHelper; import com.gh.gamecenter.core.utils.GsonUtils; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.user.UserManager; +import com.gh.gamecenter.manager.CommunityManager; import com.gh.gamecenter.qa.entity.AskTagGroupsEntity; import com.gh.gamecenter.common.retrofit.Response; import com.gh.gamecenter.retrofit.RetrofitManager; @@ -49,7 +50,7 @@ public class AskColumnRepository { private void loadUserTagGroups() { mCurCommunityId = UserManager.getInstance().getUserId(); RetrofitManager.getInstance().getApi() - .getUserAskColumnsTags(UserManager.getInstance().getUserId(), UserManager.getInstance().getCommunity().getId()) + .getUserAskColumnsTags(UserManager.getInstance().getUserId(), CommunityManager.getInstance().getCommunity().getId()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Response>() { @@ -69,7 +70,7 @@ public class AskColumnRepository { private void loadDefaultTagGroups(List userEntity) { RetrofitManager.getInstance().getApi() - .getAskColumnsTags(UserManager.getInstance().getCommunity().getId()) + .getAskColumnsTags(CommunityManager.getInstance().getCommunity().getId()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Response>() { @@ -108,7 +109,7 @@ public class AskColumnRepository { RequestBody body = RequestBody.create(MediaType.parse("application/json"), GsonUtils.toJson(entity)); RetrofitManager.getInstance().getApi() - .patchUserAskColumnsTags(body, UserManager.getInstance().getUserId(), UserManager.getInstance().getCommunity().getId()) + .patchUserAskColumnsTags(body, UserManager.getInstance().getUserId(), CommunityManager.getInstance().getCommunity().getId()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Response() { @@ -135,7 +136,7 @@ public class AskColumnRepository { private void deleteUserAskTagGroups() { RetrofitManager.getInstance() .getApi() - .deleteUserAskColumnsTags(UserManager.getInstance().getUserId(), UserManager.getInstance().getCommunity().getId()) + .deleteUserAskColumnsTags(UserManager.getInstance().getUserId(), CommunityManager.getInstance().getCommunity().getId()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Response() { diff --git a/app/src/main/java/com/gh/gamecenter/qa/column/AskColumnViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/column/AskColumnViewModel.kt index 7068c39742..9436cf12b0 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/column/AskColumnViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/column/AskColumnViewModel.kt @@ -3,7 +3,7 @@ //import android.app.Application //import androidx.lifecycle.* //import android.text.TextUtils -//import com.gh.gamecenter.manager.UserManager +//import com.gh.gamecenter.login.user.UserManager //import com.gh.gamecenter.qa.entity.AskTagGroupsEntity // //class AskColumnViewModel(application: Application, private val mRepository: AskColumnRepository) : AndroidViewModel(application) { @@ -16,7 +16,7 @@ // init { // mObservableTagGroupsList = mRepository.tagGroupsObservable // if (TextUtils.isEmpty(mRepository.curCommunityId) || -// mRepository.curCommunityId == UserManager.getInstance().community.id) { +// mRepository.curCommunityId == CommunityManager.getInstance().community.id) { // retry() // } // } diff --git a/app/src/main/java/com/gh/gamecenter/qa/column/detail/AskColumnDetailActivity.kt b/app/src/main/java/com/gh/gamecenter/qa/column/detail/AskColumnDetailActivity.kt index 5a6dfbcd91..e1d1892b16 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/column/detail/AskColumnDetailActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/column/detail/AskColumnDetailActivity.kt @@ -15,7 +15,7 @@ //import com.gh.common.util.EntranceUtils //import com.gh.gamecenter.R //import com.gh.gamecenter.databinding.ActivityAskColumnDetailBinding -//import com.gh.gamecenter.entity.CommunityEntity +//import com.gh.gamecenter.common.entity.CommunityEntity //import com.gh.gamecenter.qa.column.detail.hot.HotFragment //import com.gh.gamecenter.qa.column.detail.recommends.RecommendsFragment //import com.gh.gamecenter.qa.entity.AskTagGroupsEntity diff --git a/app/src/main/java/com/gh/gamecenter/qa/column/detail/hot/HotAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/column/detail/hot/HotAdapter.kt index b2acc41341..09b3228603 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/column/detail/hot/HotAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/column/detail/hot/HotAdapter.kt @@ -7,9 +7,9 @@ //import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler //import com.gh.gamecenter.R //import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -//import com.gh.gamecenter.baselist.ListAdapter +//import com.gh.gamecenter.common.baselist.ListAdapter //import com.gh.gamecenter.databinding.CommunityAnswerItemBinding -//import com.gh.gamecenter.entity.CommunityEntity +//import com.gh.gamecenter.common.entity.CommunityEntity //import com.gh.gamecenter.entity.SpecialColumn //import com.gh.gamecenter.qa.answer.CommunityAnswerItemViewHolder //import com.gh.gamecenter.qa.answer.detail.AnswerDetailActivity diff --git a/app/src/main/java/com/gh/gamecenter/qa/column/detail/hot/HotFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/column/detail/hot/HotFragment.kt index 679c1b3c5a..0c1a5152bd 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/column/detail/hot/HotFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/column/detail/hot/HotFragment.kt @@ -4,8 +4,8 @@ //import android.view.View //import androidx.recyclerview.widget.RecyclerView //import com.gh.common.util.EntranceUtils -//import com.gh.gamecenter.baselist.ListFragment -//import com.gh.gamecenter.entity.CommunityEntity +//import com.gh.gamecenter.common.baselist.ListFragment +//import com.gh.gamecenter.common.entity.CommunityEntity //import com.gh.gamecenter.entity.SpecialColumn //import com.gh.gamecenter.qa.entity.AnswerEntity //import com.gh.gamecenter.qa.entity.AskTagGroupsEntity diff --git a/app/src/main/java/com/gh/gamecenter/qa/column/detail/hot/HotViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/column/detail/hot/HotViewModel.kt index 367301f146..94f1eaa340 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/column/detail/hot/HotViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/column/detail/hot/HotViewModel.kt @@ -3,8 +3,8 @@ package com.gh.gamecenter.qa.column.detail.hot import android.app.Application import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.qa.entity.AnswerEntity import com.gh.gamecenter.qa.entity.AskTagGroupsEntity import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/gamecenter/qa/column/detail/recommends/RecommendsAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/column/detail/recommends/RecommendsAdapter.kt index 888350cacd..4ffab6a400 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/column/detail/recommends/RecommendsAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/column/detail/recommends/RecommendsAdapter.kt @@ -7,10 +7,10 @@ import com.gh.gamecenter.common.constant.ItemViewType import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.databinding.CommunityAnswerItemBinding import com.gh.gamecenter.entity.SpecialColumn -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.manager.CommunityManager import com.gh.gamecenter.qa.answer.CommunityAnswerItemViewHolder import com.gh.gamecenter.qa.answer.detail.AnswerDetailActivity import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity @@ -55,7 +55,7 @@ class RecommendsAdapter(context: Context, if ("community_article" == answerEntity.type) { mContext.startActivity( ArticleDetailActivity.getIntent(mContext, - UserManager.getInstance().community, + CommunityManager.getInstance().community, answerEntity.id!!, mEntrance, mPath, @@ -68,7 +68,7 @@ class RecommendsAdapter(context: Context, if ("community_article" == answerEntity.type) { mContext.startActivity( ArticleDetailActivity.getIntent(mContext, - UserManager.getInstance().community, + CommunityManager.getInstance().community, answerEntity.id!!, mEntrance, mPath, diff --git a/app/src/main/java/com/gh/gamecenter/qa/column/detail/recommends/RecommendsFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/column/detail/recommends/RecommendsFragment.kt index 014918e481..d7d7712cbc 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/column/detail/recommends/RecommendsFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/column/detail/recommends/RecommendsFragment.kt @@ -4,8 +4,8 @@ import androidx.lifecycle.ViewModelProviders import android.view.View import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.common.constant.EntranceConsts -import com.gh.gamecenter.baselist.ListFragment -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.baselist.ListFragment +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.entity.SpecialColumn import com.gh.gamecenter.qa.entity.AnswerEntity import com.gh.gamecenter.qa.entity.AskTagGroupsEntity diff --git a/app/src/main/java/com/gh/gamecenter/qa/column/detail/recommends/RecommendsViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/column/detail/recommends/RecommendsViewModel.kt index d647e2402d..30dc20c3e2 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/column/detail/recommends/RecommendsViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/column/detail/recommends/RecommendsViewModel.kt @@ -3,8 +3,8 @@ package com.gh.gamecenter.qa.column.detail.recommends import android.app.Application import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.qa.entity.AnswerEntity import com.gh.gamecenter.qa.entity.AskTagGroupsEntity import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/gamecenter/qa/column/detail/unanswered/UnansweredAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/column/detail/unanswered/UnansweredAdapter.kt index 85e4db16dc..91e5d788bb 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/column/detail/unanswered/UnansweredAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/column/detail/unanswered/UnansweredAdapter.kt @@ -7,7 +7,7 @@ import com.gh.gamecenter.common.constant.ItemViewType import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.databinding.CommunityQuestionItemBinding import com.gh.gamecenter.entity.SpecialColumn import com.gh.gamecenter.qa.entity.Questions diff --git a/app/src/main/java/com/gh/gamecenter/qa/column/detail/unanswered/UnansweredFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/column/detail/unanswered/UnansweredFragment.kt index 2a0f2e7495..3a54b3165b 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/column/detail/unanswered/UnansweredFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/column/detail/unanswered/UnansweredFragment.kt @@ -3,8 +3,8 @@ package com.gh.gamecenter.qa.column.detail.unanswered import android.view.View import androidx.lifecycle.ViewModelProviders import com.gh.gamecenter.common.constant.EntranceConsts -import com.gh.gamecenter.baselist.ListFragment -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.baselist.ListFragment +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.entity.SpecialColumn import com.gh.gamecenter.qa.entity.AskTagGroupsEntity import com.gh.gamecenter.qa.entity.Questions diff --git a/app/src/main/java/com/gh/gamecenter/qa/column/detail/unanswered/UnansweredViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/column/detail/unanswered/UnansweredViewModel.kt index a21e17ff55..ae819e672d 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/column/detail/unanswered/UnansweredViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/column/detail/unanswered/UnansweredViewModel.kt @@ -3,8 +3,8 @@ package com.gh.gamecenter.qa.column.detail.unanswered import android.app.Application import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.qa.entity.AskTagGroupsEntity import com.gh.gamecenter.qa.entity.Questions import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/gamecenter/qa/comment/NewCommentAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/comment/NewCommentAdapter.kt index d6796f9af5..e9b4fa8f5b 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/comment/NewCommentAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/comment/NewCommentAdapter.kt @@ -12,7 +12,7 @@ import com.gh.gamecenter.R import com.gh.gamecenter.adapter.OnCommentCallBackListener import com.gh.gamecenter.adapter.viewholder.AnswerCommentViewHolder import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.callback.ConfirmListener import com.gh.gamecenter.core.utils.SpanBuilder import com.gh.gamecenter.common.utils.copyTextAndToast diff --git a/app/src/main/java/com/gh/gamecenter/qa/comment/NewCommentConversationFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/comment/NewCommentConversationFragment.kt index 4c3960ae74..3b44d3a94d 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/comment/NewCommentConversationFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/comment/NewCommentConversationFragment.kt @@ -8,10 +8,10 @@ import com.gh.gamecenter.core.AppExecutor import com.gh.common.util.DirectUtils import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.databinding.FragmentAnswerCommentConversationBinding import com.gh.gamecenter.entity.CommentEntity -import com.gh.gamecenter.entity.LinkEntity +import com.gh.gamecenter.common.entity.LinkEntity // 评论详情-查看对话 class NewCommentConversationFragment : NewCommentFragment() { diff --git a/app/src/main/java/com/gh/gamecenter/qa/comment/NewCommentFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/comment/NewCommentFragment.kt index 7511429dbf..24ecead630 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/comment/NewCommentFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/comment/NewCommentFragment.kt @@ -27,8 +27,8 @@ import com.gh.gamecenter.common.view.VerticalItemDecoration import com.gh.gamecenter.CommentDetailActivity import com.gh.gamecenter.R import com.gh.gamecenter.adapter.OnCommentCallBackListener -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.ListFragment +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.common.callback.ConfirmListener import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* @@ -36,7 +36,7 @@ import com.gh.gamecenter.databinding.ItemCommentEditImageBinding import com.gh.gamecenter.entity.CommentEntity import com.gh.gamecenter.eventbus.EBCommentSuccess import com.gh.gamecenter.eventbus.EBDeleteComment -import com.gh.gamecenter.eventbus.EBReuse +import com.gh.gamecenter.common.eventbus.EBReuse import com.gh.gamecenter.qa.answer.detail.AnswerDetailFragment import com.gh.gamecenter.qa.comment.CommentActivity.Companion.GAME_COLLECTION_ID import com.gh.gamecenter.qa.comment.CommentActivity.Companion.QUESTION_ID diff --git a/app/src/main/java/com/gh/gamecenter/qa/comment/NewCommentViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/comment/NewCommentViewModel.kt index a19d1766ec..6692667484 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/comment/NewCommentViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/comment/NewCommentViewModel.kt @@ -6,9 +6,9 @@ import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider -import com.gh.common.util.EnergyTaskHelper +import com.gh.gamecenter.energy.utils.EnergyTaskHelper import com.gh.gamecenter.common.utils.UploadImageUtils -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.common.retrofit.ApiResponse import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.common.retrofit.Response diff --git a/app/src/main/java/com/gh/gamecenter/qa/comment/StairsCommentAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/comment/StairsCommentAdapter.kt index 9715630502..1ed7b98b9b 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/comment/StairsCommentAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/comment/StairsCommentAdapter.kt @@ -8,7 +8,7 @@ import com.gh.gamecenter.common.constant.ItemViewType import com.gh.gamecenter.R import com.gh.gamecenter.adapter.OnCommentCallBackListener import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.databinding.StairsCommentItemBinding import com.gh.gamecenter.entity.CommentEntity diff --git a/app/src/main/java/com/gh/gamecenter/qa/comment/StairsCommentFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/comment/StairsCommentFragment.kt index 483a586799..1ece33681e 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/comment/StairsCommentFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/comment/StairsCommentFragment.kt @@ -10,7 +10,7 @@ import com.gh.gamecenter.core.utils.DisplayUtils import com.gh.gamecenter.common.utils.goneIf import com.gh.gamecenter.CommentDetailActivity import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.lightgame.utils.Util_System_Keyboard import kotlin.math.abs diff --git a/app/src/main/java/com/gh/gamecenter/qa/comment/StairsCommentViewHolder.kt b/app/src/main/java/com/gh/gamecenter/qa/comment/StairsCommentViewHolder.kt index 350b6cb3d9..1f5b8e7180 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/comment/StairsCommentViewHolder.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/comment/StairsCommentViewHolder.kt @@ -23,7 +23,7 @@ import com.gh.gamecenter.common.utils.TextHelper import com.gh.gamecenter.core.utils.MtaHelper import com.gh.gamecenter.databinding.StairsCommentItemBinding import com.gh.gamecenter.entity.CommentEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.halo.assistant.HaloApp class StairsCommentViewHolder( diff --git a/app/src/main/java/com/gh/gamecenter/qa/comment/base/BaseCommentAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/comment/base/BaseCommentAdapter.kt index b29b982c18..edc35519ed 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/comment/base/BaseCommentAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/comment/base/BaseCommentAdapter.kt @@ -21,9 +21,9 @@ import com.gh.common.util.DialogUtils import com.gh.common.util.NewLogUtils import com.gh.gamecenter.common.view.GridSpacingItemColorDecoration import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.LoadStatus -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.common.callback.ConfirmListener import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.common.view.SegmentedFilterView diff --git a/app/src/main/java/com/gh/gamecenter/qa/comment/base/BaseCommentFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/comment/base/BaseCommentFragment.kt index 5104ae73c5..dab7a6259c 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/comment/base/BaseCommentFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/comment/base/BaseCommentFragment.kt @@ -9,7 +9,7 @@ import com.gh.gamecenter.common.view.SegmentedFilterView import com.gh.gamecenter.common.view.CustomDividerItemDecoration import com.gh.gamecenter.common.view.vertical_recycler.SnappingLinearLayoutManager import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListFragment +import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.gamecollection.detail.conversation.GameCollectionCommentConversationFragment import com.gh.gamecenter.qa.comment.conversation.CommentConversationFragment diff --git a/app/src/main/java/com/gh/gamecenter/qa/comment/base/BaseCommentViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/comment/base/BaseCommentViewModel.kt index c14fcfffe0..3272984a78 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/comment/base/BaseCommentViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/comment/base/BaseCommentViewModel.kt @@ -6,10 +6,10 @@ import androidx.lifecycle.MutableLiveData import com.gh.common.util.ErrorHelper import com.gh.common.util.NewLogUtils import com.gh.common.util.PostCommentUtils -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.baselist.LoadParams -import com.gh.gamecenter.baselist.LoadStatus -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.LoadParams +import com.gh.gamecenter.common.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.common.json.json import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.common.syncpage.SyncDataEntity diff --git a/app/src/main/java/com/gh/gamecenter/qa/comment/conversation/CommentConversationFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/comment/conversation/CommentConversationFragment.kt index 22f2bae12c..529d9f6d40 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/comment/conversation/CommentConversationFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/comment/conversation/CommentConversationFragment.kt @@ -15,13 +15,13 @@ import com.gh.gamecenter.common.syncpage.SyncDataEntity import com.gh.gamecenter.common.syncpage.SyncFieldConstants import com.gh.gamecenter.common.syncpage.SyncPageRepository import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.databinding.FragmentArticleDetailCommentBinding import com.gh.gamecenter.entity.CommentEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.qa.comment.base.BaseCommentAdapter import com.gh.gamecenter.qa.comment.base.BaseCommentFragment import com.gh.gamecenter.qa.comment.base.BaseCommentViewModel diff --git a/app/src/main/java/com/gh/gamecenter/qa/dialog/ChooseForumActivity.kt b/app/src/main/java/com/gh/gamecenter/qa/dialog/ChooseForumActivity.kt index 500c972a26..77092820d8 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/dialog/ChooseForumActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/dialog/ChooseForumActivity.kt @@ -19,7 +19,7 @@ import com.gh.gamecenter.common.utils.doOnPageSelected import com.gh.gamecenter.core.utils.DisplayUtils import com.gh.gamecenter.core.utils.doOnEnd import com.gh.gamecenter.databinding.DialogChooseForumBinding -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.entity.CommunityEntity class ChooseForumActivity : BaseActivity() { private lateinit var binding: DialogChooseForumBinding diff --git a/app/src/main/java/com/gh/gamecenter/qa/dialog/ChooseForumContainerAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/dialog/ChooseForumContainerAdapter.kt index 1f11b79381..a0f3013b14 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/dialog/ChooseForumContainerAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/dialog/ChooseForumContainerAdapter.kt @@ -10,14 +10,14 @@ import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.* import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.fromHtml import com.gh.gamecenter.common.utils.toBinding import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.common.utils.toDrawable import com.gh.gamecenter.core.utils.HtmlUtils import com.gh.gamecenter.databinding.ForumItemBinding -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.entity.ForumEntity class ChooseForumContainerAdapter(content: Context, val type: String, val onSelectCallback: ((entity: CommunityEntity) -> Unit)? = null) : ListAdapter(content) { @@ -70,7 +70,7 @@ class ChooseForumContainerAdapter(content: Context, val type: String, val onSele val bbsType = if (forumEntity.type == "official_bbs") "综合论坛" else "游戏论坛" NewLogUtils.logForumSearchResultClick(tabType, forumEntity.id, bbsType, "", "", "", position + 1) onSelectCallback?.invoke(CommunityEntity(forumEntity.id, HtmlUtils.stripHtml(forumEntity.name), type = forumEntity.type, - game = forumEntity.game, icon = icon, iconSubscript = forumEntity.game.iconSubscript)) + game = forumEntity.game.toCommunityGameEntity(), icon = icon, iconSubscript = forumEntity.game.iconSubscript)) } } else if (holder is FooterViewHolder) { holder.initItemPadding() diff --git a/app/src/main/java/com/gh/gamecenter/qa/dialog/ChooseForumContainerFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/dialog/ChooseForumContainerFragment.kt index 5df3344841..c4d7111632 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/dialog/ChooseForumContainerFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/dialog/ChooseForumContainerFragment.kt @@ -8,8 +8,8 @@ import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.common.util.NewLogUtils import com.gh.gamecenter.common.utils.viewModelProvider -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.ListFragment +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.entity.ForumEntity import com.gh.gamecenter.forum.detail.ForumDetailActivity diff --git a/app/src/main/java/com/gh/gamecenter/qa/dialog/ChooseForumContainerViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/dialog/ChooseForumContainerViewModel.kt index 1715d307d3..b2e27e568c 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/dialog/ChooseForumContainerViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/dialog/ChooseForumContainerViewModel.kt @@ -3,10 +3,10 @@ package com.gh.gamecenter.qa.dialog import android.app.Application import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.entity.ForumEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.retrofit.RetrofitManager import com.gh.gamecenter.retrofit.service.ApiService import com.halo.assistant.HaloApp diff --git a/app/src/main/java/com/gh/gamecenter/qa/editor/AnswerAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/editor/AnswerAdapter.kt index c1936a718c..fc69ee9694 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/editor/AnswerAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/editor/AnswerAdapter.kt @@ -8,7 +8,7 @@ import android.view.ViewGroup import com.gh.gamecenter.common.constant.ItemViewType import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.collection.AnswerFragment import com.gh.gamecenter.databinding.AskAnswerItemBinding import com.gh.gamecenter.qa.entity.AnswerEntity diff --git a/app/src/main/java/com/gh/gamecenter/qa/editor/AnswerFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/editor/AnswerFragment.kt index 98fb3d2707..e6dbed9816 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/editor/AnswerFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/editor/AnswerFragment.kt @@ -6,7 +6,7 @@ import androidx.recyclerview.widget.RecyclerView.ItemDecoration import com.gh.gamecenter.common.utils.viewModelProvider import com.gh.gamecenter.common.view.CustomDividerItemDecoration import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListFragment +import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.qa.entity.AnswerEntity class AnswerFragment : ListFragment() { diff --git a/app/src/main/java/com/gh/gamecenter/qa/editor/AnswerViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/editor/AnswerViewModel.kt index f091f632ca..b5e1fddbc8 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/editor/AnswerViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/editor/AnswerViewModel.kt @@ -4,9 +4,9 @@ import android.app.Application import androidx.annotation.Keep import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.entity.UserEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.qa.entity.AnswerEntity import com.gh.gamecenter.retrofit.RetrofitManager import com.halo.assistant.HaloApp diff --git a/app/src/main/java/com/gh/gamecenter/qa/editor/ArticleAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/editor/ArticleAdapter.kt index 7d3459e878..5b4fdff9c2 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/editor/ArticleAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/editor/ArticleAdapter.kt @@ -10,7 +10,7 @@ import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.* import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.collection.CollectionCommunityArticleViewHolder import com.gh.gamecenter.common.callback.ConfirmListener import com.gh.gamecenter.common.utils.goneIf diff --git a/app/src/main/java/com/gh/gamecenter/qa/editor/ArticleFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/editor/ArticleFragment.kt index 7ce11fe440..eb1e3d6278 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/editor/ArticleFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/editor/ArticleFragment.kt @@ -6,7 +6,7 @@ import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.common.utils.viewModelProvider import com.gh.gamecenter.common.view.CustomDividerItemDecoration import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListFragment +import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.qa.entity.ArticleEntity class ArticleFragment : ListFragment() { diff --git a/app/src/main/java/com/gh/gamecenter/qa/editor/ArticleViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/editor/ArticleViewModel.kt index b3320bc847..90ab050c0c 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/editor/ArticleViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/editor/ArticleViewModel.kt @@ -4,9 +4,9 @@ import android.app.Application import androidx.annotation.Keep import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.entity.UserEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.qa.entity.ArticleEntity import com.gh.gamecenter.retrofit.RetrofitManager import com.halo.assistant.HaloApp diff --git a/app/src/main/java/com/gh/gamecenter/qa/editor/GameAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/editor/GameAdapter.kt index 8feb22debf..556e533633 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/editor/GameAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/editor/GameAdapter.kt @@ -6,7 +6,7 @@ import android.content.Intent import android.view.View import android.view.ViewGroup import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.databinding.GameItemBinding import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.game.GameItemViewHolder diff --git a/app/src/main/java/com/gh/gamecenter/qa/editor/GameFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/editor/GameFragment.kt index fe4511fa48..dcab5a3be6 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/editor/GameFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/editor/GameFragment.kt @@ -16,10 +16,10 @@ import com.gh.gamecenter.common.view.FixLinearLayoutManager import com.gh.gamecenter.common.view.VerticalItemDecoration import com.gh.gamecenter.BuildConfig import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListFragment -import com.gh.gamecenter.baselist.NormalListViewModel +import com.gh.gamecenter.common.baselist.ListFragment +import com.gh.gamecenter.common.baselist.NormalListViewModel import com.gh.gamecenter.entity.GameEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.qa.entity.EditorInsertDefaultEntity import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/gamecenter/qa/editor/InsertGameCollectionWrapperActivity.kt b/app/src/main/java/com/gh/gamecenter/qa/editor/InsertGameCollectionWrapperActivity.kt index f645632665..31acf4a99b 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/editor/InsertGameCollectionWrapperActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/editor/InsertGameCollectionWrapperActivity.kt @@ -10,7 +10,7 @@ import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.R import com.gh.gamecenter.collection.GamesCollectionFragment import com.gh.gamecenter.common.utils.updateStatusBarColor -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager class InsertGameCollectionWrapperActivity : BaseActivity_TabLayout() { diff --git a/app/src/main/java/com/gh/gamecenter/qa/editor/OnLinkClickListener.kt b/app/src/main/java/com/gh/gamecenter/qa/editor/OnLinkClickListener.kt index 4f6bc20ec0..85848c97a0 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/editor/OnLinkClickListener.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/editor/OnLinkClickListener.kt @@ -10,7 +10,7 @@ import com.gh.gamecenter.core.utils.GsonUtils import com.gh.gamecenter.common.utils.clickToastByStatus import com.gh.gamecenter.common.utils.tryWithDefaultCatch import com.gh.gamecenter.core.utils.MtaHelper -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.entity.MtaEvent import com.gh.gamecenter.entity.MyVideoEntity import com.gh.gamecenter.gamecollection.detail.GameCollectionDetailActivity diff --git a/app/src/main/java/com/gh/gamecenter/qa/editor/OnlineVideoFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/editor/OnlineVideoFragment.kt index 0afb34c3e7..c75eb24426 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/editor/OnlineVideoFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/editor/OnlineVideoFragment.kt @@ -7,7 +7,7 @@ import android.view.View import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.common.view.GridSpacingItemDecoration -import com.gh.gamecenter.baselist.ListFragment +import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.utils.viewModelProvider import com.gh.gamecenter.databinding.FragmentLocalMediaBinding diff --git a/app/src/main/java/com/gh/gamecenter/qa/editor/OnlineVideoViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/editor/OnlineVideoViewModel.kt index 74bb0f2b1b..9d9476b3da 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/editor/OnlineVideoViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/editor/OnlineVideoViewModel.kt @@ -2,11 +2,9 @@ package com.gh.gamecenter.qa.editor import android.app.Application import com.gh.common.constant.Config -import com.gh.gamecenter.baselist.BaseListViewModel -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.entity.MyVideoEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.retrofit.RetrofitManager import io.reactivex.Observable diff --git a/app/src/main/java/com/gh/gamecenter/qa/editor/VideoAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/editor/VideoAdapter.kt index 91db64a311..b460832c07 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/editor/VideoAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/editor/VideoAdapter.kt @@ -9,7 +9,7 @@ import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.common.constant.ItemViewType import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.DialogHelper import com.gh.gamecenter.core.utils.SPUtils import com.gh.gamecenter.common.utils.toSimpleCount diff --git a/app/src/main/java/com/gh/gamecenter/qa/entity/AnswerDetailEntity.kt b/app/src/main/java/com/gh/gamecenter/qa/entity/AnswerDetailEntity.kt index e2ea210fb8..f5f853f91c 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/entity/AnswerDetailEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/entity/AnswerDetailEntity.kt @@ -1,7 +1,7 @@ package com.gh.gamecenter.qa.entity import android.os.Parcelable -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.entity.MeEntity import com.gh.gamecenter.entity.UserEntity import com.google.gson.annotations.SerializedName diff --git a/app/src/main/java/com/gh/gamecenter/qa/entity/AnswerEntity.kt b/app/src/main/java/com/gh/gamecenter/qa/entity/AnswerEntity.kt index bee277b9c9..1db891048c 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/entity/AnswerEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/entity/AnswerEntity.kt @@ -10,11 +10,12 @@ import androidx.room.TypeConverters import com.gh.gamecenter.common.annotation.SyncIgnore import com.gh.gamecenter.common.annotation.SyncPage import com.gh.gamecenter.common.constant.Constants +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.common.syncpage.SyncFieldConstants import com.gh.gamecenter.core.utils.SPUtils import com.gh.gamecenter.core.utils.TimeUtils import com.gh.gamecenter.entity.* -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.room.converter.* import com.google.gson.annotations.SerializedName diff --git a/app/src/main/java/com/gh/gamecenter/qa/entity/ArticleDetailEntity.kt b/app/src/main/java/com/gh/gamecenter/qa/entity/ArticleDetailEntity.kt index f604beca80..a33e4a7dca 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/entity/ArticleDetailEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/entity/ArticleDetailEntity.kt @@ -1,7 +1,7 @@ package com.gh.gamecenter.qa.entity import android.os.Parcelable -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.entity.MeEntity import com.gh.gamecenter.entity.UserEntity diff --git a/app/src/main/java/com/gh/gamecenter/qa/entity/ArticleDraftEntity.kt b/app/src/main/java/com/gh/gamecenter/qa/entity/ArticleDraftEntity.kt index 422cfa93dc..0f9ec31d88 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/entity/ArticleDraftEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/entity/ArticleDraftEntity.kt @@ -1,7 +1,7 @@ package com.gh.gamecenter.qa.entity import android.os.Parcelable -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.entity.GameEntity import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/com/gh/gamecenter/qa/entity/ArticleEntity.kt b/app/src/main/java/com/gh/gamecenter/qa/entity/ArticleEntity.kt index a5474ec9ad..d766a51447 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/entity/ArticleEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/entity/ArticleEntity.kt @@ -9,11 +9,12 @@ import androidx.room.TypeConverters import com.gh.gamecenter.common.annotation.SyncIgnore import com.gh.gamecenter.common.annotation.SyncPage import com.gh.gamecenter.common.constant.Constants +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.common.syncpage.SyncFieldConstants import com.gh.gamecenter.core.utils.SPUtils import com.gh.gamecenter.core.utils.TimeUtils import com.gh.gamecenter.entity.* -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.room.converter.* import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parceler diff --git a/app/src/main/java/com/gh/gamecenter/qa/entity/AskSubjectEntity.kt b/app/src/main/java/com/gh/gamecenter/qa/entity/AskSubjectEntity.kt index 1abacfb3d8..344a3daa2f 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/entity/AskSubjectEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/entity/AskSubjectEntity.kt @@ -1,7 +1,7 @@ package com.gh.gamecenter.qa.entity import android.os.Parcelable -import com.gh.gamecenter.entity.Auth +import com.gh.gamecenter.login.entity.Auth import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/com/gh/gamecenter/qa/entity/InviteEntity.kt b/app/src/main/java/com/gh/gamecenter/qa/entity/InviteEntity.kt index 669f1953b5..6cf4538944 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/entity/InviteEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/entity/InviteEntity.kt @@ -1,8 +1,8 @@ package com.gh.gamecenter.qa.entity -import com.gh.gamecenter.entity.Auth -import com.gh.gamecenter.entity.Badge import com.gh.gamecenter.entity.MeEntity +import com.gh.gamecenter.login.entity.Auth +import com.gh.gamecenter.login.entity.Badge import com.google.gson.annotations.SerializedName /** diff --git a/app/src/main/java/com/gh/gamecenter/qa/entity/QuestionDraftEntity.kt b/app/src/main/java/com/gh/gamecenter/qa/entity/QuestionDraftEntity.kt index 50af4a4cc0..a290a604a9 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/entity/QuestionDraftEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/entity/QuestionDraftEntity.kt @@ -1,7 +1,7 @@ package com.gh.gamecenter.qa.entity import android.os.Parcelable -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.entity.GameEntity import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/com/gh/gamecenter/qa/entity/QuestionsDetailEntity.kt b/app/src/main/java/com/gh/gamecenter/qa/entity/QuestionsDetailEntity.kt index c5bf693da8..d92f90f66d 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/entity/QuestionsDetailEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/entity/QuestionsDetailEntity.kt @@ -1,7 +1,7 @@ package com.gh.gamecenter.qa.entity import android.os.Parcelable -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.entity.MeEntity import com.gh.gamecenter.entity.UserEntity diff --git a/app/src/main/java/com/gh/gamecenter/qa/entity/SuggestedFollowEntity.kt b/app/src/main/java/com/gh/gamecenter/qa/entity/SuggestedFollowEntity.kt index 6abe49fb39..6a04ae626a 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/entity/SuggestedFollowEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/entity/SuggestedFollowEntity.kt @@ -1,6 +1,6 @@ package com.gh.gamecenter.qa.entity -import com.gh.gamecenter.entity.Auth +import com.gh.gamecenter.login.entity.Auth import com.google.gson.annotations.SerializedName data class SuggestedFollowEntity(@SerializedName("_id") diff --git a/app/src/main/java/com/gh/gamecenter/qa/follow/AskFollowAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/follow/AskFollowAdapter.kt index 9555bd5fc5..81d6b084b2 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/follow/AskFollowAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/follow/AskFollowAdapter.kt @@ -10,7 +10,7 @@ package com.gh.gamecenter.qa.follow //import com.gh.common.util.* //import com.gh.gamecenter.R //import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -//import com.gh.gamecenter.baselist.ListAdapter +//import com.gh.gamecenter.common.baselist.ListAdapter //import com.gh.gamecenter.databinding.CommunityFollowItemBinding //import com.gh.gamecenter.entity.PersonalHistoryEntity //import com.gh.gamecenter.personalhome.home.UserHistoryAdapter diff --git a/app/src/main/java/com/gh/gamecenter/qa/follow/AskFollowFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/follow/AskFollowFragment.kt index f20aa4bf9a..4f23a5aedd 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/follow/AskFollowFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/follow/AskFollowFragment.kt @@ -16,13 +16,13 @@ package com.gh.gamecenter.qa.follow //import com.gh.gamecenter.common.constant.Constants //import com.gh.common.util.* //import com.gh.gamecenter.R -//import com.gh.gamecenter.baselist.ListFragment +//import com.gh.gamecenter.common.baselist.ListFragment //import com.gh.gamecenter.entity.PersonalEntity //import com.gh.gamecenter.entity.PersonalHistoryEntity -//import com.gh.gamecenter.eventbus.EBReuse +//import com.gh.gamecenter.common.eventbus.EBReuse //import com.gh.gamecenter.eventbus.EBTypeChange //import com.gh.gamecenter.forum.home.CommunityHomeFragment -//import com.gh.gamecenter.manager.UserManager +//import com.gh.gamecenter.login.user.UserManager //import com.gh.gamecenter.qa.CommunityFragment //import org.greenrobot.eventbus.EventBus //import org.greenrobot.eventbus.Subscribe @@ -103,9 +103,9 @@ package com.gh.gamecenter.qa.follow // * 返回值标识为是否执行了刷新操作 // */ // fun load(): Boolean { -// return if (mCurrentCommunity != UserManager.getInstance().community.id) { +// return if (mCurrentCommunity != CommunityManager.getInstance().community.id) { // onRefresh() -// mCurrentCommunity = UserManager.getInstance().community.id +// mCurrentCommunity = CommunityManager.getInstance().community.id // true // } else { // false diff --git a/app/src/main/java/com/gh/gamecenter/qa/follow/AskFollowViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/follow/AskFollowViewModel.kt index 78478ed1f4..21cffe8714 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/follow/AskFollowViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/follow/AskFollowViewModel.kt @@ -3,10 +3,10 @@ //import android.annotation.SuppressLint //import android.app.Application //import androidx.lifecycle.MutableLiveData -//import com.gh.gamecenter.baselist.ListViewModel +//import com.gh.gamecenter.common.baselist.ListViewModel //import com.gh.gamecenter.entity.PersonalEntity //import com.gh.gamecenter.entity.PersonalHistoryEntity -//import com.gh.gamecenter.manager.UserManager +//import com.gh.gamecenter.login.user.UserManager //import com.gh.gamecenter.retrofit.Response //import com.gh.gamecenter.retrofit.RetrofitManager //import com.lightgame.utils.Utils @@ -27,7 +27,7 @@ // override fun provideDataObservable(page: Int): Observable> { // return RetrofitManager.getInstance() // .api -// .getAskFollow(UserManager.getInstance().community.id, UserManager.getInstance().userId, page, Utils.getTime(getApplication())) +// .getAskFollow(CommunityManager.getInstance().community.id, UserManager.getInstance().userId, page, Utils.getTime(getApplication())) // } // // override fun mergeResultLiveData() { @@ -39,7 +39,7 @@ // fun getRecommendUser() { // RetrofitManager.getInstance() // .api -// .getRecommendUsers(UserManager.getInstance().community.id, UserManager.getInstance().userId) +// .getRecommendUsers(CommunityManager.getInstance().community.id, UserManager.getInstance().userId) // .subscribeOn(Schedulers.io()) // .subscribe(object : Response>() { // override fun onResponse(response: List?) { diff --git a/app/src/main/java/com/gh/gamecenter/qa/myqa/ConcernQuestionsAdapter.java b/app/src/main/java/com/gh/gamecenter/qa/myqa/ConcernQuestionsAdapter.java index 8a6f013bab..534795664f 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/myqa/ConcernQuestionsAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/qa/myqa/ConcernQuestionsAdapter.java @@ -12,7 +12,7 @@ import com.gh.gamecenter.common.constant.ItemViewType; import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler; import com.gh.gamecenter.R; import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; -import com.gh.gamecenter.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.ListAdapter; import com.gh.gamecenter.databinding.CommunityQuestionItemBinding; import com.gh.gamecenter.qa.entity.Questions; import com.gh.gamecenter.qa.questions.CommunityQuestionViewHolder; diff --git a/app/src/main/java/com/gh/gamecenter/qa/myqa/ConcernQuestionsFragment.java b/app/src/main/java/com/gh/gamecenter/qa/myqa/ConcernQuestionsFragment.java index 218cffbc82..4fe871a051 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/myqa/ConcernQuestionsFragment.java +++ b/app/src/main/java/com/gh/gamecenter/qa/myqa/ConcernQuestionsFragment.java @@ -10,11 +10,11 @@ import androidx.recyclerview.widget.RecyclerView; import com.gh.gamecenter.common.constant.EntranceConsts; import com.gh.gamecenter.R; -import com.gh.gamecenter.baselist.ListAdapter; -import com.gh.gamecenter.baselist.ListFragment; -import com.gh.gamecenter.baselist.LoadType; -import com.gh.gamecenter.baselist.NormalListViewModel; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.common.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.ListFragment; +import com.gh.gamecenter.common.baselist.LoadType; +import com.gh.gamecenter.common.baselist.NormalListViewModel; +import com.gh.gamecenter.login.user.UserManager; import com.gh.gamecenter.qa.entity.Questions; import com.gh.gamecenter.retrofit.RetrofitManager; diff --git a/app/src/main/java/com/gh/gamecenter/qa/myqa/MyAnswerAdapter.java b/app/src/main/java/com/gh/gamecenter/qa/myqa/MyAnswerAdapter.java index 3111549a1b..07db13a169 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/myqa/MyAnswerAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/qa/myqa/MyAnswerAdapter.java @@ -11,7 +11,7 @@ import com.gh.gamecenter.common.constant.ItemViewType; import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler; import com.gh.gamecenter.R; import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; -import com.gh.gamecenter.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.ListAdapter; import com.gh.gamecenter.core.utils.DisplayUtils; import com.gh.gamecenter.databinding.CommunityAnswerItemBinding; import com.gh.gamecenter.forum.home.ForumArticleAskItemViewHolder; diff --git a/app/src/main/java/com/gh/gamecenter/qa/myqa/MyAnswerFragment.java b/app/src/main/java/com/gh/gamecenter/qa/myqa/MyAnswerFragment.java index cb2a2a2579..11facf9fca 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/myqa/MyAnswerFragment.java +++ b/app/src/main/java/com/gh/gamecenter/qa/myqa/MyAnswerFragment.java @@ -7,13 +7,13 @@ import androidx.annotation.Nullable; import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.RecyclerView; import com.gh.gamecenter.R; -import com.gh.gamecenter.baselist.ListAdapter; -import com.gh.gamecenter.baselist.ListFragment; -import com.gh.gamecenter.baselist.LoadType; -import com.gh.gamecenter.baselist.NormalListViewModel; +import com.gh.gamecenter.common.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.ListFragment; +import com.gh.gamecenter.common.baselist.LoadType; +import com.gh.gamecenter.common.baselist.NormalListViewModel; import com.gh.gamecenter.common.constant.EntranceConsts; import com.gh.gamecenter.common.view.CustomDividerItemDecoration; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.user.UserManager; import com.gh.gamecenter.qa.entity.AnswerEntity; import com.gh.gamecenter.retrofit.RetrofitManager; import com.halo.assistant.HaloApp; diff --git a/app/src/main/java/com/gh/gamecenter/qa/myqa/MyAskWrapperFragment.java b/app/src/main/java/com/gh/gamecenter/qa/myqa/MyAskWrapperFragment.java index 0d8b35b179..0e3bdc3c2a 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/myqa/MyAskWrapperFragment.java +++ b/app/src/main/java/com/gh/gamecenter/qa/myqa/MyAskWrapperFragment.java @@ -8,7 +8,7 @@ import com.gh.gamecenter.common.base.fragment.BaseFragment_TabLayout; import com.gh.gamecenter.common.constant.EntranceConsts; import com.gh.gamecenter.core.utils.MtaHelper; import com.gh.gamecenter.R; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.user.UserManager; import com.gh.gamecenter.qa.article.MyArticleFragment; import com.gh.gamecenter.qa.draft.CommunityDraftWrapperActivity; diff --git a/app/src/main/java/com/gh/gamecenter/qa/myqa/MyQuestionsAdapter.java b/app/src/main/java/com/gh/gamecenter/qa/myqa/MyQuestionsAdapter.java index 793160578b..fc56078b5e 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/myqa/MyQuestionsAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/qa/myqa/MyQuestionsAdapter.java @@ -12,7 +12,7 @@ import com.gh.gamecenter.common.constant.ItemViewType; import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler; import com.gh.gamecenter.R; import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; -import com.gh.gamecenter.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.ListAdapter; import com.gh.gamecenter.databinding.CommunityQuestionItemBinding; import com.gh.gamecenter.qa.entity.Questions; import com.gh.gamecenter.qa.questions.CommunityQuestionViewHolder; diff --git a/app/src/main/java/com/gh/gamecenter/qa/myqa/MyQuestionsFragment.java b/app/src/main/java/com/gh/gamecenter/qa/myqa/MyQuestionsFragment.java index 823097350b..4da73e54eb 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/myqa/MyQuestionsFragment.java +++ b/app/src/main/java/com/gh/gamecenter/qa/myqa/MyQuestionsFragment.java @@ -8,11 +8,11 @@ import androidx.recyclerview.widget.RecyclerView; import com.gh.gamecenter.common.constant.EntranceConsts; import com.gh.gamecenter.R; -import com.gh.gamecenter.baselist.ListAdapter; -import com.gh.gamecenter.baselist.ListFragment; -import com.gh.gamecenter.baselist.LoadType; -import com.gh.gamecenter.baselist.NormalListViewModel; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.common.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.ListFragment; +import com.gh.gamecenter.common.baselist.LoadType; +import com.gh.gamecenter.common.baselist.NormalListViewModel; +import com.gh.gamecenter.login.user.UserManager; import com.gh.gamecenter.qa.entity.Questions; import com.gh.gamecenter.retrofit.RetrofitManager; import com.halo.assistant.HaloApp; diff --git a/app/src/main/java/com/gh/gamecenter/qa/newest/AskQuestionsNewBodyAdapter.java b/app/src/main/java/com/gh/gamecenter/qa/newest/AskQuestionsNewBodyAdapter.java index 17cdcb5ce6..9d0e8acad4 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/newest/AskQuestionsNewBodyAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/qa/newest/AskQuestionsNewBodyAdapter.java @@ -11,7 +11,7 @@ //import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler; //import com.gh.gamecenter.R; //import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; -//import com.gh.gamecenter.baselist.ListAdapter; +//import com.gh.gamecenter.common.baselist.ListAdapter; //import com.gh.gamecenter.databinding.CommunityQuestionItemBinding; //import com.gh.gamecenter.qa.entity.Questions; //import com.gh.gamecenter.qa.questions.CommunityQuestionViewHolder; diff --git a/app/src/main/java/com/gh/gamecenter/qa/newest/AskQuestionsNewBodyFragment.java b/app/src/main/java/com/gh/gamecenter/qa/newest/AskQuestionsNewBodyFragment.java index b6d254fbcc..daf17ba27f 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/newest/AskQuestionsNewBodyFragment.java +++ b/app/src/main/java/com/gh/gamecenter/qa/newest/AskQuestionsNewBodyFragment.java @@ -12,14 +12,14 @@ //import com.gh.common.util.CheckLoginUtils; //import com.gh.gamecenter.core.utils.UrlFilterUtils; //import com.gh.gamecenter.R; -//import com.gh.gamecenter.baselist.ListAdapter; -//import com.gh.gamecenter.baselist.ListFragment; -//import com.gh.gamecenter.baselist.LoadStatus; -//import com.gh.gamecenter.baselist.LoadType; -//import com.gh.gamecenter.baselist.NormalListViewModel; -//import com.gh.gamecenter.eventbus.EBReuse; +//import com.gh.gamecenter.common.baselist.ListAdapter; +//import com.gh.gamecenter.common.baselist.ListFragment; +//import com.gh.gamecenter.common.baselist.LoadStatus; +//import com.gh.gamecenter.common.baselist.LoadType; +//import com.gh.gamecenter.common.baselist.NormalListViewModel; +//import com.gh.gamecenter.common.eventbus.EBReuse; //import com.gh.gamecenter.eventbus.EBTypeChange; -//import com.gh.gamecenter.manager.UserManager; +//import com.gh.gamecenter.login.user.UserManager; //import com.gh.gamecenter.qa.BbsType; //import com.gh.gamecenter.qa.CommunityFragment; //import com.gh.gamecenter.qa.entity.Questions; @@ -51,8 +51,8 @@ // @Override // public void onActivityResult(int requestCode, int resultCode, Intent data) { // super.onActivityResult(requestCode, resultCode, data); -// if (!UserManager.getInstance().getCommunity().getId().equals(mCommunityId)) { -// mCommunityId = UserManager.getInstance().getCommunity().getId(); +// if (!CommunityManager.getInstance().getCommunity().getId().equals(mCommunityId)) { +// mCommunityId = CommunityManager.getInstance().getCommunity().getId(); // if (getArguments() != null) { // mType = getArguments().getString(mCommunityId); // } @@ -67,7 +67,7 @@ // // @Override // public void onCreate(@Nullable Bundle savedInstanceState) { -// mCommunityId = UserManager.getInstance().getCommunity().getId(); +// mCommunityId = CommunityManager.getInstance().getCommunity().getId(); // if (getArguments() != null) { // mType = getArguments().getString(mCommunityId); // } @@ -128,7 +128,7 @@ // public static Fragment newInstance(String s) { // AskQuestionsNewBodyFragment questionsBodyFragment = new AskQuestionsNewBodyFragment(); // Bundle args = new Bundle(); -// args.putString(UserManager.getInstance().getCommunity().getId(), s); +// args.putString(CommunityManager.getInstance().getCommunity().getId(), s); // questionsBodyFragment.setArguments(args); // return questionsBodyFragment; // } diff --git a/app/src/main/java/com/gh/gamecenter/qa/newest/AskQuestionsNewFragment.java b/app/src/main/java/com/gh/gamecenter/qa/newest/AskQuestionsNewFragment.java index b2643099b6..6d5fd52201 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/newest/AskQuestionsNewFragment.java +++ b/app/src/main/java/com/gh/gamecenter/qa/newest/AskQuestionsNewFragment.java @@ -19,7 +19,7 @@ //import com.gh.gamecenter.common.utils.ImageUtils; //import com.gh.gamecenter.common.view.TabIndicatorView; //import com.gh.gamecenter.R; -//import com.gh.gamecenter.manager.UserManager; +//import com.gh.gamecenter.login.user.UserManager; //import com.gh.gamecenter.qa.entity.AskTagGroupsEntity; //import com.gh.gamecenter.qa.tags.AskQuestionsNewViewModel; //import com.gh.gamecenter.qa.tags.AskTagPagerFragmentAdapter; @@ -93,7 +93,7 @@ // public void onPageSelected(int position) { // if (mTagGroupsList != null && mTagGroupsList.size() > position) { // DataUtils.onMtaEvent(getContext(), "问答页面", -// UserManager.getInstance().getCommunity().getName(), "问题-" + mTagGroupsList.get(position).getName()); +// CommunityManager.getInstance().getCommunity().getName(), "问题-" + mTagGroupsList.get(position).getName()); // } // } // diff --git a/app/src/main/java/com/gh/gamecenter/qa/questions/CommunityQuestionViewHolder.kt b/app/src/main/java/com/gh/gamecenter/qa/questions/CommunityQuestionViewHolder.kt index 28476fa84b..e4fbfd1371 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/questions/CommunityQuestionViewHolder.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/questions/CommunityQuestionViewHolder.kt @@ -11,7 +11,7 @@ import com.gh.gamecenter.core.utils.NumberUtils import com.gh.gamecenter.common.view.DrawableView import com.gh.gamecenter.R import com.gh.gamecenter.databinding.CommunityQuestionItemBinding -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.manager.CommunityManager import com.gh.gamecenter.qa.answer.edit.AnswerEditActivity import com.gh.gamecenter.qa.entity.Questions @@ -63,7 +63,7 @@ class CommunityQuestionViewHolder(val binding: CommunityQuestionItemBinding) : B answerCountContainer.setOnClickListener { CheckLoginUtils.checkLogin(it.context, entrance) { - val communityName = if (questions.communityName.isNullOrEmpty()) UserManager.getInstance().community.name + val communityName = if (questions.communityName.isNullOrEmpty()) CommunityManager.getInstance().community.name else questions.communityName it.context.startActivity(AnswerEditActivity.getIntent(it.context, questions, communityName)) } diff --git a/app/src/main/java/com/gh/gamecenter/qa/questions/detail/QuestionsDetailAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/questions/detail/QuestionsDetailAdapter.kt index 506bbe18b2..a43d4cc32d 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/questions/detail/QuestionsDetailAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/questions/detail/QuestionsDetailAdapter.kt @@ -23,9 +23,9 @@ //import com.gh.gamecenter.R //import com.gh.gamecenter.adapter.viewholder.FooterViewHolder //import com.gh.gamecenter.adapter.viewholder.ReuseViewHolder -//import com.gh.gamecenter.baselist.ListAdapter +//import com.gh.gamecenter.common.baselist.ListAdapter //import com.gh.gamecenter.databinding.CommunityAnswerItemBinding -//import com.gh.gamecenter.entity.CommunityEntity +//import com.gh.gamecenter.common.entity.CommunityEntity //import com.gh.gamecenter.qa.answer.CommunityAnswerItemViewHolder //import com.gh.gamecenter.qa.answer.detail.AnswerDetailActivity //import com.gh.gamecenter.qa.column.detail.AskColumnDetailActivity diff --git a/app/src/main/java/com/gh/gamecenter/qa/questions/detail/QuestionsDetailFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/questions/detail/QuestionsDetailFragment.kt index d52e1c0e53..a2e7d18209 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/questions/detail/QuestionsDetailFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/questions/detail/QuestionsDetailFragment.kt @@ -31,17 +31,17 @@ //import com.gh.gamecenter.ImageViewerActivity //import com.gh.gamecenter.R //import com.gh.gamecenter.SuggestionActivity -//import com.gh.gamecenter.baselist.ListAdapter -//import com.gh.gamecenter.baselist.ListFragment -//import com.gh.gamecenter.baselist.LoadType +//import com.gh.gamecenter.common.baselist.ListAdapter +//import com.gh.gamecenter.common.baselist.ListFragment +//import com.gh.gamecenter.common.baselist.LoadType //import com.gh.gamecenter.common.entity.NormalShareEntity //import com.gh.gamecenter.entity.MenuItemEntity //import com.gh.gamecenter.entity.Permissions //import com.gh.gamecenter.entity.SpecialColumn //import com.gh.gamecenter.eventbus.EBDeleteDetail -//import com.gh.gamecenter.eventbus.EBReuse -//import com.gh.gamecenter.manager.UserManager -//import com.gh.gamecenter.mvvm.Status +//import com.gh.gamecenter.common.eventbus.EBReuse +//import com.gh.gamecenter.login.user.UserManager +//import com.gh.gamecenter.common.mvvm.Status //import com.gh.gamecenter.personal.PersonalFragment //import com.gh.gamecenter.qa.answer.detail.AnswerDetailActivity //import com.gh.gamecenter.qa.answer.edit.AnswerEditActivity @@ -663,7 +663,7 @@ // // 登录事件 // @Subscribe(threadMode = ThreadMode.MAIN) // fun onEventMainThread(reuse: EBReuse) { -// if (reuse.type == PersonalFragment.LOGIN_TAG) { // 登入 +// if (reuse.type == Constants.LOGIN_TAG) { // 登入 // onRefresh() // } // } diff --git a/app/src/main/java/com/gh/gamecenter/qa/questions/detail/QuestionsDetailViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/questions/detail/QuestionsDetailViewModel.kt index c25869a1f9..ae3360ab12 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/questions/detail/QuestionsDetailViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/questions/detail/QuestionsDetailViewModel.kt @@ -8,13 +8,13 @@ //import com.gh.common.util.ErrorHelper //import com.gh.gamecenter.core.utils.UrlFilterUtils //import com.gh.gamecenter.R -//import com.gh.gamecenter.baselist.ListHeadViewModel -//import com.gh.gamecenter.baselist.LoadStatus -//import com.gh.gamecenter.baselist.LoadType +//import com.gh.gamecenter.common.baselist.ListHeadViewModel +//import com.gh.gamecenter.common.baselist.LoadStatus +//import com.gh.gamecenter.common.baselist.LoadType //import com.gh.gamecenter.entity.MeEntity //import com.gh.gamecenter.entity.Permissions -//import com.gh.gamecenter.manager.UserManager -//import com.gh.gamecenter.mvvm.Resource +//import com.gh.gamecenter.login.user.UserManager +//import com.gh.gamecenter.common.mvvm.Resource //import com.gh.gamecenter.qa.entity.AnswerEntity //import com.gh.gamecenter.qa.entity.QuestionsDetailEntity //import com.gh.gamecenter.common.retrofit.BiResponse diff --git a/app/src/main/java/com/gh/gamecenter/qa/questions/draft/QuestionDraftAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/questions/draft/QuestionDraftAdapter.kt index 245c31be97..d488a160c1 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/questions/draft/QuestionDraftAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/questions/draft/QuestionDraftAdapter.kt @@ -12,7 +12,7 @@ import com.gh.gamecenter.common.utils.DialogHelper import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.databinding.CommunityQuestionDraftItemBinding import com.gh.gamecenter.qa.entity.QuestionDraftEntity diff --git a/app/src/main/java/com/gh/gamecenter/qa/questions/draft/QuestionDraftFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/questions/draft/QuestionDraftFragment.kt index 623929298e..2846da77f0 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/questions/draft/QuestionDraftFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/questions/draft/QuestionDraftFragment.kt @@ -11,10 +11,10 @@ import com.gh.gamecenter.common.utils.checkStoragePermissionBeforeAction import com.gh.gamecenter.common.utils.viewModelProvider import com.gh.gamecenter.common.view.CustomDividerItemDecoration import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.ListFragment -import com.gh.gamecenter.baselist.LoadType -import com.gh.gamecenter.eventbus.EBReuse +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListFragment +import com.gh.gamecenter.common.baselist.LoadType +import com.gh.gamecenter.common.eventbus.EBReuse import com.gh.gamecenter.qa.draft.CommunityDraftWrapperActivity import com.gh.gamecenter.qa.entity.QuestionDraftEntity import com.gh.gamecenter.qa.questions.edit.QuestionEditActivity diff --git a/app/src/main/java/com/gh/gamecenter/qa/questions/draft/QuestionDraftViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/questions/draft/QuestionDraftViewModel.kt index 69d6e49aa2..bf0c3d3865 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/questions/draft/QuestionDraftViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/questions/draft/QuestionDraftViewModel.kt @@ -4,8 +4,8 @@ import android.annotation.SuppressLint import android.app.Application import androidx.lifecycle.MutableLiveData import com.gh.gamecenter.common.utils.observableToMain -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.qa.entity.QuestionDraftEntity import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/gamecenter/qa/questions/edit/QuestionEditActivity.kt b/app/src/main/java/com/gh/gamecenter/qa/questions/edit/QuestionEditActivity.kt index f5f5efef63..21c9bd14cf 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/questions/edit/QuestionEditActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/questions/edit/QuestionEditActivity.kt @@ -28,6 +28,7 @@ import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.R import com.gh.gamecenter.common.callback.ConfirmListener import com.gh.gamecenter.common.constant.EntranceConsts +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.common.entity.NotificationUgc import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.ToastUtils @@ -35,9 +36,9 @@ import com.gh.gamecenter.core.utils.KeyboardHeightObserver import com.gh.gamecenter.core.utils.PatternUtils import com.gh.gamecenter.databinding.ActivityQuestionsEditBinding import com.gh.gamecenter.entity.* -import com.gh.gamecenter.eventbus.EBReuse -import com.gh.gamecenter.manager.UserManager -import com.gh.gamecenter.mvvm.Status +import com.gh.gamecenter.common.eventbus.EBReuse +import com.gh.gamecenter.login.user.UserManager +import com.gh.gamecenter.common.mvvm.Status import com.gh.gamecenter.qa.BbsType import com.gh.gamecenter.qa.answer.edit.AnswerEditActivity import com.gh.gamecenter.qa.article.draft.ArticleDraftActivity diff --git a/app/src/main/java/com/gh/gamecenter/qa/questions/edit/QuestionEditViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/questions/edit/QuestionEditViewModel.kt index e48ebf0568..375b18e3b3 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/questions/edit/QuestionEditViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/questions/edit/QuestionEditViewModel.kt @@ -17,16 +17,17 @@ import com.gh.gamecenter.common.utils.toRequestBody import com.gh.gamecenter.common.utils.tryWithDefaultCatch import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.entity.ActivityLabelEntity -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.entity.Permissions -import com.gh.gamecenter.eventbus.EBReuse -import com.gh.gamecenter.manager.UserManager -import com.gh.gamecenter.mvvm.Resource +import com.gh.gamecenter.common.eventbus.EBReuse +import com.gh.gamecenter.login.user.UserManager +import com.gh.gamecenter.common.mvvm.Resource import com.gh.gamecenter.qa.entity.QuestionDraftEntity import com.gh.gamecenter.qa.entity.QuestionsDetailEntity import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.common.retrofit.Response +import com.gh.gamecenter.energy.utils.EnergyTaskHelper import com.lightgame.utils.Utils import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.schedulers.Schedulers @@ -69,8 +70,8 @@ class QuestionEditViewModel(application: Application) : BaseRichEditorViewModel( if (questionEntity != null) { communityEntity = questionEntity?.community }/* else { - communityId = UserManager.getInstance().community.id - communityName = UserManager.getInstance().community.name + communityId = CommunityManager.getInstance().community.id + communityName = CommunityManager.getInstance().community.name if (!isFromSearch) checkQuestionDraft() }*/ } diff --git a/app/src/main/java/com/gh/gamecenter/qa/questions/edit/TagsSelectFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/questions/edit/TagsSelectFragment.kt index 5557163fc8..bdc921ccad 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/questions/edit/TagsSelectFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/questions/edit/TagsSelectFragment.kt @@ -29,8 +29,8 @@ import com.gh.gamecenter.entity.ErrorEntity import com.gh.gamecenter.common.entity.NotificationUgc import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.entity.Permissions -import com.gh.gamecenter.manager.UserManager -import com.gh.gamecenter.mvvm.Status +import com.gh.gamecenter.manager.CommunityManager +import com.gh.gamecenter.common.mvvm.Status import com.gh.gamecenter.qa.entity.QuestionsDetailEntity import com.gh.gamecenter.qa.questions.newdetail.NewQuestionDetailActivity import com.google.android.flexbox.FlexboxLayout @@ -145,7 +145,7 @@ class TagsSelectFragment : BaseFragment() { val data = errorEntity?.data when { errorEntity?.code == 403066 -> { - MtaHelper.onEvent("提交相似问题弹窗", UserManager.getInstance().community.name, "问题相似-出现弹窗提示") + MtaHelper.onEvent("提交相似问题弹窗", CommunityManager.getInstance().community.name, "问题相似-出现弹窗提示") DialogUtils.showCommunityDialog(context, "已有相似问题,去看看?", data?.questionTitle, @@ -154,18 +154,18 @@ class TagsSelectFragment : BaseFragment() { object : CancelListener { override fun onCancel() { mViewModel?.uploadPicAndPostQuestion(true) - MtaHelper.onEvent("提交相似问题弹窗", UserManager.getInstance().community.name, "问题相似-继续提交") + MtaHelper.onEvent("提交相似问题弹窗", CommunityManager.getInstance().community.name, "问题相似-继续提交") } }, object : ConfirmListener { override fun onConfirm() { - MtaHelper.onEvent("提交相似问题弹窗", UserManager.getInstance().community.name, "问题相似-去看看") + MtaHelper.onEvent("提交相似问题弹窗", CommunityManager.getInstance().community.name, "问题相似-去看看") val intent = NewQuestionDetailActivity.getIntent(requireContext(), data?.questionId ?: "", mEntrance, "相似问题") context?.startActivity(intent) } }) } errorEntity?.code == 403067 -> { - MtaHelper.onEvent("提交重复问题弹窗", UserManager.getInstance().community.name, "问题重复-出现弹窗提示") + MtaHelper.onEvent("提交重复问题弹窗", CommunityManager.getInstance().community.name, "问题重复-出现弹窗提示") DialogUtils.showCommunityDialog(context, "已有重复问题,无法提问", data?.questionTitle, @@ -173,7 +173,7 @@ class TagsSelectFragment : BaseFragment() { null, "去看看", null, object : ConfirmListener { override fun onConfirm() { - MtaHelper.onEvent("提交重复问题弹窗", UserManager.getInstance().community.name, "问题重复-去看看") + MtaHelper.onEvent("提交重复问题弹窗", CommunityManager.getInstance().community.name, "问题重复-去看看") val intent = NewQuestionDetailActivity.getIntent(requireContext(), data?.questionId ?: "", mEntrance, "重复问题") context?.startActivity(intent) } diff --git a/app/src/main/java/com/gh/gamecenter/qa/questions/invite/QuestionsInviteAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/questions/invite/QuestionsInviteAdapter.kt index 9489d5d865..d555fca64b 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/questions/invite/QuestionsInviteAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/questions/invite/QuestionsInviteAdapter.kt @@ -9,7 +9,7 @@ import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.DirectUtils import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.databinding.QuestioninviteHeaderItemBinding import com.gh.gamecenter.databinding.QuestionsinviteItemBinding import com.gh.gamecenter.entity.MeEntity diff --git a/app/src/main/java/com/gh/gamecenter/qa/questions/invite/QuestionsInviteFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/questions/invite/QuestionsInviteFragment.kt index 39f746be44..10ff5f8df8 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/questions/invite/QuestionsInviteFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/questions/invite/QuestionsInviteFragment.kt @@ -4,9 +4,9 @@ import android.os.Bundle import android.view.View import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.ListFragment -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListFragment +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.DialogHelper import com.gh.gamecenter.common.utils.ifLogin diff --git a/app/src/main/java/com/gh/gamecenter/qa/questions/invite/QuestionsInviteViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/questions/invite/QuestionsInviteViewModel.kt index 5a08ce875e..4aba5a1539 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/questions/invite/QuestionsInviteViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/questions/invite/QuestionsInviteViewModel.kt @@ -6,7 +6,7 @@ import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider import com.gh.common.util.ErrorHelper -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.qa.entity.InviteEntity import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/gamecenter/qa/questions/invite/QuestionsInviteWrapperFragment.java b/app/src/main/java/com/gh/gamecenter/qa/questions/invite/QuestionsInviteWrapperFragment.java index 70be8b293b..c8c13192d8 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/questions/invite/QuestionsInviteWrapperFragment.java +++ b/app/src/main/java/com/gh/gamecenter/qa/questions/invite/QuestionsInviteWrapperFragment.java @@ -18,7 +18,7 @@ import com.gh.gamecenter.common.utils.ShareUtils; import com.gh.gamecenter.common.utils.TextHelper; import com.gh.gamecenter.R; import com.gh.gamecenter.databinding.FragmentInviteBinding; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.user.UserManager; import com.gh.gamecenter.common.base.fragment.ToolbarFragment; import com.gh.gamecenter.qa.entity.QuestionsDetailEntity; import com.lightgame.utils.Util_System_Keyboard; diff --git a/app/src/main/java/com/gh/gamecenter/qa/questions/newdetail/NewQuestionDetailActivity.kt b/app/src/main/java/com/gh/gamecenter/qa/questions/newdetail/NewQuestionDetailActivity.kt index a4b2b961f9..d8ce5add15 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/questions/newdetail/NewQuestionDetailActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/questions/newdetail/NewQuestionDetailActivity.kt @@ -8,7 +8,7 @@ import com.gh.gamecenter.R import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.updateStatusBarColor import com.gh.gamecenter.core.utils.DisplayUtils -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.entity.CommunityEntity class NewQuestionDetailActivity : ToolBarActivity() { diff --git a/app/src/main/java/com/gh/gamecenter/qa/questions/newdetail/NewQuestionDetailAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/questions/newdetail/NewQuestionDetailAdapter.kt index 9a239aaa48..8540099cd3 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/questions/newdetail/NewQuestionDetailAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/questions/newdetail/NewQuestionDetailAdapter.kt @@ -7,7 +7,7 @@ import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.core.utils.SpanBuilder import com.gh.gamecenter.common.view.CustomLinkMovementMethod import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.LoadStatus import com.gh.gamecenter.databinding.ItemArticleDetailContentBinding import com.gh.gamecenter.qa.answer.detail.SimpleAnswerDetailActivity import com.gh.gamecenter.qa.comment.base.BaseCommentAdapter diff --git a/app/src/main/java/com/gh/gamecenter/qa/questions/newdetail/NewQuestionDetailFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/questions/newdetail/NewQuestionDetailFragment.kt index 1bb5773235..8549d499be 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/questions/newdetail/NewQuestionDetailFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/questions/newdetail/NewQuestionDetailFragment.kt @@ -21,17 +21,18 @@ import com.gh.common.util.LogUtils import com.gh.common.util.NewLogUtils import com.gh.gamecenter.ImageViewerActivity import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.entity.AdditionalParamsEntity +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.common.entity.NormalShareEntity import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.common.utils.ImageUtils import com.gh.gamecenter.databinding.FragmentArticleDetailBinding import com.gh.gamecenter.entity.* import com.gh.gamecenter.eventbus.EBDeleteDetail -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.qa.article.detail.CommentItemData import com.gh.gamecenter.qa.comment.CommentActivity import com.gh.gamecenter.qa.comment.base.BaseCommentAdapter diff --git a/app/src/main/java/com/gh/gamecenter/qa/questions/newdetail/NewQuestionDetailViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/questions/newdetail/NewQuestionDetailViewModel.kt index 78b8dfd901..f9e644d855 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/questions/newdetail/NewQuestionDetailViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/questions/newdetail/NewQuestionDetailViewModel.kt @@ -11,15 +11,15 @@ import com.gh.gamecenter.common.syncpage.SyncFieldConstants import com.gh.gamecenter.common.syncpage.SyncPageRepository import com.gh.common.util.* import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.LoadStatus -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.core.utils.ToastUtils import com.gh.gamecenter.common.utils.observableToMain import com.gh.gamecenter.common.utils.singleToMain import com.gh.gamecenter.common.utils.toRequestBody import com.gh.gamecenter.entity.CommentEntity import com.gh.gamecenter.eventbus.EBUserFollow -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.qa.article.detail.CommentItemData import com.gh.gamecenter.qa.comment.base.BaseCommentViewModel import com.gh.gamecenter.qa.entity.QuestionsDetailEntity diff --git a/app/src/main/java/com/gh/gamecenter/qa/questions/newdetail/QuestionDetailContentViewHolder.kt b/app/src/main/java/com/gh/gamecenter/qa/questions/newdetail/QuestionDetailContentViewHolder.kt index 2c1b65e314..3bb3efd2cf 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/questions/newdetail/QuestionDetailContentViewHolder.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/questions/newdetail/QuestionDetailContentViewHolder.kt @@ -21,7 +21,7 @@ import com.gh.gamecenter.common.callback.ConfirmListener import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.ItemArticleDetailContentBinding -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.qa.editor.OnLinkClickListener import com.gh.gamecenter.qa.entity.QuestionsDetailEntity import java.util.* diff --git a/app/src/main/java/com/gh/gamecenter/qa/recommends/AskQuestionsRecommendsAdapter.java b/app/src/main/java/com/gh/gamecenter/qa/recommends/AskQuestionsRecommendsAdapter.java index a6c7d624e1..7b81d97520 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/recommends/AskQuestionsRecommendsAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/qa/recommends/AskQuestionsRecommendsAdapter.java @@ -18,10 +18,10 @@ //import com.gh.gamecenter.R; //import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; //import com.gh.gamecenter.adapter.viewholder.ReuseViewHolder; -//import com.gh.gamecenter.baselist.ListAdapter; +//import com.gh.gamecenter.common.baselist.ListAdapter; //import com.gh.gamecenter.databinding.AskRecommendsItemConcernBinding; //import com.gh.gamecenter.databinding.CommunityAnswerItemBinding; -//import com.gh.gamecenter.manager.UserManager; +//import com.gh.gamecenter.login.user.UserManager; //import com.gh.gamecenter.qa.answer.CommunityAnswerItemViewHolder; //import com.gh.gamecenter.qa.answer.detail.AnswerDetailActivity; //import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity; @@ -110,7 +110,7 @@ // if ("community_article".equals(answer.getType())) { // if (mContext instanceof Activity) { // ((Activity) mContext).startActivityForResult(ArticleDetailActivity.getRecommendsIntent(mContext, -// UserManager.getInstance().getCommunity(), answer.getId(), "", +// CommunityManager.getInstance().getCommunity(), answer.getId(), "", // AskQuestionsRecommendsFragment.QUESTION_RECOMMEND_PATH), // AskQuestionsRecommendsFragment.RECOMMENDS_REQUEST_CODE); // } @@ -129,7 +129,7 @@ // if ("community_article".equals(answer.getType())) { // if (mContext instanceof Activity) { // ((Activity) mContext).startActivityForResult(ArticleDetailActivity.getRecommendsIntent(mContext, -// UserManager.getInstance().getCommunity(), answer.getId(), "", +// CommunityManager.getInstance().getCommunity(), answer.getId(), "", // AskQuestionsRecommendsFragment.QUESTION_RECOMMEND_PATH), // AskQuestionsRecommendsFragment.RECOMMENDS_REQUEST_CODE); // @@ -163,7 +163,7 @@ // } // // concernBind.concernDelete.setOnClickListener(v -> { -// MtaHelper.onEvent("问答页面", UserManager.getInstance().getCommunity().getName(), "推荐关注-关闭"); +// MtaHelper.onEvent("问答页面", CommunityManager.getInstance().getCommunity().getName(), "推荐关注-关闭"); // // RecyclerView.Adapter adapter = concernBind.concernList.getAdapter(); // if (adapter instanceof RecommendConcernAdapter) { diff --git a/app/src/main/java/com/gh/gamecenter/qa/recommends/AskQuestionsRecommendsFragment.java b/app/src/main/java/com/gh/gamecenter/qa/recommends/AskQuestionsRecommendsFragment.java index 3c6409e16f..244f598ab7 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/recommends/AskQuestionsRecommendsFragment.java +++ b/app/src/main/java/com/gh/gamecenter/qa/recommends/AskQuestionsRecommendsFragment.java @@ -1,7 +1,7 @@ //package com.gh.gamecenter.qa.recommends; // //import static com.gh.gamecenter.fragment.MainWrapperFragment.INDEX_BBS; -//import static com.gh.gamecenter.personal.PersonalFragment.LOGIN_TAG; +//import static com.gh.gamecenter.common.constant.Constants.LOGIN_TAG; //import static com.gh.gamecenter.personal.PersonalFragment.LOGOUT_TAG; //import static com.gh.gamecenter.qa.CommunityFragment.COMMUNITIES_SELECT_REQUEST; // @@ -26,15 +26,15 @@ //import com.gh.gamecenter.common.view.SwipeRefreshHeader; //import com.gh.gamecenter.common.view.VerticalItemDecoration; //import com.gh.gamecenter.R; -//import com.gh.gamecenter.baselist.ListFragment; -//import com.gh.gamecenter.baselist.LoadStatus; -//import com.gh.gamecenter.baselist.LoadType; -//import com.gh.gamecenter.eventbus.EBReuse; +//import com.gh.gamecenter.common.baselist.ListFragment; +//import com.gh.gamecenter.common.baselist.LoadStatus; +//import com.gh.gamecenter.common.baselist.LoadType; +//import com.gh.gamecenter.common.eventbus.EBReuse; //import com.gh.gamecenter.eventbus.EBTypeChange; //import com.gh.gamecenter.eventbus.EBUserFollow; //import com.gh.gamecenter.forum.home.CommunityHomeFragment; //import com.gh.gamecenter.fragment.MainWrapperFragment; -//import com.gh.gamecenter.manager.UserManager; +//import com.gh.gamecenter.login.user.UserManager; //import com.gh.gamecenter.qa.BbsType; //import com.gh.gamecenter.qa.CommunityFragment; //import com.gh.gamecenter.qa.entity.AnswerEntity; @@ -90,7 +90,7 @@ // // 当前在屏幕上的 fragment 为 AskQuestionRecommendsFragment 时才弹 toast // if (mParentFragment instanceof MainWrapperFragment // && ((MainWrapperFragment) mParentFragment).getCurrentItem() == INDEX_BBS -// && !TextUtils.isEmpty(UserManager.getInstance().getCommunity().getId())) { +// && !TextUtils.isEmpty(CommunityManager.getInstance().getCommunity().getId())) { // toast("获取失败,请检查网络设置"); // getDumbRefreshLayout().finishRefresh(false); // } else { diff --git a/app/src/main/java/com/gh/gamecenter/qa/recommends/AskQuestionsRecommendsViewModel.java b/app/src/main/java/com/gh/gamecenter/qa/recommends/AskQuestionsRecommendsViewModel.java index 58587944dd..8068222a00 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/recommends/AskQuestionsRecommendsViewModel.java +++ b/app/src/main/java/com/gh/gamecenter/qa/recommends/AskQuestionsRecommendsViewModel.java @@ -15,10 +15,10 @@ //import com.gh.gamecenter.core.utils.UrlFilterUtils; //import com.gh.gamecenter.R; //import com.gh.gamecenter.baselist.BaseListViewModel; -//import com.gh.gamecenter.baselist.LoadStatus; -//import com.gh.gamecenter.baselist.LoadType; -//import com.gh.gamecenter.eventbus.EBReuse; -//import com.gh.gamecenter.manager.UserManager; +//import com.gh.gamecenter.common.baselist.LoadStatus; +//import com.gh.gamecenter.common.baselist.LoadType; +//import com.gh.gamecenter.common.eventbus.EBReuse; +//import com.gh.gamecenter.login.user.UserManager; //import com.gh.gamecenter.qa.entity.AnswerEntity; //import com.gh.gamecenter.qa.entity.SuggestedFollowEntity; //import com.gh.gamecenter.qa.follow.AskFollowFragment; @@ -74,15 +74,15 @@ // } // // private String getFollowBindKey() { -// return "SUGGESTED_FOLLOWS_BIND" + UserManager.getInstance().getCommunity().getId(); +// return "SUGGESTED_FOLLOWS_BIND" + CommunityManager.getInstance().getCommunity().getId(); // } // // private String getDeleteFollowKey() { -// return "SUGGESTED_FOLLOWS_DELETE" + UserManager.getInstance().getCommunity().getId(); +// return "SUGGESTED_FOLLOWS_DELETE" + CommunityManager.getInstance().getCommunity().getId(); // } // // private String getFollowDayKey() { -// return "SUGGESTED_FOLLOWS_DAY_KEY" + UserManager.getInstance().getCommunity().getId(); +// return "SUGGESTED_FOLLOWS_DAY_KEY" + CommunityManager.getInstance().getCommunity().getId(); // } // // private String getCurDayFormat() { @@ -94,7 +94,7 @@ // if (TextUtils.isEmpty(UserManager.getInstance().getToken())) return; // // String showUpdateTime = mPreference.getString(getFollowDayKey(), null); -// String today = getCurDayFormat() + UserManager.getInstance().getCommunity().getId(); +// String today = getCurDayFormat() + CommunityManager.getInstance().getCommunity().getId(); // String deleteTime = mPreference.getString(getDeleteFollowKey(), null); // // boolean isNewData; @@ -107,7 +107,7 @@ // } // // RetrofitManager.getInstance().getApi() -// .getSuggestedFollows(UserManager.getInstance().getCommunity().getId()) +// .getSuggestedFollows(CommunityManager.getInstance().getCommunity().getId()) // .subscribeOn(Schedulers.io()) // .observeOn(AndroidSchedulers.mainThread()) // .subscribe(new Response>() { @@ -265,7 +265,7 @@ // } // mIsLoading = true; // String filter; -// String communityId = UserManager.getInstance().getCommunity().getId(); +// String communityId = CommunityManager.getInstance().getCommunity().getId(); // if (TextUtils.isEmpty(sequenceId)) { // filter = ""; // } else if (isUp) { @@ -367,11 +367,11 @@ // // private void deleteDB() { // mPreference.edit().putBoolean(getCheckIsHasCommunityDataKey(), false).apply(); -// mAnswerDao.deleteData(UserManager.getInstance().getCommunity().getId() + UserManager.getInstance().getUserId()); +// mAnswerDao.deleteData(CommunityManager.getInstance().getCommunity().getId() + UserManager.getInstance().getUserId()); // } // // private void insertDB(List entityList) { -// String communityId = UserManager.getInstance().getCommunity().getId(); +// String communityId = CommunityManager.getInstance().getCommunity().getId(); // String userId = UserManager.getInstance().getUserId(); // long orderTag = System.currentTimeMillis(); // if (!TextUtils.isEmpty(communityId)) { @@ -448,7 +448,7 @@ // mCacheFollowList.clear(); // mLiveData.postValue(null); // 清空数据 // -// String communityId = UserManager.getInstance().getCommunity().getId(); +// String communityId = CommunityManager.getInstance().getCommunity().getId(); // String userId = UserManager.getInstance().getUserId(); // LiveData> dbData = mAnswerDao.getAnswerEntityById(communityId + userId); // mLiveData.addSource(dbData, entityList -> { @@ -511,6 +511,6 @@ // } // // public static String getCheckIsHasCommunityDataKey() { -// return "CheckCommunityDataKey" + UserManager.getInstance().getCommunity().getId() + UserManager.getInstance().getUserId(); +// return "CheckCommunityDataKey" + CommunityManager.getInstance().getCommunity().getId() + UserManager.getInstance().getUserId(); // } //} diff --git a/app/src/main/java/com/gh/gamecenter/qa/recommends/AskRecommendSubjectViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/recommends/AskRecommendSubjectViewModel.kt index 8a3753c6ef..72f29a1618 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/recommends/AskRecommendSubjectViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/recommends/AskRecommendSubjectViewModel.kt @@ -5,8 +5,8 @@ package com.gh.gamecenter.qa.recommends //import androidx.lifecycle.AndroidViewModel //import androidx.lifecycle.MediatorLiveData //import androidx.lifecycle.MutableLiveData -//import com.gh.gamecenter.entity.LinkEntity -//import com.gh.gamecenter.manager.UserManager +//import com.gh.gamecenter.common.entity.LinkEntity +//import com.gh.gamecenter.login.user.UserManager //import com.gh.gamecenter.common.retrofit.BiResponse //import com.gh.gamecenter.retrofit.Response //import com.gh.gamecenter.retrofit.RetrofitManager @@ -24,17 +24,17 @@ package com.gh.gamecenter.qa.recommends // } // // fun loadAskSlideColumn() { -// val communityId = UserManager.getInstance().community.id +// val communityId = CommunityManager.getInstance().community.id // // RetrofitManager.getInstance().api -// .getAskSlide(UserManager.getInstance().community.id) +// .getAskSlide(CommunityManager.getInstance().community.id) // .subscribeOn(Schedulers.io()) // .observeOn(AndroidSchedulers.mainThread()) // .subscribe(object : Response>() { // override fun onResponse(response: List?) { // super.onResponse(response) // -// if (communityId == UserManager.getInstance().community.id) { +// if (communityId == CommunityManager.getInstance().community.id) { // slideLiveData.postValue(response) // } // } @@ -49,7 +49,7 @@ package com.gh.gamecenter.qa.recommends // @SuppressLint("CheckResult") // fun loadRecommendedEntrance() { // RetrofitManager.getInstance().api -// .getCommunityRecommendedEntrances(UserManager.getInstance().community.id) +// .getCommunityRecommendedEntrances(CommunityManager.getInstance().community.id) // .subscribeOn(Schedulers.io()) // .observeOn(AndroidSchedulers.mainThread()) // .subscribe(object : BiResponse>() { diff --git a/app/src/main/java/com/gh/gamecenter/qa/recommends/AskRecommendWrapperFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/recommends/AskRecommendWrapperFragment.kt index 8aedac4c6e..b43479c385 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/recommends/AskRecommendWrapperFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/recommends/AskRecommendWrapperFragment.kt @@ -21,9 +21,9 @@ //import com.gh.gamecenter.common.view.DumbRefreshLayout //import com.gh.gamecenter.common.view.SwipeRefreshHeader //import com.gh.gamecenter.R -//import com.gh.gamecenter.entity.CommunityEntity -//import com.gh.gamecenter.entity.LinkEntity -//import com.gh.gamecenter.manager.UserManager +//import com.gh.gamecenter.common.entity.CommunityEntity +//import com.gh.gamecenter.common.entity.LinkEntity +//import com.gh.gamecenter.login.user.UserManager //import com.gh.gamecenter.qa.CommunityFragment.Companion.COMMUNITIES_SELECT_REQUEST //import com.gh.gamecenter.qa.recommends.newest.RecommendNewestFragment //import com.google.android.material.appbar.AppBarLayout @@ -89,7 +89,7 @@ // override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { // super.onActivityResult(requestCode, resultCode, data) // if (requestCode == COMMUNITIES_SELECT_REQUEST && resultCode == Activity.RESULT_OK) { -// if (CommunityEntity.SORT_TIME == UserManager.getInstance().community.refreshSort) { +// if (CommunityEntity.SORT_TIME == CommunityManager.getInstance().community.refreshSort) { // changeFragment(true) // } else { // changeFragment(false) @@ -126,14 +126,14 @@ // super.onViewCreated(view, savedInstanceState) // setViewPagerHeight() // -// if (CommunityEntity.SORT_TIME == UserManager.getInstance().community.refreshSort) { +// if (CommunityEntity.SORT_TIME == CommunityManager.getInstance().community.refreshSort) { // changeFragment(true) // } else { // changeFragment(false) // } // // mChangeBtn.setOnClickListener { -// MtaHelper.onEvent("问答页面", UserManager.getInstance().community.name, "推荐-切换排序") +// MtaHelper.onEvent("问答页面", CommunityManager.getInstance().community.name, "推荐-切换排序") // showMoreItemDialog() // } // @@ -187,14 +187,14 @@ // timeSelect.visibility = View.INVISIBLE // popupWindow.dismiss() // changeFragment(false) -// MtaHelper.onEvent("问答页面", UserManager.getInstance().community.name, "推荐-按精选排序") +// MtaHelper.onEvent("问答页面", CommunityManager.getInstance().community.name, "推荐-按精选排序") // } // itemTime.setOnClickListener { // recommendSelect.visibility = View.INVISIBLE // timeSelect.visibility = View.VISIBLE // popupWindow.dismiss() // changeFragment(true) -// MtaHelper.onEvent("问答页面", UserManager.getInstance().community.name, "推荐-按时间排序") +// MtaHelper.onEvent("问答页面", CommunityManager.getInstance().community.name, "推荐-按时间排序") // } // // val recommendFragmentIsVisible = mRecommendsFragment != null && mRecommendsFragment!!.isVisible @@ -233,7 +233,7 @@ // ImageUtils.display(entranceViewIv, link.image) // // entranceViewItem.setOnClickListener { -// MtaHelper.onEvent("社区推荐入口", UserManager.getInstance().community.name, link.name) +// MtaHelper.onEvent("社区推荐入口", CommunityManager.getInstance().community.name, link.name) // DirectUtils.directToLinkPage(entranceViewTv.context, link, "", "推荐入口") // } // diff --git a/app/src/main/java/com/gh/gamecenter/qa/recommends/AskRecommendsSubjectPageAdapter.java b/app/src/main/java/com/gh/gamecenter/qa/recommends/AskRecommendsSubjectPageAdapter.java index e957557f3e..0a8df5b9d2 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/recommends/AskRecommendsSubjectPageAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/qa/recommends/AskRecommendsSubjectPageAdapter.java @@ -13,8 +13,8 @@ //import com.gh.gamecenter.R; //import com.gh.gamecenter.adapter.RecyclingPagerAdapter; //import com.gh.gamecenter.databinding.AskRecommendsSubjectItemBinding; -//import com.gh.gamecenter.entity.LinkEntity; -//import com.gh.gamecenter.manager.UserManager; +//import com.gh.gamecenter.common.entity.LinkEntity; +//import com.gh.gamecenter.login.user.UserManager; // //import java.util.List; // @@ -51,7 +51,7 @@ // LinkEntity entity = mEntityList.get(position % mEntityList.size()); // ImageUtils.display(binding.subjectIcon, entity.getImage()); // binding.getRoot().setOnClickListener(v -> { -// MtaHelper.onEvent("社区轮播图", UserManager.getInstance().getCommunity().getName(), String.valueOf(position + 1)); +// MtaHelper.onEvent("社区轮播图", CommunityManager.getInstance().getCommunity().getName(), String.valueOf(position + 1)); // DirectUtils.directToLinkPage(mContext, entity, "", "轮播图"); // }); // diff --git a/app/src/main/java/com/gh/gamecenter/qa/recommends/RecommendConcernAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/recommends/RecommendConcernAdapter.kt index 16a1467d2f..7f7654e92c 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/recommends/RecommendConcernAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/recommends/RecommendConcernAdapter.kt @@ -8,7 +8,7 @@ //import com.gh.gamecenter.common.utils.toColor //import com.gh.gamecenter.R //import com.gh.gamecenter.databinding.AskRecommendsConcernListItemBinding -//import com.gh.gamecenter.manager.UserManager +//import com.gh.gamecenter.login.user.UserManager //import com.gh.gamecenter.qa.entity.SuggestedFollowEntity //import com.lightgame.adapter.BaseRecyclerAdapter // @@ -38,7 +38,7 @@ // v.setTextColor(R.color.theme_font.toColor()) // v.text = "关注" // v.setOnClickListener { -// MtaHelper.onEvent("问答页面", UserManager.getInstance().community.name, "推荐关注-关注") +// MtaHelper.onEvent("问答页面", CommunityManager.getInstance().community.name, "推荐关注-关注") // listViewModel.followUser(entity.id, object : OnFollowCallback { // override fun onFollowSuccess() { // isFollowed = true diff --git a/app/src/main/java/com/gh/gamecenter/qa/recommends/newest/RecommendNewestAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/recommends/newest/RecommendNewestAdapter.kt index 8b2a8fccfb..95987c5bca 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/recommends/newest/RecommendNewestAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/recommends/newest/RecommendNewestAdapter.kt @@ -8,9 +8,9 @@ //import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler //import com.gh.gamecenter.R //import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -//import com.gh.gamecenter.baselist.ListAdapter +//import com.gh.gamecenter.common.baselist.ListAdapter //import com.gh.gamecenter.databinding.CommunityAnswerItemBinding -//import com.gh.gamecenter.manager.UserManager +//import com.gh.gamecenter.login.user.UserManager //import com.gh.gamecenter.qa.answer.CommunityAnswerItemViewHolder //import com.gh.gamecenter.qa.answer.detail.SimpleAnswerDetailActivity //import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity @@ -62,7 +62,7 @@ // answerViewHolder.bindAnswerItem(answer, "", getPath()) // binding.title.setOnClickListener { // if ("community_article" == answer.type) { -// mContext.startActivity(ArticleDetailActivity.getIntent(mContext, UserManager.getInstance().community, answer.id!!, "", getPath())) +// mContext.startActivity(ArticleDetailActivity.getIntent(mContext, CommunityManager.getInstance().community, answer.id!!, "", getPath())) // } else { // val questions = answer.questions // mContext.startActivity(NewQuestionDetailActivity.getIntent(mContext, questions.id, "", getPath())) @@ -71,7 +71,7 @@ // // answerViewHolder.itemView.setOnClickListener { // if ("community_article" == answer.type) { -// mContext.startActivity(ArticleDetailActivity.getIntent(mContext, UserManager.getInstance().community, answer.id!!, "", getPath())) +// mContext.startActivity(ArticleDetailActivity.getIntent(mContext, CommunityManager.getInstance().community, answer.id!!, "", getPath())) // } else { // mContext.startActivity(SimpleAnswerDetailActivity.getIntent(mContext, answer.id // ?: "", "", getPath())) diff --git a/app/src/main/java/com/gh/gamecenter/qa/recommends/newest/RecommendNewestFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/recommends/newest/RecommendNewestFragment.kt index d1e50dcf47..2b7af7791e 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/recommends/newest/RecommendNewestFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/recommends/newest/RecommendNewestFragment.kt @@ -8,13 +8,13 @@ //import androidx.recyclerview.widget.RecyclerView //import com.gh.gamecenter.common.view.DumbRefreshLayout //import com.gh.gamecenter.common.view.VerticalItemDecoration -//import com.gh.gamecenter.baselist.ListFragment -//import com.gh.gamecenter.baselist.LoadStatus -//import com.gh.gamecenter.baselist.LoadType -//import com.gh.gamecenter.baselist.NormalListViewModel +//import com.gh.gamecenter.common.baselist.ListFragment +//import com.gh.gamecenter.common.baselist.LoadStatus +//import com.gh.gamecenter.common.baselist.LoadType +//import com.gh.gamecenter.common.baselist.NormalListViewModel //import com.gh.gamecenter.eventbus.EBTypeChange //import com.gh.gamecenter.forum.home.CommunityHomeFragment -//import com.gh.gamecenter.manager.UserManager +//import com.gh.gamecenter.login.user.UserManager //import com.gh.gamecenter.qa.CommunityFragment //import com.gh.gamecenter.qa.CommunityFragment.Companion.COMMUNITIES_SELECT_REQUEST //import com.gh.gamecenter.qa.entity.AnswerEntity @@ -40,7 +40,7 @@ // } // // override fun provideDataObservable(page: Int): Observable> { -// return RetrofitManager.getInstance().api.getCommunitiesRecommendNewest(UserManager.getInstance().community.id, page) +// return RetrofitManager.getInstance().api.getCommunitiesRecommendNewest(CommunityManager.getInstance().community.id, page) // } // // override fun provideListViewModel(): NormalListViewModel { diff --git a/app/src/main/java/com/gh/gamecenter/qa/search/AskSearchActivity.java b/app/src/main/java/com/gh/gamecenter/qa/search/AskSearchActivity.java index 991fecdf8d..86f9136424 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/search/AskSearchActivity.java +++ b/app/src/main/java/com/gh/gamecenter/qa/search/AskSearchActivity.java @@ -30,7 +30,7 @@ //import com.gh.gamecenter.R; //import com.gh.gamecenter.db.AskSearchHistoryDao; //import com.gh.gamecenter.eventbus.EBSearch; -//import com.gh.gamecenter.manager.UserManager; +//import com.gh.gamecenter.login.user.UserManager; //import com.gh.gamecenter.qa.questions.edit.QuestionEditActivity; //import com.gh.gamecenter.qa.search.history.HistoryFragment; //import com.gh.gamecenter.retrofit.Response; @@ -147,7 +147,7 @@ // if (actionId == EditorInfo.IME_ACTION_SEARCH) { // Util_System_Keyboard.hideSoftKeyboard(this, mSearchEt); // search(); -// mDao.add(mSearchKey, UserManager.getInstance().getCommunity().getId()); +// mDao.add(mSearchKey, CommunityManager.getInstance().getCommunity().getId()); // } // return false; // }); @@ -205,15 +205,15 @@ // if (!TextUtils.isEmpty(mDefaultSearchKey)) { // mSearchEt.setText(mDefaultSearchKey); // mSearchEt.setSelection(mSearchEt.getText().length()); -// mDao.add(mDefaultSearchKey, UserManager.getInstance().getCommunity().getId()); +// mDao.add(mDefaultSearchKey, CommunityManager.getInstance().getCommunity().getId()); // Util_System_Keyboard.hideSoftKeyboard(this, mSearchEt); // -// MtaHelper.onEvent("社区搜索", "默认搜索", UserManager.getInstance().getCommunity().getName() + "-" + mDefaultSearchKey); +// MtaHelper.onEvent("社区搜索", "默认搜索", CommunityManager.getInstance().getCommunity().getName() + "-" + mDefaultSearchKey); // } // } else { // Util_System_Keyboard.hideSoftKeyboard(this, mSearchEt); -// mDao.add(mSearchKey, UserManager.getInstance().getCommunity().getId()); -// MtaHelper.onEvent("社区搜索", "主动搜索", UserManager.getInstance().getCommunity().getName() + "-" + mSearchKey); +// mDao.add(mSearchKey, CommunityManager.getInstance().getCommunity().getId()); +// MtaHelper.onEvent("社区搜索", "主动搜索", CommunityManager.getInstance().getCommunity().getName() + "-" + mSearchKey); // } // } else if (v.getId() == R.id.bar_back) { // onBackPressed(); @@ -224,7 +224,7 @@ // RetrofitManager // .getInstance() // .getApi() -// .getCommunityDefaultSearch(UserManager.getInstance().getCommunity().getId()) +// .getCommunityDefaultSearch(CommunityManager.getInstance().getCommunity().getId()) // .subscribeOn(Schedulers.io()) // .observeOn(AndroidSchedulers.mainThread()) // .subscribe(new Response() { diff --git a/app/src/main/java/com/gh/gamecenter/qa/search/artilce/ArticleAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/search/artilce/ArticleAdapter.kt index 5d3f0f92a6..b2b0f19c13 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/search/artilce/ArticleAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/search/artilce/ArticleAdapter.kt @@ -8,7 +8,7 @@ //import com.gh.gamecenter.common.utils.ImageUtils //import com.gh.gamecenter.core.utils.NumberUtils //import com.gh.gamecenter.R -//import com.gh.gamecenter.baselist.NormalListViewModel +//import com.gh.gamecenter.common.baselist.NormalListViewModel //import com.gh.gamecenter.qa.entity.ArticleEntity //import com.gh.gamecenter.qa.search.AskSearchNormalItemViewHolder //import com.gh.gamecenter.qa.search.base.BaseAskSearchAdapter diff --git a/app/src/main/java/com/gh/gamecenter/qa/search/artilce/ArticleFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/search/artilce/ArticleFragment.kt index a1291b304c..4f0f17f0e5 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/search/artilce/ArticleFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/search/artilce/ArticleFragment.kt @@ -4,8 +4,8 @@ //import android.text.TextUtils //import com.gh.common.util.EntranceUtils //import com.gh.gamecenter.core.utils.UrlFilterUtils -//import com.gh.gamecenter.baselist.NormalListViewModel -//import com.gh.gamecenter.manager.UserManager +//import com.gh.gamecenter.common.baselist.NormalListViewModel +//import com.gh.gamecenter.login.user.UserManager //import com.gh.gamecenter.qa.entity.ArticleEntity //import com.gh.gamecenter.qa.search.base.BaseAskSearchFragment //import com.gh.gamecenter.retrofit.RetrofitManager @@ -41,12 +41,12 @@ // val api = RetrofitManager.getInstance().api // return if (TextUtils.isEmpty(mSearchKey)) null // else if (!questionTag.isNullOrEmpty()) { -// api.getAskSearchArticle(UserManager.getInstance().community.id, mSearchKey, +// api.getAskSearchArticle(CommunityManager.getInstance().community.id, mSearchKey, // UrlFilterUtils.getFilterQuery("question_tag", questionTag, "type", "community_article"), "community_article_vote:-1", page) // } else if (!columnId.isNullOrEmpty()) { -// api.getAskSearchArticle(UserManager.getInstance().community.id, mSearchKey, +// api.getAskSearchArticle(CommunityManager.getInstance().community.id, mSearchKey, // UrlFilterUtils.getFilterQuery("column_id", columnId, "type", "community_article"), "community_article_vote:-1", page) -// } else api.getAskSearchArticle(UserManager.getInstance().community.id, mSearchKey, +// } else api.getAskSearchArticle(CommunityManager.getInstance().community.id, mSearchKey, // UrlFilterUtils.getFilterQuery("type", "community_article"), "community_article_vote:-1", page) // } //} \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/qa/search/base/BaseAskSearchAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/search/base/BaseAskSearchAdapter.kt index e9154c9d1c..5e79904a32 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/search/base/BaseAskSearchAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/search/base/BaseAskSearchAdapter.kt @@ -9,10 +9,10 @@ //import com.gh.common.util.DirectUtils //import com.gh.gamecenter.R //import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -//import com.gh.gamecenter.baselist.ListAdapter -//import com.gh.gamecenter.baselist.ListViewModel +//import com.gh.gamecenter.common.baselist.ListAdapter +//import com.gh.gamecenter.common.baselist.ListViewModel //import com.gh.gamecenter.db.AskSearchHistoryDao -//import com.gh.gamecenter.manager.UserManager +//import com.gh.gamecenter.login.user.UserManager //import com.gh.gamecenter.qa.answer.detail.SimpleAnswerDetailActivity //import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity //import com.gh.gamecenter.qa.column.detail.AskColumnDetailActivity @@ -109,7 +109,7 @@ // // protected fun skipArticleDetail(id: String) { // mContext.startActivity(ArticleDetailActivity.getIntent(mContext, -// UserManager.getInstance().community, id, mEntrance, mPath)) +// CommunityManager.getInstance().community, id, mEntrance, mPath)) // postSearchLogAndSearchHistory() // } // @@ -120,13 +120,13 @@ // // protected fun skipColumn(id: String) { //// mContext.startActivity(CommunitySubjectActivity.getIntent(mContext, -//// UserManager.getInstance().community, id, mEntrance, mPath)) +//// CommunityManager.getInstance().community, id, mEntrance, mPath)) //// postSearchLogAndSearchHistory() // } // // protected fun skipSpecialColumn(id: String) { // mContext.startActivity(AskColumnDetailActivity.getIntentByColumnId(mContext, -// id, UserManager.getInstance().community, mEntrance, mPath)) +// id, CommunityManager.getInstance().community, mEntrance, mPath)) // postSearchLogAndSearchHistory() // } // @@ -134,7 +134,7 @@ // if (mContext is AskSearchActivity) { // (mContext as AskSearchActivity).postLog(false) // } -// mDao.add(mSearchKey, UserManager.getInstance().community.id) +// mDao.add(mSearchKey, CommunityManager.getInstance().community.id) // } // //} diff --git a/app/src/main/java/com/gh/gamecenter/qa/search/base/BaseAskSearchFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/search/base/BaseAskSearchFragment.kt index 57d53cf8cd..4cadb6a41a 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/search/base/BaseAskSearchFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/search/base/BaseAskSearchFragment.kt @@ -5,9 +5,9 @@ //import android.view.View //import com.gh.common.util.EntranceUtils //import com.gh.gamecenter.baselist.BaseListViewModel -//import com.gh.gamecenter.baselist.ListAdapter -//import com.gh.gamecenter.baselist.ListFragment -//import com.gh.gamecenter.baselist.LoadType +//import com.gh.gamecenter.common.baselist.ListAdapter +//import com.gh.gamecenter.common.baselist.ListFragment +//import com.gh.gamecenter.common.baselist.LoadType // //abstract class BaseAskSearchFragment> : ListFragment() { // diff --git a/app/src/main/java/com/gh/gamecenter/qa/search/history/HistoryFragmentAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/search/history/HistoryFragmentAdapter.kt index a5104736b1..452e842c14 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/search/history/HistoryFragmentAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/search/history/HistoryFragmentAdapter.kt @@ -8,7 +8,7 @@ //import com.gh.gamecenter.databinding.CommunitySearchHistoryItemBinding //import com.gh.gamecenter.db.AskSearchHistoryDao //import com.gh.gamecenter.eventbus.EBSearch -//import com.gh.gamecenter.manager.UserManager +//import com.gh.gamecenter.login.user.UserManager //import com.gh.gamecenter.qa.search.AskSearchActivity //import com.lightgame.adapter.BaseRecyclerAdapter //import com.lightgame.utils.Util_System_Keyboard @@ -19,7 +19,7 @@ // // private val mDao: AskSearchHistoryDao = dao // -// private val mHistoryList: MutableList = dao.getAll(UserManager.getInstance().community.id) +// private val mHistoryList: MutableList = dao.getAll(CommunityManager.getInstance().community.id) // // init { // if (mHistoryList.isEmpty()) { @@ -41,11 +41,11 @@ // val key = mHistoryList[position] // holder.binding.key = key // holder.itemView.setOnClickListener { v -> -// mDao.add(key, UserManager.getInstance().community.id) +// mDao.add(key, CommunityManager.getInstance().community.id) // EventBus.getDefault().post(EBSearch(AskSearchActivity.ASK_SEARCH_EB_TYPE, key)) // Util_System_Keyboard.hideSoftKeyboardByIBinder(mContext, v.windowToken) // -// MtaHelper.onEvent("社区搜索", "历史搜索", UserManager.getInstance().community.name + "-" + key) +// MtaHelper.onEvent("社区搜索", "历史搜索", CommunityManager.getInstance().community.name + "-" + key) // } // } // diff --git a/app/src/main/java/com/gh/gamecenter/qa/search/history/HistoryViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/search/history/HistoryViewModel.kt index 20e2d064c1..2a3bc406a6 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/search/history/HistoryViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/search/history/HistoryViewModel.kt @@ -3,7 +3,7 @@ //import android.app.Application //import androidx.lifecycle.AndroidViewModel //import androidx.lifecycle.MutableLiveData -//import com.gh.gamecenter.manager.UserManager +//import com.gh.gamecenter.login.user.UserManager //import com.gh.gamecenter.qa.entity.CommunityHotSearch //import com.gh.gamecenter.retrofit.Response //import com.gh.gamecenter.retrofit.RetrofitManager @@ -16,7 +16,7 @@ // // fun getHotSearch() { // RetrofitManager.getInstance().api -// .getCommunityHotSearch(UserManager.getInstance().community.id) +// .getCommunityHotSearch(CommunityManager.getInstance().community.id) // .subscribeOn(Schedulers.io()) // .observeOn(AndroidSchedulers.mainThread()) // .subscribe(object : Response>() { diff --git a/app/src/main/java/com/gh/gamecenter/qa/search/history/HotFragmentAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/search/history/HotFragmentAdapter.kt index 64023749b1..0c29565e10 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/search/history/HotFragmentAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/search/history/HotFragmentAdapter.kt @@ -8,7 +8,7 @@ //import com.gh.gamecenter.databinding.CommunitySearchHotItemBinding //import com.gh.gamecenter.db.AskSearchHistoryDao //import com.gh.gamecenter.eventbus.EBSearch -//import com.gh.gamecenter.manager.UserManager +//import com.gh.gamecenter.login.user.UserManager //import com.gh.gamecenter.qa.entity.CommunityHotSearch //import com.gh.gamecenter.qa.search.AskSearchActivity //import com.lightgame.adapter.BaseRecyclerAdapter @@ -35,11 +35,11 @@ // holder.binding.setPosition(position + 1) // holder.binding.data = data // holder.itemView.setOnClickListener { v -> -// mDao.add(data.keyword, UserManager.getInstance().community.id) +// mDao.add(data.keyword, CommunityManager.getInstance().community.id) // EventBus.getDefault().post(EBSearch(AskSearchActivity.ASK_SEARCH_EB_TYPE, data.keyword)) // Util_System_Keyboard.hideSoftKeyboardByIBinder(mContext, v.windowToken) // -// MtaHelper.onEvent("社区搜索", "热门搜索", UserManager.getInstance().community.name + "-" + data.keyword) +// MtaHelper.onEvent("社区搜索", "热门搜索", CommunityManager.getInstance().community.name + "-" + data.keyword) // } // } // diff --git a/app/src/main/java/com/gh/gamecenter/qa/search/hottest/HottestAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/search/hottest/HottestAdapter.kt index 7f2a311bf9..98e092feac 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/search/hottest/HottestAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/search/hottest/HottestAdapter.kt @@ -13,7 +13,7 @@ //import com.gh.gamecenter.common.utils.ImageUtils //import com.gh.gamecenter.core.utils.NumberUtils //import com.gh.gamecenter.R -//import com.gh.gamecenter.baselist.NormalListViewModel +//import com.gh.gamecenter.common.baselist.NormalListViewModel //import com.gh.gamecenter.databinding.AskSearchQuestionItemBinding //import com.gh.gamecenter.databinding.CommunitySearchColummItemBinding //import com.gh.gamecenter.databinding.CommunitySearchSpecialColummItemBinding diff --git a/app/src/main/java/com/gh/gamecenter/qa/search/hottest/HottestFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/search/hottest/HottestFragment.kt index 3017fe0729..08c0f53453 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/search/hottest/HottestFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/search/hottest/HottestFragment.kt @@ -3,8 +3,8 @@ //import android.text.TextUtils //import androidx.lifecycle.ViewModelProviders //import com.gh.gamecenter.core.utils.UrlFilterUtils -//import com.gh.gamecenter.baselist.NormalListViewModel -//import com.gh.gamecenter.manager.UserManager +//import com.gh.gamecenter.common.baselist.NormalListViewModel +//import com.gh.gamecenter.login.user.UserManager //import com.gh.gamecenter.qa.entity.SearchHottestEntity //import com.gh.gamecenter.qa.search.base.BaseAskSearchFragment //import com.gh.gamecenter.retrofit.RetrofitManager @@ -38,13 +38,13 @@ // val api = RetrofitManager.getInstance().api // return if (TextUtils.isEmpty(mSearchKey)) null // else if (!questionTag.isNullOrEmpty()) { -// api.getAskSearch(UserManager.getInstance().community.id, mSearchKey, +// api.getAskSearch(CommunityManager.getInstance().community.id, mSearchKey, // UrlFilterUtils.getFilterQuery("question_tag", questionTag), "answer_vote:-1", page) // } else if (!columnId.isNullOrEmpty()) { -// api.getAskSearch(UserManager.getInstance().community.id, mSearchKey, +// api.getAskSearch(CommunityManager.getInstance().community.id, mSearchKey, // UrlFilterUtils.getFilterQuery("column_id", columnId), "answer_vote:-1", page) // } else { -// api.getAskSearch(UserManager.getInstance().community.id, mSearchKey, +// api.getAskSearch(CommunityManager.getInstance().community.id, mSearchKey, // UrlFilterUtils.getFilterQuery("", ""), "answer_vote:-1", page) // } // } diff --git a/app/src/main/java/com/gh/gamecenter/qa/search/newest/NewestAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/search/newest/NewestAdapter.kt index 05997b880a..b526b41531 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/search/newest/NewestAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/search/newest/NewestAdapter.kt @@ -9,7 +9,7 @@ //import com.gh.gamecenter.common.utils.ImageUtils //import com.gh.gamecenter.core.utils.NumberUtils //import com.gh.gamecenter.R -//import com.gh.gamecenter.baselist.NormalListViewModel +//import com.gh.gamecenter.common.baselist.NormalListViewModel //import com.gh.gamecenter.qa.entity.SearchNewestEntity //import com.gh.gamecenter.qa.search.AskSearchNormalItemViewHolder //import com.gh.gamecenter.qa.search.base.BaseAskSearchAdapter diff --git a/app/src/main/java/com/gh/gamecenter/qa/search/newest/NewestFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/search/newest/NewestFragment.kt index 0d2da831c6..354c9ae8b7 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/search/newest/NewestFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/search/newest/NewestFragment.kt @@ -3,8 +3,8 @@ //import android.text.TextUtils //import androidx.lifecycle.ViewModelProviders //import com.gh.gamecenter.core.utils.UrlFilterUtils -//import com.gh.gamecenter.baselist.NormalListViewModel -//import com.gh.gamecenter.manager.UserManager +//import com.gh.gamecenter.common.baselist.NormalListViewModel +//import com.gh.gamecenter.login.user.UserManager //import com.gh.gamecenter.qa.entity.SearchNewestEntity //import com.gh.gamecenter.qa.search.base.BaseAskSearchFragment //import com.gh.gamecenter.retrofit.RetrofitManager @@ -38,12 +38,12 @@ // val api = RetrofitManager.getInstance().api // return if (TextUtils.isEmpty(mSearchKey)) null // else if (!questionTag.isNullOrEmpty()) { -// api.getAskSearchNewest(UserManager.getInstance().community.id, mSearchKey, +// api.getAskSearchNewest(CommunityManager.getInstance().community.id, mSearchKey, // UrlFilterUtils.getFilterQuery("question_tag", questionTag), "answer_time:-1", page) // } else if (!columnId.isNullOrEmpty()) { -// api.getAskSearchNewest(UserManager.getInstance().community.id, mSearchKey, +// api.getAskSearchNewest(CommunityManager.getInstance().community.id, mSearchKey, // UrlFilterUtils.getFilterQuery("column_id", columnId), "answer_time:-1", page) -// } else api.getAskSearchNewest(UserManager.getInstance().community.id, mSearchKey, +// } else api.getAskSearchNewest(CommunityManager.getInstance().community.id, mSearchKey, // UrlFilterUtils.getFilterQuery("", ""), "answer_time:-1", page) // } //} diff --git a/app/src/main/java/com/gh/gamecenter/qa/search/question/QuestionAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/search/question/QuestionAdapter.kt index 6d305ad30d..718af3d8f2 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/search/question/QuestionAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/search/question/QuestionAdapter.kt @@ -6,7 +6,7 @@ //import androidx.recyclerview.widget.RecyclerView //import com.gh.gamecenter.core.utils.NumberUtils //import com.gh.gamecenter.R -//import com.gh.gamecenter.baselist.NormalListViewModel +//import com.gh.gamecenter.common.baselist.NormalListViewModel //import com.gh.gamecenter.databinding.AskSearchQuestionItemBinding //import com.gh.gamecenter.qa.entity.Questions //import com.gh.gamecenter.qa.search.AskSearchQuestionItemViewHolder diff --git a/app/src/main/java/com/gh/gamecenter/qa/search/question/QuestionFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/search/question/QuestionFragment.kt index 2c8d39b086..f3c593c22f 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/search/question/QuestionFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/search/question/QuestionFragment.kt @@ -3,8 +3,8 @@ //import android.text.TextUtils //import androidx.lifecycle.ViewModelProviders //import com.gh.gamecenter.core.utils.UrlFilterUtils -//import com.gh.gamecenter.baselist.NormalListViewModel -//import com.gh.gamecenter.manager.UserManager +//import com.gh.gamecenter.common.baselist.NormalListViewModel +//import com.gh.gamecenter.login.user.UserManager //import com.gh.gamecenter.qa.entity.Questions //import com.gh.gamecenter.qa.search.base.BaseAskSearchFragment //import com.gh.gamecenter.retrofit.RetrofitManager @@ -38,13 +38,13 @@ // val api = RetrofitManager.getInstance().api // return if (TextUtils.isEmpty(mSearchKey)) null // else if (!questionTag.isNullOrEmpty()) { -// api.getAskSearchQuestion(UserManager.getInstance().community.id, mSearchKey, +// api.getAskSearchQuestion(CommunityManager.getInstance().community.id, mSearchKey, // UrlFilterUtils.getFilterQuery("question_tag", questionTag, "type", "question"), "question_time:-1", page) // } else if (!columnId.isNullOrEmpty()) { -// api.getAskSearchQuestion(UserManager.getInstance().community.id, mSearchKey, +// api.getAskSearchQuestion(CommunityManager.getInstance().community.id, mSearchKey, // UrlFilterUtils.getFilterQuery("column_id", columnId, "type", "question"), "question_time:-1", page) // } else -// api.getAskSearchQuestion(UserManager.getInstance().community.id, mSearchKey, +// api.getAskSearchQuestion(CommunityManager.getInstance().community.id, mSearchKey, // UrlFilterUtils.getFilterQuery("type", "question"), "question_time:-1", page) // } // diff --git a/app/src/main/java/com/gh/gamecenter/qa/search/user/UserAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/search/user/UserAdapter.kt index 9fe2a920d3..d3170d350f 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/search/user/UserAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/search/user/UserAdapter.kt @@ -8,7 +8,7 @@ //import com.gh.gamecenter.R //import com.gh.gamecenter.databinding.FollowersOrFansItemBinding //import com.gh.gamecenter.entity.FollowersOrFansEntity -//import com.gh.gamecenter.manager.UserManager +//import com.gh.gamecenter.login.user.UserManager //import com.gh.gamecenter.personalhome.FollowersOrFansViewHolder //import com.gh.gamecenter.qa.search.base.BaseAskSearchAdapter // diff --git a/app/src/main/java/com/gh/gamecenter/qa/search/user/UserFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/search/user/UserFragment.kt index 7c172d4c11..cb70bcd81f 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/search/user/UserFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/search/user/UserFragment.kt @@ -6,7 +6,7 @@ //import androidx.lifecycle.ViewModelProviders //import com.gh.gamecenter.core.utils.UrlFilterUtils //import com.gh.gamecenter.entity.FollowersOrFansEntity -//import com.gh.gamecenter.manager.UserManager +//import com.gh.gamecenter.login.user.UserManager //import com.gh.gamecenter.qa.search.base.BaseAskSearchFragment //import com.gh.gamecenter.retrofit.RetrofitManager //import com.halo.assistant.HaloApp @@ -49,13 +49,13 @@ // val api = RetrofitManager.getInstance().api // return if (TextUtils.isEmpty(mSearchKey)) null // else if (!questionTag.isNullOrEmpty()) { -// api.getAskSearchUser(UserManager.getInstance().community.id, mSearchKey, +// api.getAskSearchUser(CommunityManager.getInstance().community.id, mSearchKey, // UrlFilterUtils.getFilterQuery("question_tag", questionTag, "type", "user"), page) // } else if (!columnId.isNullOrEmpty()) { -// api.getAskSearchUser(UserManager.getInstance().community.id, mSearchKey, +// api.getAskSearchUser(CommunityManager.getInstance().community.id, mSearchKey, // UrlFilterUtils.getFilterQuery("column_id", columnId, "type", "user"), page) // } else -// api.getAskSearchUser(UserManager.getInstance().community.id, mSearchKey, +// api.getAskSearchUser(CommunityManager.getInstance().community.id, mSearchKey, // UrlFilterUtils.getFilterQuery("type", "user"), page) // } // diff --git a/app/src/main/java/com/gh/gamecenter/qa/search/user/UserViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/search/user/UserViewModel.kt index ec225e681f..75531d0bbc 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/search/user/UserViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/search/user/UserViewModel.kt @@ -5,7 +5,7 @@ //import androidx.lifecycle.ViewModel //import androidx.lifecycle.ViewModelProvider //import com.gh.gamecenter.R -//import com.gh.gamecenter.baselist.ListViewModel +//import com.gh.gamecenter.common.baselist.ListViewModel //import com.gh.gamecenter.baselist.OnDataObservable //import com.gh.gamecenter.entity.FollowersOrFansEntity //import com.gh.gamecenter.eventbus.EBUserFollow diff --git a/app/src/main/java/com/gh/gamecenter/qa/subject/AskSubjectAdapter.java b/app/src/main/java/com/gh/gamecenter/qa/subject/AskSubjectAdapter.java index 9dc0435696..6f3196f21e 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/subject/AskSubjectAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/qa/subject/AskSubjectAdapter.java @@ -8,14 +8,14 @@ import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.RecyclerView; import com.gh.gamecenter.R; import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; -import com.gh.gamecenter.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.ListAdapter; import com.gh.gamecenter.common.callback.OnListClickListener; import com.gh.gamecenter.common.constant.ItemViewType; import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler; import com.gh.gamecenter.common.utils.ImageUtils; import com.gh.gamecenter.databinding.AskSubjectTopItemBinding; import com.gh.gamecenter.databinding.CommunityAnswerItemBinding; -import com.gh.gamecenter.entity.CommunityEntity; +import com.gh.gamecenter.common.entity.CommunityEntity; import com.gh.gamecenter.qa.answer.CommunityAnswerItemViewHolder; import com.gh.gamecenter.qa.answer.detail.SimpleAnswerDetailActivity; import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity; diff --git a/app/src/main/java/com/gh/gamecenter/qa/subject/AskSubjectFragment.java b/app/src/main/java/com/gh/gamecenter/qa/subject/AskSubjectFragment.java index 8abf7428dd..975d33dd8a 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/subject/AskSubjectFragment.java +++ b/app/src/main/java/com/gh/gamecenter/qa/subject/AskSubjectFragment.java @@ -7,16 +7,15 @@ import android.widget.TextView; import androidx.annotation.Nullable; import androidx.recyclerview.widget.RecyclerView; -import com.gh.common.util.DataUtils; import com.gh.gamecenter.R; -import com.gh.gamecenter.baselist.ListAdapter; -import com.gh.gamecenter.baselist.ListFragment; -import com.gh.gamecenter.baselist.LoadType; +import com.gh.gamecenter.common.baselist.ListAdapter; +import com.gh.gamecenter.common.baselist.ListFragment; +import com.gh.gamecenter.common.baselist.LoadType; import com.gh.gamecenter.common.constant.EntranceConsts; import com.gh.gamecenter.common.view.VerticalItemDecoration; import com.gh.gamecenter.core.utils.DisplayUtils; import com.gh.gamecenter.core.utils.TimeElapsedHelper; -import com.gh.gamecenter.mvvm.Status; +import com.gh.gamecenter.common.mvvm.Status; import com.gh.gamecenter.qa.entity.AnswerEntity; /** diff --git a/app/src/main/java/com/gh/gamecenter/qa/subject/AskSubjectViewModel.java b/app/src/main/java/com/gh/gamecenter/qa/subject/AskSubjectViewModel.java index d0867c7a0e..cfb1bdd232 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/subject/AskSubjectViewModel.java +++ b/app/src/main/java/com/gh/gamecenter/qa/subject/AskSubjectViewModel.java @@ -6,11 +6,11 @@ import androidx.annotation.NonNull; import androidx.lifecycle.MediatorLiveData; import androidx.lifecycle.MutableLiveData; -import com.gh.gamecenter.baselist.ListHeadViewModel; -import com.gh.gamecenter.baselist.LoadType; -import com.gh.gamecenter.entity.CommunityEntity; -import com.gh.gamecenter.mvvm.Resource; -import com.gh.gamecenter.mvvm.Status; +import com.gh.gamecenter.common.baselist.ListHeadViewModel; +import com.gh.gamecenter.common.baselist.LoadType; +import com.gh.gamecenter.common.entity.CommunityEntity; +import com.gh.gamecenter.common.mvvm.Resource; +import com.gh.gamecenter.common.mvvm.Status; import com.gh.gamecenter.qa.entity.AnswerEntity; import com.gh.gamecenter.qa.entity.AskSubjectEntity; import com.gh.gamecenter.retrofit.RetrofitManager; @@ -42,7 +42,7 @@ public class AskSubjectViewModel extends ListHeadViewModel provideHeadDataObservable() { - return mApi.getAskSubjectData(communityData.getId(), columnId); + return RetrofitManager.getInstance().getApi().getAskSubjectData(communityData.getId(), columnId); } @Override diff --git a/app/src/main/java/com/gh/gamecenter/qa/subject/CommunitySubjectActivity.java b/app/src/main/java/com/gh/gamecenter/qa/subject/CommunitySubjectActivity.java index 83f017c8c2..9e3b317b35 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/subject/CommunitySubjectActivity.java +++ b/app/src/main/java/com/gh/gamecenter/qa/subject/CommunitySubjectActivity.java @@ -6,7 +6,7 @@ import android.os.Bundle; import com.gh.gamecenter.common.base.activity.ToolBarActivity; import com.gh.gamecenter.common.constant.EntranceConsts; -import com.gh.gamecenter.entity.CommunityEntity; +import com.gh.gamecenter.common.entity.CommunityEntity; /** * Created by khy on 10/04/18. diff --git a/app/src/main/java/com/gh/gamecenter/qa/tags/AskQuestionsNewRepository.java b/app/src/main/java/com/gh/gamecenter/qa/tags/AskQuestionsNewRepository.java index f16af22f09..b4daf28c38 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/tags/AskQuestionsNewRepository.java +++ b/app/src/main/java/com/gh/gamecenter/qa/tags/AskQuestionsNewRepository.java @@ -7,7 +7,8 @@ import android.text.TextUtils; import com.gh.common.util.ErrorHelper; import com.gh.gamecenter.core.utils.GsonUtils; import com.gh.gamecenter.R; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.user.UserManager; +import com.gh.gamecenter.manager.CommunityManager; import com.gh.gamecenter.qa.entity.AskTagGroupsEntity; import com.gh.gamecenter.common.retrofit.Response; import com.gh.gamecenter.retrofit.RetrofitManager; @@ -47,7 +48,7 @@ public class AskQuestionsNewRepository { private void loadUserTagGroups() { RetrofitManager.getInstance().getApi() - .getUserAskTagGroups(UserManager.getInstance().getUserId(), UserManager.getInstance().getCommunity().getId()) + .getUserAskTagGroups(UserManager.getInstance().getUserId(), CommunityManager.getInstance().getCommunity().getId()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Response>() { @@ -67,7 +68,7 @@ public class AskQuestionsNewRepository { private void loadDefaultTagGroups(List userEntity) { RetrofitManager.getInstance().getApi() - .getDefaultAskTagGroups(UserManager.getInstance().getCommunity().getId()) + .getDefaultAskTagGroups(CommunityManager.getInstance().getCommunity().getId()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Response>() { @@ -114,7 +115,7 @@ public class AskQuestionsNewRepository { RequestBody body = RequestBody.create(MediaType.parse("application/json"), GsonUtils.toJson(entity)); RetrofitManager.getInstance().getApi() - .postUserAskTagGroups(body, UserManager.getInstance().getUserId(), UserManager.getInstance().getCommunity().getId()) + .postUserAskTagGroups(body, UserManager.getInstance().getUserId(), CommunityManager.getInstance().getCommunity().getId()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Response() { @@ -141,7 +142,7 @@ public class AskQuestionsNewRepository { private void deleteUserAskTagGroups() { RetrofitManager.getInstance() .getApi() - .deleteUserAskTagGroups(UserManager.getInstance().getUserId(), UserManager.getInstance().getCommunity().getId()) + .deleteUserAskTagGroups(UserManager.getInstance().getUserId(), CommunityManager.getInstance().getCommunity().getId()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Response() { diff --git a/app/src/main/java/com/gh/gamecenter/qa/video/detail/ForumVideoDetailFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/video/detail/ForumVideoDetailFragment.kt index 645e791ff0..5a1ba6a817 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/video/detail/ForumVideoDetailFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/video/detail/ForumVideoDetailFragment.kt @@ -41,8 +41,8 @@ import com.gh.gamecenter.eventbus.EBDownloadStatus import com.gh.gamecenter.eventbus.EBPackage import com.gh.gamecenter.forum.home.ForumScrollCalculatorHelper import com.gh.gamecenter.gamedetail.GameDetailFragment -import com.gh.gamecenter.manager.UserManager -import com.gh.gamecenter.mvvm.Status +import com.gh.gamecenter.login.user.UserManager +import com.gh.gamecenter.common.mvvm.Status import com.gh.gamecenter.qa.dialog.ChooseActivityDialogFragment import com.gh.gamecenter.qa.dialog.MoreFunctionPanelDialog import com.gh.gamecenter.qa.video.detail.comment.VideoCommentFragment @@ -245,7 +245,7 @@ class ForumVideoDetailFragment : BaseFragment_TabLayout() { mViewModel.addHistoryRecord(entity) } else { mBinding.container.visibility = View.GONE - if (it.exception != null && it.exception.code() == 404) { + if (it.exception != null && it.exception!!.code() == 404) { mBinding.reuseNoneData.reuseTvNoneData.text = "页面不见了" mBinding.reuseNoneData.root.visibility = View.VISIBLE } else { diff --git a/app/src/main/java/com/gh/gamecenter/qa/video/detail/ForumVideoDetailViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/video/detail/ForumVideoDetailViewModel.kt index 5447a94053..8df155cbfc 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/video/detail/ForumVideoDetailViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/video/detail/ForumVideoDetailViewModel.kt @@ -15,7 +15,7 @@ import com.gh.gamecenter.common.utils.toRequestBody import com.gh.gamecenter.common.utils.tryCatchInRelease import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.entity.* -import com.gh.gamecenter.mvvm.Resource +import com.gh.gamecenter.common.mvvm.Resource import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/gamecenter/qa/video/detail/comment/VideoCommentFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/video/detail/comment/VideoCommentFragment.kt index 3a1f29195a..b9ebb201a5 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/video/detail/comment/VideoCommentFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/video/detail/comment/VideoCommentFragment.kt @@ -9,20 +9,19 @@ import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.common.syncpage.SyncDataEntity import com.gh.gamecenter.common.syncpage.SyncFieldConstants import com.gh.gamecenter.common.syncpage.SyncPageRepository -import com.gh.common.util.* import com.gh.common.util.NewLogUtils import com.gh.gamecenter.common.view.CustomDividerItemDecoration import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.LazyListFragment -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.LazyListFragment +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.common.view.SegmentedFilterView import com.gh.gamecenter.databinding.FragmentVideoCommentListBinding import com.gh.gamecenter.entity.ForumVideoEntity -import com.gh.gamecenter.manager.UserManager -import com.gh.gamecenter.mvvm.Status +import com.gh.gamecenter.login.user.UserManager +import com.gh.gamecenter.common.mvvm.Status import com.gh.gamecenter.qa.article.detail.CommentItemData import com.gh.gamecenter.qa.comment.CommentActivity import com.gh.gamecenter.qa.comment.base.BaseCommentViewModel diff --git a/app/src/main/java/com/gh/gamecenter/qa/video/detail/comment/VideoCommentViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/video/detail/comment/VideoCommentViewModel.kt index 3170ff58cb..2050727b6c 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/video/detail/comment/VideoCommentViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/video/detail/comment/VideoCommentViewModel.kt @@ -4,7 +4,7 @@ import android.app.Application import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider -import com.gh.gamecenter.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.LoadStatus import com.gh.gamecenter.entity.CommentEntity import com.gh.gamecenter.entity.ForumVideoEntity import com.gh.gamecenter.qa.comment.base.BaseCommentViewModel diff --git a/app/src/main/java/com/gh/gamecenter/qa/video/detail/desc/VideoDescAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/video/detail/desc/VideoDescAdapter.kt index cf15ccd5f7..be071b8399 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/video/detail/desc/VideoDescAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/video/detail/desc/VideoDescAdapter.kt @@ -10,7 +10,7 @@ import com.gh.gamecenter.core.utils.TimeUtils import com.gh.gamecenter.common.utils.toBinding import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.entity.VideoDescItemEntity import com.gh.gamecenter.qa.video.detail.ForumVideoDetailActivity import com.gh.gamecenter.qa.video.detail.ForumVideoDetailViewModel diff --git a/app/src/main/java/com/gh/gamecenter/qa/video/detail/desc/VideoDescFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/video/detail/desc/VideoDescFragment.kt index a8e8f094b4..52e5f51146 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/video/detail/desc/VideoDescFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/video/detail/desc/VideoDescFragment.kt @@ -8,12 +8,12 @@ import com.gh.gamecenter.common.utils.ShareUtils import com.gh.gamecenter.common.utils.observeNonNull import com.gh.gamecenter.common.utils.viewModelProviderFromParent import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.LazyListFragment -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.LazyListFragment +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.entity.ForumVideoEntity import com.gh.gamecenter.entity.VideoDescItemEntity import com.gh.gamecenter.common.eventbus.EBShare -import com.gh.gamecenter.mvvm.Status +import com.gh.gamecenter.common.mvvm.Status import com.gh.gamecenter.qa.video.detail.ForumVideoDetailViewModel import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode diff --git a/app/src/main/java/com/gh/gamecenter/qa/video/detail/desc/VideoDescTopViewHolder.kt b/app/src/main/java/com/gh/gamecenter/qa/video/detail/desc/VideoDescTopViewHolder.kt index 47b74f26ee..2f00936a91 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/video/detail/desc/VideoDescTopViewHolder.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/video/detail/desc/VideoDescTopViewHolder.kt @@ -19,7 +19,7 @@ import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.ItemVideoDescTopBinding import com.gh.gamecenter.entity.ForumVideoEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.qa.video.detail.ForumVideoDetailViewModel import kotlin.math.max diff --git a/app/src/main/java/com/gh/gamecenter/qa/video/detail/desc/VideoDescViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/video/detail/desc/VideoDescViewModel.kt index bb13e6cbed..efb24bc1f1 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/video/detail/desc/VideoDescViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/video/detail/desc/VideoDescViewModel.kt @@ -7,7 +7,7 @@ import com.gh.gamecenter.common.syncpage.SyncDataEntity import com.gh.gamecenter.common.syncpage.SyncFieldConstants import com.gh.gamecenter.common.syncpage.SyncPageRepository import com.gh.common.util.* -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.core.utils.ToastUtils import com.gh.gamecenter.common.utils.clickToastByStatus import com.gh.gamecenter.common.utils.observableToMain @@ -15,7 +15,7 @@ import com.gh.gamecenter.common.utils.singleToMain import com.gh.gamecenter.entity.ForumVideoEntity import com.gh.gamecenter.entity.VideoDescItemEntity import com.gh.gamecenter.eventbus.EBUserFollow -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/gamecenter/qa/video/publish/VideoPublishActivity.kt b/app/src/main/java/com/gh/gamecenter/qa/video/publish/VideoPublishActivity.kt index f5f7df308f..e96c686c80 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/video/publish/VideoPublishActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/video/publish/VideoPublishActivity.kt @@ -7,6 +7,7 @@ import android.view.View import com.gh.gamecenter.common.base.activity.ToolBarActivity import com.gh.gamecenter.R import com.gh.gamecenter.common.constant.EntranceConsts +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.common.utils.updateStatusBarColor import com.gh.gamecenter.entity.* import com.gh.gamecenter.qa.BbsType diff --git a/app/src/main/java/com/gh/gamecenter/qa/video/publish/VideoPublishFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/video/publish/VideoPublishFragment.kt index 34f94fd356..dbc3361d4a 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/video/publish/VideoPublishFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/video/publish/VideoPublishFragment.kt @@ -26,10 +26,11 @@ import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.FragmentVideoPublishBinding import com.gh.gamecenter.entity.* -import com.gh.gamecenter.manager.UserManager -import com.gh.gamecenter.mvvm.Status +import com.gh.gamecenter.login.user.UserManager +import com.gh.gamecenter.common.mvvm.Status import com.gh.gamecenter.common.base.fragment.ToolbarFragment import com.gh.gamecenter.common.callback.ConfirmListener +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.common.entity.NotificationUgc import com.gh.gamecenter.qa.BbsType import com.gh.gamecenter.qa.dialog.ChooseActivityDialogFragment diff --git a/app/src/main/java/com/gh/gamecenter/qa/video/publish/VideoPublishViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/video/publish/VideoPublishViewModel.kt index 039b7dc9df..0140952b7f 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/video/publish/VideoPublishViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/video/publish/VideoPublishViewModel.kt @@ -10,11 +10,12 @@ import android.provider.MediaStore import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.MediatorLiveData import com.gh.gamecenter.common.base.fragment.WaitingDialogFragment +import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.core.runOnIoThread import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.entity.* -import com.gh.gamecenter.manager.UserManager -import com.gh.gamecenter.mvvm.Resource +import com.gh.gamecenter.login.user.UserManager +import com.gh.gamecenter.common.mvvm.Resource import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.common.retrofit.ObservableUtil import com.gh.gamecenter.common.retrofit.Response diff --git a/app/src/main/java/com/gh/gamecenter/receiver/UmengMessageReceiver.kt b/app/src/main/java/com/gh/gamecenter/receiver/UmengMessageReceiver.kt index 997142d346..40cd9ef6c9 100644 --- a/app/src/main/java/com/gh/gamecenter/receiver/UmengMessageReceiver.kt +++ b/app/src/main/java/com/gh/gamecenter/receiver/UmengMessageReceiver.kt @@ -9,7 +9,7 @@ //import com.gh.common.util.DirectUtils //import com.gh.common.util.EntranceUtils //import com.gh.common.util.PushHelper -//import com.gh.gamecenter.entity.LinkEntity +//import com.gh.gamecenter.common.entity.LinkEntity //import com.umeng.message.UTrack //import com.umeng.message.entity.UMessage //import org.json.JSONObject diff --git a/app/src/main/java/com/gh/gamecenter/retrofit/service/ApiService.java b/app/src/main/java/com/gh/gamecenter/retrofit/service/ApiService.java index 7f2c419d3e..576e54d274 100644 --- a/app/src/main/java/com/gh/gamecenter/retrofit/service/ApiService.java +++ b/app/src/main/java/com/gh/gamecenter/retrofit/service/ApiService.java @@ -1,11 +1,16 @@ package com.gh.gamecenter.retrofit.service; import com.gh.common.filter.RegionSetting; +import com.gh.gamecenter.common.entity.LinkEntity; +import com.gh.gamecenter.common.entity.ToolBoxEntity; import com.gh.gamecenter.common.entity.OssEntity; import com.gh.gamecenter.entity.SettingsEntity; import com.gh.gamecenter.entity.*; import com.gh.gamecenter.gamedetail.entity.BigEvent; import com.gh.gamecenter.gamedetail.entity.NewGameDetailEntity; +import com.gh.gamecenter.login.entity.AvatarBorderEntity; +import com.gh.gamecenter.login.entity.BackgroundImageEntity; +import com.gh.gamecenter.login.entity.UserInfoEntity; import com.gh.gamecenter.personalhome.rating.MyRating; import com.gh.gamecenter.qa.entity.AnswerDetailEntity; import com.gh.gamecenter.qa.entity.AnswerDraftEntity; @@ -161,12 +166,6 @@ public interface ApiService { @GET("certification") Single getCertification(); - /** - * 更新实名认证 - */ - @POST("certification") - Single postCertification(@Body RequestBody body); - /** * 检查实名认证接口 */ @@ -421,23 +420,6 @@ public interface ApiService { @POST("devices:find") Observable checkDevice(@Body RequestBody body); - /** - * 将老用户的数据同步到 3.0 版本的数据中 - */ - @Headers({"Content-Type: application/json", "Accept: application/json"}) - @POST("users:sync") - Observable syncUserData(@Body RequestBody body); - - /** - * 获取用户信息(头像/用户名) - */ - @POST - Observable getUserInfo(@Url String url); - - // Header作为区分 userinfo 的唯一标识 - @POST() - Observable getRetryUserInfo(@Url String url, @Header("retry") String tag); // 在OkHttpRetryInterceptor使用主要是不允许这个接口重试 - /** * 添加关注 */ @@ -1015,79 +997,6 @@ public interface ApiService { @GET("users/{user_id}:sign-in") Observable postSign(@Path("user_id") String userId); - - //----------------用户登录相关---------------// - - /** - * 手机登录获取验证码 - */ - @Headers({"Content-Type: application/json", "Accept: application/json"}) - @POST("login/mobile?step=1") - Observable loginByCaptcha(@Body RequestBody body); - - /** - * 手机登录 - */ - @Headers({"Content-Type: application/json", "Accept: application/json"}) - @POST("login/mobile?step=2") - Observable loginByMobile(@Body RequestBody body); - - /** - * QQ登录 - */ - @Headers({"Content-Type: application/json", "Accept: application/json"}) - @POST("login/qq") - Observable loginByQQ(@Body RequestBody body); - - /** - * 微博登录 - */ - @Headers({"Content-Type: application/json", "Accept: application/json"}) - @POST("login/weibo") - Observable loginByWeibo(@Body RequestBody body); - - /** - * 微信登录 - */ - @Headers({"Content-Type: application/json", "Accept: application/json"}) - @POST("login/wechat") - Observable loginByWechat(@Body RequestBody body); - - /** - * 抖音登录 - */ - @Headers({"Content-Type: application/json", "Accept: application/json"}) - @POST("login/douyin") - Observable loginByDouYin(@Body RequestBody body); - - /** - * 一键登录 - */ - @Headers({"Content-Type: application/json", "Accept: application/json"}) - @POST("login/mobile_oauth") - Observable loginByOauth(@Body RequestBody body); - - /** - * 刷新accessToken - */ - @Headers({"Content-Type: application/json", "Accept: application/json"}) - @POST() - Observable refreshToken(@Url String url, @Body RequestBody body); - - /** - * 修改用户信息 - */ - @Headers({"Content-Type: application/json", "Accept: application/json"}) - @PUT("users/{user_id}") - Observable changeUserInfo(@Body RequestBody body, @Path("user_id") String userId); - - /** - * 注销登录 - */ - @Headers({"Content-Type: application/json", "Accept: application/json"}) - @POST("logout") - Observable logout(); - /** * 绑定手机 */ @@ -2250,12 +2159,6 @@ public interface ApiService { @GET("exam/etiquette/switch_status") Single getRegulationTestStatus(); - /** - * 获取用户礼仪考试状态 - */ - @GET("users/{user_id}/exam/etiquette") - Single getUserRegulationTestStatus(@Path("user_id") String userId); - /** * 获取安利墙列表 */ @@ -2854,54 +2757,6 @@ public interface ApiService { @GET("catalogs/{catalog_id}/special") Single> getSpecialCatalogs(@Path("catalog_id") String catalogId, @Query("page") int page); - /** - * 上报光能任务 - */ - @POST("users/{user_id}/tasks:check") - Single> postEnergyTask(@Path("user_id") String userId, @Body RequestBody body); - - /** - * 获取商品分类列表 - */ - @GET("shop/commodities/categories") - Single> getCommodityCategories(); - - /** - * 获取商品列表 - */ - @GET("shop/commodities") - Single> getCommodities(@Query("filter") String filter, @Query("page") int page, @Query("page_size") int pageSize); - - /** - * 获取新手任务列表 - */ - @GET("novice_tasks") - Single> getNoviceTasks(); - - /** - * 获取常驻任务列表 - */ - @GET("fixed_tasks") - Single> getFixedTasks(); - - /** - * 获取日常任务列表 - */ - @GET("daily_tasks") - Single> getDailyTasks(); - - /** - * 获取用户剩余光能 - */ - @GET("users/{user_id}/energies") - Single getUserEnergies(@Path("user_id") String userId); - - /** - * 获取光能屋滚动通知 - */ - @GET("shop/orders/roll_notices") - Single> getRollNotices(); - /** * 新增一个问题草稿 */ @@ -2932,12 +2787,6 @@ public interface ApiService { @DELETE("users/{user_id}/bbses/question_drafts/{draft_id}") Observable deleteQuestionDraft(@Path("user_id") String userId, @Path("draft_id") String draftId); - /** - * 检测邀请码 - */ - @POST("users/{user_id}:invited") - Single checkInviteCode(@Path("user_id") String userId, @Body RequestBody body); - /** * 举报用户 */ @@ -2950,18 +2799,6 @@ public interface ApiService { @GET("users/{user_id}/levels") Single getUserLevels(@Path("user_id") String userId); - /** - * 获取签到状态 - */ - @GET("users/{user_id}:signin") - Single getSignStatus(@Path("user_id") String userId); - - /** - * 签到并获取状态 - */ - @POST("users/{user_id}:signin") - Single signIn(@Path("user_id") String userId); - /** * 提交没帮助反馈 */ @@ -3537,12 +3374,6 @@ public interface ApiService { @GET("games/{game_id}/third_party_address") Observable getThirdPartyAddress(@Path("game_id") String gameId); - /** - * 同步从其他游戏传过来的实名认证 - */ - @POST("./certification:sync") - Observable postSyncCertification(@Body RequestBody body); - /** * 整合首页接口 */ diff --git a/app/src/main/java/com/gh/gamecenter/room/converter/CommunityConverter.kt b/app/src/main/java/com/gh/gamecenter/room/converter/CommunityConverter.kt index ae02ce4ee6..5468e886df 100644 --- a/app/src/main/java/com/gh/gamecenter/room/converter/CommunityConverter.kt +++ b/app/src/main/java/com/gh/gamecenter/room/converter/CommunityConverter.kt @@ -3,7 +3,7 @@ package com.gh.gamecenter.room.converter import androidx.room.TypeConverter import com.gh.gamecenter.common.utils.toJson import com.gh.gamecenter.common.utils.toObject -import com.gh.gamecenter.entity.CommunityEntity +import com.gh.gamecenter.common.entity.CommunityEntity class CommunityConverter { @TypeConverter diff --git a/app/src/main/java/com/gh/gamecenter/search/SearchGameIndexAdapter.kt b/app/src/main/java/com/gh/gamecenter/search/SearchGameIndexAdapter.kt index 96309e4f24..9ea89e5268 100644 --- a/app/src/main/java/com/gh/gamecenter/search/SearchGameIndexAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/search/SearchGameIndexAdapter.kt @@ -27,7 +27,7 @@ import com.gh.gamecenter.R import com.gh.gamecenter.SearchType import com.gh.gamecenter.adapter.viewholder.GameViewHolder import com.gh.gamecenter.adapter.viewholder.SearchHistoryViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.FmSearchHistoryItemBinding diff --git a/app/src/main/java/com/gh/gamecenter/search/SearchGameIndexFragment.kt b/app/src/main/java/com/gh/gamecenter/search/SearchGameIndexFragment.kt index c06507e942..39d1a416bd 100644 --- a/app/src/main/java/com/gh/gamecenter/search/SearchGameIndexFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/search/SearchGameIndexFragment.kt @@ -17,8 +17,8 @@ import com.gh.gamecenter.R import com.gh.gamecenter.SearchActivity import com.gh.gamecenter.SearchType import com.gh.gamecenter.SuggestionActivity -import com.gh.gamecenter.baselist.ListFragment -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListFragment +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.constant.ItemViewType import com.gh.gamecenter.common.utils.viewModelProvider diff --git a/app/src/main/java/com/gh/gamecenter/search/SearchGameResultAdapter.kt b/app/src/main/java/com/gh/gamecenter/search/SearchGameResultAdapter.kt index a92441a032..039c322b91 100644 --- a/app/src/main/java/com/gh/gamecenter/search/SearchGameResultAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/search/SearchGameResultAdapter.kt @@ -28,7 +28,7 @@ import com.gh.gamecenter.SuggestionActivity import com.gh.gamecenter.adapter.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder import com.gh.gamecenter.adapter.viewholder.SearchGameFooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.LayoutSearchGameContentTagBinding diff --git a/app/src/main/java/com/gh/gamecenter/search/SearchGameResultFragment.kt b/app/src/main/java/com/gh/gamecenter/search/SearchGameResultFragment.kt index f04d3af64d..55ac08b293 100644 --- a/app/src/main/java/com/gh/gamecenter/search/SearchGameResultFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/search/SearchGameResultFragment.kt @@ -21,8 +21,8 @@ import com.gh.gamecenter.R import com.gh.gamecenter.SearchActivity import com.gh.gamecenter.SearchType import com.gh.gamecenter.SuggestionActivity -import com.gh.gamecenter.baselist.ListFragment -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListFragment +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.viewModelProvider import com.gh.gamecenter.core.utils.DisplayUtils diff --git a/app/src/main/java/com/gh/gamecenter/search/SearchGameResultViewModel.kt b/app/src/main/java/com/gh/gamecenter/search/SearchGameResultViewModel.kt index d0cb654afd..2831aa531e 100644 --- a/app/src/main/java/com/gh/gamecenter/search/SearchGameResultViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/search/SearchGameResultViewModel.kt @@ -4,9 +4,9 @@ import android.annotation.SuppressLint import android.app.Application import com.gh.common.constant.Config import com.gh.gamecenter.BuildConfig -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.baselist.LoadParams -import com.gh.gamecenter.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.LoadParams +import com.gh.gamecenter.common.baselist.LoadStatus import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.entity.SearchSubjectEntity import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/gamecenter/security/BindPhoneActivity.kt b/app/src/main/java/com/gh/gamecenter/security/BindPhoneActivity.kt index 3472ddd864..34a4a89d42 100644 --- a/app/src/main/java/com/gh/gamecenter/security/BindPhoneActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/security/BindPhoneActivity.kt @@ -3,17 +3,19 @@ package com.gh.gamecenter.security import android.content.Context import android.content.Intent import android.os.Bundle +import com.alibaba.android.arouter.facade.annotation.Route import com.gh.gamecenter.common.base.activity.ToolBarActivity import com.gh.gamecenter.R import com.gh.gamecenter.common.constant.EntranceConsts +import com.gh.gamecenter.common.constant.RouteConsts import com.gh.gamecenter.common.utils.updateStatusBarColor import com.gh.gamecenter.entity.ConflictUserEntity +@Route(path = RouteConsts.activity.bindPhoneActivity) class BindPhoneActivity : ToolBarActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - hideToolbar(intent.extras?.getBundle(NORMAL_FRAGMENT_BUNDLE)?.getBoolean(EntranceConsts.KEY_FROM_LOGIN) == true) updateStatusBarColor(R.color.background_white, R.color.background_white) } @@ -25,6 +27,10 @@ class BindPhoneActivity : ToolBarActivity() { updateStatusBarColor(R.color.background_white, R.color.background_white) } + override fun provideNormalIntent(): Intent { + return getTargetIntent(this, BindPhoneActivity::class.java, BindPhoneFragment::class.java) + } + companion object { const val RESULT_FINISH_CODE = 411 diff --git a/app/src/main/java/com/gh/gamecenter/security/BindPhoneConflictFragment.kt b/app/src/main/java/com/gh/gamecenter/security/BindPhoneConflictFragment.kt index 5a37400a47..b166ba9946 100644 --- a/app/src/main/java/com/gh/gamecenter/security/BindPhoneConflictFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/security/BindPhoneConflictFragment.kt @@ -11,7 +11,7 @@ import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.utils.ImageUtils import com.gh.gamecenter.databinding.FragmentBindPhoneConflictBinding import com.gh.gamecenter.entity.ConflictUserEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.base.fragment.ToolbarFragment class BindPhoneConflictFragment : ToolbarFragment() { diff --git a/app/src/main/java/com/gh/gamecenter/security/BindPhoneFragment.kt b/app/src/main/java/com/gh/gamecenter/security/BindPhoneFragment.kt index 4a5cacf96c..3e2c091532 100644 --- a/app/src/main/java/com/gh/gamecenter/security/BindPhoneFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/security/BindPhoneFragment.kt @@ -9,16 +9,18 @@ import androidx.lifecycle.Observer import com.gh.gamecenter.common.constant.Constants import com.gh.common.util.* import com.gh.common.util.DialogUtils -import com.gh.common.util.EnergyTaskHelper.postInviteCodeTask +import com.gh.gamecenter.energy.utils.EnergyTaskHelper.postInviteCodeTask import com.gh.gamecenter.R import com.gh.gamecenter.common.BuildConfig +import com.gh.gamecenter.common.base.activity.ToolBarActivity import com.gh.gamecenter.common.callback.ConfirmListener import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.FragmentBindPhoneBinding -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.base.fragment.ToolbarFragment +import com.gh.gamecenter.energy.utils.EnergyTaskHelper import com.lightgame.utils.Utils class BindPhoneFragment : ToolbarFragment() { @@ -59,6 +61,8 @@ class BindPhoneFragment : ToolbarFragment() { mFromLogin = requireArguments().getBoolean(EntranceConsts.KEY_FROM_LOGIN) mChangePhone = requireArguments().getBoolean(EntranceConsts.KEY_CHANGE_PHONE) + (requireActivity() as? ToolBarActivity)?.hideToolbar(mFromLogin) + mViewModel = viewModelProvider() } diff --git a/app/src/main/java/com/gh/gamecenter/security/BindPhoneViewModel.kt b/app/src/main/java/com/gh/gamecenter/security/BindPhoneViewModel.kt index ab588eddf2..68e45a60fd 100644 --- a/app/src/main/java/com/gh/gamecenter/security/BindPhoneViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/security/BindPhoneViewModel.kt @@ -7,10 +7,10 @@ import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.MutableLiveData import com.gh.gamecenter.common.utils.DeviceUtils import com.gh.gamecenter.core.utils.GsonUtils -import com.gh.common.util.LoginUtils import com.gh.gamecenter.core.utils.ToastUtils import com.gh.gamecenter.entity.ConflictUserEntity import com.gh.gamecenter.common.retrofit.BiResponse +import com.gh.gamecenter.login.utils.LoginUtils import com.gh.gamecenter.retrofit.RetrofitManager import com.lightgame.utils.Utils import io.reactivex.android.schedulers.AndroidSchedulers diff --git a/app/src/main/java/com/gh/gamecenter/security/SecurityFragment.kt b/app/src/main/java/com/gh/gamecenter/security/SecurityFragment.kt index b4aa5da41e..472c210537 100644 --- a/app/src/main/java/com/gh/gamecenter/security/SecurityFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/security/SecurityFragment.kt @@ -8,8 +8,8 @@ import com.gh.common.util.DirectUtils import com.gh.gamecenter.common.utils.EnvHelper import com.gh.gamecenter.R import com.gh.gamecenter.databinding.FragmentSecurityBinding -import com.gh.gamecenter.eventbus.EBReuse -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.common.eventbus.EBReuse +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.base.fragment.ToolbarFragment import com.gh.gamecenter.personal.PersonalFragment import org.greenrobot.eventbus.Subscribe @@ -101,7 +101,7 @@ class SecurityFragment : ToolbarFragment() { // 登录事件 @Subscribe(threadMode = ThreadMode.MAIN) fun onEventMainThread(reuse: EBReuse) { - if (reuse.type == PersonalFragment.LOGOUT_TAG) { + if (reuse.type == Constants.LOGOUT_TAG) { activity?.finish() } } diff --git a/app/src/main/java/com/gh/gamecenter/servers/GameServersContentAdapter.kt b/app/src/main/java/com/gh/gamecenter/servers/GameServersContentAdapter.kt index 09bac0efd9..7a87560f56 100644 --- a/app/src/main/java/com/gh/gamecenter/servers/GameServersContentAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/servers/GameServersContentAdapter.kt @@ -18,7 +18,7 @@ import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameTestViewHolder -import com.gh.gamecenter.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.LoadStatus import com.gh.gamecenter.core.utils.StringUtils import com.gh.gamecenter.common.utils.toBinding import com.gh.gamecenter.common.utils.toColor diff --git a/app/src/main/java/com/gh/gamecenter/servers/GameServersContentFragment.kt b/app/src/main/java/com/gh/gamecenter/servers/GameServersContentFragment.kt index c59a798dd6..f4f4af6d9c 100644 --- a/app/src/main/java/com/gh/gamecenter/servers/GameServersContentFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/servers/GameServersContentFragment.kt @@ -19,7 +19,7 @@ import com.gh.common.xapk.XapkInstaller import com.gh.common.xapk.XapkUnzipStatus import com.gh.download.DownloadManager import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.LoadStatus import com.gh.gamecenter.common.base.fragment.BaseFragment import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.common.utils.* diff --git a/app/src/main/java/com/gh/gamecenter/servers/GameServersContentViewModel.kt b/app/src/main/java/com/gh/gamecenter/servers/GameServersContentViewModel.kt index 6b10881b18..3d83955cce 100644 --- a/app/src/main/java/com/gh/gamecenter/servers/GameServersContentViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/servers/GameServersContentViewModel.kt @@ -8,7 +8,7 @@ import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.MutableLiveData import com.gh.common.util.* import com.gh.download.DownloadManager -import com.gh.gamecenter.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.LoadStatus import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.countOccurrences import com.gh.gamecenter.core.utils.UrlFilterUtils diff --git a/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorGameListAdapter.kt b/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorGameListAdapter.kt index 98ed37b32f..424c6b4094 100644 --- a/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorGameListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorGameListAdapter.kt @@ -32,7 +32,7 @@ import com.gh.gamecenter.MainActivity import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.callback.BiCallback import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.* diff --git a/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorGameListFragment.kt b/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorGameListFragment.kt index 6b7038e7c6..561d2cf0a6 100644 --- a/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorGameListFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorGameListFragment.kt @@ -3,13 +3,13 @@ package com.gh.gamecenter.simulatorgame import android.os.Bundle import android.view.View import com.gh.download.DownloadManager -import com.gh.gamecenter.baselist.ListFragment -import com.gh.gamecenter.baselist.LoadType import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.safelyGetInRelease import com.gh.gamecenter.common.utils.viewModelProvider import com.gh.gamecenter.common.utils.viewModelProviderFromParent import com.gh.gamecenter.core.AppExecutor +import com.gh.gamecenter.common.baselist.ListFragment +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.entity.SimulatorEntity import com.gh.gamecenter.game.GameAndPosition diff --git a/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorGameListViewModel.kt b/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorGameListViewModel.kt index 45726749b8..f21f052373 100644 --- a/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorGameListViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorGameListViewModel.kt @@ -9,7 +9,7 @@ import com.gh.gamecenter.common.utils.NetworkUtils import com.gh.gamecenter.core.utils.UrlFilterUtils import com.gh.gamecenter.common.utils.safelyGetInRelease import com.gh.download.DownloadManager -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.entity.SimulatorGameRecordEntity import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorManagementAdapter.kt b/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorManagementAdapter.kt index 4d97ecfb28..0327c699e1 100644 --- a/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorManagementAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorManagementAdapter.kt @@ -13,7 +13,7 @@ import com.gh.gamecenter.common.base.BaseRecyclerViewHolder import com.gh.common.simulator.SimulatorDownloadManager import com.gh.common.util.* import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.DialogHelper import com.gh.gamecenter.core.utils.ToastUtils import com.gh.gamecenter.common.utils.goneIf diff --git a/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorManagementFragment.kt b/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorManagementFragment.kt index 1805874dde..f47a5ab4b7 100644 --- a/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorManagementFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorManagementFragment.kt @@ -10,7 +10,7 @@ import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.utils.viewModelProvider import com.gh.gamecenter.common.view.SpacingItemDecoration import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListFragment +import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.databinding.FragmentSimulatorListBinding import com.gh.gamecenter.entity.SimulatorEntity import com.gh.gamecenter.eventbus.EBPackage diff --git a/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorManagementViewModel.kt b/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorManagementViewModel.kt index 929fafd22a..0d405d5fb2 100644 --- a/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorManagementViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorManagementViewModel.kt @@ -5,7 +5,7 @@ import android.app.Application import android.content.pm.PackageManager import com.gh.gamecenter.common.utils.NetworkUtils import com.gh.common.util.PackageUtils -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.entity.ApkEntity import com.gh.gamecenter.entity.SimulatorEntity import com.gh.gamecenter.retrofit.RetrofitManager diff --git a/app/src/main/java/com/gh/gamecenter/subject/SubjectAdapter.kt b/app/src/main/java/com/gh/gamecenter/subject/SubjectAdapter.kt index a65df62988..a7d6ac3e37 100644 --- a/app/src/main/java/com/gh/gamecenter/subject/SubjectAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/subject/SubjectAdapter.kt @@ -19,13 +19,13 @@ import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameImageViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.GameImageItemBinding import com.gh.gamecenter.databinding.GameItemBinding import com.gh.gamecenter.entity.GameEntity -import com.gh.gamecenter.entity.LinkEntity +import com.gh.gamecenter.common.entity.LinkEntity import com.gh.gamecenter.eventbus.EBDownloadStatus import com.gh.gamecenter.game.GameItemViewHolder import com.lightgame.download.DownloadEntity diff --git a/app/src/main/java/com/gh/gamecenter/subject/SubjectListFragment.kt b/app/src/main/java/com/gh/gamecenter/subject/SubjectListFragment.kt index 10d1a0fbf2..db9bd948e1 100644 --- a/app/src/main/java/com/gh/gamecenter/subject/SubjectListFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/subject/SubjectListFragment.kt @@ -10,9 +10,9 @@ import com.gh.common.xapk.XapkInstaller import com.gh.common.xapk.XapkUnzipStatus import com.gh.download.DownloadManager import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.LazyListFragment -import com.gh.gamecenter.baselist.LoadType import com.gh.gamecenter.common.constant.Constants +import com.gh.gamecenter.common.baselist.LazyListFragment +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.common.utils.viewModelProviderFromParent diff --git a/app/src/main/java/com/gh/gamecenter/subject/SubjectListViewModel.kt b/app/src/main/java/com/gh/gamecenter/subject/SubjectListViewModel.kt index f74d606fcb..610385a23a 100644 --- a/app/src/main/java/com/gh/gamecenter/subject/SubjectListViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/subject/SubjectListViewModel.kt @@ -6,9 +6,9 @@ import androidx.lifecycle.ViewModelProvider import com.gh.common.exposure.ExposureSource import com.gh.common.exposure.ExposureUtils import com.gh.gamecenter.core.utils.TimeUtils -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.baselist.LoadStatus -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.entity.SubjectData import com.gh.gamecenter.entity.SubjectSettingEntity diff --git a/app/src/main/java/com/gh/gamecenter/subject/tile/SubjectTileFragment.kt b/app/src/main/java/com/gh/gamecenter/subject/tile/SubjectTileFragment.kt index 462a52ed8b..1b8b4b9f89 100644 --- a/app/src/main/java/com/gh/gamecenter/subject/tile/SubjectTileFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/subject/tile/SubjectTileFragment.kt @@ -13,7 +13,7 @@ import com.gh.gamecenter.R import com.gh.gamecenter.databinding.FragmentSubjectTiledBinding import com.gh.gamecenter.entity.SubjectData import com.gh.gamecenter.entity.SubjectSettingEntity -import com.gh.gamecenter.eventbus.EBReuse +import com.gh.gamecenter.common.eventbus.EBReuse import com.gh.gamecenter.common.base.fragment.ToolbarController import com.gh.gamecenter.subject.SubjectListFragment import com.google.android.material.appbar.AppBarLayout diff --git a/app/src/main/java/com/gh/gamecenter/tag/TagsListAdapter.kt b/app/src/main/java/com/gh/gamecenter/tag/TagsListAdapter.kt index e0540bfdc1..bc95039d4e 100644 --- a/app/src/main/java/com/gh/gamecenter/tag/TagsListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/tag/TagsListAdapter.kt @@ -14,7 +14,7 @@ import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.databinding.GameItemBinding import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.eventbus.EBDownloadStatus diff --git a/app/src/main/java/com/gh/gamecenter/tag/TagsListFragment.kt b/app/src/main/java/com/gh/gamecenter/tag/TagsListFragment.kt index e581c5090a..c57ccd4624 100644 --- a/app/src/main/java/com/gh/gamecenter/tag/TagsListFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/tag/TagsListFragment.kt @@ -12,13 +12,13 @@ import com.gh.common.xapk.XapkInstaller import com.gh.common.xapk.XapkUnzipStatus import com.gh.download.DownloadManager import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.ListFragment -import com.gh.gamecenter.baselist.LoadType import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.common.utils.observeNonNull import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.common.utils.viewModelProvider +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListFragment +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.databinding.FragmentTagsBinding import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.entity.SubjectSettingEntity diff --git a/app/src/main/java/com/gh/gamecenter/tag/TagsListViewModel.kt b/app/src/main/java/com/gh/gamecenter/tag/TagsListViewModel.kt index 230e55a970..1b757574e1 100644 --- a/app/src/main/java/com/gh/gamecenter/tag/TagsListViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/tag/TagsListViewModel.kt @@ -7,7 +7,7 @@ import com.gh.common.exposure.ExposureSource import com.gh.common.exposure.ExposureUtils import com.gh.gamecenter.core.utils.UrlFilterUtils import com.gh.common.view.ConfigFilterView -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.entity.SubjectSettingEntity import com.gh.gamecenter.entity.TagEntity diff --git a/app/src/main/java/com/gh/gamecenter/toolbox/ToolBoxBlockActivity.kt b/app/src/main/java/com/gh/gamecenter/toolbox/ToolBoxBlockActivity.kt index 42d44b27bb..44dcf32037 100644 --- a/app/src/main/java/com/gh/gamecenter/toolbox/ToolBoxBlockActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/toolbox/ToolBoxBlockActivity.kt @@ -19,7 +19,7 @@ import com.gh.gamecenter.common.view.CustomLinkMovementMethod import com.gh.gamecenter.R import com.gh.gamecenter.SuggestionActivity import com.gh.gamecenter.WebActivity -import com.gh.gamecenter.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.LoadStatus import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* diff --git a/app/src/main/java/com/gh/gamecenter/toolbox/ToolBoxBlockAdapter.kt b/app/src/main/java/com/gh/gamecenter/toolbox/ToolBoxBlockAdapter.kt index 54805f9d0a..f4acdf39dc 100644 --- a/app/src/main/java/com/gh/gamecenter/toolbox/ToolBoxBlockAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/toolbox/ToolBoxBlockAdapter.kt @@ -8,11 +8,11 @@ import com.gh.gamecenter.R import com.gh.gamecenter.common.base.BaseRecyclerViewHolder import com.gh.gamecenter.common.utils.goneIf import com.gh.gamecenter.common.utils.safelyGetInRelease -import com.gh.gamecenter.baselist.ListExecutor +import com.gh.gamecenter.common.baselist.ListExecutor import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.databinding.ToolboxBlockItemBinding import com.gh.gamecenter.entity.ToolBoxBlockEntity -import com.gh.gamecenter.entity.ToolBoxEntity +import com.gh.gamecenter.common.entity.ToolBoxEntity import com.lightgame.adapter.BaseRecyclerAdapter class ToolBoxBlockAdapter(context: Context, private val mViewModel: ToolBoxViewModel) : BaseRecyclerAdapter(context) { diff --git a/app/src/main/java/com/gh/gamecenter/toolbox/ToolBoxItemAdapter.kt b/app/src/main/java/com/gh/gamecenter/toolbox/ToolBoxItemAdapter.kt index 8716e351fb..66b31f9f43 100644 --- a/app/src/main/java/com/gh/gamecenter/toolbox/ToolBoxItemAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/toolbox/ToolBoxItemAdapter.kt @@ -8,7 +8,7 @@ import com.gh.common.constant.Config import com.gh.gamecenter.NewsDetailActivity import com.gh.gamecenter.R import com.gh.gamecenter.WebActivity.Companion.getWebByCollectionTools -import com.gh.gamecenter.baselist.ListExecutor +import com.gh.gamecenter.common.baselist.ListExecutor import com.gh.gamecenter.common.base.BaseRecyclerViewHolder import com.gh.gamecenter.common.utils.ImageUtils.display import com.gh.gamecenter.common.utils.NightModeUtils @@ -16,7 +16,7 @@ import com.gh.gamecenter.common.utils.goneIf import com.gh.gamecenter.common.utils.safelyGetInRelease import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.databinding.ItemToolboxBinding -import com.gh.gamecenter.entity.ToolBoxEntity +import com.gh.gamecenter.common.entity.ToolBoxEntity import com.lightgame.adapter.BaseRecyclerAdapter class ToolBoxItemAdapter(context: Context, private val isBlockInside: Boolean = false, private val mViewModel: ToolBoxViewModel) : diff --git a/app/src/main/java/com/gh/gamecenter/toolbox/ToolBoxViewModel.kt b/app/src/main/java/com/gh/gamecenter/toolbox/ToolBoxViewModel.kt index fc0a53b7b6..e8656837f2 100644 --- a/app/src/main/java/com/gh/gamecenter/toolbox/ToolBoxViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/toolbox/ToolBoxViewModel.kt @@ -4,14 +4,14 @@ import android.app.Application import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.MutableLiveData import com.gh.gamecenter.common.constant.Constants -import com.gh.gamecenter.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.LoadStatus import com.gh.gamecenter.core.utils.GsonUtils import com.gh.gamecenter.core.utils.SPUtils import com.gh.gamecenter.core.utils.TimeUtils import com.gh.gamecenter.common.utils.toJson import com.gh.gamecenter.core.utils.UrlFilterUtils import com.gh.gamecenter.entity.ToolBoxBlockEntity -import com.gh.gamecenter.entity.ToolBoxEntity +import com.gh.gamecenter.common.entity.ToolBoxEntity import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.retrofit.RetrofitManager import com.google.gson.reflect.TypeToken diff --git a/app/src/main/java/com/gh/gamecenter/video/data/VideoDataAdapter.kt b/app/src/main/java/com/gh/gamecenter/video/data/VideoDataAdapter.kt index 41c79f83f1..94f97e2f89 100644 --- a/app/src/main/java/com/gh/gamecenter/video/data/VideoDataAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/video/data/VideoDataAdapter.kt @@ -9,7 +9,7 @@ import com.gh.gamecenter.core.utils.SpanBuilder import com.gh.gamecenter.common.utils.toBinding import com.gh.gamecenter.common.view.CustomMarkerView import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.databinding.ItemVideoDataChartBinding import com.gh.gamecenter.databinding.ItemVideoDataOverviewBinding import com.gh.gamecenter.entity.VideoDataItem diff --git a/app/src/main/java/com/gh/gamecenter/video/data/VideoDataFragment.kt b/app/src/main/java/com/gh/gamecenter/video/data/VideoDataFragment.kt index 16b0794c6c..e0c2691731 100644 --- a/app/src/main/java/com/gh/gamecenter/video/data/VideoDataFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/video/data/VideoDataFragment.kt @@ -15,7 +15,7 @@ import com.gh.gamecenter.common.view.FixLinearLayoutManager import com.gh.gamecenter.common.view.VerticalItemDecoration import com.gh.gamecenter.core.utils.DisplayUtils import com.gh.gamecenter.databinding.FragmentVideoDataBinding -import com.gh.gamecenter.mvvm.Status +import com.gh.gamecenter.common.mvvm.Status class VideoDataFragment : BaseFragment() { private lateinit var mViewModel: VideoDataViewModel diff --git a/app/src/main/java/com/gh/gamecenter/video/data/VideoDataViewModel.kt b/app/src/main/java/com/gh/gamecenter/video/data/VideoDataViewModel.kt index d329d2a5a9..bb04199c8b 100644 --- a/app/src/main/java/com/gh/gamecenter/video/data/VideoDataViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/video/data/VideoDataViewModel.kt @@ -6,8 +6,8 @@ import androidx.lifecycle.MutableLiveData import com.gh.gamecenter.core.utils.TimeUtils import com.gh.gamecenter.entity.VideoDataItem import com.gh.gamecenter.entity.VideoDataOverViewEntity -import com.gh.gamecenter.manager.UserManager -import com.gh.gamecenter.mvvm.Resource +import com.gh.gamecenter.login.user.UserManager +import com.gh.gamecenter.common.mvvm.Resource import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.retrofit.RetrofitManager import io.reactivex.android.schedulers.AndroidSchedulers diff --git a/app/src/main/java/com/gh/gamecenter/video/detail/DetailPlayerView.kt b/app/src/main/java/com/gh/gamecenter/video/detail/DetailPlayerView.kt index 5550c2a9c5..a25362302d 100644 --- a/app/src/main/java/com/gh/gamecenter/video/detail/DetailPlayerView.kt +++ b/app/src/main/java/com/gh/gamecenter/video/detail/DetailPlayerView.kt @@ -38,7 +38,7 @@ import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.LayoutVideoDetailSurfaceBinding import com.gh.gamecenter.entity.VideoEntity import com.gh.gamecenter.eventbus.EBRecommed -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.qa.comment.CommentActivity import com.gh.gamecenter.video.game.GameVideoActivity import com.halo.assistant.HaloApp diff --git a/app/src/main/java/com/gh/gamecenter/video/detail/HomeVideoFragment.kt b/app/src/main/java/com/gh/gamecenter/video/detail/HomeVideoFragment.kt index 1939bfcc3a..99af137b26 100644 --- a/app/src/main/java/com/gh/gamecenter/video/detail/HomeVideoFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/video/detail/HomeVideoFragment.kt @@ -23,7 +23,7 @@ import com.gh.gamecenter.common.utils.visibleIf import com.gh.gamecenter.common.utils.ImageUtils import com.gh.gamecenter.core.utils.MtaHelper import com.gh.gamecenter.databinding.FragmentHomeVideoBinding -import com.gh.gamecenter.entity.LinkEntity +import com.gh.gamecenter.common.entity.LinkEntity import com.gh.gamecenter.entity.SettingsEntity import com.gh.gamecenter.eventbus.EBRecommed import io.reactivex.disposables.Disposable diff --git a/app/src/main/java/com/gh/gamecenter/video/detail/VideoDetailContainerFragment.kt b/app/src/main/java/com/gh/gamecenter/video/detail/VideoDetailContainerFragment.kt index 76888e690b..b796abe5db 100644 --- a/app/src/main/java/com/gh/gamecenter/video/detail/VideoDetailContainerFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/video/detail/VideoDetailContainerFragment.kt @@ -26,16 +26,17 @@ import com.gh.download.DownloadManager import com.gh.download.cache.ExoCacheManager import com.gh.gamecenter.R import com.gh.gamecenter.common.constant.EntranceConsts +import com.gh.gamecenter.common.eventbus.EBReuse import com.gh.gamecenter.common.eventbus.EBShare import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.FragmentVideoDetailContainerBinding import com.gh.gamecenter.entity.VideoEntity import com.gh.gamecenter.eventbus.* -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.qa.comment.CommentActivity import com.gh.gamecenter.qa.comment.NewCommentFragment -import com.gh.gamecenter.user.UserViewModel +import com.gh.gamecenter.login.user.UserViewModel import com.halo.assistant.HaloApp import com.lightgame.download.DataWatcher import com.lightgame.download.DownloadEntity diff --git a/app/src/main/java/com/gh/gamecenter/video/detail/VideoDetailContainerViewModel.kt b/app/src/main/java/com/gh/gamecenter/video/detail/VideoDetailContainerViewModel.kt index 2647fa6c4d..27bb565ae8 100644 --- a/app/src/main/java/com/gh/gamecenter/video/detail/VideoDetailContainerViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/video/detail/VideoDetailContainerViewModel.kt @@ -19,9 +19,10 @@ import com.gh.gamecenter.entity.MyVideoEntity import com.gh.gamecenter.entity.User import com.gh.gamecenter.entity.VideoEntity import com.gh.gamecenter.eventbus.EBUserFollow -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.common.retrofit.Response +import com.gh.gamecenter.energy.utils.EnergyTaskHelper import com.gh.gamecenter.retrofit.RetrofitManager import com.google.gson.JsonObject import com.lightgame.utils.Utils diff --git a/app/src/main/java/com/gh/gamecenter/video/game/GameVideoActivity.kt b/app/src/main/java/com/gh/gamecenter/video/game/GameVideoActivity.kt index bd6e68597c..1f554767fa 100644 --- a/app/src/main/java/com/gh/gamecenter/video/game/GameVideoActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/video/game/GameVideoActivity.kt @@ -19,7 +19,7 @@ import com.gh.gamecenter.common.utils.observeNonNull import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.core.utils.DisplayUtils import com.gh.gamecenter.databinding.ActivityVideoGameBinding -import com.gh.gamecenter.mvvm.Status +import com.gh.gamecenter.common.mvvm.Status class GameVideoActivity : ToolBarActivity() { diff --git a/app/src/main/java/com/gh/gamecenter/video/game/GameVideoAdapter.kt b/app/src/main/java/com/gh/gamecenter/video/game/GameVideoAdapter.kt index e1a906507a..e2df4f141b 100644 --- a/app/src/main/java/com/gh/gamecenter/video/game/GameVideoAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/video/game/GameVideoAdapter.kt @@ -8,8 +8,8 @@ import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.DirectUtils import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.NormalListViewModel +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.NormalListViewModel import com.gh.gamecenter.databinding.VideoNewItemBinding import com.gh.gamecenter.entity.MyVideoEntity import com.gh.gamecenter.video.VideoItemViewHolder diff --git a/app/src/main/java/com/gh/gamecenter/video/game/GameVideoFragment.kt b/app/src/main/java/com/gh/gamecenter/video/game/GameVideoFragment.kt index 5f53bd1126..30d7ec3ac4 100644 --- a/app/src/main/java/com/gh/gamecenter/video/game/GameVideoFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/video/game/GameVideoFragment.kt @@ -9,8 +9,8 @@ import com.gh.common.constant.Config import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.view.GridSpacingItemDecoration -import com.gh.gamecenter.baselist.ListFragment -import com.gh.gamecenter.baselist.NormalListViewModel +import com.gh.gamecenter.common.baselist.ListFragment +import com.gh.gamecenter.common.baselist.NormalListViewModel import com.gh.gamecenter.entity.MyVideoEntity import com.gh.gamecenter.retrofit.RetrofitManager import com.halo.assistant.HaloApp diff --git a/app/src/main/java/com/gh/gamecenter/video/game/GameVideoViewModel.kt b/app/src/main/java/com/gh/gamecenter/video/game/GameVideoViewModel.kt index 4a29c2ef13..75fa86fb10 100644 --- a/app/src/main/java/com/gh/gamecenter/video/game/GameVideoViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/video/game/GameVideoViewModel.kt @@ -7,7 +7,7 @@ import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider import com.gh.gamecenter.entity.GameVideoInfo -import com.gh.gamecenter.mvvm.Resource +import com.gh.gamecenter.common.mvvm.Resource import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.retrofit.RetrofitManager import io.reactivex.android.schedulers.AndroidSchedulers diff --git a/app/src/main/java/com/gh/gamecenter/video/label/VideoLabelFragment.kt b/app/src/main/java/com/gh/gamecenter/video/label/VideoLabelFragment.kt index 69314d48b3..8de3639ab9 100644 --- a/app/src/main/java/com/gh/gamecenter/video/label/VideoLabelFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/video/label/VideoLabelFragment.kt @@ -11,9 +11,9 @@ import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.utils.viewModelProvider import com.gh.gamecenter.common.view.divider.HorizontalDividerItemDecoration import com.gh.gamecenter.R -import com.gh.gamecenter.databinding.FragmentListBaseBinding import com.gh.gamecenter.entity.ActivityLabelEntity import com.gh.gamecenter.common.base.fragment.ToolbarFragment +import com.gh.gamecenter.common.databinding.FragmentListBaseBinding import com.gh.gamecenter.qa.dialog.ChooseActivityDialogFragment class VideoLabelFragment : ToolbarFragment() { diff --git a/app/src/main/java/com/gh/gamecenter/video/upload/view/UploadVideoActivity.kt b/app/src/main/java/com/gh/gamecenter/video/upload/view/UploadVideoActivity.kt index 4668a86740..10ef9cbdf4 100644 --- a/app/src/main/java/com/gh/gamecenter/video/upload/view/UploadVideoActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/video/upload/view/UploadVideoActivity.kt @@ -45,7 +45,7 @@ import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.ActivityVideoUplaodBinding import com.gh.gamecenter.entity.* -import com.gh.gamecenter.mvvm.Status +import com.gh.gamecenter.common.mvvm.Status import com.gh.gamecenter.qa.editor.GameActivity import com.gh.gamecenter.video.label.VideoLabelActivity import com.gh.gamecenter.video.poster.PosterEditActivity diff --git a/app/src/main/java/com/gh/gamecenter/video/upload/view/UploadVideoViewModel.kt b/app/src/main/java/com/gh/gamecenter/video/upload/view/UploadVideoViewModel.kt index d6abc1d74a..8391dbc28f 100644 --- a/app/src/main/java/com/gh/gamecenter/video/upload/view/UploadVideoViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/video/upload/view/UploadVideoViewModel.kt @@ -14,11 +14,12 @@ import com.gh.gamecenter.common.utils.toJson import com.gh.gamecenter.common.utils.tryCatchInRelease import com.gh.gamecenter.common.utils.tryWithDefaultCatch import com.gh.gamecenter.entity.* -import com.gh.gamecenter.manager.UserManager -import com.gh.gamecenter.mvvm.Resource +import com.gh.gamecenter.login.user.UserManager +import com.gh.gamecenter.common.mvvm.Resource import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.common.utils.UploadImageUtils +import com.gh.gamecenter.energy.utils.EnergyTaskHelper import com.gh.gamecenter.retrofit.RetrofitManager import com.google.gson.JsonObject import com.lightgame.utils.Utils diff --git a/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoDraftAdapter.kt b/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoDraftAdapter.kt index 99a5f6130e..6f638fd622 100644 --- a/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoDraftAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoDraftAdapter.kt @@ -14,7 +14,7 @@ import com.gh.common.util.* import com.gh.gamecenter.common.view.BugFixedPopupWindow import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.DialogHelper import com.gh.gamecenter.core.utils.EmptyCallback import com.gh.gamecenter.common.utils.PermissionHelper diff --git a/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoDraftFragment.kt b/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoDraftFragment.kt index ec69e58ecb..43fc85b98d 100644 --- a/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoDraftFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoDraftFragment.kt @@ -9,7 +9,7 @@ import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.common.view.CustomDividerItemDecoration import com.gh.gamecenter.common.view.FixLinearLayoutManager import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListFragment +import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.entity.VideoDraftEntity import com.gh.gamecenter.qa.draft.CommunityDraftWrapperActivity import com.gh.gamecenter.qa.video.publish.VideoPublishActivity diff --git a/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoDraftViewModel.kt b/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoDraftViewModel.kt index 36638bcb81..1de8d86ad1 100644 --- a/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoDraftViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoDraftViewModel.kt @@ -3,9 +3,9 @@ package com.gh.gamecenter.video.videomanager import android.app.Application import com.gh.common.constant.Config import com.gh.common.util.ErrorHelper -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.entity.VideoDraftEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.retrofit.RetrofitManager import io.reactivex.Observable diff --git a/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoVerifyAdapter.kt b/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoVerifyAdapter.kt index c86fa55d56..af61faf9eb 100644 --- a/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoVerifyAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoVerifyAdapter.kt @@ -14,7 +14,7 @@ import com.gh.common.util.LogUtils import com.gh.gamecenter.common.view.BugFixedPopupWindow import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.VideoVerifyItemBinding diff --git a/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoVerifyFragment.kt b/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoVerifyFragment.kt index 6c8ecd8363..df3aa7b348 100644 --- a/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoVerifyFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoVerifyFragment.kt @@ -7,7 +7,7 @@ import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.view.FixLinearLayoutManager import com.gh.gamecenter.common.view.GridSpacingItemDecoration -import com.gh.gamecenter.baselist.ListFragment +import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.entity.VideoEntity import com.gh.gamecenter.video.upload.view.UploadVideoActivity diff --git a/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoVerifyViewModel.kt b/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoVerifyViewModel.kt index eaf712209f..f69ecc1383 100644 --- a/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoVerifyViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoVerifyViewModel.kt @@ -3,9 +3,9 @@ package com.gh.gamecenter.video.videomanager import android.app.Application import com.gh.common.constant.Config import com.gh.common.util.ErrorHelper -import com.gh.gamecenter.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.ListViewModel import com.gh.gamecenter.entity.VideoEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.retrofit.RetrofitManager import com.lightgame.utils.Utils diff --git a/app/src/main/java/com/gh/gamecenter/vote/VoteAdapter.kt b/app/src/main/java/com/gh/gamecenter/vote/VoteAdapter.kt index 0135a79073..223aa3bf71 100644 --- a/app/src/main/java/com/gh/gamecenter/vote/VoteAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/vote/VoteAdapter.kt @@ -16,8 +16,8 @@ import com.gh.gamecenter.NewsDetailActivity import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.VoteViewHolder -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.LoadStatus import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.utils.ifLogin diff --git a/app/src/main/java/com/gh/gamecenter/vote/VoteFragment.kt b/app/src/main/java/com/gh/gamecenter/vote/VoteFragment.kt index a4db73b2ce..886f6a6f01 100644 --- a/app/src/main/java/com/gh/gamecenter/vote/VoteFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/vote/VoteFragment.kt @@ -20,7 +20,7 @@ import com.gh.common.util.* import com.gh.common.util.DialogUtils import com.gh.common.util.DirectUtils.directToLinkPage import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListFragment +import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.MtaHelper.onEvent diff --git a/app/src/main/java/com/gh/gamecenter/vote/VoteViewModel.kt b/app/src/main/java/com/gh/gamecenter/vote/VoteViewModel.kt index ee9e9f49d0..4156af69f7 100644 --- a/app/src/main/java/com/gh/gamecenter/vote/VoteViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/vote/VoteViewModel.kt @@ -4,8 +4,8 @@ import android.app.Application import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.baselist.LoadType +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.common.retrofit.ApiResponse import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.core.utils.GsonUtils diff --git a/app/src/main/java/com/halo/assistant/HaloApp.java b/app/src/main/java/com/halo/assistant/HaloApp.java index 9ef89f9f38..f3bd230670 100644 --- a/app/src/main/java/com/halo/assistant/HaloApp.java +++ b/app/src/main/java/com/halo/assistant/HaloApp.java @@ -26,7 +26,6 @@ import com.facebook.imagepipeline.core.MemoryChunkType; import com.facebook.imagepipeline.decoder.ImageDecoderConfig; import com.gh.base.GlobalActivityLifecycleObserver; import com.gh.common.FixedRateJobHelper; -import com.gh.common.exposure.ExposureManager; import com.gh.common.filter.RegionSettingHelper; import com.gh.common.util.DataUtils; import com.gh.common.util.DownloadNotificationHelper; @@ -41,7 +40,6 @@ import com.gh.gamecenter.Injection; import com.gh.gamecenter.common.constant.Config; import com.gh.gamecenter.common.constant.Constants; import com.gh.gamecenter.common.image.EmptyDecoder; -import com.gh.gamecenter.common.loghub.LoghubUtils; import com.gh.gamecenter.common.tracker.Tracker; import com.gh.gamecenter.common.utils.DeviceUtils; import com.gh.gamecenter.common.utils.EmulatorUtil; @@ -62,8 +60,8 @@ import com.gh.gamecenter.receiver.DownloadReceiver; import com.gh.gamecenter.receiver.InstallAndUninstallReceiver; import com.gh.gamecenter.receiver.InstallReceiver; import com.gh.gamecenter.receiver.NetworkStateReceiver; -import com.gh.gamecenter.user.UserRepository; import com.gh.vspace.VHelper; +import com.gh.gamecenter.login.user.UserRepository; import com.github.piasy.biv.BigImageViewer; import com.github.piasy.biv.loader.fresco.FrescoImageLoader; import com.lightgame.utils.Utils; @@ -73,7 +71,6 @@ import com.shuyu.gsyvideoplayer.player.PlayerFactory; import java.lang.reflect.Method; import java.util.ServiceLoader; -import java.util.concurrent.ExecutorService; import io.reactivex.plugins.RxJavaPlugins; import tv.danmaku.ijk.media.exo2.Exo2PlayerManager; @@ -274,7 +271,7 @@ public class HaloApp extends MultiDexApplication implements Configuration.Provid FixedRateJobHelper.begin(); RegionSettingHelper.getRegionSetting(); - + ExtensionsKt.doOnMainProcessOnly(this, () -> { retrieveVGameInfoIfNeeded(); PackageRepository.initData(); diff --git a/app/src/main/java/com/halo/assistant/fragment/SettingsFragment.kt b/app/src/main/java/com/halo/assistant/fragment/SettingsFragment.kt index 84059104ac..7bf11ccc73 100644 --- a/app/src/main/java/com/halo/assistant/fragment/SettingsFragment.kt +++ b/app/src/main/java/com/halo/assistant/fragment/SettingsFragment.kt @@ -18,7 +18,6 @@ import android.widget.TextView import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModelProvider -import com.airbnb.lottie.LottieAnimationView import com.gh.common.constant.Config import com.gh.gamecenter.common.constant.Constants import com.gh.common.history.HistoryHelper @@ -38,18 +37,20 @@ import com.gh.gamecenter.core.utils.EmptyCallback import com.gh.gamecenter.core.utils.GsonUtils import com.gh.gamecenter.core.utils.SPUtils import com.gh.gamecenter.databinding.FragmentSettingBinding -import com.gh.gamecenter.entity.UserInfoEntity +import com.gh.gamecenter.login.entity.UserInfoEntity import com.gh.gamecenter.entity.WechatConfigEntity -import com.gh.gamecenter.eventbus.EBReuse +import com.gh.gamecenter.common.eventbus.EBReuse import com.gh.gamecenter.fragment.MainWrapperFragment import com.gh.gamecenter.game.upload.GameSubmissionActivity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.security.SecurityActivity import com.gh.gamecenter.setting.GameDownloadSettingActivity import com.gh.gamecenter.setting.VideoSettingActivity import com.gh.gamecenter.core.utils.DisplayUtils -import com.gh.gamecenter.user.UserRepository -import com.gh.gamecenter.user.UserViewModel +import com.gh.gamecenter.energy.utils.EnergyTaskHelper +import com.gh.gamecenter.login.user.UserRepository +import com.gh.gamecenter.login.user.UserViewModel +import com.gh.gamecenter.login.utils.LoginUtils import com.halo.assistant.HaloApp import com.lightgame.download.FileUtils import com.lightgame.utils.Utils diff --git a/app/src/main/java/com/halo/assistant/fragment/WebFragment.kt b/app/src/main/java/com/halo/assistant/fragment/WebFragment.kt index 3158e03941..d145ea112e 100644 --- a/app/src/main/java/com/halo/assistant/fragment/WebFragment.kt +++ b/app/src/main/java/com/halo/assistant/fragment/WebFragment.kt @@ -43,13 +43,12 @@ import com.gh.gamecenter.core.utils.EmptyCallback import com.gh.gamecenter.databinding.FragmentWebBinding import com.gh.gamecenter.entity.CommentnumEntity import com.gh.gamecenter.entity.MeEntity -import com.gh.gamecenter.entity.ToolBoxEntity +import com.gh.gamecenter.common.entity.ToolBoxEntity import com.gh.gamecenter.entity.WebShareEntity -import com.gh.gamecenter.eventbus.EBReuse +import com.gh.gamecenter.common.eventbus.EBReuse import com.gh.gamecenter.eventbus.EBTypeChange import com.gh.gamecenter.gamedetail.GameDetailFragment import com.gh.gamecenter.message.MessageDetailFragment -import com.gh.gamecenter.personal.PersonalFragment import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.retrofit.RetrofitManager import com.lightgame.utils.Utils @@ -244,7 +243,7 @@ class WebFragment : LazyFragment(), IScrollable { override fun onSuccess() { var userData = mToolBoxEntity?.me if (userData == null) { - userData = MeEntity() + userData = ToolBoxEntity.ToolboxMeEntity() mToolBoxEntity?.me = userData } userData.isToolkitFavorite = true @@ -643,7 +642,7 @@ class WebFragment : LazyFragment(), IScrollable { } else { // 是绑定微信页面时,登录后刷新页面 if (mIsBindWechat) { // 登录 - if (bean.type == PersonalFragment.LOGIN_TAG || (bean.type == Constants.EB_QUIT_LOGIN)) { + if (bean.type == Constants.LOGIN_TAG || (bean.type == Constants.EB_QUIT_LOGIN)) { newsWebview.reload() } } else { diff --git a/app/src/main/java/com/halo/assistant/fragment/myconcern/MyConcernAdapter.java b/app/src/main/java/com/halo/assistant/fragment/myconcern/MyConcernAdapter.java index c83416a7cd..538a4fe5da 100644 --- a/app/src/main/java/com/halo/assistant/fragment/myconcern/MyConcernAdapter.java +++ b/app/src/main/java/com/halo/assistant/fragment/myconcern/MyConcernAdapter.java @@ -19,7 +19,7 @@ import com.gh.gamecenter.R; import com.gh.gamecenter.adapter.viewholder.ConcernViewHolder; import com.gh.gamecenter.databinding.ConcernItemBinding; import com.gh.gamecenter.entity.GameEntity; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.user.UserManager; import com.gh.gamecenter.common.retrofit.Response; import com.gh.gamecenter.retrofit.RetrofitManager; import com.lightgame.adapter.BaseRecyclerAdapter; diff --git a/app/src/main/java/com/halo/assistant/fragment/myconcern/MyConcernFragment.java b/app/src/main/java/com/halo/assistant/fragment/myconcern/MyConcernFragment.java index f8e8eefb4e..332cda224a 100644 --- a/app/src/main/java/com/halo/assistant/fragment/myconcern/MyConcernFragment.java +++ b/app/src/main/java/com/halo/assistant/fragment/myconcern/MyConcernFragment.java @@ -11,7 +11,7 @@ import com.gh.common.view.Concern_LinearLayout; import com.gh.gamecenter.R; import com.gh.gamecenter.entity.GameEntity; import com.gh.gamecenter.eventbus.EBConcernChanged; -import com.gh.gamecenter.eventbus.EBReuse; +import com.gh.gamecenter.common.eventbus.EBReuse; import com.gh.gamecenter.common.base.fragment.ToolbarFragment; import org.greenrobot.eventbus.Subscribe; @@ -23,7 +23,7 @@ import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import static com.gh.gamecenter.personal.PersonalFragment.LOGIN_TAG; +import static com.gh.gamecenter.common.constant.Constants.LOGIN_TAG; /** * Created by CsHeng on 14/12/2017. diff --git a/app/src/main/java/com/halo/assistant/fragment/user/ManuallyRealNameFragment.kt b/app/src/main/java/com/halo/assistant/fragment/user/ManuallyRealNameFragment.kt index 07aad10203..3cee59f971 100644 --- a/app/src/main/java/com/halo/assistant/fragment/user/ManuallyRealNameFragment.kt +++ b/app/src/main/java/com/halo/assistant/fragment/user/ManuallyRealNameFragment.kt @@ -19,7 +19,7 @@ import com.gh.gamecenter.core.utils.ToastUtils import com.gh.gamecenter.common.utils.enlargeTouchArea import com.gh.gamecenter.common.utils.ImageUtils import com.gh.gamecenter.databinding.FragmentManuallyRealNameBinding -import com.gh.gamecenter.entity.IdCardEntity +import com.gh.gamecenter.login.entity.IdCardEntity import com.gh.gamecenter.common.base.fragment.ToolbarFragment import com.gh.gamecenter.common.utils.UploadImageUtils import com.squareup.picasso.MemoryPolicy diff --git a/app/src/main/java/com/halo/assistant/fragment/user/ManuallyRealNameViewModel.kt b/app/src/main/java/com/halo/assistant/fragment/user/ManuallyRealNameViewModel.kt index c5b33519c9..9806fdc0a8 100644 --- a/app/src/main/java/com/halo/assistant/fragment/user/ManuallyRealNameViewModel.kt +++ b/app/src/main/java/com/halo/assistant/fragment/user/ManuallyRealNameViewModel.kt @@ -7,9 +7,9 @@ import androidx.lifecycle.MutableLiveData import com.gh.common.util.ErrorHelper import com.gh.gamecenter.core.utils.GsonUtils import com.gh.gamecenter.common.utils.tryWithDefaultCatch -import com.gh.gamecenter.entity.IdCardEntity -import com.gh.gamecenter.entity.UserInfoEntity +import com.gh.gamecenter.login.entity.UserInfoEntity import com.gh.gamecenter.common.retrofit.BiResponse +import com.gh.gamecenter.login.entity.IdCardEntity import com.gh.gamecenter.retrofit.RetrofitManager import com.halo.assistant.HaloApp import io.reactivex.android.schedulers.AndroidSchedulers diff --git a/app/src/main/java/com/halo/assistant/fragment/user/RealNameInfoViewModel.kt b/app/src/main/java/com/halo/assistant/fragment/user/RealNameInfoViewModel.kt index 62a3a5cf0d..c6d86d277f 100644 --- a/app/src/main/java/com/halo/assistant/fragment/user/RealNameInfoViewModel.kt +++ b/app/src/main/java/com/halo/assistant/fragment/user/RealNameInfoViewModel.kt @@ -14,12 +14,12 @@ import com.gh.gamecenter.core.utils.SPUtils import com.gh.gamecenter.common.utils.toObject import com.gh.gamecenter.common.utils.toRequestBody import com.gh.gamecenter.common.utils.tryWithDefaultCatch -import com.gh.gamecenter.entity.IdCardEntity -import com.gh.gamecenter.entity.UserInfoEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.entity.IdCardEntity +import com.gh.gamecenter.login.entity.UserInfoEntity +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.retrofit.BiResponse -import com.gh.gamecenter.retrofit.RetrofitManager -import com.gh.gamecenter.user.UserRepository +import com.gh.gamecenter.login.retrofit.RetrofitManager +import com.gh.gamecenter.login.user.UserRepository import com.halo.assistant.HaloApp import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.schedulers.Schedulers diff --git a/app/src/main/java/com/halo/assistant/fragment/user/SelectPortraitFragment.java b/app/src/main/java/com/halo/assistant/fragment/user/SelectPortraitFragment.java index 3f429cfcf4..3ad94d023f 100644 --- a/app/src/main/java/com/halo/assistant/fragment/user/SelectPortraitFragment.java +++ b/app/src/main/java/com/halo/assistant/fragment/user/SelectPortraitFragment.java @@ -22,7 +22,7 @@ import com.gh.gamecenter.core.utils.RandomUtils; import com.gh.gamecenter.common.utils.UserIconUtils; import com.gh.gamecenter.R; import com.gh.gamecenter.common.base.fragment.ToolbarFragment; -import com.gh.gamecenter.user.UserViewModel; +import com.gh.gamecenter.login.user.UserViewModel; import com.lightgame.utils.Utils; import com.zhihu.matisse.internal.utils.PathUtils; diff --git a/app/src/main/java/com/halo/assistant/fragment/user/SelectRegionFragment.java b/app/src/main/java/com/halo/assistant/fragment/user/SelectRegionFragment.java index 24ea8c9a64..9763ba4ac2 100644 --- a/app/src/main/java/com/halo/assistant/fragment/user/SelectRegionFragment.java +++ b/app/src/main/java/com/halo/assistant/fragment/user/SelectRegionFragment.java @@ -16,9 +16,9 @@ import android.text.TextUtils; import com.gh.common.util.DialogUtils; import com.gh.gamecenter.common.constant.EntranceConsts; import com.gh.gamecenter.R; -import com.gh.gamecenter.entity.UserInfoEntity; +import com.gh.gamecenter.login.entity.UserInfoEntity; import com.gh.gamecenter.common.retrofit.ApiResponse; -import com.gh.gamecenter.user.UserViewModel; +import com.gh.gamecenter.login.user.UserViewModel; import com.gh.gamecenter.common.base.fragment.ToolbarFragment; import com.halo.assistant.fragment.user.region.OnRegionSelectListener; import com.halo.assistant.fragment.user.region.RegionCountFragment; diff --git a/app/src/main/java/com/halo/assistant/fragment/user/UserInfoEditFragment.kt b/app/src/main/java/com/halo/assistant/fragment/user/UserInfoEditFragment.kt index 48432487ac..984debdc3d 100644 --- a/app/src/main/java/com/halo/assistant/fragment/user/UserInfoEditFragment.kt +++ b/app/src/main/java/com/halo/assistant/fragment/user/UserInfoEditFragment.kt @@ -23,13 +23,13 @@ import com.gh.gamecenter.core.utils.SPUtils import com.gh.gamecenter.common.utils.fromHtml import com.gh.gamecenter.common.utils.TextHelper import com.gh.gamecenter.databinding.FragmentUserinfoEditBinding -import com.gh.gamecenter.entity.UserInfoEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.entity.UserInfoEntity +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.base.fragment.ToolbarFragment import com.gh.gamecenter.common.retrofit.JSONObjectResponse import com.gh.gamecenter.retrofit.RetrofitManager import com.gh.gamecenter.common.retrofit.ApiResponse -import com.gh.gamecenter.user.UserViewModel +import com.gh.gamecenter.login.user.UserViewModel import com.halo.assistant.HaloApp import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.schedulers.Schedulers diff --git a/app/src/main/java/com/halo/assistant/fragment/user/UserInfoFragment.kt b/app/src/main/java/com/halo/assistant/fragment/user/UserInfoFragment.kt index b7c78490a8..9f82c68d43 100644 --- a/app/src/main/java/com/halo/assistant/fragment/user/UserInfoFragment.kt +++ b/app/src/main/java/com/halo/assistant/fragment/user/UserInfoFragment.kt @@ -9,10 +9,10 @@ import com.gh.gamecenter.common.utils.ImageUtils.display import com.gh.gamecenter.core.utils.MtaHelper import com.gh.gamecenter.* import com.gh.gamecenter.databinding.FragmentUserinfoBinding -import com.gh.gamecenter.entity.UserInfoEntity +import com.gh.gamecenter.login.entity.UserInfoEntity import com.gh.gamecenter.common.base.fragment.ToolbarFragment import com.gh.gamecenter.common.retrofit.ApiResponse -import com.gh.gamecenter.user.UserViewModel +import com.gh.gamecenter.login.user.UserViewModel class UserInfoFragment : ToolbarFragment() { diff --git a/app/src/main/java/com/halo/assistant/fragment/user/region/RegionCounAdapter.java b/app/src/main/java/com/halo/assistant/fragment/user/region/RegionCounAdapter.java index c24900df55..390a5424da 100644 --- a/app/src/main/java/com/halo/assistant/fragment/user/region/RegionCounAdapter.java +++ b/app/src/main/java/com/halo/assistant/fragment/user/region/RegionCounAdapter.java @@ -12,7 +12,7 @@ import com.gh.gamecenter.R; import com.gh.gamecenter.adapter.viewholder.AreaViewHolder; import com.gh.gamecenter.databinding.AreaItemBinding; import com.gh.gamecenter.entity.LocalEntity; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.user.UserManager; import com.google.gson.reflect.TypeToken; import com.lightgame.adapter.BaseRecyclerAdapter; diff --git a/app/src/main/java/com/halo/assistant/fragment/user/region/RegionProvAdapter.java b/app/src/main/java/com/halo/assistant/fragment/user/region/RegionProvAdapter.java index 54eb1ace85..42061c357a 100644 --- a/app/src/main/java/com/halo/assistant/fragment/user/region/RegionProvAdapter.java +++ b/app/src/main/java/com/halo/assistant/fragment/user/region/RegionProvAdapter.java @@ -9,7 +9,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.gh.gamecenter.adapter.viewholder.AreaViewHolder; import com.gh.gamecenter.databinding.AreaItemBinding; -import com.gh.gamecenter.manager.UserManager; +import com.gh.gamecenter.login.user.UserManager; import com.lightgame.adapter.BaseRecyclerAdapter; import java.util.List; diff --git a/app/src/main/res/drawable-xxhdpi/ic_energy_center_sign_tomorrow.webp b/app/src/main/res/drawable-xxhdpi/ic_energy_center_sign_tomorrow.webp deleted file mode 100644 index 1acad1f6d5..0000000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_energy_center_sign_tomorrow.webp and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_off_shelve.png b/app/src/main/res/drawable-xxxhdpi/ic_off_shelve.png deleted file mode 100755 index 1fad717c54..0000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/ic_off_shelve.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_shelve.png b/app/src/main/res/drawable-xxxhdpi/ic_shelve.png deleted file mode 100755 index 5a27cebc5c..0000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/ic_shelve.png and /dev/null differ diff --git a/app/src/main/res/drawable/login_btn_bg.xml b/app/src/main/res/drawable/login_btn_bg.xml deleted file mode 100644 index 87ce80d428..0000000000 --- a/app/src/main/res/drawable/login_btn_bg.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/tab_item_energy_center.xml b/app/src/main/res/layout/tab_item_energy_center.xml deleted file mode 100644 index 2fd13ce3bc..0000000000 --- a/app/src/main/res/layout/tab_item_energy_center.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 972723e9bf..6b3fa932d6 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -64,8 +64,6 @@ 关注 新手 温馨提示 - 加载中... - 上拉加载 搜索游戏 右划一个游戏\n可以免流量分享哦 我知道了 @@ -75,14 +73,10 @@ 搜索 ]]> 加载完毕 - 加载失败,点击重试 活动 相关推荐 - 噢,网络好似开小差了 - 点击任意地方重试 暂无游戏 查看精品推荐 - 这里还没有东西哦 暂无符合条件的游戏哦 请输入文字... 搜索 @@ -293,17 +287,6 @@ 正在反馈... 下载管理 - 输入手机号码 - 输入验证码 - 获取验证码 - 输入邀请码(选填) - +86 - 登录 - 一键登录 > - QQ - 微信 - 新浪微博 - 第三方账号快捷登录 版本更新 个人中心 一键删除(%1$d个,释放%2$s) @@ -323,8 +306,6 @@ 替换素材 起一个难忘的名字吧 - 登录异常,请稍后重试 - 登录异常(%1$d),请稍后重试 选择地区 退出账号 分享 @@ -480,8 +461,6 @@ 已取消 查看更多 发送(%1$d) - 用户协议与免责声明 - http://api.ghzs666.com/v2d6/disclaimer 光环助手接入第三方SDK目录 https://resource.ghzs.com/page/third_party_sdk/index.html 光环助手评论规则 @@ -531,14 +510,12 @@ 未选择 未填写 请输入正确的链接 - 登录成功 问答 社区 推荐 问题 上拉查看历史礼包 - 没有更多了 创作不易,留言点赞一下 ~ 到底了哦~点击回到顶部 全部 @@ -636,7 +613,6 @@ 最多只能选择5个标签 至多上传20张 至多上传20个 - 登录中... 提问 至少输入6个字 @@ -697,9 +673,7 @@ %1$s 在 %2$s]]> 发表了评论 - 隐私政策 游戏服务上传准则 - https://resource.ghzs.com/page/privacy_policies/privacy_policies.html https://resource.ghzs.com/page/game_rule/game_rule.html https://resource.ghzs.com/page/user_protocol/disclaimer.html @@ -796,30 +770,6 @@ 已尝试添加到桌面 如桌面未出现图标,请开启桌面快捷方式权限 - 光能 - 领光能 - 光能中心 - 光能屋 - 光能明细 - 光能规则 - 赚光能 - 登录兑大奖 - 兑换规则 - 你来晚啦,任务已经被人做完喇~ - 前往光能屋查看更多 >> - 签到规则 - 1、每日可领取2个光能、1个成长值,最多领取连续7天签到奖励,中断或签满7天则重新计算 - 2、连续签满7天可额外奖励1次免费抽奖机会 - - 提示 - 填写邀请码需验证手机号绑定信息,检测\n到您未绑定手机(仅限新手机号绑定) - 该手机号以前已绑定过,请用\n新手机重新绑定 - 立即绑定 - 立即更换手机号 - 好友邀请码 - 输入好友邀请码 - 温馨提示:\n当你填写邀请码成功后,你和邀请人都能获取光能,必\n须是新用户才能填写邀请码获取光能哦! - 举报原因 头像、昵称、背景图、签名含有违规信息 发布大量垃圾或广告信息 @@ -836,13 +786,6 @@ 虚拟奖品领取方式 活动奖金领取方式 - 权限申请 - 完成一键登录,需向你申请授权以下权限: - 电话权限 - 识别具体运营商,方便对应运营商完成一键\n登录服务 - 马上授权 - 暂不授权,验证码登录 - 审核中...请耐心等待 审核不通过 内容审核中 diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 2fdbf793dc..5d2153177f 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -336,12 +336,6 @@ 12sp - - + + + \ No newline at end of file diff --git a/module_core/src/main/java/com/gh/gamecenter/core/provider/IConfigProvider.kt b/module_core/src/main/java/com/gh/gamecenter/core/provider/IConfigProvider.kt index fc10323e93..b01d1f8184 100644 --- a/module_core/src/main/java/com/gh/gamecenter/core/provider/IConfigProvider.kt +++ b/module_core/src/main/java/com/gh/gamecenter/core/provider/IConfigProvider.kt @@ -5,14 +5,18 @@ import com.alibaba.android.arouter.facade.template.IProvider interface IConfigProvider : IProvider { fun getTencentAppId():String fun getWechatAppId():String + fun getWechatSecret():String fun getUploadLimitSize(): Long fun getSize(): Int fun getQuality(): Int fun getRatio(): Int fun getGif(): String - fun getJpeg(): String + fun getJpeg(): String? fun getWebp(): String fun getGitThumb(): String fun getGifWaterMark(): String fun getQQ(): String + fun getQuickLoginAppId(): String + fun getQuickLoginAppKey(): String + fun getWeiboAppKey(): String } \ No newline at end of file diff --git a/module_core/src/main/java/com/gh/gamecenter/core/provider/IDataUtilsProvider.kt b/module_core/src/main/java/com/gh/gamecenter/core/provider/IDataUtilsProvider.kt new file mode 100644 index 0000000000..b93e26729b --- /dev/null +++ b/module_core/src/main/java/com/gh/gamecenter/core/provider/IDataUtilsProvider.kt @@ -0,0 +1,9 @@ +package com.gh.gamecenter.core.provider + +import com.alibaba.android.arouter.facade.template.IProvider + +interface IDataUtilsProvider : IProvider { + + fun getDeviceCertification() + +} \ No newline at end of file diff --git a/module_core/src/main/java/com/gh/gamecenter/core/provider/IDefaultUrlHandlerProvider.kt b/module_core/src/main/java/com/gh/gamecenter/core/provider/IDefaultUrlHandlerProvider.kt index b588635285..eda835d30d 100644 --- a/module_core/src/main/java/com/gh/gamecenter/core/provider/IDefaultUrlHandlerProvider.kt +++ b/module_core/src/main/java/com/gh/gamecenter/core/provider/IDefaultUrlHandlerProvider.kt @@ -5,5 +5,5 @@ import com.alibaba.android.arouter.facade.template.IProvider interface IDefaultUrlHandlerProvider : IProvider { - fun interceptUrl(context: Context, url: String, entrance: String):Boolean + fun interceptUrl(context: Context, url: String, entrance: String, bringAppToFront: Boolean = false): Boolean } \ No newline at end of file diff --git a/module_core/src/main/java/com/gh/gamecenter/core/provider/IDirectProvider.kt b/module_core/src/main/java/com/gh/gamecenter/core/provider/IDirectProvider.kt index 04ae7aaf3a..a861f68e94 100644 --- a/module_core/src/main/java/com/gh/gamecenter/core/provider/IDirectProvider.kt +++ b/module_core/src/main/java/com/gh/gamecenter/core/provider/IDirectProvider.kt @@ -9,4 +9,18 @@ interface IDirectProvider : IProvider { fun directToRegulationTestPage(context: Context) fun directToQqConversation(context: Context, qq: String) + + fun directToCommodityDetail(context: Context, commodityId: String) + + fun directToEnergyRecord(context: Context) + + fun directToEnergyRulePage(context: Context) + + fun directToInviteFriends(context: Context) + + fun directToExchangeRulePage(context: Context) + + fun directToExchangeCommodityPage(context: Context) + + fun directToLotteryParadisePage(context: Context) } \ No newline at end of file diff --git a/module_core/src/main/java/com/gh/gamecenter/core/provider/IDownloadManagerProvider.kt b/module_core/src/main/java/com/gh/gamecenter/core/provider/IDownloadManagerProvider.kt index c3046128a6..82b25ef669 100644 --- a/module_core/src/main/java/com/gh/gamecenter/core/provider/IDownloadManagerProvider.kt +++ b/module_core/src/main/java/com/gh/gamecenter/core/provider/IDownloadManagerProvider.kt @@ -5,4 +5,6 @@ import com.lightgame.download.DownloadEntity interface IDownloadManagerProvider : IProvider { fun getDownloadEntityByUrl(url: String): DownloadEntity? + + fun resumeAllInvisiblePendingTask() } \ No newline at end of file diff --git a/module_core/src/main/java/com/gh/gamecenter/core/provider/IEnergyTaskProvider.kt b/module_core/src/main/java/com/gh/gamecenter/core/provider/IEnergyTaskProvider.kt index 03163909be..1aa863ddf9 100644 --- a/module_core/src/main/java/com/gh/gamecenter/core/provider/IEnergyTaskProvider.kt +++ b/module_core/src/main/java/com/gh/gamecenter/core/provider/IEnergyTaskProvider.kt @@ -7,4 +7,8 @@ interface IEnergyTaskProvider : IProvider { fun postEnergyTaskForShare(type: String, id: String, url: String) fun logInviteResult(result: String, type: String? = null) + + fun postEnergyTask(action: String) + + fun postInviteCodeTask(code: String, from: String, callback: (() -> Unit)?) } \ No newline at end of file diff --git a/module_core/src/main/java/com/gh/gamecenter/core/provider/IErrorHelperProvider.kt b/module_core/src/main/java/com/gh/gamecenter/core/provider/IErrorHelperProvider.kt new file mode 100644 index 0000000000..5d5fb61c09 --- /dev/null +++ b/module_core/src/main/java/com/gh/gamecenter/core/provider/IErrorHelperProvider.kt @@ -0,0 +1,13 @@ +package com.gh.gamecenter.core.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.template.IProvider +import retrofit2.HttpException + +interface IErrorHelperProvider : IProvider { + + fun handleError(context: Context, errorString: String?, showHighPriorityHint: Boolean = false) + + fun handleLoginError(context: Context, httpException: HttpException?) + +} \ No newline at end of file diff --git a/module_core/src/main/java/com/gh/gamecenter/core/provider/IFloatingBackViewManagerProvider.kt b/module_core/src/main/java/com/gh/gamecenter/core/provider/IFloatingBackViewManagerProvider.kt new file mode 100644 index 0000000000..6b50b72ea6 --- /dev/null +++ b/module_core/src/main/java/com/gh/gamecenter/core/provider/IFloatingBackViewManagerProvider.kt @@ -0,0 +1,7 @@ +package com.gh.gamecenter.core.provider + +import com.alibaba.android.arouter.facade.template.IProvider + +interface IFloatingBackViewManagerProvider : IProvider { + fun enableBackViewForTaskType() +} \ No newline at end of file diff --git a/module_core/src/main/java/com/gh/gamecenter/core/provider/IGameSubstituteRepositoryProvider.kt b/module_core/src/main/java/com/gh/gamecenter/core/provider/IGameSubstituteRepositoryProvider.kt new file mode 100644 index 0000000000..9b56e63df5 --- /dev/null +++ b/module_core/src/main/java/com/gh/gamecenter/core/provider/IGameSubstituteRepositoryProvider.kt @@ -0,0 +1,9 @@ +package com.gh.gamecenter.core.provider + +import com.alibaba.android.arouter.facade.template.IProvider + +interface IGameSubstituteRepositoryProvider : IProvider { + + fun updateSubstitutableGames() + +} \ No newline at end of file diff --git a/module_core/src/main/java/com/gh/gamecenter/core/provider/ILogUtilsProvider.kt b/module_core/src/main/java/com/gh/gamecenter/core/provider/ILogUtilsProvider.kt new file mode 100644 index 0000000000..a958a50711 --- /dev/null +++ b/module_core/src/main/java/com/gh/gamecenter/core/provider/ILogUtilsProvider.kt @@ -0,0 +1,9 @@ +package com.gh.gamecenter.core.provider + +import com.alibaba.android.arouter.facade.template.IProvider + +interface ILogUtilsProvider : IProvider { + + fun login(loginStep: String, loginType: String, entrance: String) + +} \ No newline at end of file diff --git a/module_core/src/main/java/com/gh/gamecenter/core/provider/IMessageUnreadRepositoryProvider.kt b/module_core/src/main/java/com/gh/gamecenter/core/provider/IMessageUnreadRepositoryProvider.kt new file mode 100644 index 0000000000..22cff43e8c --- /dev/null +++ b/module_core/src/main/java/com/gh/gamecenter/core/provider/IMessageUnreadRepositoryProvider.kt @@ -0,0 +1,9 @@ +package com.gh.gamecenter.core.provider + +import com.alibaba.android.arouter.facade.template.IProvider + +interface IMessageUnreadRepositoryProvider : IProvider { + + fun loadMessageUnreadData() + +} \ No newline at end of file diff --git a/module_core/src/main/java/com/gh/gamecenter/core/provider/IQuickLoginProvider.kt b/module_core/src/main/java/com/gh/gamecenter/core/provider/IQuickLoginProvider.kt index ef9a7883f2..e0a6281753 100644 --- a/module_core/src/main/java/com/gh/gamecenter/core/provider/IQuickLoginProvider.kt +++ b/module_core/src/main/java/com/gh/gamecenter/core/provider/IQuickLoginProvider.kt @@ -6,4 +6,6 @@ import com.alibaba.android.arouter.facade.template.IProvider interface IQuickLoginProvider : IProvider { fun startLogin(context: Context, entrance: String) + + fun isOpenMobileData(context: Context): Boolean } \ No newline at end of file diff --git a/module_core/src/main/java/com/gh/gamecenter/core/provider/IReservationRepositoryProvider.kt b/module_core/src/main/java/com/gh/gamecenter/core/provider/IReservationRepositoryProvider.kt new file mode 100644 index 0000000000..c88b0b77ed --- /dev/null +++ b/module_core/src/main/java/com/gh/gamecenter/core/provider/IReservationRepositoryProvider.kt @@ -0,0 +1,11 @@ +package com.gh.gamecenter.core.provider + +import com.alibaba.android.arouter.facade.template.IProvider + +interface IReservationRepositoryProvider : IProvider { + + fun refreshReservations() + + fun clearReservations() + +} \ No newline at end of file diff --git a/module_core/src/main/java/com/gh/gamecenter/core/provider/ITimeUtilProvider.kt b/module_core/src/main/java/com/gh/gamecenter/core/provider/ITimeUtilProvider.kt new file mode 100644 index 0000000000..ce0ff0a61c --- /dev/null +++ b/module_core/src/main/java/com/gh/gamecenter/core/provider/ITimeUtilProvider.kt @@ -0,0 +1,11 @@ +package com.gh.gamecenter.core.provider + +import com.alibaba.android.arouter.facade.template.IProvider + +interface ITimeUtilProvider : IProvider { + + fun currentTimeMillis(): Long + + fun currentTime(): Int + +} \ No newline at end of file diff --git a/module_core/src/main/java/com/gh/gamecenter/core/provider/IWebProvider.kt b/module_core/src/main/java/com/gh/gamecenter/core/provider/IWebProvider.kt index 3a34869316..bedcb5ff3a 100644 --- a/module_core/src/main/java/com/gh/gamecenter/core/provider/IWebProvider.kt +++ b/module_core/src/main/java/com/gh/gamecenter/core/provider/IWebProvider.kt @@ -5,5 +5,7 @@ import android.content.Intent import com.alibaba.android.arouter.facade.template.IProvider interface IWebProvider : IProvider { - fun getIntent(context: Context, url: String, autoCompletionTitle: Boolean): Intent + fun getIntent(context: Context, url: String, autoCompletionTitle: Boolean): Intent? + + fun getWebIntent(context: Context, title: String, url: String): Intent? } \ No newline at end of file diff --git a/module_core/src/main/java/com/gh/gamecenter/core/provider/IWechatBindHelperProvider.kt b/module_core/src/main/java/com/gh/gamecenter/core/provider/IWechatBindHelperProvider.kt new file mode 100644 index 0000000000..f6db0e06d3 --- /dev/null +++ b/module_core/src/main/java/com/gh/gamecenter/core/provider/IWechatBindHelperProvider.kt @@ -0,0 +1,7 @@ +package com.gh.gamecenter.core.provider + +import com.alibaba.android.arouter.facade.template.IProvider + +interface IWechatBindHelperProvider : IProvider { + fun getWechatConfig() +} \ No newline at end of file diff --git a/module_energy/.gitignore b/module_energy/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/module_energy/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/module_energy/build.gradle b/module_energy/build.gradle new file mode 100644 index 0000000000..a582970daa --- /dev/null +++ b/module_energy/build.gradle @@ -0,0 +1,114 @@ +if (isRelease.toBoolean()) { + apply plugin: 'com.android.library' +} else { + apply plugin: 'com.android.application' +} +apply plugin: 'org.jetbrains.kotlin.android' +apply plugin: 'kotlin-kapt' +apply plugin: 'kotlin-parcelize' + +android { + compileSdkVersion rootProject.ext.compileSdkVersion + + defaultConfig { + if (!isRelease.toBoolean()) { + applicationId "com.gh.gamecenter" + multiDexEnabled true + + buildConfigField "String", "API_HOST", "\"${API_HOST}\"" + buildConfigField "String", "WECHAT_APPID", "\"${WECHAT_APPID}\"" + buildConfigField "String", "WECHAT_SECRET", "\"${WECHAT_SECRET}\"" + buildConfigField "String", "TENCENT_APPID", "\"${TENCENT_APPID}\"" + buildConfigField "String", "WEIBO_APPKEY", "\"${WEIBO_APPKEY}\"" + buildConfigField "String", "QUICK_LOGIN_APPID", "\"${QUICK_LOGIN_APPID}\"" + buildConfigField "String", "QUICK_LOGIN_APPKEY", "\"${QUICK_LOGIN_APPKEY}\"" + } + minSdkVersion rootProject.ext.minSdkVersion + targetSdkVersion rootProject.ext.targetSdkVersion + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + debug { + if (!isRelease.toBoolean()) { + buildConfigField "String", "DEV_API_HOST", "\"${DEV_API_HOST}\"" + } + } + + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + + if (!isRelease.toBoolean()) { + buildConfigField "String", "DEV_API_HOST", "\"${API_HOST}\"" + } + } + } + + sourceSets { + main{ + if (isRelease.toBoolean()) { + manifest.srcFile 'src/main/AndroidManifest.xml' + java { + exclude 'manifest/**' + } + } else { + java { + srcDirs = ['src/main/java', "src/energy/java"] + } + manifest.srcFile 'src/main/manifest/AndroidManifest.xml' + } + } + } + + buildFeatures { + viewBinding true + } + + kapt { + arguments { + arg("AROUTER_MODULE_NAME", project.name) + } + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } +} + +dependencies { + implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs') + + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.3' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' + + kapt "com.alibaba:arouter-compiler:$arouterVersion" + api "io.github.florent37:shapeofview:${shapeOfView}" + + if (!isRelease.toBoolean()) { + implementation "androidx.multidex:multidex:${multiDex}" + } + + implementation(project(path: ":module_common")) { + exclude group: 'androidx.swiperefreshlayout' + } + implementation(project(path: ":module_login")) { + exclude group: 'androidx.swiperefreshlayout' + } +} \ No newline at end of file diff --git a/module_energy/proguard-rules.pro b/module_energy/proguard-rules.pro new file mode 100644 index 0000000000..481bb43481 --- /dev/null +++ b/module_energy/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/module_energy/src/androidTest/java/com/gh/gamecenter/energy/ExampleInstrumentedTest.kt b/module_energy/src/androidTest/java/com/gh/gamecenter/energy/ExampleInstrumentedTest.kt new file mode 100644 index 0000000000..44691cf754 --- /dev/null +++ b/module_energy/src/androidTest/java/com/gh/gamecenter/energy/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.gh.gamecenter.energy + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.gh.gamecenter.energy.test", appContext.packageName) + } +} \ No newline at end of file diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/CheckLoginUtils.java b/module_energy/src/energy/java/com/gh/gamecenter/energy/CheckLoginUtils.java new file mode 100644 index 0000000000..64581635cb --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/CheckLoginUtils.java @@ -0,0 +1,58 @@ +package com.gh.gamecenter.energy; + +import android.app.Activity; +import android.content.Context; +import android.text.TextUtils; + +import com.gh.gamecenter.common.constant.Constants; +import com.gh.gamecenter.common.utils.NetworkUtils; +import com.gh.gamecenter.core.utils.CurrentActivityHolder; +import com.gh.gamecenter.core.utils.SPUtils; +import com.gh.gamecenter.login.user.UserManager; +import com.gh.gamecenter.login.utils.QuickLoginHelper; +import com.lightgame.utils.Utils; + + +/** + * Created by khy on 28/06/17. + */ + +public class CheckLoginUtils { + + public static void checkLogin(Context context, String entrance, OnLoginListener listener) { + if (!isLogin()) { + if (listener != null) Utils.toast(context, "需要登录"); +// LogUtils.login("dialog", null, entrance); +// LogUtils.login("activity", null, entrance); + + if (SPUtils.getBoolean(Constants.SP_HAS_GET_PHONE_INFO) || NetworkUtils.isOpenMobileData(context)) { + // 需要确保传入的 context 不为 application + if (!(context instanceof Activity)) { + context = CurrentActivityHolder.getCurrentActivity(); + } + + if (context != null) { + QuickLoginHelper.startLogin(context, entrance); + } + } else { + // 有可能App未启动 +// Bundle bundle = new Bundle(); +// bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance); +// bundle.putString(EntranceConsts.KEY_TO, LoginActivity.class.getName()); +// EntranceUtils.jumpActivity(context, bundle); + } + } else { + if (listener != null) { + listener.onLogin(); + } + } + } + + public static boolean isLogin() { + return !TextUtils.isEmpty(UserManager.getInstance().getToken()); + } + + public interface OnLoginListener { + void onLogin(); + } +} diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/DataUtils.java b/module_energy/src/energy/java/com/gh/gamecenter/energy/DataUtils.java new file mode 100644 index 0000000000..c5b37fb35f --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/DataUtils.java @@ -0,0 +1,74 @@ +package com.gh.gamecenter.energy; + +import android.app.Application; +import android.content.Context; +import com.gh.gamecenter.core.AppExecutor; +import com.lightgame.config.CommonDebug; + +import io.sentry.Sentry; +import io.sentry.android.core.SentryAndroid; + +/** + * Created by LGT on 2016/6/15. + * 数据收集 工具类 (TalkingData、MTA) + */ +public class DataUtils { + + /** + * 初始化各种统计工具,仅在release build(非debug)模式启用统计 + */ + public static void init(final Application context, String channel) { + if (CommonDebug.IS_DEBUG) { + return; + } + + // 初始化 Sentry 约占用 90ms,这里切换到子线程初始化 + AppExecutor.getIoExecutor().execute(() -> initSentry(context, channel)); + } + + private static void initSentry(Context context, String channel) { + SentryAndroid.init(context, options -> { + // Sentry 疯狂报 ANR (很大一部分还是莫名奇妙的 ANR)严重影响到其它闪退日志的收集 + // 这里将它局限到只有官网渠道的包才统计 ANR + if ("GH_206".equals(channel) || "GH_BETA".equals(channel)) { + options.setAnrEnabled(true); + options.setAnrTimeoutIntervalMillis(6000); + } else { + options.setAnrEnabled(false); + } + + options.setDebug(BuildConfig.DEBUG); + options.setEnableSessionTracking(true); +// options.setEnvironment(BuildConfig.FLAVOR); + options.setDsn("https://6b1caf0d17c1408e8680f3f73ff80bd0@sentry.shanqu.cc/22"); + + options.setBeforeSend((event, hint) -> { + if (BuildConfig.DEBUG) { + return null; + } else { + return event; + } + }); + +// options.setBeforeBreadcrumb(((breadcrumb, hint) -> { +// if ("ui.lifecycle".equals(breadcrumb.getCategory()) && "started".equals(breadcrumb.getData("state")) && GlobalActivityManager.INSTANCE.getCurrentActivity() instanceof BaseActivity) { +// Pair businessId = ((BaseActivity) GlobalActivityManager.INSTANCE.getCurrentActivity()).getBusinessId(); +// if (businessId != null) { +// breadcrumb.setData("businessId1", businessId.component1()); +// breadcrumb.setData("businessId2", businessId.component2()); +// } +// } +// return breadcrumb; +// })); + }); + + Sentry.configureScope(scope -> { + if (com.gh.gamecenter.common.BuildConfig.BUILD_TIME != 0L) { + scope.setTag("alias", "内测版" + BuildConfig.VERSION_NAME); + } else { + scope.setTag("alias", "正式版" + BuildConfig.VERSION_NAME); + scope.setTag("channel", channel); + } + }); + } +} diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/EnergyModuleApp.kt b/module_energy/src/energy/java/com/gh/gamecenter/energy/EnergyModuleApp.kt new file mode 100644 index 0000000000..41ed97d82d --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/EnergyModuleApp.kt @@ -0,0 +1,101 @@ +package com.gh.gamecenter.energy + +import android.os.Build +import androidx.multidex.MultiDexApplication +import com.alibaba.android.arouter.launcher.ARouter +import com.facebook.animated.giflite.GifDecoder +import com.facebook.common.logging.FLog +import com.facebook.imageformat.DefaultImageFormats +import com.facebook.imagepipeline.core.ImagePipelineConfig +import com.facebook.imagepipeline.core.ImageTranscoderType +import com.facebook.imagepipeline.core.MemoryChunkType +import com.facebook.imagepipeline.decoder.ImageDecoderConfig +import com.gh.gamecenter.common.image.EmptyDecoder +import com.gh.gamecenter.common.utils.ImageUtils.disableAnimatedImage +import com.gh.gamecenter.common.utils.ImageUtils.isFrescoInitialized +import com.gh.gamecenter.common.utils.TimestampUtils +import com.gh.gamecenter.core.iinterface.IApplication +import com.github.piasy.biv.BigImageViewer +import com.github.piasy.biv.loader.fresco.FrescoImageLoader +import java.util.* + +class EnergyModuleApp: MultiDexApplication() { + + private val mApplicationList = ServiceLoader.load(IApplication::class.java, this.javaClass.classLoader) + + override fun onCreate() { + super.onCreate() + initArouter() + mApp = this + for (application in mApplicationList) { + application.onCreate(this) + } + TimestampUtils.initMap() + initFresco() + DataUtils.init(this, "") + } + + private fun initArouter() { + if (BuildConfig.DEBUG) { // 这两行必须写在init之前,否则这些配置在init过程中将无效 + ARouter.openLog() // 打印日志 + ARouter.openDebug() // 开启调试模式(如果在InstantRun模式下运行,必须开启调试模式!线上版本需要关闭,否则有安全风险) + } + ARouter.init(this) // 尽可能早,推荐在Application中初始化 + } + + fun initFresco() { + // 初始化 Fresco(BigImageViewer 已包含Fresco) + if (!isFrescoInitialized()) { + // 在 5.0 & 5.1 设备上 disable native code,原因是应用附带了 arm64 的 SO 以后在部分 5.0/5.1 设备 + // 会出现找不到 arm64 so 的情况,具体可见 + // https://sentry.ghzs.com/organizations/lightgame/issues/53107/ + // 所以这里尝试在 5.0 & 5.1 设备上关闭 fresco 的 native 解码,应该会让 5.0 & 5.1 的设备 OOM 概率提高,但先试试效果 + // 同时禁用动图 + val pipelineConfigBuilder = ImagePipelineConfig.newBuilder(this) + val decodeConfigBuilder = ImageDecoderConfig.newBuilder() + if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP + || Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP_MR1 + ) { + pipelineConfigBuilder.setMemoryChunkType(MemoryChunkType.BUFFER_MEMORY) + .setImageTranscoderType(ImageTranscoderType.JAVA_TRANSCODER) + decodeConfigBuilder.overrideDecoder(DefaultImageFormats.GIF, GifDecoder()).build() + val manufacture = Build.MANUFACTURER.lowercase(Locale.getDefault()) + + // OPPO 和 VIVO 的 5.1.1 设备还会去加载 WEBP_ANIMATED 的 SO, + // 实测没有发现有地方使用 WEBP_ANIMATED 的图片,这里用空占位图来替换 WEBP 动图 + if ("oppo" == manufacture || "vivo" == manufacture) { + decodeConfigBuilder.overrideDecoder( + DefaultImageFormats.WEBP_ANIMATED, + EmptyDecoder() + ).build() + } + pipelineConfigBuilder + .setImageDecoderConfig(decodeConfigBuilder.build()) + .experiment() + .setNativeCodeDisabled(true) + + // 图片仅加载静态图片 + disableAnimatedImage() + } + try { + BigImageViewer.initialize( + FrescoImageLoader.with( + this, + pipelineConfigBuilder.build() + ) + ) + } catch (e: Throwable) { + e.printStackTrace() + } + FLog.setMinimumLoggingLevel(FLog.VERBOSE) + } + } + + companion object { + private lateinit var mApp: EnergyModuleApp + + fun getInstance(): EnergyModuleApp { + return mApp + } + } +} \ No newline at end of file diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/ActivationProviderImpl.kt b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/ActivationProviderImpl.kt new file mode 100644 index 0000000000..0e5cdb18b9 --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/ActivationProviderImpl.kt @@ -0,0 +1,18 @@ +package com.gh.gamecenter.energy.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IActivationProvider + +@Route(path = RouteConsts.provider.activation, name = "ActivationHelper暴露服务") +class ActivationProviderImpl : IActivationProvider { + override fun init(context: Context?) { + + } + + override fun sendActivationInfo() { + } + + +} \ No newline at end of file diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/AppProviderImpl.kt b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/AppProviderImpl.kt new file mode 100644 index 0000000000..156a522e04 --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/AppProviderImpl.kt @@ -0,0 +1,51 @@ +package com.gh.gamecenter.energy.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IAppProvider +import com.gh.gamecenter.energy.HaloApp +import com.gh.gamecenter.energy.R + +@Route(path = RouteConsts.provider.app, name = "Application暴露服务") +class AppProviderImpl : IAppProvider { + override fun init(context: Context?) { + + } + + override fun getAppName(): String { + return HaloApp.getInstance().getString(R.string.app_name) + } + + override fun getGid(): String { + return "" + } + + override fun getOaid(): String { + return "" + } + + override fun getChannel(): String { + return "" + } + + override fun getUserAgent(): String { + return "" + } + + override fun getServerUserMark(): String { + return "" + } + + override fun getDeviceRamSize(): Long { + return 0L + } + + override fun getTemporaryLocalDeviceId(): String { + return "" + } + + override fun isUserAcceptPrivacyPolicy(context: Context): Boolean { + return true + } +} \ No newline at end of file diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/BuildConfigImpl.kt b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/BuildConfigImpl.kt new file mode 100644 index 0000000000..3f5588830a --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/BuildConfigImpl.kt @@ -0,0 +1,31 @@ +package com.gh.gamecenter.energy.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IBuildConfigProvider +import com.gh.gamecenter.energy.BuildConfig + +@Route(path = RouteConsts.provider.buildConfig, name = "BuildConfig暴露服务") +class BuildConfigImpl : IBuildConfigProvider { + override fun init(context: Context?) { + + } + + override fun getApplicationId(): String = BuildConfig.APPLICATION_ID + + override fun getVersionName(): String = BuildConfig.VERSION_NAME + + override fun getExposureVersion(): String = "" + + override fun isDebug(): Boolean = BuildConfig.DEBUG + + override fun getApiHost(): String = BuildConfig.API_HOST + + override fun getDevApiHost(): String = BuildConfig.DEV_API_HOST + + override fun getNewApiHost(): String = "" + + override fun getNewDevApiHost(): String = "" + +} \ No newline at end of file diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/CheckLoginProviderImpl.kt b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/CheckLoginProviderImpl.kt new file mode 100644 index 0000000000..c356f0f963 --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/CheckLoginProviderImpl.kt @@ -0,0 +1,18 @@ +package com.gh.gamecenter.energy.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.ICheckLoginProvider +import com.gh.gamecenter.energy.CheckLoginUtils + +@Route(path = RouteConsts.provider.checkLogin, name = "CheckLoginUtils暴露服务") +class CheckLoginProviderImpl : ICheckLoginProvider { + override fun checkLogin(context: Context, entrance: String, action: (() -> Unit)?) { + CheckLoginUtils.checkLogin(context, entrance, action) + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/ConfigProviderImpl.kt b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/ConfigProviderImpl.kt new file mode 100644 index 0000000000..4b84ca9ea4 --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/ConfigProviderImpl.kt @@ -0,0 +1,78 @@ +package com.gh.gamecenter.energy.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IConfigProvider +import com.gh.gamecenter.energy.BuildConfig + +@Route(path = RouteConsts.provider.config, name = "Config暴露服务") +class ConfigProviderImpl : IConfigProvider { + override fun getTencentAppId(): String { + return BuildConfig.TENCENT_APPID + } + + override fun getWechatAppId(): String { + return BuildConfig.WECHAT_APPID + } + + override fun getWechatSecret(): String { + return BuildConfig.WECHAT_SECRET + } + + override fun getUploadLimitSize(): Long { + return 0L + } + + override fun getSize(): Int { + return 0 + } + + override fun getRatio(): Int { + return 0 + } + + override fun getQuality(): Int { + return 0 + } + + override fun getGif(): String { + return "" + } + + override fun getJpeg(): String? { + return null + } + + override fun getWebp(): String { + return "" + } + + override fun getGitThumb(): String { + return "" + } + + override fun getGifWaterMark(): String { + return "" + } + + override fun getQQ(): String { + return "" + } + + override fun getQuickLoginAppId(): String { + return BuildConfig.QUICK_LOGIN_APPID + } + + override fun getQuickLoginAppKey(): String { + return BuildConfig.QUICK_LOGIN_APPKEY + } + + override fun getWeiboAppKey(): String { + return BuildConfig.WEIBO_APPKEY + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/DataUtilsProviderImpl.kt b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/DataUtilsProviderImpl.kt new file mode 100644 index 0000000000..d980a319bd --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/DataUtilsProviderImpl.kt @@ -0,0 +1,17 @@ +package com.gh.gamecenter.energy.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IDataUtilsProvider + +@Route(path = RouteConsts.provider.dataUtils, name = "DataUtils暴露服务") +class DataUtilsProviderImpl : IDataUtilsProvider { + + override fun getDeviceCertification() { + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/DefaultUrlHandlerProviderImpl.kt b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/DefaultUrlHandlerProviderImpl.kt new file mode 100644 index 0000000000..68e875891f --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/DefaultUrlHandlerProviderImpl.kt @@ -0,0 +1,25 @@ +package com.gh.gamecenter.energy.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IDefaultUrlHandlerProvider +import com.gh.gamecenter.core.utils.ToastUtils + +@Route(path = RouteConsts.provider.defaultUrlHandler, name = "DefaultUrlHandler暴露服务") +class DefaultUrlHandlerProviderImpl : IDefaultUrlHandlerProvider { + + override fun interceptUrl( + context: Context, + url: String, + entrance: String, + bringAppToFront: Boolean + ): Boolean { + ToastUtils.toast("调用->DefaultUrlHandlerProviderImpl.interceptUrl") + return false + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/DialogUtilsProviderImpl.kt b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/DialogUtilsProviderImpl.kt new file mode 100644 index 0000000000..dc92f23603 --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/DialogUtilsProviderImpl.kt @@ -0,0 +1,18 @@ +package com.gh.gamecenter.energy.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IDialogUtilsProvider +import com.gh.gamecenter.core.utils.ToastUtils + +@Route(path = RouteConsts.provider.dialogUtils, name = "DialogUtils暴露服务") +class DialogUtilsProviderImpl : IDialogUtilsProvider { + override fun showRegulationTestDialog(context: Context, confirm: () -> Unit, cancel: () -> Unit) { + ToastUtils.toast("调用->DialogUtilsProviderImpl.showRegulationTestDialog") + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/DirectProviderImpl.kt b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/DirectProviderImpl.kt new file mode 100644 index 0000000000..54955d83b8 --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/DirectProviderImpl.kt @@ -0,0 +1,55 @@ +package com.gh.gamecenter.energy.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IDirectProvider +import com.gh.gamecenter.core.utils.ToastUtils + +@Route(path = RouteConsts.provider.directUtils, name = "DirectUtils暴露服务") +class DirectProviderImpl : IDirectProvider { + + override fun directToWebView(context: Context, url: String, entrance: String?) { + ToastUtils.toast("调用->DirectProviderImpl.directToWebView") + } + + override fun directToRegulationTestPage(context: Context) { + ToastUtils.toast("调用->DirectProviderImpl.directToRegulationTestPage") + } + + override fun directToQqConversation(context: Context, qq: String) { + ToastUtils.toast("调用->DirectProviderImpl.directToQqConversation") + } + + override fun directToCommodityDetail(context: Context, commodityId: String) { + ToastUtils.toast("调用->DirectProviderImpl.directToCommodityDetail") + } + + override fun directToEnergyRecord(context: Context) { + ToastUtils.toast("调用->DirectProviderImpl.directToEnergyRecord") + } + + override fun directToEnergyRulePage(context: Context) { + ToastUtils.toast("调用->DirectProviderImpl.directToEnergyRulePage") + } + + override fun directToInviteFriends(context: Context) { + ToastUtils.toast("调用->DirectProviderImpl.directToInviteFriends") + } + + override fun directToExchangeRulePage(context: Context) { + ToastUtils.toast("调用->DirectProviderImpl.directToExchangeRulePage") + } + + override fun directToExchangeCommodityPage(context: Context) { + ToastUtils.toast("调用->DirectProviderImpl.directToExchangeCommodityPage") + } + + override fun directToLotteryParadisePage(context: Context) { + ToastUtils.toast("调用->DirectProviderImpl.directToLotteryParadisePage") + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/DownloadManagerProviderImpl.kt b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/DownloadManagerProviderImpl.kt new file mode 100644 index 0000000000..1e352df912 --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/DownloadManagerProviderImpl.kt @@ -0,0 +1,23 @@ +package com.gh.gamecenter.energy.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IDownloadManagerProvider +import com.lightgame.download.DownloadEntity + +@Route(path = RouteConsts.provider.downloadManager, name = "DownloadManager暴露服务") +class DownloadManagerProviderImpl : IDownloadManagerProvider { + + override fun getDownloadEntityByUrl(url: String): DownloadEntity? { + return null + } + + override fun resumeAllInvisiblePendingTask() { + } + + override fun init(context: Context?) { + + } + +} \ No newline at end of file diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/EntranceUtilsProviderImpl.kt b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/EntranceUtilsProviderImpl.kt new file mode 100644 index 0000000000..929ed9454c --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/EntranceUtilsProviderImpl.kt @@ -0,0 +1,22 @@ +package com.gh.gamecenter.energy.provider + +import android.content.Context +import android.os.Bundle +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IEntranceUtilsProvider +import com.gh.gamecenter.core.utils.ToastUtils + +@Route(path = RouteConsts.provider.entranceUtils, name = "EntranceUtils暴露服务") +class EntranceUtilsProviderImpl: IEntranceUtilsProvider { + override fun jumpActivity(context: Context, bundle: Bundle) { + ToastUtils.toast("调用->EntranceUtilsProviderImpl.jumpActivity") + } + + override fun saveShortcut(activityName: String, bundle: Bundle?) { + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/ErrorHelperProviderImpl.kt b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/ErrorHelperProviderImpl.kt new file mode 100644 index 0000000000..f1143d758e --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/ErrorHelperProviderImpl.kt @@ -0,0 +1,28 @@ +package com.gh.gamecenter.energy.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IErrorHelperProvider +import com.gh.gamecenter.core.utils.ToastUtils +import retrofit2.HttpException + +@Route(path = RouteConsts.provider.errorHelper, name = "ErrorHelper暴露服务") +class ErrorHelperProviderImpl : IErrorHelperProvider { + + override fun handleError( + context: Context, + errorString: String?, + showHighPriorityHint: Boolean + ) { + ToastUtils.toast("调用->ErrorHelperProviderImpl.handleError") + } + + override fun handleLoginError(context: Context, httpException: HttpException?) { + ToastUtils.toast("调用->ErrorHelperProviderImpl.handleLoginError") + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/FloatingBackViewManagerProviderImpl.kt b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/FloatingBackViewManagerProviderImpl.kt new file mode 100644 index 0000000000..2700ff0911 --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/FloatingBackViewManagerProviderImpl.kt @@ -0,0 +1,19 @@ +package com.gh.gamecenter.energy.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IFloatingBackViewManagerProvider +import com.gh.gamecenter.core.utils.ToastUtils + +@Route(path = RouteConsts.provider.floatingBackViewManager, name = "FloatingViewBackManager暴露服务") +class FloatingBackViewManagerProviderImpl : IFloatingBackViewManagerProvider { + + override fun enableBackViewForTaskType() { + ToastUtils.toast("调用->FloatingBackViewManagerProviderImpl.enableBackViewForTaskType") + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/GameSubstituteRepositoryProviderImpl.kt b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/GameSubstituteRepositoryProviderImpl.kt new file mode 100644 index 0000000000..51f339eaec --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/GameSubstituteRepositoryProviderImpl.kt @@ -0,0 +1,17 @@ +package com.gh.gamecenter.energy.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IGameSubstituteRepositoryProvider + +@Route(path = RouteConsts.provider.gameSubstituteRepository, name = "GameSubstituteRepositoryHelper暴露服务") +class GameSubstituteRepositoryProviderImpl : IGameSubstituteRepositoryProvider { + + override fun updateSubstitutableGames() { + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/LinkDirectUtilsProviderImpl.kt b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/LinkDirectUtilsProviderImpl.kt new file mode 100644 index 0000000000..6c99fadb53 --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/LinkDirectUtilsProviderImpl.kt @@ -0,0 +1,26 @@ +package com.gh.gamecenter.energy.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.common.entity.LinkEntity +import com.gh.gamecenter.common.provider.ILinkDirectUtilsProvider +import com.gh.gamecenter.core.utils.ToastUtils + +@Route(path = RouteConsts.provider.linkDirectUtils, name = "DirectUtils暴露服务,主要是暴露directToLinkPage方法") +class LinkDirectUtilsProviderImpl : ILinkDirectUtilsProvider { + + override fun directToLinkPage( + context: Context, + linkEntity: LinkEntity, + entrance: String, + path: String + ) { + ToastUtils.toast("调用->LinkDirectUtilsProviderImpl.directToLinkPage") + } + + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/LogUtilsProviderImpl.kt b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/LogUtilsProviderImpl.kt new file mode 100644 index 0000000000..8c893e800e --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/LogUtilsProviderImpl.kt @@ -0,0 +1,17 @@ +package com.gh.gamecenter.energy.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.* + +@Route(path = RouteConsts.provider.logUtils, name = "LogUtils暴露服务") +class LogUtilsProviderImpl : ILogUtilsProvider { + + override fun login(loginStep: String, loginType: String, entrance: String) { + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/MessageUnreadRepositoryProviderImpl.kt b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/MessageUnreadRepositoryProviderImpl.kt new file mode 100644 index 0000000000..93090321f8 --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/MessageUnreadRepositoryProviderImpl.kt @@ -0,0 +1,17 @@ +package com.gh.gamecenter.energy.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IMessageUnreadRepositoryProvider + +@Route(path = RouteConsts.provider.messageUnreadRepository, name = "MessageUnreadRepository暴露服务") +class MessageUnreadRepositoryProviderImpl : IMessageUnreadRepositoryProvider { + + override fun loadMessageUnreadData() { + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/PackageHelperProviderImpl.kt b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/PackageHelperProviderImpl.kt new file mode 100644 index 0000000000..00303e0e68 --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/PackageHelperProviderImpl.kt @@ -0,0 +1,18 @@ +package com.gh.gamecenter.energy.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IPackageHelperProvider + +@Route(path = RouteConsts.provider.packageHelper, name = "PackageHelper暴露服务") +class PackageHelperProviderImpl : IPackageHelperProvider { + + override fun getLocalPackageNameSet(): HashSet { + return hashSetOf() + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/PackageInstallerProviderImpl.kt b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/PackageInstallerProviderImpl.kt new file mode 100644 index 0000000000..8b98a5a29e --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/PackageInstallerProviderImpl.kt @@ -0,0 +1,21 @@ +package com.gh.gamecenter.energy.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IPackageInstallerProvider +import com.lightgame.download.DownloadEntity + +@Route(path = RouteConsts.provider.packageInstaller, name = "PackageInstaller暴露服务") +class PackageInstallerProviderImpl : IPackageInstallerProvider { + + override fun install(context: Context, downloadEntity: DownloadEntity, showUnzipToast: Boolean) { + } + + override fun uninstall(context: Context, path: String) { + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/PackageUtilsProviderImpl.kt b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/PackageUtilsProviderImpl.kt new file mode 100644 index 0000000000..909b50a681 --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/PackageUtilsProviderImpl.kt @@ -0,0 +1,38 @@ +package com.gh.gamecenter.energy.provider + +import android.content.Context +import android.content.pm.PackageInfo +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IPackageUtilsProvider + +@Route(path = RouteConsts.provider.packageUtils, name = "PackageUtils暴露服务") +class PackageUtilsProviderImpl : IPackageUtilsProvider { + override fun obtainProcessName(context: Context): String? { + return "" + } + + override fun getGhVersionName(): String { + return "" + } + + override fun getGhVersionCode(): Int { + return 0 + } + + override fun getInstalledPackages(context: Context, flag: Int): List { + return listOf() + } + + override fun getApkSignatureByPackageName(context: Context, packageName: String): Array { + return arrayOf() + } + + override fun getSideLoadedInfo(): MutableMap? { + return mutableMapOf() + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/ReservationRepositoryProviderImpl.kt b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/ReservationRepositoryProviderImpl.kt new file mode 100644 index 0000000000..a3f581ce03 --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/ReservationRepositoryProviderImpl.kt @@ -0,0 +1,20 @@ +package com.gh.gamecenter.energy.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IReservationRepositoryProvider + +@Route(path = RouteConsts.provider.reservationRepository, name = "ReservationRepository暴露服务") +class ReservationRepositoryProviderImpl : IReservationRepositoryProvider { + + override fun refreshReservations() { + } + + override fun clearReservations() { + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/TimeUtilProviderImpl.kt b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/TimeUtilProviderImpl.kt new file mode 100644 index 0000000000..b67161bee5 --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/TimeUtilProviderImpl.kt @@ -0,0 +1,16 @@ +package com.gh.gamecenter.energy.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.ITimeUtilProvider + +@Route(path = RouteConsts.provider.timeUtil, name = "TimeUtil暴露服务") +class TimeUtilProviderImpl : ITimeUtilProvider { + + override fun currentTimeMillis() = System.currentTimeMillis() + + override fun currentTime() = (System.currentTimeMillis() / 1000).toInt() + + override fun init(context: Context?) {} +} \ No newline at end of file diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/WebProviderImpl.kt b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/WebProviderImpl.kt new file mode 100644 index 0000000000..7e9826f03d --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/WebProviderImpl.kt @@ -0,0 +1,22 @@ +package com.gh.gamecenter.energy.provider + +import android.content.Context +import android.content.Intent +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IWebProvider + +@Route(path = RouteConsts.provider.webActivity, name = "WebActivity暴露服务") +class WebProviderImpl : IWebProvider { + override fun getIntent(context: Context, url: String, autoCompletionTitle: Boolean): Intent? { + return null + } + + override fun getWebIntent(context: Context, title: String, url: String): Intent? { + return null + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/WechatHelperProviderImpl.kt b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/WechatHelperProviderImpl.kt new file mode 100644 index 0000000000..dc8d8a59ed --- /dev/null +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/provider/WechatHelperProviderImpl.kt @@ -0,0 +1,16 @@ +package com.gh.gamecenter.energy.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IWechatBindHelperProvider + +@Route(path = RouteConsts.provider.wechatHelper, name = "WechatHelper暴露服务") +class WechatHelperProviderImpl : IWechatBindHelperProvider { + override fun getWechatConfig() { + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/module_energy/src/main/AndroidManifest.xml b/module_energy/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..a419385fb7 --- /dev/null +++ b/module_energy/src/main/AndroidManifest.xml @@ -0,0 +1,16 @@ + + + + + + + + + + \ No newline at end of file diff --git a/module_energy/src/main/java/com/gh/gamecenter/energy/HaloApp.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/HaloApp.kt new file mode 100644 index 0000000000..e23e56053b --- /dev/null +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/HaloApp.kt @@ -0,0 +1,44 @@ +package com.gh.gamecenter.energy + +import android.app.Application +import android.content.res.Configuration +import com.gh.gamecenter.core.iinterface.IApplication +import com.google.auto.service.AutoService + +@AutoService(IApplication::class) +class HaloApp : IApplication { + + override fun attachBaseContext() { + + } + + override fun onCreate(application: Application) { + mApp = application + } + + + override fun onLowMemory() { + + } + + override fun onTerminate() { + + } + + override fun onTrimMemory(level: Int) { + + } + + override fun onConfigurationChanged(newConfig: Configuration) { + + } + + companion object { + private lateinit var mApp: Application + + @JvmStatic + fun getInstance(): Application { + return mApp + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/entity/CommodityCategoryEntity.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/entity/CommodityCategoryEntity.kt similarity index 86% rename from app/src/main/java/com/gh/gamecenter/entity/CommodityCategoryEntity.kt rename to module_energy/src/main/java/com/gh/gamecenter/energy/entity/CommodityCategoryEntity.kt index 3841a2b68d..8996b4ca03 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/CommodityCategoryEntity.kt +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/entity/CommodityCategoryEntity.kt @@ -1,4 +1,4 @@ -package com.gh.gamecenter.entity +package com.gh.gamecenter.energy.entity import android.os.Parcelable import com.google.gson.annotations.SerializedName diff --git a/app/src/main/java/com/gh/gamecenter/entity/CommodityEntity.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/entity/CommodityEntity.kt similarity index 97% rename from app/src/main/java/com/gh/gamecenter/entity/CommodityEntity.kt rename to module_energy/src/main/java/com/gh/gamecenter/energy/entity/CommodityEntity.kt index 977f46f80c..5a493a5d2c 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/CommodityEntity.kt +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/entity/CommodityEntity.kt @@ -1,4 +1,4 @@ -package com.gh.gamecenter.entity +package com.gh.gamecenter.energy.entity import android.os.Parcelable import com.google.gson.annotations.SerializedName diff --git a/app/src/main/java/com/gh/gamecenter/entity/EnergyTaskCompleteEntity.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/entity/EnergyTaskCompleteEntity.kt similarity index 86% rename from app/src/main/java/com/gh/gamecenter/entity/EnergyTaskCompleteEntity.kt rename to module_energy/src/main/java/com/gh/gamecenter/energy/entity/EnergyTaskCompleteEntity.kt index 5ffd78e254..be495a7832 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/EnergyTaskCompleteEntity.kt +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/entity/EnergyTaskCompleteEntity.kt @@ -1,4 +1,4 @@ -package com.gh.gamecenter.entity +package com.gh.gamecenter.energy.entity import android.os.Parcelable import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/com/gh/gamecenter/entity/RollNoticeEntity.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/entity/RollNoticeEntity.kt similarity index 93% rename from app/src/main/java/com/gh/gamecenter/entity/RollNoticeEntity.kt rename to module_energy/src/main/java/com/gh/gamecenter/energy/entity/RollNoticeEntity.kt index 3734bb3d52..359cee045b 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/RollNoticeEntity.kt +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/entity/RollNoticeEntity.kt @@ -1,4 +1,4 @@ -package com.gh.gamecenter.entity +package com.gh.gamecenter.energy.entity import android.os.Parcelable import com.google.gson.annotations.SerializedName diff --git a/app/src/main/java/com/gh/gamecenter/entity/SignStatusEntity.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/entity/SignStatusEntity.kt similarity index 91% rename from app/src/main/java/com/gh/gamecenter/entity/SignStatusEntity.kt rename to module_energy/src/main/java/com/gh/gamecenter/energy/entity/SignStatusEntity.kt index 7436fa1139..6365c246e3 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/SignStatusEntity.kt +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/entity/SignStatusEntity.kt @@ -1,4 +1,4 @@ -package com.gh.gamecenter.entity +package com.gh.gamecenter.energy.entity import android.os.Parcelable import com.google.gson.annotations.SerializedName diff --git a/module_energy/src/main/java/com/gh/gamecenter/energy/entity/Size.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/entity/Size.kt new file mode 100644 index 0000000000..df2f715806 --- /dev/null +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/entity/Size.kt @@ -0,0 +1,11 @@ +package com.gh.gamecenter.energy.entity + +import android.os.Parcelable +import kotlinx.parcelize.Parcelize + +@Parcelize +data class Size( + var min: Int? = -1, + var max: Int? = -1, + var text: String? = "全部大小" +) : Parcelable \ No newline at end of file diff --git a/module_energy/src/main/java/com/gh/gamecenter/energy/entity/TaskEntity.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/entity/TaskEntity.kt new file mode 100644 index 0000000000..04c1074d96 --- /dev/null +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/entity/TaskEntity.kt @@ -0,0 +1,26 @@ +package com.gh.gamecenter.energy.entity + +import android.os.Parcelable +import com.gh.gamecenter.common.entity.LinkEntity +import com.google.gson.annotations.SerializedName +import kotlinx.parcelize.Parcelize + +@Parcelize +data class TaskEntity( + @SerializedName("_id") + var id: String = "", + @SerializedName("task_id") + var taskId: String = "", + var name: String = "", + var descr: String = "", + var icon: String = "", + var action: String = "", + var energy: Long = 0, + var done: Int = 0, + var limit: Int = 0, + var quota: Int = 0, // 任务指标,代表需要做多少个才算完成 + var progress: Int = 0, // 已完成的进度 + var status: String = "", // normal正常 finished完成 limiting任务达到上限 + var link: LinkEntity = LinkEntity(), + var isFixed: Boolean = false +) : Parcelable \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/eventbus/EBTask.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/eventbus/EBTask.kt similarity index 60% rename from app/src/main/java/com/gh/gamecenter/eventbus/EBTask.kt rename to module_energy/src/main/java/com/gh/gamecenter/energy/eventbus/EBTask.kt index 9f870d22a8..38ccc6fb81 100644 --- a/app/src/main/java/com/gh/gamecenter/eventbus/EBTask.kt +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/eventbus/EBTask.kt @@ -1,3 +1,3 @@ -package com.gh.gamecenter.eventbus +package com.gh.gamecenter.energy.eventbus class EBTask(val isHorizontalTask: Boolean, val position: Int) \ No newline at end of file diff --git a/app/src/main/java/com/gh/common/provider/EnergyTaskProviderImpl.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/provider/EnergyTaskProviderImpl.kt similarity index 61% rename from app/src/main/java/com/gh/common/provider/EnergyTaskProviderImpl.kt rename to module_energy/src/main/java/com/gh/gamecenter/energy/provider/EnergyTaskProviderImpl.kt index b78a5e072a..3d6301ba27 100644 --- a/app/src/main/java/com/gh/common/provider/EnergyTaskProviderImpl.kt +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/provider/EnergyTaskProviderImpl.kt @@ -1,11 +1,11 @@ -package com.gh.common.provider +package com.gh.gamecenter.energy.provider import android.content.Context import com.alibaba.android.arouter.facade.annotation.Route -import com.gh.common.util.EnergyTaskHelper -import com.gh.common.util.IntegralLogHelper import com.gh.gamecenter.common.constant.RouteConsts import com.gh.gamecenter.core.provider.IEnergyTaskProvider +import com.gh.gamecenter.energy.utils.EnergyTaskHelper +import com.gh.gamecenter.energy.utils.IntegralLogHelper @Route(path = RouteConsts.provider.energyTask, name = "EnergyTask暴露服务") class EnergyTaskProviderImpl : IEnergyTaskProvider { @@ -17,6 +17,14 @@ class EnergyTaskProviderImpl : IEnergyTaskProvider { IntegralLogHelper.logInviteResult(result, type) } + override fun postEnergyTask(action: String) { + EnergyTaskHelper.postEnergyTask(action) + } + + override fun postInviteCodeTask(code: String, from: String, callback: (() -> Unit)?) { + EnergyTaskHelper.postInviteCodeTask(code, from, callback) + } + override fun init(context: Context?) { } diff --git a/module_energy/src/main/java/com/gh/gamecenter/energy/retrofit/ApiService.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/retrofit/ApiService.kt new file mode 100644 index 0000000000..c99218f4b3 --- /dev/null +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/retrofit/ApiService.kt @@ -0,0 +1,81 @@ +package com.gh.gamecenter.energy.retrofit + +import com.gh.gamecenter.energy.entity.* +import com.google.gson.JsonObject +import io.reactivex.Single +import okhttp3.RequestBody +import okhttp3.ResponseBody +import retrofit2.http.* + +interface ApiService { + + /** + * 获取商品分类列表 + */ + @GET("shop/commodities/categories") + fun getCommodityCategories(): Single> + + /** + * 获取商品列表 + */ + @GET("shop/commodities") + fun getCommodities( + @Query("filter") filter: String, + @Query("page") page: Int, + @Query("page_size") pageSize: Int + ): Single> + + /** + * 获取新手任务列表 + */ + @GET("novice_tasks") + fun getNoviceTasks(): Single> + + /** + * 获取常驻任务列表 + */ + @GET("fixed_tasks") + fun getFixedTasks(): Single> + + /** + * 获取日常任务列表 + */ + @GET("daily_tasks") + fun getDailyTasks(): Single> + + /** + * 获取用户剩余光能 + */ + @GET("users/{user_id}/energies") + fun getUserEnergies(@Path("user_id") userId: String?): Single + + /** + * 获取光能屋滚动通知 + */ + @GET("shop/orders/roll_notices") + fun getRollNotices(): Single> + + /** + * 获取签到状态 + */ + @GET("users/{user_id}:signin") + fun getSignStatus(@Path("user_id") userId: String): Single + + /** + * 签到并获取状态 + */ + @POST("users/{user_id}:signin") + fun signIn(@Path("user_id") userId: String): Single + + /** + * 上报光能任务 + */ + @POST("users/{user_id}/tasks:check") + fun postEnergyTask(@Path("user_id") userId: String, @Body body: RequestBody): Single> + + /** + * 检测邀请码 + */ + @POST("users/{user_id}:invited") + fun checkInviteCode(@Path("user_id") userId: String, @Body body: RequestBody): Single +} \ No newline at end of file diff --git a/module_energy/src/main/java/com/gh/gamecenter/energy/retrofit/RetrofitManager.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/retrofit/RetrofitManager.kt new file mode 100644 index 0000000000..ab2b23e7d5 --- /dev/null +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/retrofit/RetrofitManager.kt @@ -0,0 +1,19 @@ +package com.gh.gamecenter.energy.retrofit + +import com.gh.gamecenter.common.retrofit.BaseRetrofitManager +import com.gh.gamecenter.common.utils.EnvHelper.getHost +import com.gh.gamecenter.core.utils.SingletonHolder +import com.gh.gamecenter.energy.HaloApp + +class RetrofitManager private constructor(): BaseRetrofitManager() { + + val api: ApiService + + init { + val context = HaloApp.getInstance().applicationContext + val okHttpNormalConfig = getOkHttpConfig(context, 0, 2) + api = provideService(okHttpNormalConfig, getHost(), ApiService::class.java) + } + + companion object: SingletonHolder(::RetrofitManager) +} \ No newline at end of file diff --git a/module_energy/src/main/java/com/gh/gamecenter/energy/utils/DialogUtils.java b/module_energy/src/main/java/com/gh/gamecenter/energy/utils/DialogUtils.java new file mode 100644 index 0000000000..40c7b1a4cd --- /dev/null +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/utils/DialogUtils.java @@ -0,0 +1,126 @@ +package com.gh.gamecenter.energy.utils; + +import android.app.Activity; +import android.app.Dialog; +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.Window; +import android.view.animation.Animation; +import android.view.animation.AnimationUtils; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import androidx.core.content.ContextCompat; + +import com.gh.gamecenter.common.callback.ConfirmListener; +import com.gh.gamecenter.energy.R; +import com.gh.gamecenter.energy.databinding.DialogEnergySignBinding; +import com.lightgame.utils.AppManager; + +public class DialogUtils { + /** + * @param context may be is application context + * @return activity context + */ + private static Context checkDialogContext(Context context) { + if (context == null) { + throw new NullPointerException("dialog context is null"); + } + + if (context instanceof Activity) { + return context; + } + + // currentActivity 是否存在 isDestroyed 的情况? + return AppManager.getInstance().currentActivity(); + } + + public static void showSignSuccessDialog(Context context, ConfirmListener listener) { + context = checkDialogContext(context); + + final Dialog dialog = new Dialog(context, R.style.DialogWindowTransparent); + + View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_sign_success, null); + + ImageView signBg = contentView.findViewById(R.id.signBg); + RelativeLayout signContainer = contentView.findViewById(R.id.signContainer); + + Animation animation1 = AnimationUtils.loadAnimation(context, R.anim.anim_badge_light_bg); + signBg.startAnimation(animation1); + + Animation animation2 = AnimationUtils.loadAnimation(context, R.anim.anim_sign_dialog_dismiss); + signContainer.postDelayed(() -> signContainer.startAnimation(animation2), 2000); + + signContainer.postDelayed(dialog::dismiss, 3000); + + dialog.setOnDismissListener(dialogInterface -> listener.onConfirm()); + + dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); + dialog.setContentView(contentView); + dialog.show(); + } + + public static void showEnergyTaskNoticeDialog(Context context, String title, String content) { + context = checkDialogContext(context); + + final Dialog dialog = new Dialog(context, R.style.DialogWindowTransparent); + + View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_notice, null); + TextView titleTv = contentView.findViewById(R.id.dialog_title); + TextView contentTv = contentView.findViewById(R.id.dialog_content); + TextView okTv = contentView.findViewById(R.id.dialog_ok); + + if (title == null) { + titleTv.setVisibility(View.GONE); + } else { + titleTv.setVisibility(View.VISIBLE); + titleTv.setText(title); + } + contentTv.setText(content); + + okTv.setTextColor(ContextCompat.getColor(context, R.color.theme_font)); + okTv.setOnClickListener(v -> { + dialog.dismiss(); + }); + + dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); + dialog.setContentView(contentView); + dialog.show(); + } + + public static void showEnergySignDialog(Context context, int sevenDaySerialSign) { + context = checkDialogContext(context); + + final Dialog dialog = new Dialog(context, R.style.DialogWindowTransparent); + DialogEnergySignBinding binding = DialogEnergySignBinding.inflate(LayoutInflater.from(context)); + + if (sevenDaySerialSign > 7) sevenDaySerialSign = 7; + + for (int i = 1; i <= sevenDaySerialSign; i++) { + int index = (i - 1) * 2; + LinearLayout dayContainer = (LinearLayout) binding.signDaysContainer.getChildAt(index); + ImageView dayIv = (ImageView) dayContainer.getChildAt(1); + dayIv.setImageResource(R.drawable.ic_energy_center_signed); + + if (i != 7) { + int rIndex = (i - 1) * 2 + 1; + LinearLayout lineContainer = (LinearLayout) binding.signDaysContainer.getChildAt(rIndex); + View straightLine = lineContainer.getChildAt(0); + View dottedLine = lineContainer.getChildAt(1); + if (i != sevenDaySerialSign) { + straightLine.setVisibility(View.VISIBLE); + } else { + dottedLine.setVisibility(View.VISIBLE); + } + } + } + + dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); + dialog.setContentView(binding.getRoot()); + dialog.show(); + } + +} diff --git a/app/src/main/java/com/gh/common/util/EnergyTaskHelper.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/utils/EnergyTaskHelper.kt similarity index 95% rename from app/src/main/java/com/gh/common/util/EnergyTaskHelper.kt rename to module_energy/src/main/java/com/gh/gamecenter/energy/utils/EnergyTaskHelper.kt index 92f2756906..dbc2688640 100644 --- a/app/src/main/java/com/gh/common/util/EnergyTaskHelper.kt +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/utils/EnergyTaskHelper.kt @@ -1,4 +1,4 @@ -package com.gh.common.util +package com.gh.gamecenter.energy.utils import android.annotation.SuppressLint import android.view.Gravity @@ -7,18 +7,18 @@ import android.widget.LinearLayout import android.widget.PopupWindow import android.widget.TextView import com.gh.gamecenter.common.constant.Constants -import com.gh.gamecenter.R import com.gh.gamecenter.common.utils.debugOnly import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.utils.tryCatchInRelease import com.gh.gamecenter.common.utils.tryWithDefaultCatch import com.gh.gamecenter.common.utils.PackageFlavorHelper import com.gh.gamecenter.core.utils.* -import com.gh.gamecenter.energy.EnergyCenterActivity -import com.gh.gamecenter.entity.EnergyTaskCompleteEntity -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.retrofit.BiResponse -import com.gh.gamecenter.retrofit.RetrofitManager +import com.gh.gamecenter.energy.R +import com.gh.gamecenter.energy.entity.EnergyTaskCompleteEntity +import com.gh.gamecenter.energy.retrofit.RetrofitManager +import com.gh.gamecenter.energy.view.EnergyCenterActivity import com.lightgame.utils.AppManager import com.lightgame.utils.Utils import io.reactivex.android.schedulers.AndroidSchedulers diff --git a/module_energy/src/main/java/com/gh/gamecenter/energy/utils/IntegralLogHelper.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/utils/IntegralLogHelper.kt new file mode 100644 index 0000000000..a297e27973 --- /dev/null +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/utils/IntegralLogHelper.kt @@ -0,0 +1,160 @@ +package com.gh.gamecenter.energy.utils + +import com.gh.gamecenter.common.loghub.LoghubUtils.log +import com.gh.gamecenter.common.tracker.Tracker.launchId +import com.gh.gamecenter.common.tracker.Tracker.sessionId +import com.gh.gamecenter.common.utils.LogUtils +import com.gh.gamecenter.common.utils.debugOnly +import com.gh.gamecenter.common.utils.tryWithDefaultCatch +import com.lightgame.utils.Utils +import org.json.JSONObject + +object IntegralLogHelper { + + fun log(event: String, location: String) = log(event, location, null) + + fun log(event: String, location: String, entrance: String? = null) { + val json = JSONObject().apply { + tryWithDefaultCatch { + put("meta", LogUtils.getMetaObject()) + put("event", event) + put("location", location) + put("timestamp", System.currentTimeMillis() / 1000) + put("launch_id", launchId) + put("session_id", sessionId) + entrance?.let { + put("entrance", it) + } + } + } + + debugOnly { + Utils.log("LogUtils->$json") + } + log(json, "score", false) + } + + fun logTask(event: String, location: String, jobId: String, jobName: String, jobType: String) { + val json = JSONObject().apply { + tryWithDefaultCatch { + put("meta", LogUtils.getMetaObject()) + put("event", event) + put("location", location) + put("timestamp", System.currentTimeMillis() / 1000) + put("launch_id", launchId) + put("session_id", sessionId) + put("job_id", jobId) + put("job_name", jobName) + put("job_type", jobType) + } + } + + debugOnly { + Utils.log("LogUtils->$json") + } + log(json, "score", false) + } + + fun logCommodityCategory(event: String, location: String, entrance: String, categoryId: String, categoryName: String) { + val json = JSONObject().apply { + tryWithDefaultCatch { + put("meta", LogUtils.getMetaObject()) + put("event", event) + put("location", location) + put("timestamp", System.currentTimeMillis() / 1000) + put("launch_id", launchId) + put("session_id", sessionId) + put("entrance", entrance) + put("goods_species_id", categoryId) + put("goods_species_name", categoryName) + } + } + + debugOnly { + Utils.log("LogUtils->$json") + } + log(json, "score", false) + } + + fun logCommodity(event: String, location: String, commodityId: String, categoryId: String, categoryName: String) { + val json = JSONObject().apply { + tryWithDefaultCatch { + put("meta", LogUtils.getMetaObject()) + put("event", event) + put("location", location) + put("timestamp", System.currentTimeMillis() / 1000) + put("launch_id", launchId) + put("session_id", sessionId) + put("goods_id", commodityId) + put("goods_species_id", categoryId) + put("goods_species_name", categoryName) + } + } + + debugOnly { + Utils.log("LogUtils->$json") + } + log(json, "score", false) + } + + fun logEnergyRange(event: String, location: String, range: String) { + val json = JSONObject().apply { + tryWithDefaultCatch { + put("meta", LogUtils.getMetaObject()) + put("event", event) + put("location", location) + put("timestamp", System.currentTimeMillis() / 1000) + put("launch_id", launchId) + put("session_id", sessionId) + put("energy_range", range) + } + } + + debugOnly { + Utils.log("LogUtils->$json") + } + log(json, "score", false) + } + + fun logPendent(event: String, location: String, pendentId: String, pendentType: String? = null) { + val json = JSONObject().apply { + tryWithDefaultCatch { + put("meta", LogUtils.getMetaObject()) + put("event", event) + put("location", location) + put("timestamp", System.currentTimeMillis() / 1000) + put("launch_id", launchId) + put("session_id", sessionId) + put("pendant_id", pendentId) + pendentType?.run { + put("pendant_type", this) + } + } + } + + debugOnly { + Utils.log("LogUtils->$json") + } + log(json, "score", false) + } + + fun logInviteResult(result: String, type: String? = null) { + val json = JSONObject().apply { + tryWithDefaultCatch { + put("meta", LogUtils.getMetaObject()) + put("event", "invite_result") + put("location", "邀请途径面板") + put("timestamp", System.currentTimeMillis() / 1000) + put("launch_id", launchId) + put("session_id", sessionId) + put("invitation_result", result) + put("invitation_type", type) + } + } + + debugOnly { + Utils.log("LogUtils->$json") + } + log(json, "score", false) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/energy/CommodityAdapter.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/view/CommodityAdapter.kt similarity index 83% rename from app/src/main/java/com/gh/gamecenter/energy/CommodityAdapter.kt rename to module_energy/src/main/java/com/gh/gamecenter/energy/view/CommodityAdapter.kt index 866c2ca002..086c5030de 100644 --- a/app/src/main/java/com/gh/gamecenter/energy/CommodityAdapter.kt +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/view/CommodityAdapter.kt @@ -1,4 +1,4 @@ -package com.gh.gamecenter.energy +package com.gh.gamecenter.energy.view import android.content.Context import android.graphics.Paint @@ -6,18 +6,21 @@ import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.StaggeredGridLayoutManager +import com.alibaba.android.arouter.launcher.ARouter import com.gh.gamecenter.common.base.BaseRecyclerViewHolder import com.gh.gamecenter.common.constant.ItemViewType -import com.gh.common.exposure.time.TimeUtil -import com.gh.common.util.* -import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.constant.RouteConsts import com.gh.gamecenter.common.utils.* +import com.gh.gamecenter.common.viewholder.FooterViewHolder +import com.gh.gamecenter.core.provider.IDirectProvider +import com.gh.gamecenter.core.provider.ITimeUtilProvider import com.gh.gamecenter.core.utils.* -import com.gh.gamecenter.databinding.CommodityItemBinding -import com.gh.gamecenter.entity.CommodityCategoryEntity -import com.gh.gamecenter.entity.CommodityEntity +import com.gh.gamecenter.energy.R +import com.gh.gamecenter.energy.databinding.CommodityItemBinding +import com.gh.gamecenter.energy.entity.CommodityCategoryEntity +import com.gh.gamecenter.energy.entity.CommodityEntity +import com.gh.gamecenter.energy.utils.IntegralLogHelper import io.reactivex.disposables.Disposable class CommodityAdapter( @@ -99,21 +102,24 @@ class CommodityAdapter( log("view_goods_detail", "商品详情页") } - DirectUtils.directToCommodityDetail(mContext, commodity.id) + val directUtils = ARouter.getInstance().build(RouteConsts.provider.directUtils).navigation() as? IDirectProvider + directUtils?.directToCommodityDetail(mContext, commodity.id) } + val timeUtil = ARouter.getInstance().build(RouteConsts.provider.timeUtil).navigation() as? ITimeUtilProvider + // 判断是否显示倒计时 when { // 显示上架时间 commodity.showShelveTimer - && commodity.shelveTimestamp > TimeUtil.currentTime() - && commodity.shelveTimestamp - (commodity.shelveTimerBeforeDays * 86400) < TimeUtil.currentTime() -> { + && commodity.shelveTimestamp > (timeUtil?.currentTime() ?: (System.currentTimeMillis() / 1000).toInt()) + && commodity.shelveTimestamp - (commodity.shelveTimerBeforeDays * 86400) < (timeUtil?.currentTime() ?: (System.currentTimeMillis() / 1000).toInt()) -> { exchangeCountTv.visibility = View.GONE timerContainer.visibility = View.VISIBLE timerContainer.setBackgroundResource(R.drawable.bg_shelve_timer) timerIv.setImageResource(R.drawable.ic_shelve) timerTv.setTextColor(R.color.theme_yellow.toColor()) - val duration = commodity.shelveTimestamp - TimeUtil.currentTime() + val duration = commodity.shelveTimestamp - (timeUtil?.currentTime() ?: (System.currentTimeMillis() / 1000).toInt()) if (duration > 86400) { val durationDay = duration / 86400 timerTv.text = "${durationDay}天 后开抢" @@ -133,14 +139,14 @@ class CommodityAdapter( // 显示下架时间 commodity.showOffShelveTimer - && commodity.offShelveTimestamp > TimeUtil.currentTime() - && commodity.offShelveTimestamp - (commodity.offShelveTimerBeforeDays * 86400) < TimeUtil.currentTime() -> { + && commodity.offShelveTimestamp > (timeUtil?.currentTime() ?: (System.currentTimeMillis() / 1000).toInt()) + && commodity.offShelveTimestamp - (commodity.offShelveTimerBeforeDays * 86400) < (timeUtil?.currentTime() ?: (System.currentTimeMillis() / 1000).toInt()) -> { exchangeCountTv.visibility = View.GONE timerContainer.visibility = View.VISIBLE timerContainer.setBackgroundResource(R.drawable.bg_off_shelve_timer) timerIv.setImageResource(R.drawable.ic_off_shelve) timerTv.setTextColor(R.color.theme_red.toColor()) - val duration = commodity.offShelveTimestamp - TimeUtil.currentTime() + val duration = commodity.offShelveTimestamp - (timeUtil?.currentTime() ?: (System.currentTimeMillis() / 1000).toInt()) if (duration > 86400) { val durationDay = duration / 86400 timerTv.text = "${durationDay}天 后结束" diff --git a/app/src/main/java/com/gh/gamecenter/energy/CommodityFragment.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/view/CommodityFragment.kt similarity index 95% rename from app/src/main/java/com/gh/gamecenter/energy/CommodityFragment.kt rename to module_energy/src/main/java/com/gh/gamecenter/energy/view/CommodityFragment.kt index 4d15340552..6c36072f41 100644 --- a/app/src/main/java/com/gh/gamecenter/energy/CommodityFragment.kt +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/view/CommodityFragment.kt @@ -1,4 +1,4 @@ -package com.gh.gamecenter.energy +package com.gh.gamecenter.energy.view import android.os.Bundle import android.view.View @@ -8,22 +8,21 @@ import android.widget.PopupWindow import android.widget.TextView import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.StaggeredGridLayoutManager -import com.gh.common.util.* +import com.gh.gamecenter.common.baselist.ListFragment +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.core.utils.NumberUtils.findMax -import com.gh.gamecenter.R -import com.gh.gamecenter.baselist.ListFragment -import com.gh.gamecenter.baselist.LoadType import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.dip2px -import com.gh.gamecenter.common.utils.layoutInflater import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.common.utils.viewModelProvider -import com.gh.gamecenter.databinding.FragmentCommodityListBinding -import com.gh.gamecenter.databinding.ItemFilterCommodityCategoryBinding -import com.gh.gamecenter.databinding.LayoutFilterCategoryBinding -import com.gh.gamecenter.entity.CommodityCategoryEntity -import com.gh.gamecenter.entity.CommodityEntity -import com.gh.gamecenter.entity.SubjectSettingEntity +import com.gh.gamecenter.energy.R +import com.gh.gamecenter.energy.databinding.FragmentCommodityListBinding +import com.gh.gamecenter.energy.databinding.ItemFilterCommodityCategoryBinding +import com.gh.gamecenter.energy.databinding.LayoutFilterCategoryBinding +import com.gh.gamecenter.energy.entity.CommodityCategoryEntity +import com.gh.gamecenter.energy.entity.CommodityEntity +import com.gh.gamecenter.energy.entity.Size +import com.gh.gamecenter.energy.utils.IntegralLogHelper import com.google.android.flexbox.FlexboxLayout class CommodityFragment : ListFragment() { @@ -52,9 +51,9 @@ class CommodityFragment : ListFragment() { override fun provideListAdapter() = mAdapter ?: CommodityAdapter( - requireContext(), - mEntrance, - mCategory ?: CommodityCategoryEntity() + requireContext(), + mEntrance, + mCategory ?: CommodityCategoryEntity() ).apply { mAdapter = this } override fun getItemDecoration() = null @@ -321,7 +320,7 @@ class CommodityFragment : ListFragment() { onLoadRefresh() } - fun refreshPage(size: SubjectSettingEntity.Size) { + fun refreshPage(size: Size) { if (size != mListViewModel.sortSize ) { mListViewModel.sortSize = size onRefresh() diff --git a/module_energy/src/main/java/com/gh/gamecenter/energy/view/CommodityViewModel.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/view/CommodityViewModel.kt new file mode 100644 index 0000000000..7d4c1aa753 --- /dev/null +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/view/CommodityViewModel.kt @@ -0,0 +1,55 @@ +package com.gh.gamecenter.energy.view + +import android.app.Application +import androidx.lifecycle.ViewModel +import androidx.lifecycle.ViewModelProvider +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.common.baselist.LoadParams +import com.gh.gamecenter.core.utils.UrlFilterUtils +import com.gh.gamecenter.energy.HaloApp +import com.gh.gamecenter.energy.entity.CommodityEntity +import com.gh.gamecenter.energy.entity.Size +import com.gh.gamecenter.energy.retrofit.RetrofitManager +import io.reactivex.Single + +class CommodityViewModel(application: Application, var categoryId: String, var entrance: String) : + ListViewModel(application) { + + init { + if (entrance == "光能中心") { + setOverLimitSize(11) // 光能中心的商品列表最多只展示10个 + } + } + + var sortSize = Size() + + override fun provideDataObservable(page: Int) = null + + override fun provideDataSingle(page: Int): Single> { + return RetrofitManager.getInstance().api.getCommodities( + getFilter(), + page, + if (entrance == "光能中心") 10 + else LoadParams.DEFAULT_PAGE_SIZE + ) + } + + override fun mergeResultLiveData() { + mResultLiveData.addSource(mListLiveData) { mResultLiveData.postValue(it) } + } + + private fun getFilter(): String { + return UrlFilterUtils.getFilterQuery( + "category_id", categoryId, + "min_energy", sortSize.min.toString(), + "max_energy", sortSize.max.toString() + ) + } + + class Factory(private val categoryId: String, private val entrance: String) : + ViewModelProvider.NewInstanceFactory() { + override fun create(modelClass: Class): T { + return CommodityViewModel(HaloApp.getInstance(), categoryId, entrance) as T + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/energy/EnergyCenterActivity.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/view/EnergyCenterActivity.kt similarity index 86% rename from app/src/main/java/com/gh/gamecenter/energy/EnergyCenterActivity.kt rename to module_energy/src/main/java/com/gh/gamecenter/energy/view/EnergyCenterActivity.kt index 3802c4664d..1638c9da8f 100644 --- a/app/src/main/java/com/gh/gamecenter/energy/EnergyCenterActivity.kt +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/view/EnergyCenterActivity.kt @@ -1,4 +1,4 @@ -package com.gh.gamecenter.energy +package com.gh.gamecenter.energy.view import android.content.Context import android.content.Intent @@ -22,6 +22,10 @@ class EnergyCenterActivity : ToolBarActivity() { } } + override fun provideNormalIntent(): Intent { + return getTargetIntent(this, EnergyCenterActivity::class.java, EnergyCenterFragment::class.java) + } + companion object { fun getIntent(context: Context?): Intent? { return getIntent(context, 0) diff --git a/app/src/main/java/com/gh/gamecenter/energy/EnergyCenterFragment.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/view/EnergyCenterFragment.kt similarity index 85% rename from app/src/main/java/com/gh/gamecenter/energy/EnergyCenterFragment.kt rename to module_energy/src/main/java/com/gh/gamecenter/energy/view/EnergyCenterFragment.kt index 3bdf7643fe..002d7a2519 100644 --- a/app/src/main/java/com/gh/gamecenter/energy/EnergyCenterFragment.kt +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/view/EnergyCenterFragment.kt @@ -1,4 +1,4 @@ -package com.gh.gamecenter.energy +package com.gh.gamecenter.energy.view import android.graphics.Typeface import android.os.Build @@ -8,25 +8,27 @@ import android.view.LayoutInflater import android.view.View import android.widget.* import androidx.fragment.app.Fragment +import com.alibaba.android.arouter.launcher.ARouter import com.gh.gamecenter.common.base.adapter.FragmentAdapter import com.gh.gamecenter.common.base.fragment.BaseLazyFragment -import com.gh.common.util.* -import com.gh.common.util.DialogUtils -import com.gh.gamecenter.R import com.gh.gamecenter.common.callback.ConfirmListener import com.gh.gamecenter.common.constant.EntranceConsts +import com.gh.gamecenter.common.constant.RouteConsts import com.gh.gamecenter.common.utils.* +import com.gh.gamecenter.core.provider.IDirectProvider import com.gh.gamecenter.core.utils.* -import com.gh.gamecenter.databinding.FragmentEnergyCenterBinding -import com.gh.gamecenter.databinding.TabItemMainBinding -import com.gh.gamecenter.entity.CommodityCategoryEntity -import com.gh.gamecenter.entity.SignStatusEntity -import com.gh.gamecenter.entity.UserInfoEntity -import com.gh.gamecenter.manager.UserManager -import com.gh.gamecenter.personalhome.UserHomeViewModel -import com.gh.gamecenter.user.UserViewModel +import com.gh.gamecenter.energy.HaloApp +import com.gh.gamecenter.energy.R +import com.gh.gamecenter.energy.databinding.FragmentEnergyCenterBinding +import com.gh.gamecenter.energy.databinding.TabItemEnergyBinding +import com.gh.gamecenter.energy.entity.CommodityCategoryEntity +import com.gh.gamecenter.energy.entity.SignStatusEntity +import com.gh.gamecenter.energy.utils.DialogUtils +import com.gh.gamecenter.energy.utils.IntegralLogHelper +import com.gh.gamecenter.login.entity.UserInfoEntity +import com.gh.gamecenter.login.user.UserManager +import com.gh.gamecenter.login.user.UserViewModel import com.google.android.material.bottomsheet.BottomSheetBehavior -import com.halo.assistant.HaloApp import kotlin.math.abs @@ -34,7 +36,7 @@ class EnergyCenterFragment : BaseLazyFragment() { private var mBinding: FragmentEnergyCenterBinding? = null private var mUserViewModel: UserViewModel? = null - private var mUserHomeViewModel: UserHomeViewModel? = null + private var mEnergyUserViewModel: EnergyUserViewModel? = null private var mEnergyCenterViewModel: EnergyCenterViewModel? = null private val mTitleList = listOf("赚光能", "兑换区") private var mTabList = arrayListOf() @@ -55,8 +57,8 @@ class EnergyCenterFragment : BaseLazyFragment() { super.onFragmentResume() if (NetworkUtils.isNetworkConnected(requireContext())) { - if (CheckLoginUtils.isLogin()) { - mUserHomeViewModel?.getUserEnergy() + if (UserManager.getInstance().isLoggedIn) { + mEnergyUserViewModel?.getUserEnergy() refreshTaskList() } } @@ -69,8 +71,8 @@ class EnergyCenterFragment : BaseLazyFragment() { if (mInitTabIndex != 0 && mInitTabIndex != 1) mInitTabIndex = 0 mEnergyCenterViewModel = viewModelProvider() - mUserViewModel = viewModelProvider(UserViewModel.Factory(HaloApp.getInstance().application)) - mUserHomeViewModel = viewModelProvider(UserHomeViewModel.Factory(HaloApp.getInstance().application, UserManager.getInstance().userId)) + mUserViewModel = viewModelProvider(UserViewModel.Factory(HaloApp.getInstance())) + mEnergyUserViewModel = viewModelProvider(EnergyUserViewModel.Factory(HaloApp.getInstance(), UserManager.getInstance().userId)) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { @@ -95,33 +97,33 @@ class EnergyCenterFragment : BaseLazyFragment() { mUserViewModel?.loginObsUserinfo?.observeNonNull(viewLifecycleOwner) { if (it.data != null) { mUserInfo = it.data - mUserHomeViewModel?.userId = UserManager.getInstance().userId - mUserHomeViewModel?.getSignInfo() - mUserHomeViewModel?.getUserEnergy() + mEnergyUserViewModel?.userId = UserManager.getInstance().userId + mEnergyUserViewModel?.getSignInfo() + mEnergyUserViewModel?.getUserEnergy() refreshTaskList() } } - mUserHomeViewModel?.energy?.observeNonNull(viewLifecycleOwner) { + mEnergyUserViewModel?.energy?.observeNonNull(viewLifecycleOwner) { mEnergy = it mBinding?.userEnergy?.text = it.toString() } - mUserHomeViewModel?.sign?.observeNonNull(this) { + mEnergyUserViewModel?.sign?.observeNonNull(this) { mSignStatus = it DialogUtils.showSignSuccessDialog(requireContext(), object : ConfirmListener { override fun onConfirm() { - mUserHomeViewModel?.getUserEnergy() + mEnergyUserViewModel?.getUserEnergy() refreshTaskList() } }) } - mUserHomeViewModel?.signStatus?.observeNonNull(this) { + mEnergyUserViewModel?.signStatus?.observeNonNull(this) { mSignStatus = it // 今天未签到且需要自动签到才调用签到接口 if (!it.todaySignIn && !ClickUtils.isFastDoubleClick(990)) { - mUserHomeViewModel?.signIn() + mEnergyUserViewModel?.signIn() } } @@ -299,8 +301,8 @@ class EnergyCenterFragment : BaseLazyFragment() { } } - private fun generateTabView(title: String): TabItemMainBinding { - val binding = TabItemMainBinding.inflate(LayoutInflater.from(requireContext())) + private fun generateTabView(title: String): TabItemEnergyBinding { + val binding = TabItemEnergyBinding.inflate(LayoutInflater.from(requireContext())) binding.tabTitle.run { text = title textSize = DEFAULT_TAB_TEXT_SIZE @@ -331,7 +333,8 @@ class EnergyCenterFragment : BaseLazyFragment() { } ifLogin("光能中心-光能值") { - DirectUtils.directToEnergyRecord(requireContext()) + val directUtils = ARouter.getInstance().build(RouteConsts.provider.directUtils).navigation() as? IDirectProvider + directUtils?.directToEnergyRecord(requireContext()) } } @@ -340,8 +343,8 @@ class EnergyCenterFragment : BaseLazyFragment() { log("click_energy_rule", LOCATION) log("view_energy_rule", "光能规则") } - - DirectUtils.directToEnergyRulePage(requireContext()) + val directUtils = ARouter.getInstance().build(RouteConsts.provider.directUtils).navigation() as? IDirectProvider + directUtils?.directToEnergyRulePage(requireContext()) } R.id.signIv -> { @@ -359,7 +362,8 @@ class EnergyCenterFragment : BaseLazyFragment() { } ifLogin("光能中心-邀请好友") { - DirectUtils.directToInviteFriends(requireContext()) + val directUtils = ARouter.getInstance().build(RouteConsts.provider.directUtils).navigation() as? IDirectProvider + directUtils?.directToInviteFriends(requireContext()) } } } @@ -367,7 +371,7 @@ class EnergyCenterFragment : BaseLazyFragment() { private fun dealSignIn() { IntegralLogHelper.log("click_sign", LOCATION) - mUserHomeViewModel?.signIn() + mEnergyUserViewModel?.signIn() } fun openBottomSheet(callback: () -> Unit) { diff --git a/app/src/main/java/com/gh/gamecenter/energy/EnergyCenterViewModel.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/view/EnergyCenterViewModel.kt similarity index 83% rename from app/src/main/java/com/gh/gamecenter/energy/EnergyCenterViewModel.kt rename to module_energy/src/main/java/com/gh/gamecenter/energy/view/EnergyCenterViewModel.kt index d3568bac52..92b310ff74 100644 --- a/app/src/main/java/com/gh/gamecenter/energy/EnergyCenterViewModel.kt +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/view/EnergyCenterViewModel.kt @@ -1,12 +1,12 @@ -package com.gh.gamecenter.energy +package com.gh.gamecenter.energy.view import android.annotation.SuppressLint import android.app.Application import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.MutableLiveData -import com.gh.gamecenter.entity.CommodityCategoryEntity import com.gh.gamecenter.common.retrofit.BiResponse -import com.gh.gamecenter.retrofit.RetrofitManager +import com.gh.gamecenter.energy.entity.CommodityCategoryEntity +import com.gh.gamecenter.energy.retrofit.RetrofitManager import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.schedulers.Schedulers @@ -22,7 +22,7 @@ class EnergyCenterViewModel(application: Application) : AndroidViewModel(applica @SuppressLint("CheckResult") fun getCommodityCategories() { - api.commodityCategories + api.getCommodityCategories() .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(object : BiResponse>() { diff --git a/app/src/main/java/com/gh/gamecenter/energy/EnergyHouseActivity.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/view/EnergyHouseActivity.kt similarity index 96% rename from app/src/main/java/com/gh/gamecenter/energy/EnergyHouseActivity.kt rename to module_energy/src/main/java/com/gh/gamecenter/energy/view/EnergyHouseActivity.kt index f3361611ed..b4b7b4adb3 100644 --- a/app/src/main/java/com/gh/gamecenter/energy/EnergyHouseActivity.kt +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/view/EnergyHouseActivity.kt @@ -1,4 +1,4 @@ -package com.gh.gamecenter.energy +package com.gh.gamecenter.energy.view import android.content.Context import android.content.Intent diff --git a/app/src/main/java/com/gh/gamecenter/energy/EnergyHouseFragment.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/view/EnergyHouseFragment.kt similarity index 86% rename from app/src/main/java/com/gh/gamecenter/energy/EnergyHouseFragment.kt rename to module_energy/src/main/java/com/gh/gamecenter/energy/view/EnergyHouseFragment.kt index 1cc4ff2f2b..b7cb86463b 100644 --- a/app/src/main/java/com/gh/gamecenter/energy/EnergyHouseFragment.kt +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/view/EnergyHouseFragment.kt @@ -1,4 +1,4 @@ -package com.gh.gamecenter.energy +package com.gh.gamecenter.energy.view import android.graphics.Typeface import android.os.Build @@ -11,29 +11,32 @@ import android.widget.TextView import androidx.core.os.bundleOf import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentStatePagerAdapter +import com.alibaba.android.arouter.launcher.ARouter import com.gh.gamecenter.common.base.fragment.BaseLazyFragment import com.gh.common.util.* -import com.gh.gamecenter.R import com.gh.gamecenter.common.constant.EntranceConsts +import com.gh.gamecenter.common.constant.RouteConsts import com.gh.gamecenter.common.utils.* -import com.gh.gamecenter.databinding.FragmentEnergyHouseBinding -import com.gh.gamecenter.databinding.TabItemCommodityBinding -import com.gh.gamecenter.entity.CommodityCategoryEntity -import com.gh.gamecenter.entity.SubjectSettingEntity -import com.gh.gamecenter.entity.UserInfoEntity -import com.gh.gamecenter.manager.UserManager -import com.gh.gamecenter.personalhome.UserHomeViewModel -import com.gh.gamecenter.user.UserViewModel +import com.gh.gamecenter.core.provider.IDirectProvider +import com.gh.gamecenter.energy.HaloApp +import com.gh.gamecenter.energy.R +import com.gh.gamecenter.energy.databinding.FragmentEnergyHouseBinding +import com.gh.gamecenter.energy.databinding.TabItemCommodityBinding +import com.gh.gamecenter.energy.entity.CommodityCategoryEntity +import com.gh.gamecenter.energy.entity.Size +import com.gh.gamecenter.energy.utils.IntegralLogHelper +import com.gh.gamecenter.login.entity.UserInfoEntity +import com.gh.gamecenter.login.user.UserManager +import com.gh.gamecenter.login.user.UserViewModel import com.google.android.material.bottomsheet.BottomSheetBehavior import com.google.android.material.tabs.TabLayout -import com.halo.assistant.HaloApp import kotlin.math.abs class EnergyHouseFragment: BaseLazyFragment() { private var mBinding: FragmentEnergyHouseBinding? = null private var mUserViewModel: UserViewModel? = null - private var mUserHomeViewModel: UserHomeViewModel? = null + private var mEnergyUserViewModel: EnergyUserViewModel? = null private var mEnergyHouseViewModel: EnergyHouseViewModel? = null private var mCommodityCategories: List? = null private var mUserInfo: UserInfoEntity? = null @@ -42,7 +45,7 @@ class EnergyHouseFragment: BaseLazyFragment() { private val mFragments = ArrayList() private val mRollNotices = ArrayList() private var mCurrentSizeIndex = 0 - private var mCurrentSize = SubjectSettingEntity.Size() + private var mCurrentSize = Size() private var mEnergy = 0L private var mCategoryId = "" private var mInitIndex = 0 @@ -56,8 +59,8 @@ class EnergyHouseFragment: BaseLazyFragment() { super.onFragmentResume() if (NetworkUtils.isNetworkConnected(requireContext())) { - if (CheckLoginUtils.isLogin()) { - mUserHomeViewModel?.getUserEnergy() + if (UserManager.getInstance().isLoggedIn) { + mEnergyUserViewModel?.getUserEnergy() } } } @@ -66,8 +69,9 @@ class EnergyHouseFragment: BaseLazyFragment() { super.onCreate(savedInstanceState) mCategoryId = arguments?.getString(EntranceConsts.KEY_CATEGORY_ID) ?: "" mEnergyHouseViewModel = viewModelProvider() - mUserViewModel = viewModelProvider(UserViewModel.Factory(HaloApp.getInstance().application)) - mUserHomeViewModel = viewModelProvider(UserHomeViewModel.Factory(HaloApp.getInstance().application, UserManager.getInstance().userId)) + mUserViewModel = viewModelProvider(UserViewModel.Factory(HaloApp.getInstance())) + mEnergyUserViewModel = viewModelProvider(EnergyUserViewModel.Factory(HaloApp.getInstance(), UserManager.getInstance().userId)) + } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { @@ -93,13 +97,13 @@ class EnergyHouseFragment: BaseLazyFragment() { mUserInfo = it.data userIcon.display(mUserInfo?.iconBorder?.url, mUserInfo?.icon ?: "") loginTipTv.visibility = View.GONE - mUserHomeViewModel?.userId = UserManager.getInstance().userId - mUserHomeViewModel?.getUserEnergy() + mEnergyUserViewModel?.userId = UserManager.getInstance().userId + mEnergyUserViewModel?.getUserEnergy() } } } - mUserHomeViewModel?.energy?.observeNonNull(viewLifecycleOwner) { + mEnergyUserViewModel?.energy?.observeNonNull(viewLifecycleOwner) { mEnergy = it mBinding?.run { userEnergyContainer.visibility = View.VISIBLE @@ -327,13 +331,13 @@ class EnergyHouseFragment: BaseLazyFragment() { return binding } - private fun getDefaultSizeFilterArray(): ArrayList { - return arrayListOf().apply { - add(SubjectSettingEntity.Size(min = -1, max = -1, text = "全部")) - add(SubjectSettingEntity.Size(min = 1, max = 100, text = "1-100")) - add(SubjectSettingEntity.Size(min = 101, max = 500, text = "101-500")) - add(SubjectSettingEntity.Size(min = 501, max = 2000, text = "501-2000")) - add(SubjectSettingEntity.Size(min = 2000, max = -1, text = "2000以上")) + private fun getDefaultSizeFilterArray(): ArrayList { + return arrayListOf().apply { + add(Size(min = -1, max = -1, text = "全部")) + add(Size(min = 1, max = 100, text = "1-100")) + add(Size(min = 101, max = 500, text = "101-500")) + add(Size(min = 501, max = 2000, text = "501-2000")) + add(Size(min = 2000, max = -1, text = "2000以上")) } } @@ -404,7 +408,8 @@ class EnergyHouseFragment: BaseLazyFragment() { } ifLogin("光能屋-光能值") { - DirectUtils.directToEnergyRecord(requireContext()) + val directUtils = ARouter.getInstance().build(RouteConsts.provider.directUtils).navigation() as? IDirectProvider + directUtils?.directToEnergyRecord(requireContext()) } } @@ -413,8 +418,8 @@ class EnergyHouseFragment: BaseLazyFragment() { log("click_exchange_rule", LOCATION) log("view_exchange_rule", "兑换规则") } - - DirectUtils.directToExchangeRulePage(requireContext()) + val directUtils = ARouter.getInstance().build(RouteConsts.provider.directUtils).navigation() as? IDirectProvider + directUtils?.directToExchangeRulePage(requireContext()) } R.id.exchangeCommodity -> { @@ -424,7 +429,8 @@ class EnergyHouseFragment: BaseLazyFragment() { } ifLogin("光能屋-兑换商品") { - DirectUtils.directToExchangeCommodityPage(requireContext()) + val directUtils = ARouter.getInstance().build(RouteConsts.provider.directUtils).navigation() as? IDirectProvider + directUtils?.directToExchangeCommodityPage(requireContext()) } } @@ -435,7 +441,8 @@ class EnergyHouseFragment: BaseLazyFragment() { } ifLogin("光能屋-抽奖乐园") { - DirectUtils.directToLotteryParadisePage(requireContext()) + val directUtils = ARouter.getInstance().build(RouteConsts.provider.directUtils).navigation() as? IDirectProvider + directUtils?.directToLotteryParadisePage(requireContext()) } } diff --git a/app/src/main/java/com/gh/gamecenter/energy/EnergyHouseViewModel.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/view/EnergyHouseViewModel.kt similarity index 84% rename from app/src/main/java/com/gh/gamecenter/energy/EnergyHouseViewModel.kt rename to module_energy/src/main/java/com/gh/gamecenter/energy/view/EnergyHouseViewModel.kt index 506eaa9481..4346fa434a 100644 --- a/app/src/main/java/com/gh/gamecenter/energy/EnergyHouseViewModel.kt +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/view/EnergyHouseViewModel.kt @@ -1,13 +1,13 @@ -package com.gh.gamecenter.energy +package com.gh.gamecenter.energy.view import android.annotation.SuppressLint import android.app.Application import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.MutableLiveData -import com.gh.gamecenter.entity.CommodityCategoryEntity -import com.gh.gamecenter.entity.RollNoticeEntity import com.gh.gamecenter.common.retrofit.BiResponse -import com.gh.gamecenter.retrofit.RetrofitManager +import com.gh.gamecenter.energy.entity.CommodityCategoryEntity +import com.gh.gamecenter.energy.entity.RollNoticeEntity +import com.gh.gamecenter.energy.retrofit.RetrofitManager import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.schedulers.Schedulers @@ -25,7 +25,7 @@ class EnergyHouseViewModel(application: Application) @SuppressLint("CheckResult") fun getRollNotices() { - api.rollNotices + api.getRollNotices() .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(object : BiResponse>() { @@ -37,7 +37,7 @@ class EnergyHouseViewModel(application: Application) @SuppressLint("CheckResult") fun getCommodityCategories() { - api.commodityCategories + api.getCommodityCategories() .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(object : BiResponse>() { diff --git a/module_energy/src/main/java/com/gh/gamecenter/energy/view/EnergyUserViewModel.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/view/EnergyUserViewModel.kt new file mode 100644 index 0000000000..df614a1972 --- /dev/null +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/view/EnergyUserViewModel.kt @@ -0,0 +1,71 @@ +package com.gh.gamecenter.energy.view + +import android.annotation.SuppressLint +import android.app.Application +import androidx.lifecycle.AndroidViewModel +import androidx.lifecycle.MutableLiveData +import androidx.lifecycle.ViewModel +import androidx.lifecycle.ViewModelProvider +import com.gh.gamecenter.common.retrofit.BiResponse +import com.gh.gamecenter.energy.entity.SignStatusEntity +import com.gh.gamecenter.energy.retrofit.RetrofitManager +import com.gh.gamecenter.energy.utils.EnergyTaskHelper +import com.google.gson.JsonObject +import io.reactivex.android.schedulers.AndroidSchedulers +import io.reactivex.schedulers.Schedulers + +class EnergyUserViewModel(application: Application, var userId: String) : AndroidViewModel(application) { + + private val api = RetrofitManager.getInstance().api + var energy = MutableLiveData() + var sign = MutableLiveData() + var signStatus = MutableLiveData() + + + @SuppressLint("CheckResult") + fun getUserEnergy() { + RetrofitManager.getInstance() + .api.getUserEnergies(userId) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(object : BiResponse() { + override fun onSuccess(data: JsonObject) { + energy.postValue(data["energy"].asLong) + } + }) + } + @SuppressLint("CheckResult") + fun signIn() { + RetrofitManager.getInstance() + .api.signIn(userId) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(object : BiResponse() { + override fun onSuccess(data: SignStatusEntity) { + EnergyTaskHelper.postEnergyTask("sign_in_cumulatively") + EnergyTaskHelper.postEnergyTask("sign_in_continuously") + sign.postValue(data) + } + }) + } + + @SuppressLint("CheckResult") + fun getSignInfo() { + RetrofitManager.getInstance() + .api.getSignStatus(userId) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(object : BiResponse() { + override fun onSuccess(data: SignStatusEntity) { + signStatus.postValue(data) + } + }) + } + + class Factory(private val mApplication: Application, + private val mUserId: String) : ViewModelProvider.NewInstanceFactory() { + override fun create(modelClass: Class): T { + return EnergyUserViewModel(mApplication, mUserId) as T + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/energy/HorizontalTaskAdapter.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/view/HorizontalTaskAdapter.kt similarity index 69% rename from app/src/main/java/com/gh/gamecenter/energy/HorizontalTaskAdapter.kt rename to module_energy/src/main/java/com/gh/gamecenter/energy/view/HorizontalTaskAdapter.kt index fc8749953c..5167db27a8 100644 --- a/app/src/main/java/com/gh/gamecenter/energy/HorizontalTaskAdapter.kt +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/view/HorizontalTaskAdapter.kt @@ -1,20 +1,21 @@ -package com.gh.gamecenter.energy +package com.gh.gamecenter.energy.view import android.content.Context import android.view.ViewGroup import androidx.appcompat.app.AppCompatActivity +import com.alibaba.android.arouter.launcher.ARouter import com.gh.gamecenter.common.base.BaseRecyclerViewHolder -import com.gh.common.util.* -import com.gh.gamecenter.R +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.common.provider.ILinkDirectUtilsProvider +import com.gh.gamecenter.common.utils.* +import com.gh.gamecenter.core.provider.IFloatingBackViewManagerProvider import com.gh.gamecenter.core.utils.ToastUtils -import com.gh.gamecenter.common.utils.dip2px -import com.gh.gamecenter.common.utils.toBinding -import com.gh.gamecenter.common.utils.toResString -import com.gh.gamecenter.common.utils.ImageUtils -import com.gh.gamecenter.databinding.NoviceTaskItemBinding -import com.gh.gamecenter.entity.TaskEntity -import com.gh.gamecenter.gamedetail.dialog.InviteCodeDialog -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.energy.R +import com.gh.gamecenter.energy.databinding.NoviceTaskItemBinding +import com.gh.gamecenter.energy.entity.TaskEntity +import com.gh.gamecenter.energy.utils.DialogUtils +import com.gh.gamecenter.energy.utils.IntegralLogHelper +import com.gh.gamecenter.login.user.UserManager import com.lightgame.adapter.BaseRecyclerAdapter class HorizontalTaskAdapter( @@ -62,7 +63,7 @@ class HorizontalTaskAdapter( ) } - CheckLoginUtils.checkLogin(mContext, entrance) { + mContext.ifLogin(entrance) { when (task.status) { "normal" -> { if (task.action == "enter_invite_code") { @@ -75,8 +76,12 @@ class HorizontalTaskAdapter( position ) } else { - FloatingBackViewManager.enableBackView(FloatingBackViewManager.TYPE_TASK) - DirectUtils.directToLinkPage(mContext, task.link, entrance, "") + val floatingBackViewManager = ARouter.getInstance() + .build(RouteConsts.provider.floatingBackViewManager) + .navigation() as? IFloatingBackViewManagerProvider + floatingBackViewManager?.enableBackViewForTaskType() + val directUtils = ARouter.getInstance().build(RouteConsts.provider.linkDirectUtils).navigation() as? ILinkDirectUtilsProvider + directUtils?.directToLinkPage(mContext, task.link, entrance, "") } } diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/dialog/InviteCodeDialog.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/view/InviteCodeDialog.kt similarity index 87% rename from app/src/main/java/com/gh/gamecenter/gamedetail/dialog/InviteCodeDialog.kt rename to module_energy/src/main/java/com/gh/gamecenter/energy/view/InviteCodeDialog.kt index e1804977af..1ba1435194 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/dialog/InviteCodeDialog.kt +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/view/InviteCodeDialog.kt @@ -1,18 +1,20 @@ -package com.gh.gamecenter.gamedetail.dialog +package com.gh.gamecenter.energy.view import android.annotation.SuppressLint import android.os.Bundle import android.view.* import androidx.appcompat.app.AppCompatActivity +import com.alibaba.android.arouter.launcher.ARouter import com.gh.gamecenter.common.base.fragment.BaseDraggableDialogFragment -import com.gh.common.util.EnergyTaskHelper -import com.gh.gamecenter.core.utils.ToastUtils -import com.gh.gamecenter.databinding.DialogInviteCodeBinding -import com.gh.gamecenter.eventbus.EBTask -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.common.constant.EntranceConsts +import com.gh.gamecenter.common.constant.RouteConsts import com.gh.gamecenter.common.retrofit.BiResponse -import com.gh.gamecenter.retrofit.RetrofitManager -import com.gh.gamecenter.security.BindPhoneActivity +import com.gh.gamecenter.core.utils.ToastUtils +import com.gh.gamecenter.energy.databinding.DialogInviteCodeBinding +import com.gh.gamecenter.energy.eventbus.EBTask +import com.gh.gamecenter.energy.retrofit.RetrofitManager +import com.gh.gamecenter.energy.utils.EnergyTaskHelper +import com.gh.gamecenter.login.user.UserManager import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.schedulers.Schedulers import okhttp3.MediaType @@ -61,7 +63,10 @@ class InviteCodeDialog : BaseDraggableDialogFragment() { } bindBtn.setOnClickListener { - requireActivity().startActivity(BindPhoneActivity.getNormalIntent(requireActivity(), false)) + ARouter.getInstance().build(RouteConsts.activity.bindPhoneActivity) + .withBoolean(EntranceConsts.KEY_FROM_LOGIN, false) + .withBoolean(EntranceConsts.KEY_CHANGE_PHONE, false) + .navigation() dismissAllowingStateLoss() } diff --git a/app/src/main/java/com/gh/gamecenter/energy/TaskAdapter.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/view/TaskAdapter.kt similarity index 83% rename from app/src/main/java/com/gh/gamecenter/energy/TaskAdapter.kt rename to module_energy/src/main/java/com/gh/gamecenter/energy/view/TaskAdapter.kt index 22e0aa15db..896c1e5b37 100644 --- a/app/src/main/java/com/gh/gamecenter/energy/TaskAdapter.kt +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/view/TaskAdapter.kt @@ -1,4 +1,4 @@ -package com.gh.gamecenter.energy +package com.gh.gamecenter.energy.view import android.content.Context import android.view.View @@ -6,22 +6,25 @@ import android.view.ViewGroup import androidx.appcompat.app.AppCompatActivity import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import com.alibaba.android.arouter.launcher.ARouter import com.gh.gamecenter.common.base.BaseRecyclerViewHolder import com.gh.gamecenter.common.constant.ItemViewType -import com.gh.common.util.* -import com.gh.common.util.DialogUtils -import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder -import com.gh.gamecenter.baselist.ListAdapter -import com.gh.gamecenter.baselist.LoadStatus +import com.gh.gamecenter.common.baselist.ListAdapter +import com.gh.gamecenter.common.baselist.LoadStatus +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.common.provider.ILinkDirectUtilsProvider import com.gh.gamecenter.common.utils.* -import com.gh.gamecenter.core.utils.* -import com.gh.gamecenter.databinding.DailyTaskItemBinding -import com.gh.gamecenter.databinding.NoviceTasksItemBinding -import com.gh.gamecenter.databinding.TaskBottomItemBinding -import com.gh.gamecenter.databinding.TaskTitleItemBinding -import com.gh.gamecenter.gamedetail.dialog.InviteCodeDialog -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.common.viewholder.FooterViewHolder +import com.gh.gamecenter.core.provider.IFloatingBackViewManagerProvider +import com.gh.gamecenter.core.utils.ToastUtils +import com.gh.gamecenter.energy.R +import com.gh.gamecenter.energy.databinding.DailyTaskItemBinding +import com.gh.gamecenter.energy.databinding.NoviceTasksItemBinding +import com.gh.gamecenter.energy.databinding.TaskBottomItemBinding +import com.gh.gamecenter.energy.databinding.TaskTitleItemBinding +import com.gh.gamecenter.energy.utils.DialogUtils +import com.gh.gamecenter.energy.utils.IntegralLogHelper +import com.gh.gamecenter.login.user.UserManager class TaskAdapter(context: Context) : ListAdapter(context) { @@ -173,7 +176,7 @@ class TaskAdapter(context: Context) : ListAdapter(context) { ) } - CheckLoginUtils.checkLogin(mContext, mEntrance) { + mContext.ifLogin(mEntrance) { when (task.status) { "normal" -> { if (task.action == "enter_invite_code") { @@ -186,8 +189,12 @@ class TaskAdapter(context: Context) : ListAdapter(context) { position ) } else { - FloatingBackViewManager.enableBackView(FloatingBackViewManager.TYPE_TASK) - DirectUtils.directToLinkPage(mContext, task.link, mEntrance, "") + val floatingBackViewManager = ARouter.getInstance() + .build(RouteConsts.provider.floatingBackViewManager) + .navigation() as? IFloatingBackViewManagerProvider + floatingBackViewManager?.enableBackViewForTaskType() + val directUtils = ARouter.getInstance().build(RouteConsts.provider.linkDirectUtils).navigation() as? ILinkDirectUtilsProvider + directUtils?.directToLinkPage(mContext, task.link, mEntrance, "") } } diff --git a/app/src/main/java/com/gh/gamecenter/energy/TaskFragment.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/view/TaskFragment.kt similarity index 91% rename from app/src/main/java/com/gh/gamecenter/energy/TaskFragment.kt rename to module_energy/src/main/java/com/gh/gamecenter/energy/view/TaskFragment.kt index e657baacc7..f7b0ac0547 100644 --- a/app/src/main/java/com/gh/gamecenter/energy/TaskFragment.kt +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/view/TaskFragment.kt @@ -1,12 +1,12 @@ -package com.gh.gamecenter.energy +package com.gh.gamecenter.energy.view import android.os.Bundle +import com.gh.gamecenter.common.baselist.ListFragment +import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.core.utils.ClickUtils import com.gh.gamecenter.common.utils.safelyGetInRelease import com.gh.gamecenter.common.utils.viewModelProvider -import com.gh.gamecenter.baselist.ListFragment -import com.gh.gamecenter.baselist.LoadType -import com.gh.gamecenter.eventbus.EBTask +import com.gh.gamecenter.energy.eventbus.EBTask import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode diff --git a/app/src/main/java/com/gh/gamecenter/energy/TaskItemData.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/view/TaskItemData.kt similarity index 72% rename from app/src/main/java/com/gh/gamecenter/energy/TaskItemData.kt rename to module_energy/src/main/java/com/gh/gamecenter/energy/view/TaskItemData.kt index b45ad0db1f..c3acc65f8a 100644 --- a/app/src/main/java/com/gh/gamecenter/energy/TaskItemData.kt +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/view/TaskItemData.kt @@ -1,6 +1,7 @@ -package com.gh.gamecenter.energy +package com.gh.gamecenter.energy.view + +import com.gh.gamecenter.energy.entity.TaskEntity -import com.gh.gamecenter.entity.TaskEntity data class TaskItemData(var noviceTasks: List? = null, var title: String? = null, diff --git a/app/src/main/java/com/gh/gamecenter/energy/TaskViewModel.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/view/TaskViewModel.kt similarity index 85% rename from app/src/main/java/com/gh/gamecenter/energy/TaskViewModel.kt rename to module_energy/src/main/java/com/gh/gamecenter/energy/view/TaskViewModel.kt index 11058652a5..7b25e5d040 100644 --- a/app/src/main/java/com/gh/gamecenter/energy/TaskViewModel.kt +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/view/TaskViewModel.kt @@ -1,10 +1,10 @@ -package com.gh.gamecenter.energy +package com.gh.gamecenter.energy.view import android.annotation.SuppressLint import android.app.Application -import com.gh.gamecenter.baselist.ListViewModel -import com.gh.gamecenter.entity.TaskEntity -import com.gh.gamecenter.retrofit.RetrofitManager +import com.gh.gamecenter.common.baselist.ListViewModel +import com.gh.gamecenter.energy.entity.TaskEntity +import com.gh.gamecenter.energy.retrofit.RetrofitManager import io.reactivex.Single import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.schedulers.Schedulers @@ -23,8 +23,8 @@ class TaskViewModel(application: Application) override fun provideDataObservable(page: Int) = null - override fun provideDataSingle(page: Int): Single> { - return mApi.dailyTasks + override fun provideDataSingle(page: Int): Single> { + return mApi.getDailyTasks() } @SuppressLint("CheckResult") @@ -33,7 +33,7 @@ class TaskViewModel(application: Application) val itemDataList = arrayListOf() - Single.concat(mApi.noviceTasks, mApi.fixedTasks) + Single.concat(mApi.getNoviceTasks(), mApi.getFixedTasks()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe ({ diff --git a/module_energy/src/main/manifest/AndroidManifest.xml b/module_energy/src/main/manifest/AndroidManifest.xml new file mode 100644 index 0000000000..30a3b7b2fe --- /dev/null +++ b/module_energy/src/main/manifest/AndroidManifest.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/anim/anim_sign_dialog_dismiss.xml b/module_energy/src/main/res/anim/anim_sign_dialog_dismiss.xml similarity index 100% rename from app/src/main/res/anim/anim_sign_dialog_dismiss.xml rename to module_energy/src/main/res/anim/anim_sign_dialog_dismiss.xml diff --git a/app/src/main/res/drawable-xxhdpi/bg_popup_energy_task.webp b/module_energy/src/main/res/drawable-xxhdpi/bg_popup_energy_task.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/bg_popup_energy_task.webp rename to module_energy/src/main/res/drawable-xxhdpi/bg_popup_energy_task.webp diff --git a/app/src/main/res/drawable-xxhdpi/bg_sign_dialog.webp b/module_energy/src/main/res/drawable-xxhdpi/bg_sign_dialog.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/bg_sign_dialog.webp rename to module_energy/src/main/res/drawable-xxhdpi/bg_sign_dialog.webp diff --git a/app/src/main/res/drawable-xxhdpi/ic_commodity_close.webp b/module_energy/src/main/res/drawable-xxhdpi/ic_commodity_close.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_commodity_close.webp rename to module_energy/src/main/res/drawable-xxhdpi/ic_commodity_close.webp diff --git a/app/src/main/res/drawable-xxhdpi/ic_commodity_open.webp b/module_energy/src/main/res/drawable-xxhdpi/ic_commodity_open.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_commodity_open.webp rename to module_energy/src/main/res/drawable-xxhdpi/ic_commodity_open.webp diff --git a/app/src/main/res/drawable-xxhdpi/ic_energy.webp b/module_energy/src/main/res/drawable-xxhdpi/ic_energy.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_energy.webp rename to module_energy/src/main/res/drawable-xxhdpi/ic_energy.webp diff --git a/app/src/main/res/drawable-xxhdpi/ic_energy_center.webp b/module_energy/src/main/res/drawable-xxhdpi/ic_energy_center.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_energy_center.webp rename to module_energy/src/main/res/drawable-xxhdpi/ic_energy_center.webp diff --git a/app/src/main/res/drawable-xxhdpi/ic_energy_center_lottery.webp b/module_energy/src/main/res/drawable-xxhdpi/ic_energy_center_lottery.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_energy_center_lottery.webp rename to module_energy/src/main/res/drawable-xxhdpi/ic_energy_center_lottery.webp diff --git a/app/src/main/res/drawable-xxhdpi/ic_energy_center_notice.webp b/module_energy/src/main/res/drawable-xxhdpi/ic_energy_center_notice.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_energy_center_notice.webp rename to module_energy/src/main/res/drawable-xxhdpi/ic_energy_center_notice.webp diff --git a/app/src/main/res/drawable-xxhdpi/ic_energy_center_record.webp b/module_energy/src/main/res/drawable-xxhdpi/ic_energy_center_record.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_energy_center_record.webp rename to module_energy/src/main/res/drawable-xxhdpi/ic_energy_center_record.webp diff --git a/app/src/main/res/drawable-xxhdpi/ic_energy_center_sign_gift.webp b/module_energy/src/main/res/drawable-xxhdpi/ic_energy_center_sign_gift.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_energy_center_sign_gift.webp rename to module_energy/src/main/res/drawable-xxhdpi/ic_energy_center_sign_gift.webp diff --git a/app/src/main/res/drawable-xxhdpi/ic_energy_house.webp b/module_energy/src/main/res/drawable-xxhdpi/ic_energy_house.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_energy_house.webp rename to module_energy/src/main/res/drawable-xxhdpi/ic_energy_house.webp diff --git a/app/src/main/res/drawable-xxhdpi/ic_energy_house_energy.webp b/module_energy/src/main/res/drawable-xxhdpi/ic_energy_house_energy.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_energy_house_energy.webp rename to module_energy/src/main/res/drawable-xxhdpi/ic_energy_house_energy.webp diff --git a/app/src/main/res/drawable-xxhdpi/ic_energy_house_notice.webp b/module_energy/src/main/res/drawable-xxhdpi/ic_energy_house_notice.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_energy_house_notice.webp rename to module_energy/src/main/res/drawable-xxhdpi/ic_energy_house_notice.webp diff --git a/app/src/main/res/drawable-xxhdpi/ic_energy_more.png b/module_energy/src/main/res/drawable-xxhdpi/ic_energy_more.png similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_energy_more.png rename to module_energy/src/main/res/drawable-xxhdpi/ic_energy_more.png diff --git a/app/src/main/res/drawable-xxhdpi/ic_energy_order_center.webp b/module_energy/src/main/res/drawable-xxhdpi/ic_energy_order_center.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_energy_order_center.webp rename to module_energy/src/main/res/drawable-xxhdpi/ic_energy_order_center.webp diff --git a/app/src/main/res/drawable-xxhdpi/ic_energy_record.webp b/module_energy/src/main/res/drawable-xxhdpi/ic_energy_record.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_energy_record.webp rename to module_energy/src/main/res/drawable-xxhdpi/ic_energy_record.webp diff --git a/app/src/main/res/drawable-xxhdpi/ic_energy_task_complete.webp b/module_energy/src/main/res/drawable-xxhdpi/ic_energy_task_complete.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_energy_task_complete.webp rename to module_energy/src/main/res/drawable-xxhdpi/ic_energy_task_complete.webp diff --git a/app/src/main/res/drawable-xxhdpi/ic_invite_close.png b/module_energy/src/main/res/drawable-xxhdpi/ic_invite_close.png similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_invite_close.png rename to module_energy/src/main/res/drawable-xxhdpi/ic_invite_close.png diff --git a/app/src/main/res/drawable-xxhdpi/ic_popup_energy_task_more.webp b/module_energy/src/main/res/drawable-xxhdpi/ic_popup_energy_task_more.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_popup_energy_task_more.webp rename to module_energy/src/main/res/drawable-xxhdpi/ic_popup_energy_task_more.webp diff --git a/app/src/main/res/drawable-xxhdpi/ic_sign_dialog.webp b/module_energy/src/main/res/drawable-xxhdpi/ic_sign_dialog.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_sign_dialog.webp rename to module_energy/src/main/res/drawable-xxhdpi/ic_sign_dialog.webp diff --git a/app/src/main/res/drawable-xxhdpi/pic_sign_dialog.webp b/module_energy/src/main/res/drawable-xxhdpi/pic_sign_dialog.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/pic_sign_dialog.webp rename to module_energy/src/main/res/drawable-xxhdpi/pic_sign_dialog.webp diff --git a/app/src/main/res/drawable-xxxhdpi/bg_bottom_sheet_collapses.webp b/module_energy/src/main/res/drawable-xxxhdpi/bg_bottom_sheet_collapses.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/bg_bottom_sheet_collapses.webp rename to module_energy/src/main/res/drawable-xxxhdpi/bg_bottom_sheet_collapses.webp diff --git a/app/src/main/res/drawable-xxxhdpi/bg_bottom_sheet_expanded.webp b/module_energy/src/main/res/drawable-xxxhdpi/bg_bottom_sheet_expanded.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/bg_bottom_sheet_expanded.webp rename to module_energy/src/main/res/drawable-xxxhdpi/bg_bottom_sheet_expanded.webp diff --git a/app/src/main/res/drawable-xxxhdpi/bg_commodity_bottom_more.webp b/module_energy/src/main/res/drawable-xxxhdpi/bg_commodity_bottom_more.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/bg_commodity_bottom_more.webp rename to module_energy/src/main/res/drawable-xxxhdpi/bg_commodity_bottom_more.webp diff --git a/app/src/main/res/drawable-xxxhdpi/bg_commodity_cover.webp b/module_energy/src/main/res/drawable-xxxhdpi/bg_commodity_cover.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/bg_commodity_cover.webp rename to module_energy/src/main/res/drawable-xxxhdpi/bg_commodity_cover.webp diff --git a/app/src/main/res/drawable-xxxhdpi/bg_commodity_item.webp b/module_energy/src/main/res/drawable-xxxhdpi/bg_commodity_item.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/bg_commodity_item.webp rename to module_energy/src/main/res/drawable-xxxhdpi/bg_commodity_item.webp diff --git a/app/src/main/res/drawable-xxxhdpi/bg_commodity_tag.webp b/module_energy/src/main/res/drawable-xxxhdpi/bg_commodity_tag.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/bg_commodity_tag.webp rename to module_energy/src/main/res/drawable-xxxhdpi/bg_commodity_tag.webp diff --git a/app/src/main/res/drawable-xxxhdpi/bg_energy_center_top.webp b/module_energy/src/main/res/drawable-xxxhdpi/bg_energy_center_top.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/bg_energy_center_top.webp rename to module_energy/src/main/res/drawable-xxxhdpi/bg_energy_center_top.webp diff --git a/app/src/main/res/drawable-xxxhdpi/bg_energy_dialog.webp b/module_energy/src/main/res/drawable-xxxhdpi/bg_energy_dialog.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/bg_energy_dialog.webp rename to module_energy/src/main/res/drawable-xxxhdpi/bg_energy_dialog.webp diff --git a/app/src/main/res/drawable-xxxhdpi/bg_energy_house.webp b/module_energy/src/main/res/drawable-xxxhdpi/bg_energy_house.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/bg_energy_house.webp rename to module_energy/src/main/res/drawable-xxxhdpi/bg_energy_house.webp diff --git a/app/src/main/res/drawable-xxxhdpi/bg_energy_house_roll_notice.webp b/module_energy/src/main/res/drawable-xxxhdpi/bg_energy_house_roll_notice.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/bg_energy_house_roll_notice.webp rename to module_energy/src/main/res/drawable-xxxhdpi/bg_energy_house_roll_notice.webp diff --git a/app/src/main/res/drawable-xxxhdpi/bg_energy_sign_dialog.webp b/module_energy/src/main/res/drawable-xxxhdpi/bg_energy_sign_dialog.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/bg_energy_sign_dialog.webp rename to module_energy/src/main/res/drawable-xxxhdpi/bg_energy_sign_dialog.webp diff --git a/app/src/main/res/drawable-xxxhdpi/bg_energy_task_btn_finished.webp b/module_energy/src/main/res/drawable-xxxhdpi/bg_energy_task_btn_finished.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/bg_energy_task_btn_finished.webp rename to module_energy/src/main/res/drawable-xxxhdpi/bg_energy_task_btn_finished.webp diff --git a/app/src/main/res/drawable-xxxhdpi/bg_energy_task_btn_normal.webp b/module_energy/src/main/res/drawable-xxxhdpi/bg_energy_task_btn_normal.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/bg_energy_task_btn_normal.webp rename to module_energy/src/main/res/drawable-xxxhdpi/bg_energy_task_btn_normal.webp diff --git a/app/src/main/res/drawable-xxxhdpi/bg_energy_value.webp b/module_energy/src/main/res/drawable-xxxhdpi/bg_energy_value.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/bg_energy_value.webp rename to module_energy/src/main/res/drawable-xxxhdpi/bg_energy_value.webp diff --git a/app/src/main/res/drawable-xxxhdpi/bg_house_bottom_sheet_collapses.webp b/module_energy/src/main/res/drawable-xxxhdpi/bg_house_bottom_sheet_collapses.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/bg_house_bottom_sheet_collapses.webp rename to module_energy/src/main/res/drawable-xxxhdpi/bg_house_bottom_sheet_collapses.webp diff --git a/app/src/main/res/drawable-xxxhdpi/bg_novice_tasks.webp b/module_energy/src/main/res/drawable-xxxhdpi/bg_novice_tasks.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/bg_novice_tasks.webp rename to module_energy/src/main/res/drawable-xxxhdpi/bg_novice_tasks.webp diff --git a/app/src/main/res/drawable-xxxhdpi/bg_popup_energy_task.webp b/module_energy/src/main/res/drawable-xxxhdpi/bg_popup_energy_task.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/bg_popup_energy_task.webp rename to module_energy/src/main/res/drawable-xxxhdpi/bg_popup_energy_task.webp diff --git a/app/src/main/res/drawable-xxxhdpi/bg_task_bottom.webp b/module_energy/src/main/res/drawable-xxxhdpi/bg_task_bottom.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/bg_task_bottom.webp rename to module_energy/src/main/res/drawable-xxxhdpi/bg_task_bottom.webp diff --git a/app/src/main/res/drawable-xxxhdpi/bg_task_top.webp b/module_energy/src/main/res/drawable-xxxhdpi/bg_task_top.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/bg_task_top.webp rename to module_energy/src/main/res/drawable-xxxhdpi/bg_task_top.webp diff --git a/app/src/main/res/drawable-xxxhdpi/ic_energy.webp b/module_energy/src/main/res/drawable-xxxhdpi/ic_energy.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/ic_energy.webp rename to module_energy/src/main/res/drawable-xxxhdpi/ic_energy.webp diff --git a/app/src/main/res/drawable-xxxhdpi/ic_energy_center.webp b/module_energy/src/main/res/drawable-xxxhdpi/ic_energy_center.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/ic_energy_center.webp rename to module_energy/src/main/res/drawable-xxxhdpi/ic_energy_center.webp diff --git a/app/src/main/res/drawable-xxxhdpi/ic_energy_center_invite.webp b/module_energy/src/main/res/drawable-xxxhdpi/ic_energy_center_invite.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/ic_energy_center_invite.webp rename to module_energy/src/main/res/drawable-xxxhdpi/ic_energy_center_invite.webp diff --git a/app/src/main/res/drawable-xxxhdpi/ic_energy_center_lottery.webp b/module_energy/src/main/res/drawable-xxxhdpi/ic_energy_center_lottery.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/ic_energy_center_lottery.webp rename to module_energy/src/main/res/drawable-xxxhdpi/ic_energy_center_lottery.webp diff --git a/app/src/main/res/drawable-xxxhdpi/ic_energy_center_notice.webp b/module_energy/src/main/res/drawable-xxxhdpi/ic_energy_center_notice.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/ic_energy_center_notice.webp rename to module_energy/src/main/res/drawable-xxxhdpi/ic_energy_center_notice.webp diff --git a/app/src/main/res/drawable-xxxhdpi/ic_energy_center_record.webp b/module_energy/src/main/res/drawable-xxxhdpi/ic_energy_center_record.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/ic_energy_center_record.webp rename to module_energy/src/main/res/drawable-xxxhdpi/ic_energy_center_record.webp diff --git a/app/src/main/res/drawable-xxxhdpi/ic_energy_center_sign.webp b/module_energy/src/main/res/drawable-xxxhdpi/ic_energy_center_sign.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/ic_energy_center_sign.webp rename to module_energy/src/main/res/drawable-xxxhdpi/ic_energy_center_sign.webp diff --git a/app/src/main/res/drawable-xxxhdpi/ic_energy_center_sign_gift.webp b/module_energy/src/main/res/drawable-xxxhdpi/ic_energy_center_sign_gift.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/ic_energy_center_sign_gift.webp rename to module_energy/src/main/res/drawable-xxxhdpi/ic_energy_center_sign_gift.webp diff --git a/app/src/main/res/drawable-xxxhdpi/ic_energy_center_sign_normal.webp b/module_energy/src/main/res/drawable-xxxhdpi/ic_energy_center_sign_normal.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/ic_energy_center_sign_normal.webp rename to module_energy/src/main/res/drawable-xxxhdpi/ic_energy_center_sign_normal.webp diff --git a/app/src/main/res/drawable-xxxhdpi/ic_energy_center_signed.webp b/module_energy/src/main/res/drawable-xxxhdpi/ic_energy_center_signed.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/ic_energy_center_signed.webp rename to module_energy/src/main/res/drawable-xxxhdpi/ic_energy_center_signed.webp diff --git a/app/src/main/res/drawable-xxxhdpi/ic_energy_center_top_energy.webp b/module_energy/src/main/res/drawable-xxxhdpi/ic_energy_center_top_energy.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/ic_energy_center_top_energy.webp rename to module_energy/src/main/res/drawable-xxxhdpi/ic_energy_center_top_energy.webp diff --git a/app/src/main/res/drawable-xxxhdpi/ic_energy_house.webp b/module_energy/src/main/res/drawable-xxxhdpi/ic_energy_house.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/ic_energy_house.webp rename to module_energy/src/main/res/drawable-xxxhdpi/ic_energy_house.webp diff --git a/app/src/main/res/drawable-xxxhdpi/ic_energy_house_energy.webp b/module_energy/src/main/res/drawable-xxxhdpi/ic_energy_house_energy.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/ic_energy_house_energy.webp rename to module_energy/src/main/res/drawable-xxxhdpi/ic_energy_house_energy.webp diff --git a/app/src/main/res/drawable-xxxhdpi/ic_energy_house_notice.webp b/module_energy/src/main/res/drawable-xxxhdpi/ic_energy_house_notice.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/ic_energy_house_notice.webp rename to module_energy/src/main/res/drawable-xxxhdpi/ic_energy_house_notice.webp diff --git a/app/src/main/res/drawable-xxxhdpi/ic_energy_order_center.webp b/module_energy/src/main/res/drawable-xxxhdpi/ic_energy_order_center.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/ic_energy_order_center.webp rename to module_energy/src/main/res/drawable-xxxhdpi/ic_energy_order_center.webp diff --git a/app/src/main/res/drawable-xxxhdpi/ic_energy_record.webp b/module_energy/src/main/res/drawable-xxxhdpi/ic_energy_record.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/ic_energy_record.webp rename to module_energy/src/main/res/drawable-xxxhdpi/ic_energy_record.webp diff --git a/app/src/main/res/drawable-xxxhdpi/ic_energy_tab_indicator.png b/module_energy/src/main/res/drawable-xxxhdpi/ic_energy_tab_indicator.png similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/ic_energy_tab_indicator.png rename to module_energy/src/main/res/drawable-xxxhdpi/ic_energy_tab_indicator.png diff --git a/app/src/main/res/drawable-xxxhdpi/ic_energy_task_complete.webp b/module_energy/src/main/res/drawable-xxxhdpi/ic_energy_task_complete.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/ic_energy_task_complete.webp rename to module_energy/src/main/res/drawable-xxxhdpi/ic_energy_task_complete.webp diff --git a/app/src/main/res/drawable-xxxhdpi/ic_exchange_commodity.webp b/module_energy/src/main/res/drawable-xxxhdpi/ic_exchange_commodity.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/ic_exchange_commodity.webp rename to module_energy/src/main/res/drawable-xxxhdpi/ic_exchange_commodity.webp diff --git a/app/src/main/res/drawable-xxxhdpi/ic_invite_close.png b/module_energy/src/main/res/drawable-xxxhdpi/ic_invite_close.png similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/ic_invite_close.png rename to module_energy/src/main/res/drawable-xxxhdpi/ic_invite_close.png diff --git a/app/src/main/res/drawable-xxxhdpi/ic_lottery_paradise.webp b/module_energy/src/main/res/drawable-xxxhdpi/ic_lottery_paradise.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/ic_lottery_paradise.webp rename to module_energy/src/main/res/drawable-xxxhdpi/ic_lottery_paradise.webp diff --git a/module_energy/src/main/res/drawable-xxxhdpi/ic_off_shelve.webp b/module_energy/src/main/res/drawable-xxxhdpi/ic_off_shelve.webp new file mode 100644 index 0000000000..9f467d1f4d Binary files /dev/null and b/module_energy/src/main/res/drawable-xxxhdpi/ic_off_shelve.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_popup_energy_task_more.png b/module_energy/src/main/res/drawable-xxxhdpi/ic_popup_energy_task_more.png similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/ic_popup_energy_task_more.png rename to module_energy/src/main/res/drawable-xxxhdpi/ic_popup_energy_task_more.png diff --git a/module_energy/src/main/res/drawable-xxxhdpi/ic_shelve.webp b/module_energy/src/main/res/drawable-xxxhdpi/ic_shelve.webp new file mode 100644 index 0000000000..f50a426656 Binary files /dev/null and b/module_energy/src/main/res/drawable-xxxhdpi/ic_shelve.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/pic_commodity_no_data.webp b/module_energy/src/main/res/drawable-xxxhdpi/pic_commodity_no_data.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/pic_commodity_no_data.webp rename to module_energy/src/main/res/drawable-xxxhdpi/pic_commodity_no_data.webp diff --git a/app/src/main/res/drawable-xxxhdpi/pic_daily_task_title.webp b/module_energy/src/main/res/drawable-xxxhdpi/pic_daily_task_title.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/pic_daily_task_title.webp rename to module_energy/src/main/res/drawable-xxxhdpi/pic_daily_task_title.webp diff --git a/app/src/main/res/drawable-xxxhdpi/pic_earn_energy.webp b/module_energy/src/main/res/drawable-xxxhdpi/pic_earn_energy.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/pic_earn_energy.webp rename to module_energy/src/main/res/drawable-xxxhdpi/pic_earn_energy.webp diff --git a/app/src/main/res/drawable-xxxhdpi/pic_energy_rule.webp b/module_energy/src/main/res/drawable-xxxhdpi/pic_energy_rule.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/pic_energy_rule.webp rename to module_energy/src/main/res/drawable-xxxhdpi/pic_energy_rule.webp diff --git a/app/src/main/res/drawable-xxxhdpi/pic_energy_sign_dialog_top.webp b/module_energy/src/main/res/drawable-xxxhdpi/pic_energy_sign_dialog_top.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/pic_energy_sign_dialog_top.webp rename to module_energy/src/main/res/drawable-xxxhdpi/pic_energy_sign_dialog_top.webp diff --git a/app/src/main/res/drawable-xxxhdpi/pic_exchange_rule.webp b/module_energy/src/main/res/drawable-xxxhdpi/pic_exchange_rule.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/pic_exchange_rule.webp rename to module_energy/src/main/res/drawable-xxxhdpi/pic_exchange_rule.webp diff --git a/app/src/main/res/drawable-xxxhdpi/pic_fix_task_title.webp b/module_energy/src/main/res/drawable-xxxhdpi/pic_fix_task_title.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/pic_fix_task_title.webp rename to module_energy/src/main/res/drawable-xxxhdpi/pic_fix_task_title.webp diff --git a/app/src/main/res/drawable-xxxhdpi/pic_novice_task_title.webp b/module_energy/src/main/res/drawable-xxxhdpi/pic_novice_task_title.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/pic_novice_task_title.webp rename to module_energy/src/main/res/drawable-xxxhdpi/pic_novice_task_title.webp diff --git a/app/src/main/res/drawable/bg_energy_center_dotted_line.xml b/module_energy/src/main/res/drawable/bg_energy_center_dotted_line.xml similarity index 100% rename from app/src/main/res/drawable/bg_energy_center_dotted_line.xml rename to module_energy/src/main/res/drawable/bg_energy_center_dotted_line.xml diff --git a/app/src/main/res/drawable/bg_off_shelve_timer.xml b/module_energy/src/main/res/drawable/bg_off_shelve_timer.xml similarity index 100% rename from app/src/main/res/drawable/bg_off_shelve_timer.xml rename to module_energy/src/main/res/drawable/bg_off_shelve_timer.xml diff --git a/app/src/main/res/drawable/bg_shelve_timer.xml b/module_energy/src/main/res/drawable/bg_shelve_timer.xml similarity index 100% rename from app/src/main/res/drawable/bg_shelve_timer.xml rename to module_energy/src/main/res/drawable/bg_shelve_timer.xml diff --git a/app/src/main/res/drawable/button_round_00dba4.xml b/module_energy/src/main/res/drawable/button_round_00dba4.xml similarity index 100% rename from app/src/main/res/drawable/button_round_00dba4.xml rename to module_energy/src/main/res/drawable/button_round_00dba4.xml diff --git a/app/src/main/res/drawable/button_round_e6f8fa.xml b/module_energy/src/main/res/drawable/button_round_e6f8fa.xml similarity index 100% rename from app/src/main/res/drawable/button_round_e6f8fa.xml rename to module_energy/src/main/res/drawable/button_round_e6f8fa.xml diff --git a/app/src/main/res/drawable/button_round_ebf9fa.xml b/module_energy/src/main/res/drawable/button_round_ebf9fa.xml similarity index 100% rename from app/src/main/res/drawable/button_round_ebf9fa.xml rename to module_energy/src/main/res/drawable/button_round_ebf9fa.xml diff --git a/app/src/main/res/layout/commodity_item.xml b/module_energy/src/main/res/layout/commodity_item.xml similarity index 100% rename from app/src/main/res/layout/commodity_item.xml rename to module_energy/src/main/res/layout/commodity_item.xml diff --git a/app/src/main/res/layout/daily_task_item.xml b/module_energy/src/main/res/layout/daily_task_item.xml similarity index 100% rename from app/src/main/res/layout/daily_task_item.xml rename to module_energy/src/main/res/layout/daily_task_item.xml diff --git a/app/src/main/res/layout/dialog_energy_sign.xml b/module_energy/src/main/res/layout/dialog_energy_sign.xml similarity index 100% rename from app/src/main/res/layout/dialog_energy_sign.xml rename to module_energy/src/main/res/layout/dialog_energy_sign.xml diff --git a/app/src/main/res/layout/dialog_invite_code.xml b/module_energy/src/main/res/layout/dialog_invite_code.xml similarity index 100% rename from app/src/main/res/layout/dialog_invite_code.xml rename to module_energy/src/main/res/layout/dialog_invite_code.xml diff --git a/app/src/main/res/layout/dialog_sign_success.xml b/module_energy/src/main/res/layout/dialog_sign_success.xml similarity index 100% rename from app/src/main/res/layout/dialog_sign_success.xml rename to module_energy/src/main/res/layout/dialog_sign_success.xml diff --git a/app/src/main/res/layout/fragment_commodity_list.xml b/module_energy/src/main/res/layout/fragment_commodity_list.xml similarity index 100% rename from app/src/main/res/layout/fragment_commodity_list.xml rename to module_energy/src/main/res/layout/fragment_commodity_list.xml diff --git a/app/src/main/res/layout/fragment_energy_center.xml b/module_energy/src/main/res/layout/fragment_energy_center.xml similarity index 100% rename from app/src/main/res/layout/fragment_energy_center.xml rename to module_energy/src/main/res/layout/fragment_energy_center.xml diff --git a/app/src/main/res/layout/fragment_energy_house.xml b/module_energy/src/main/res/layout/fragment_energy_house.xml similarity index 100% rename from app/src/main/res/layout/fragment_energy_house.xml rename to module_energy/src/main/res/layout/fragment_energy_house.xml diff --git a/app/src/main/res/layout/item_filter_commodity_category.xml b/module_energy/src/main/res/layout/item_filter_commodity_category.xml similarity index 100% rename from app/src/main/res/layout/item_filter_commodity_category.xml rename to module_energy/src/main/res/layout/item_filter_commodity_category.xml diff --git a/app/src/main/res/layout/item_filter_commodity_size.xml b/module_energy/src/main/res/layout/item_filter_commodity_size.xml similarity index 100% rename from app/src/main/res/layout/item_filter_commodity_size.xml rename to module_energy/src/main/res/layout/item_filter_commodity_size.xml diff --git a/app/src/main/res/layout/layout_filter_category.xml b/module_energy/src/main/res/layout/layout_filter_category.xml similarity index 100% rename from app/src/main/res/layout/layout_filter_category.xml rename to module_energy/src/main/res/layout/layout_filter_category.xml diff --git a/app/src/main/res/layout/novice_task_item.xml b/module_energy/src/main/res/layout/novice_task_item.xml similarity index 100% rename from app/src/main/res/layout/novice_task_item.xml rename to module_energy/src/main/res/layout/novice_task_item.xml diff --git a/app/src/main/res/layout/novice_tasks_item.xml b/module_energy/src/main/res/layout/novice_tasks_item.xml similarity index 100% rename from app/src/main/res/layout/novice_tasks_item.xml rename to module_energy/src/main/res/layout/novice_tasks_item.xml diff --git a/app/src/main/res/layout/popup_energy_task.xml b/module_energy/src/main/res/layout/popup_energy_task.xml similarity index 100% rename from app/src/main/res/layout/popup_energy_task.xml rename to module_energy/src/main/res/layout/popup_energy_task.xml diff --git a/app/src/main/res/layout/tab_item_commodity.xml b/module_energy/src/main/res/layout/tab_item_commodity.xml similarity index 100% rename from app/src/main/res/layout/tab_item_commodity.xml rename to module_energy/src/main/res/layout/tab_item_commodity.xml diff --git a/module_energy/src/main/res/layout/tab_item_energy.xml b/module_energy/src/main/res/layout/tab_item_energy.xml new file mode 100644 index 0000000000..a64b0d4340 --- /dev/null +++ b/module_energy/src/main/res/layout/tab_item_energy.xml @@ -0,0 +1,29 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/task_bottom_item.xml b/module_energy/src/main/res/layout/task_bottom_item.xml similarity index 100% rename from app/src/main/res/layout/task_bottom_item.xml rename to module_energy/src/main/res/layout/task_bottom_item.xml diff --git a/app/src/main/res/layout/task_title_item.xml b/module_energy/src/main/res/layout/task_title_item.xml similarity index 100% rename from app/src/main/res/layout/task_title_item.xml rename to module_energy/src/main/res/layout/task_title_item.xml diff --git a/module_energy/src/main/res/values/strings.xml b/module_energy/src/main/res/values/strings.xml new file mode 100644 index 0000000000..a053eaf4c1 --- /dev/null +++ b/module_energy/src/main/res/values/strings.xml @@ -0,0 +1,29 @@ + + + + 积分模块 + 光能 + 领光能 + 光能中心 + 光能屋 + 光能明细 + 光能规则 + 赚光能 + 登录兑大奖 + 兑换规则 + 你来晚啦,任务已经被人做完喇~ + 前往光能屋查看更多 >> + 签到规则 + 1、每日可领取2个光能、1个成长值,最多领取连续7天签到奖励,中断或签满7天则重新计算 + 2、连续签满7天可额外奖励1次免费抽奖机会 + + 提示 + 填写邀请码需验证手机号绑定信息,检测\n到您未绑定手机(仅限新手机号绑定) + 该手机号以前已绑定过,请用\n新手机重新绑定 + 立即绑定 + 立即更换手机号 + 好友邀请码 + 输入好友邀请码 + 温馨提示:\n当你填写邀请码成功后,你和邀请人都能获取光能,必\n须是新用户才能填写邀请码获取光能哦! + + \ No newline at end of file diff --git a/module_energy/src/test/java/com/gh/gamecenter/energy/ExampleUnitTest.kt b/module_energy/src/test/java/com/gh/gamecenter/energy/ExampleUnitTest.kt new file mode 100644 index 0000000000..6c4ed9a47e --- /dev/null +++ b/module_energy/src/test/java/com/gh/gamecenter/energy/ExampleUnitTest.kt @@ -0,0 +1,17 @@ +package com.gh.gamecenter.energy + +import org.junit.Test + +import org.junit.Assert.* + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file diff --git a/module_login/.gitignore b/module_login/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/module_login/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/module_login/build.gradle b/module_login/build.gradle new file mode 100644 index 0000000000..48be39432d --- /dev/null +++ b/module_login/build.gradle @@ -0,0 +1,57 @@ +plugins { + id 'com.android.library' + id 'org.jetbrains.kotlin.android' + id 'kotlin-kapt' + id 'kotlin-parcelize' +} + +android { + compileSdkVersion rootProject.ext.compileSdkVersion + + defaultConfig { + minSdkVersion rootProject.ext.minSdkVersion + targetSdkVersion rootProject.ext.targetSdkVersion + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildFeatures { + viewBinding true + } + + kapt { + arguments { + arg("AROUTER_MODULE_NAME", project.name) + } + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } +} + +dependencies { + implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs') + + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.3' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' + + kapt "com.alibaba:arouter-compiler:$arouterVersion" + + implementation(project(path: ":module_common")) +} \ No newline at end of file diff --git a/module_common/libs/quick_login_android_5.8.1.aar b/module_login/libs/quick_login_android_5.8.1.aar similarity index 100% rename from module_common/libs/quick_login_android_5.8.1.aar rename to module_login/libs/quick_login_android_5.8.1.aar diff --git a/module_login/proguard-rules.pro b/module_login/proguard-rules.pro new file mode 100644 index 0000000000..481bb43481 --- /dev/null +++ b/module_login/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/module_login/src/androidTest/java/com/gh/gamecenter/login/ExampleInstrumentedTest.kt b/module_login/src/androidTest/java/com/gh/gamecenter/login/ExampleInstrumentedTest.kt new file mode 100644 index 0000000000..bad9634c3b --- /dev/null +++ b/module_login/src/androidTest/java/com/gh/gamecenter/login/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.gh.gamecenter.login + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.gh.gamecenter.login.test", appContext.packageName) + } +} \ No newline at end of file diff --git a/module_login/src/main/AndroidManifest.xml b/module_login/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..1e885c7244 --- /dev/null +++ b/module_login/src/main/AndroidManifest.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/module_login/src/main/java/com/gh/gamecenter/login/HaloApp.kt b/module_login/src/main/java/com/gh/gamecenter/login/HaloApp.kt new file mode 100644 index 0000000000..9f4aa26ff6 --- /dev/null +++ b/module_login/src/main/java/com/gh/gamecenter/login/HaloApp.kt @@ -0,0 +1,44 @@ +package com.gh.gamecenter.login + +import android.app.Application +import android.content.res.Configuration +import com.gh.gamecenter.core.iinterface.IApplication +import com.google.auto.service.AutoService + +@AutoService(IApplication::class) +class HaloApp : IApplication { + + override fun attachBaseContext() { + + } + + override fun onCreate(application: Application) { + mApp = application + } + + + override fun onLowMemory() { + + } + + override fun onTerminate() { + + } + + override fun onTrimMemory(level: Int) { + + } + + override fun onConfigurationChanged(newConfig: Configuration) { + + } + + companion object { + private lateinit var mApp: Application + + @JvmStatic + fun getInstance(): Application { + return mApp + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/entity/AuthEntity.kt b/module_login/src/main/java/com/gh/gamecenter/login/entity/AuthEntity.kt similarity index 89% rename from app/src/main/java/com/gh/gamecenter/entity/AuthEntity.kt rename to module_login/src/main/java/com/gh/gamecenter/login/entity/AuthEntity.kt index cd30e5e7dc..447e88d496 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/AuthEntity.kt +++ b/module_login/src/main/java/com/gh/gamecenter/login/entity/AuthEntity.kt @@ -1,4 +1,4 @@ -package com.gh.gamecenter.entity +package com.gh.gamecenter.login.entity import android.os.Parcelable import com.google.gson.annotations.SerializedName diff --git a/app/src/main/java/com/gh/gamecenter/entity/AvatarBorderEntity.kt b/module_login/src/main/java/com/gh/gamecenter/login/entity/AvatarBorderEntity.kt similarity index 93% rename from app/src/main/java/com/gh/gamecenter/entity/AvatarBorderEntity.kt rename to module_login/src/main/java/com/gh/gamecenter/login/entity/AvatarBorderEntity.kt index 911fdd551b..c08319ccf8 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/AvatarBorderEntity.kt +++ b/module_login/src/main/java/com/gh/gamecenter/login/entity/AvatarBorderEntity.kt @@ -1,4 +1,4 @@ -package com.gh.gamecenter.entity +package com.gh.gamecenter.login.entity import android.os.Parcelable import com.google.gson.annotations.SerializedName diff --git a/app/src/main/java/com/gh/gamecenter/entity/BackgroundImageEntity.kt b/module_login/src/main/java/com/gh/gamecenter/login/entity/BackgroundImageEntity.kt similarity index 90% rename from app/src/main/java/com/gh/gamecenter/entity/BackgroundImageEntity.kt rename to module_login/src/main/java/com/gh/gamecenter/login/entity/BackgroundImageEntity.kt index 4214f24c61..7367b23772 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/BackgroundImageEntity.kt +++ b/module_login/src/main/java/com/gh/gamecenter/login/entity/BackgroundImageEntity.kt @@ -1,4 +1,4 @@ -package com.gh.gamecenter.entity +package com.gh.gamecenter.login.entity import android.os.Parcelable import com.google.gson.annotations.SerializedName diff --git a/module_login/src/main/java/com/gh/gamecenter/login/entity/Badge.kt b/module_login/src/main/java/com/gh/gamecenter/login/entity/Badge.kt new file mode 100644 index 0000000000..b877e1ce80 --- /dev/null +++ b/module_login/src/main/java/com/gh/gamecenter/login/entity/Badge.kt @@ -0,0 +1,16 @@ +package com.gh.gamecenter.login.entity + +import android.os.Parcelable +import kotlinx.parcelize.Parcelize + +// 徽章 +@Parcelize +data class Badge( + var name: String = "", + var icon: String = "", + var actions: List? = null) : Parcelable + +// 徽章领取条件 +@Parcelize +data class BadgeAction( + var text: String = "") : Parcelable \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/entity/IdCardEntity.kt b/module_login/src/main/java/com/gh/gamecenter/login/entity/IdCardEntity.kt similarity index 90% rename from app/src/main/java/com/gh/gamecenter/entity/IdCardEntity.kt rename to module_login/src/main/java/com/gh/gamecenter/login/entity/IdCardEntity.kt index 870c556a81..82a942a4de 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/IdCardEntity.kt +++ b/module_login/src/main/java/com/gh/gamecenter/login/entity/IdCardEntity.kt @@ -1,4 +1,4 @@ -package com.gh.gamecenter.entity +package com.gh.gamecenter.login.entity import androidx.room.Entity import com.google.gson.annotations.SerializedName diff --git a/module_login/src/main/java/com/gh/gamecenter/login/entity/LoginTokenEntity.java b/module_login/src/main/java/com/gh/gamecenter/login/entity/LoginTokenEntity.java new file mode 100644 index 0000000000..ce667f26eb --- /dev/null +++ b/module_login/src/main/java/com/gh/gamecenter/login/entity/LoginTokenEntity.java @@ -0,0 +1,67 @@ +package com.gh.gamecenter.login.entity; + +import androidx.annotation.NonNull; + +import com.google.gson.annotations.SerializedName; + +/** + * Created by khy on 29/11/17. + */ +public class LoginTokenEntity { + + @NonNull + private String id; + + @SerializedName("access_token") + @NonNull + private TokenEntity accessToken; + + @SerializedName("refresh_token") + @NonNull + private TokenEntity refreshToken; + + private String loginType; + + @SerializedName("first_login") + private boolean firstLogin; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public TokenEntity getAccessToken() { + return accessToken; + } + + public void setAccessToken(TokenEntity accessToken) { + this.accessToken = accessToken; + } + + public TokenEntity getRefreshToken() { + return refreshToken; + } + + public void setRefreshToken(TokenEntity refreshToken) { + this.refreshToken = refreshToken; + } + + public String getLoginType() { + return loginType; + } + + public void setLoginType(String loginType) { + this.loginType = loginType; + } + + public boolean isFirstLogin() { + return firstLogin; + } + + public void setFirstLogin(boolean firstLogin) { + this.firstLogin = firstLogin; + } +} diff --git a/module_login/src/main/java/com/gh/gamecenter/login/entity/TokenEntity.java b/module_login/src/main/java/com/gh/gamecenter/login/entity/TokenEntity.java new file mode 100644 index 0000000000..548eb82231 --- /dev/null +++ b/module_login/src/main/java/com/gh/gamecenter/login/entity/TokenEntity.java @@ -0,0 +1,27 @@ +package com.gh.gamecenter.login.entity; + +/** + * Created by khy on 29/11/17. + */ +public class TokenEntity { + + private String value; + + private long expire; + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public long getExpire() { + return expire; + } + + public void setExpire(long expire) { + this.expire = expire; + } +} diff --git a/app/src/main/java/com/gh/gamecenter/entity/UserInfoEntity.kt b/module_login/src/main/java/com/gh/gamecenter/login/entity/UserInfoEntity.kt similarity index 95% rename from app/src/main/java/com/gh/gamecenter/entity/UserInfoEntity.kt rename to module_login/src/main/java/com/gh/gamecenter/login/entity/UserInfoEntity.kt index 1d2ec0e924..457bcd1531 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/UserInfoEntity.kt +++ b/module_login/src/main/java/com/gh/gamecenter/login/entity/UserInfoEntity.kt @@ -1,4 +1,4 @@ -package com.gh.gamecenter.entity +package com.gh.gamecenter.login.entity import com.google.gson.annotations.SerializedName diff --git a/module_login/src/main/java/com/gh/gamecenter/login/provider/QuickLoginProviderImpl.kt b/module_login/src/main/java/com/gh/gamecenter/login/provider/QuickLoginProviderImpl.kt new file mode 100644 index 0000000000..7672676eb4 --- /dev/null +++ b/module_login/src/main/java/com/gh/gamecenter/login/provider/QuickLoginProviderImpl.kt @@ -0,0 +1,34 @@ +package com.gh.gamecenter.login.provider + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.cmic.sso.sdk.auth.AuthnHelper +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.core.provider.IQuickLoginProvider +import com.gh.gamecenter.login.utils.QuickLoginHelper +import org.json.JSONException + +@Route(path = RouteConsts.provider.quickLogin, name = "一键登录暴露服务") +class QuickLoginProviderImpl : IQuickLoginProvider { + + override fun startLogin(context: Context, entrance: String) { + QuickLoginHelper.startLogin(context, entrance) + } + + override fun isOpenMobileData(context: Context): Boolean { + val helper = AuthnHelper.getInstance(context) + val jsonObject = helper.getNetworkType(context) + val net: Int + try { + net = jsonObject.getString("networkType").toInt() + if (net == 1 || net == 3) return true + } catch (e: JSONException) { + e.printStackTrace() + } + return false + } + + override fun init(context: Context?) { + + } +} \ No newline at end of file diff --git a/app/src/main/java/com/gh/common/provider/UserManagerProviderImpl.kt b/module_login/src/main/java/com/gh/gamecenter/login/provider/UserManagerProviderImpl.kt similarity index 92% rename from app/src/main/java/com/gh/common/provider/UserManagerProviderImpl.kt rename to module_login/src/main/java/com/gh/gamecenter/login/provider/UserManagerProviderImpl.kt index 70f69d7e96..2fcd261649 100644 --- a/app/src/main/java/com/gh/common/provider/UserManagerProviderImpl.kt +++ b/module_login/src/main/java/com/gh/gamecenter/login/provider/UserManagerProviderImpl.kt @@ -1,10 +1,10 @@ -package com.gh.common.provider +package com.gh.gamecenter.login.provider import android.content.Context import com.alibaba.android.arouter.facade.annotation.Route import com.gh.gamecenter.common.constant.RouteConsts import com.gh.gamecenter.core.provider.IUserManagerProvider -import com.gh.gamecenter.manager.UserManager +import com.gh.gamecenter.login.user.UserManager @Route(path = RouteConsts.provider.userManager, name = "UserManager暴露服务") class UserManagerProviderImpl : IUserManagerProvider { diff --git a/module_login/src/main/java/com/gh/gamecenter/login/retrofit/ApiService.java b/module_login/src/main/java/com/gh/gamecenter/login/retrofit/ApiService.java new file mode 100644 index 0000000000..3bc3ca2f56 --- /dev/null +++ b/module_login/src/main/java/com/gh/gamecenter/login/retrofit/ApiService.java @@ -0,0 +1,127 @@ +package com.gh.gamecenter.login.retrofit; + +import com.gh.gamecenter.login.entity.LoginTokenEntity; +import com.gh.gamecenter.login.entity.UserInfoEntity; + +import io.reactivex.Observable; +import io.reactivex.Single; +import okhttp3.RequestBody; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Path; +import retrofit2.http.Url; + +public interface ApiService { + + /** + * 刷新accessToken + */ + @Headers({"Content-Type: application/json", "Accept: application/json"}) + @POST() + Observable refreshToken(@Url String url, @Body RequestBody body); + + /** + * 修改用户信息 + */ + @Headers({"Content-Type: application/json", "Accept: application/json"}) + @PUT("users/{user_id}") + Observable changeUserInfo(@Body RequestBody body, @Path("user_id") String userId); + + /** + * 注销登录 + */ + @Headers({"Content-Type: application/json", "Accept: application/json"}) + @POST("logout") + Observable logout(); + + /** + * 将老用户的数据同步到 3.0 版本的数据中 + */ + @Headers({"Content-Type: application/json", "Accept: application/json"}) + @POST("users:sync") + Observable syncUserData(@Body RequestBody body); + + /** + * 获取用户信息(头像/用户名) + */ + @POST + Observable getUserInfo(@Url String url); + + // Header作为区分 userinfo 的唯一标识 + @POST() + Observable getRetryUserInfo(@Url String url, @Header("retry") String tag); // 在OkHttpRetryInterceptor使用主要是不允许这个接口重试 + + /** + * 获取用户礼仪考试状态 + */ + @GET("users/{user_id}/exam/etiquette") + Single getUserRegulationTestStatus(@Path("user_id") String userId); + + /** + * 手机登录获取验证码 + */ + @Headers({"Content-Type: application/json", "Accept: application/json"}) + @POST("login/mobile?step=1") + Observable loginByCaptcha(@Body RequestBody body); + + /** + * 手机登录 + */ + @Headers({"Content-Type: application/json", "Accept: application/json"}) + @POST("login/mobile?step=2") + Observable loginByMobile(@Body RequestBody body); + + /** + * QQ登录 + */ + @Headers({"Content-Type: application/json", "Accept: application/json"}) + @POST("login/qq") + Observable loginByQQ(@Body RequestBody body); + + /** + * 微博登录 + */ + @Headers({"Content-Type: application/json", "Accept: application/json"}) + @POST("login/weibo") + Observable loginByWeibo(@Body RequestBody body); + + /** + * 微信登录 + */ + @Headers({"Content-Type: application/json", "Accept: application/json"}) + @POST("login/wechat") + Observable loginByWechat(@Body RequestBody body); + + /** + * 抖音登录 + */ + @Headers({"Content-Type: application/json", "Accept: application/json"}) + @POST("login/douyin") + Observable loginByDouYin(@Body RequestBody body); + + /** + * 一键登录 + */ + @Headers({"Content-Type: application/json", "Accept: application/json"}) + @POST("login/mobile_oauth") + Observable loginByOauth(@Body RequestBody body); + + /** + * 更新实名认证 + */ + @POST("certification") + Single postCertification(@Body RequestBody body); + + /** + * 同步从其他游戏传过来的实名认证 + */ + @POST("./certification:sync") + Observable postSyncCertification(@Body RequestBody body); + + +} diff --git a/module_login/src/main/java/com/gh/gamecenter/login/retrofit/RetrofitManager.java b/module_login/src/main/java/com/gh/gamecenter/login/retrofit/RetrofitManager.java new file mode 100644 index 0000000000..7493b20988 --- /dev/null +++ b/module_login/src/main/java/com/gh/gamecenter/login/retrofit/RetrofitManager.java @@ -0,0 +1,32 @@ +package com.gh.gamecenter.login.retrofit; + +import android.content.Context; + +import com.gh.gamecenter.common.retrofit.BaseRetrofitManager; +import com.gh.gamecenter.common.utils.EnvHelper; +import com.gh.gamecenter.login.HaloApp; + +import okhttp3.OkHttpClient; + +public class RetrofitManager extends BaseRetrofitManager { + + private final ApiService mApiService; + + private RetrofitManager() { + Context context = HaloApp.getInstance().getApplicationContext(); + OkHttpClient okHttpNormalConfig = getOkHttpConfig(context, 0, 2); + mApiService = provideService(okHttpNormalConfig, EnvHelper.getHost(), ApiService.class); + } + + public static RetrofitManager getInstance() { + return SingletonHolder.INSTANCE; + } + + public ApiService getApi() { + return mApiService; + } + + private static class SingletonHolder { + private static final RetrofitManager INSTANCE = new RetrofitManager(); + } +} diff --git a/app/src/main/java/com/gh/gamecenter/user/LoginTag.java b/module_login/src/main/java/com/gh/gamecenter/login/user/LoginTag.java similarity index 89% rename from app/src/main/java/com/gh/gamecenter/user/LoginTag.java rename to module_login/src/main/java/com/gh/gamecenter/login/user/LoginTag.java index df5cfec861..371d3d88b4 100644 --- a/app/src/main/java/com/gh/gamecenter/user/LoginTag.java +++ b/module_login/src/main/java/com/gh/gamecenter/login/user/LoginTag.java @@ -1,4 +1,4 @@ -package com.gh.gamecenter.user; +package com.gh.gamecenter.login.user; /** * Created by khy on 29/11/17. diff --git a/app/src/main/java/com/gh/gamecenter/manager/UserManager.java b/module_login/src/main/java/com/gh/gamecenter/login/user/UserManager.java similarity index 87% rename from app/src/main/java/com/gh/gamecenter/manager/UserManager.java rename to module_login/src/main/java/com/gh/gamecenter/login/user/UserManager.java index e2b4e6bc15..55c206e6fd 100644 --- a/app/src/main/java/com/gh/gamecenter/manager/UserManager.java +++ b/module_login/src/main/java/com/gh/gamecenter/login/user/UserManager.java @@ -1,4 +1,4 @@ -package com.gh.gamecenter.manager; +package com.gh.gamecenter.login.user; import android.annotation.SuppressLint; import android.content.SharedPreferences; @@ -7,26 +7,25 @@ import android.text.TextUtils; import androidx.annotation.Nullable; -import com.gh.common.repository.ReservationRepository; -import com.gh.common.util.ErrorHelper; import com.gh.gamecenter.common.base.activity.BaseActivity; +import com.alibaba.android.arouter.launcher.ARouter; import com.gh.gamecenter.common.constant.Constants; import com.gh.gamecenter.common.eventbus.EBShowDialog; +import com.gh.gamecenter.common.constant.RouteConsts; import com.gh.gamecenter.common.exposure.meta.MetaUtil; import com.gh.gamecenter.common.retrofit.BiResponse; import com.gh.gamecenter.common.retrofit.Response; import com.gh.gamecenter.common.utils.DeviceUtils; import com.gh.gamecenter.common.utils.EnvHelper; +import com.gh.gamecenter.core.provider.IReservationRepositoryProvider; import com.gh.gamecenter.core.utils.GsonUtils; import com.gh.gamecenter.core.utils.SPUtils; -import com.gh.gamecenter.entity.CommunityEntity; -import com.gh.gamecenter.entity.LoginTokenEntity; -import com.gh.gamecenter.entity.TokenEntity; -import com.gh.gamecenter.entity.UserInfoEntity; -import com.gh.gamecenter.retrofit.RetrofitManager; -import com.gh.gamecenter.retrofit.service.ApiService; -import com.gh.gamecenter.user.UserRepository; -import com.halo.assistant.HaloApp; +import com.gh.gamecenter.login.HaloApp; +import com.gh.gamecenter.login.entity.LoginTokenEntity; +import com.gh.gamecenter.login.entity.TokenEntity; +import com.gh.gamecenter.login.entity.UserInfoEntity; +import com.gh.gamecenter.login.retrofit.ApiService; +import com.gh.gamecenter.login.retrofit.RetrofitManager; import com.lightgame.utils.Utils; import org.greenrobot.eventbus.EventBus; @@ -45,14 +44,11 @@ import retrofit2.HttpException; public class UserManager { - private final String COMMUNITY_KEY = "CommunityKey"; - private SharedPreferences mSp; @Nullable private UserInfoEntity mUserInfoEntity; private LoginTokenEntity mLoginTokenEntity; - private CommunityEntity mCommunityData; private String deviceId; @@ -61,7 +57,7 @@ public class UserManager { } private UserManager() { - mSp = PreferenceManager.getDefaultSharedPreferences(HaloApp.getInstance().getApplication()); + mSp = PreferenceManager.getDefaultSharedPreferences(HaloApp.getInstance()); deviceId = mSp.getString(Constants.DEVICE_KEY, ""); } @@ -84,7 +80,7 @@ public class UserManager { } public String getToken() { - if (mLoginTokenEntity != null) { + if (mLoginTokenEntity != null && mLoginTokenEntity.getAccessToken() != null) { return mLoginTokenEntity.getAccessToken().getValue(); } return null; @@ -112,22 +108,6 @@ public class UserManager { return deviceId; } - public void setCommunityData(CommunityEntity community) { - if (community != null) { - SPUtils.setString(mSp, COMMUNITY_KEY, GsonUtils.toJson(community)); - this.mCommunityData = community; - } - } - - public CommunityEntity getCommunity() { - if (mCommunityData == null || TextUtils.isEmpty(mCommunityData.getId())) { - String communityJson = mSp.getString(COMMUNITY_KEY, null); - mCommunityData = TextUtils.isEmpty(communityJson) ? new CommunityEntity() - : GsonUtils.fromJson(communityJson, CommunityEntity.class); - } - return mCommunityData == null ? new CommunityEntity() : mCommunityData; - } - public void logout() { mUserInfoEntity = null; mLoginTokenEntity = null; @@ -150,8 +130,8 @@ public class UserManager { // 判断RefreshToken是否过期 TokenEntity refreshToken = tokenEntity.getRefreshToken(); - if (refreshToken.getExpire() < Utils.getTime(HaloApp.getInstance().getApplication())) { - Utils.toast(HaloApp.getInstance().getApplication(), "账号过期,请重新登录!"); + if (refreshToken.getExpire() < Utils.getTime(HaloApp.getInstance())) { + Utils.toast(HaloApp.getInstance(), "账号过期,请重新登录!"); UserRepository.getInstance().logout(); callBack.onLoginFailure(null); return; @@ -159,7 +139,7 @@ public class UserManager { RequestBody body = null; try { - JSONObject device = DeviceUtils.getLoginDevice(HaloApp.getInstance().getApplication()); + JSONObject device = DeviceUtils.getLoginDevice(HaloApp.getInstance()); JSONObject content = new JSONObject(); content.put("refresh_token", refreshToken.getValue()); content.put("device", device); @@ -179,7 +159,8 @@ public class UserManager { refreshUserInfo(callBack); // 更新用户预约的游戏列表 - ReservationRepository.refreshReservations(); + IReservationRepositoryProvider reservationRepository = (IReservationRepositoryProvider) ARouter.getInstance().build(RouteConsts.provider.reservationRepository).navigation(); + reservationRepository.refreshReservations(); refreshUserRegulationTestStatus(); } diff --git a/app/src/main/java/com/gh/gamecenter/user/UserRepository.java b/module_login/src/main/java/com/gh/gamecenter/login/user/UserRepository.java similarity index 83% rename from app/src/main/java/com/gh/gamecenter/user/UserRepository.java rename to module_login/src/main/java/com/gh/gamecenter/login/user/UserRepository.java index a44ae48eea..82e15f5645 100644 --- a/app/src/main/java/com/gh/gamecenter/user/UserRepository.java +++ b/module_login/src/main/java/com/gh/gamecenter/login/user/UserRepository.java @@ -1,4 +1,4 @@ -package com.gh.gamecenter.user; +package com.gh.gamecenter.login.user; import android.annotation.SuppressLint; import android.content.Context; @@ -11,39 +11,39 @@ import androidx.annotation.Nullable; import androidx.lifecycle.LiveData; import androidx.lifecycle.MediatorLiveData; -import com.gh.gamecenter.common.constant.Constants; -import com.gh.common.repository.ReservationRepository; +import com.alibaba.android.arouter.launcher.ARouter; +import com.gh.gamecenter.core.provider.IWechatBindHelperProvider; +import com.gh.gamecenter.login.HaloApp; +import com.gh.gamecenter.login.utils.LoginHelper; import com.gh.gamecenter.common.callback.BiCallback; -import com.gh.common.util.DataUtils; +import com.gh.gamecenter.common.constant.Constants; +import com.gh.gamecenter.common.constant.RouteConsts; +import com.gh.gamecenter.common.eventbus.EBReuse; import com.gh.gamecenter.common.retrofit.ApiResponse; -import com.gh.gamecenter.common.utils.DeviceUtils; -import com.gh.common.util.EnergyTaskHelper; -import com.gh.gamecenter.common.utils.EnvHelper; -import com.gh.common.util.ErrorHelper; -import com.gh.common.util.GameSubstituteRepositoryHelper; -import com.gh.gamecenter.core.utils.GsonUtils; -import com.gh.common.util.LoginHelper; -import com.gh.common.util.LoginUtils; -import com.gh.common.util.NewLogUtils; -import com.gh.gamecenter.core.utils.SPUtils; -import com.gh.common.util.WechatBindHelper; -import com.gh.download.DownloadManager; -import com.gh.gamecenter.R; -import com.gh.gamecenter.entity.AvatarBorderEntity; -import com.gh.gamecenter.entity.BackgroundImageEntity; -import com.gh.gamecenter.entity.IdCardEntity; -import com.gh.gamecenter.entity.LoginTokenEntity; -import com.gh.gamecenter.entity.TokenEntity; -import com.gh.gamecenter.entity.UserInfoEntity; -import com.gh.gamecenter.eventbus.EBReuse; -import com.gh.gamecenter.manager.UserManager; -import com.gh.gamecenter.message.MessageUnreadRepository; -import com.gh.gamecenter.personal.PersonalFragment; import com.gh.gamecenter.common.retrofit.BiResponse; import com.gh.gamecenter.common.retrofit.Response; -import com.gh.gamecenter.retrofit.RetrofitManager; -import com.gh.gamecenter.retrofit.service.ApiService; -import com.halo.assistant.HaloApp; +import com.gh.gamecenter.common.utils.DeviceUtils; +import com.gh.gamecenter.common.utils.EnvHelper; +import com.gh.gamecenter.core.provider.IDataUtilsProvider; +import com.gh.gamecenter.core.provider.IDownloadManagerProvider; +import com.gh.gamecenter.core.provider.IEnergyTaskProvider; +import com.gh.gamecenter.core.provider.IErrorHelperProvider; +import com.gh.gamecenter.core.provider.IGameSubstituteRepositoryProvider; +import com.gh.gamecenter.core.provider.IMessageUnreadRepositoryProvider; +import com.gh.gamecenter.core.provider.IReservationRepositoryProvider; +import com.gh.gamecenter.core.utils.GsonUtils; +import com.gh.gamecenter.core.utils.SPUtils; +import com.gh.gamecenter.login.R; +import com.gh.gamecenter.login.utils.NewLogUtils; +import com.gh.gamecenter.login.retrofit.ApiService; +import com.gh.gamecenter.login.retrofit.RetrofitManager; +import com.gh.gamecenter.login.entity.AvatarBorderEntity; +import com.gh.gamecenter.login.entity.BackgroundImageEntity; +import com.gh.gamecenter.login.entity.IdCardEntity; +import com.gh.gamecenter.login.entity.LoginTokenEntity; +import com.gh.gamecenter.login.entity.TokenEntity; +import com.gh.gamecenter.login.entity.UserInfoEntity; +import com.gh.gamecenter.login.utils.LoginUtils; import com.lightgame.config.CommonDebug; import com.lightgame.utils.Utils; @@ -62,6 +62,9 @@ import okhttp3.RequestBody; import okhttp3.ResponseBody; import retrofit2.HttpException; +import static com.gh.gamecenter.common.constant.Constants.LOGIN_TAG; +import static com.gh.gamecenter.common.constant.Constants.LOGOUT_TAG; + /** * Created by khy on 28/11/17. */ @@ -138,13 +141,17 @@ public class UserRepository { SPUtils.setString(mPreferences, Constants.USER_INFO_KEY, null); SPUtils.setString(Constants.SP_REGULATION_TEST_PASS_STATUS, ""); - ReservationRepository.clearReservations(); - GameSubstituteRepositoryHelper.updateSubstitutableGames(); + IReservationRepositoryProvider reservationRepository = (IReservationRepositoryProvider) ARouter.getInstance().build(RouteConsts.provider.reservationRepository).navigation(); + reservationRepository.clearReservations(); + + IGameSubstituteRepositoryProvider gameSubstituteRepository = (IGameSubstituteRepositoryProvider) ARouter.getInstance().build(RouteConsts.provider.gameSubstituteRepository).navigation(); + gameSubstituteRepository.updateSubstitutableGames(); // 通知页面更新 - EventBus.getDefault().post(new EBReuse(PersonalFragment.LOGOUT_TAG)); + EventBus.getDefault().post(new EBReuse(LOGOUT_TAG)); - DataUtils.getDeviceCertification(HaloApp.getInstance().getGid()); + IDataUtilsProvider dataUtils = (IDataUtilsProvider) ARouter.getInstance().build(RouteConsts.provider.dataUtils).navigation(); + dataUtils.getDeviceCertification(); } public LiveData> getLoginUserInfo() { @@ -226,8 +233,10 @@ public class UserRepository { userTokenHandle(response, loginTag); - GameSubstituteRepositoryHelper.updateSubstitutableGames(); - WechatBindHelper.getWechatConfig(null); + IGameSubstituteRepositoryProvider gameSubstituteRepository = (IGameSubstituteRepositoryProvider) ARouter.getInstance().build(RouteConsts.provider.gameSubstituteRepository).navigation(); + gameSubstituteRepository.updateSubstitutableGames(); + IWechatBindHelperProvider wechatBindHelper = (IWechatBindHelperProvider) ARouter.getInstance().build(RouteConsts.provider.wechatHelper).navigation(); + wechatBindHelper.getWechatConfig(); if (callback != null) { callback.onFirst(response); @@ -339,7 +348,8 @@ public class UserRepository { mCacheUserInfoEntity.setIcon(content); break; case UserViewModel.TYPE_ID_CARD: - EnergyTaskHelper.postEnergyTask("authentication"); + IEnergyTaskProvider energyTaskHelper = (IEnergyTaskProvider) ARouter.getInstance().build(RouteConsts.provider.energyTask).navigation(); + energyTaskHelper.postEnergyTask("authentication"); mCacheUserInfoEntity.setIdCard(GsonUtils.fromJson(content, IdCardEntity.class)); break; case UserViewModel.TYPE_INTRODUCE: @@ -460,13 +470,15 @@ public class UserRepository { } // 重启因为实名认证而处于等待中的任务 - DownloadManager.getInstance().resumeAllInvisiblePendingTask(); + IDownloadManagerProvider downloadManager = (IDownloadManagerProvider) ARouter.getInstance().build(RouteConsts.provider.downloadManager).navigation(); + downloadManager.resumeAllInvisiblePendingTask(); } @Override public void onFailure(@NonNull Exception exception) { mEditObsResponseUserInfo.postValue(null); - ErrorHelper.handleLoginError(HaloApp.getInstance(), (HttpException) exception); + IErrorHelperProvider errorHelper = (IErrorHelperProvider) ARouter.getInstance().build(RouteConsts.provider.errorHelper).navigation(); + errorHelper.handleLoginError(HaloApp.getInstance(), (HttpException) exception); NewLogUtils.INSTANCE.logCertificationResult(isForcedToCertificate, 0); } }); @@ -492,7 +504,8 @@ public class UserRepository { @Override public void onResponse(@Nullable ResponseBody response) { super.onResponse(response); - DataUtils.getDeviceCertification(HaloApp.getInstance().getGid()); + IDataUtilsProvider dataUtils = (IDataUtilsProvider) ARouter.getInstance().build(RouteConsts.provider.dataUtils).navigation(); + dataUtils.getDeviceCertification(); } @Override @@ -512,22 +525,26 @@ public class UserRepository { // 绑定客服 IM // ImManager.attachIm(); - ReservationRepository.refreshReservations(); + IReservationRepositoryProvider reservationRepository = (IReservationRepositoryProvider) ARouter.getInstance().build(RouteConsts.provider.reservationRepository).navigation(); + reservationRepository.refreshReservations(); UserManager.getInstance().refreshUserRegulationTestStatus(); if (loginTag != null) { Utils.toast(mContext, R.string.login_success); - EventBus.getDefault().post(new EBReuse(PersonalFragment.LOGIN_TAG)); + EventBus.getDefault().post(new EBReuse(LOGIN_TAG)); - MessageUnreadRepository.INSTANCE.loadMessageUnreadData(); + + IMessageUnreadRepositoryProvider messageUnreadRepository = (IMessageUnreadRepositoryProvider) ARouter.getInstance().build(RouteConsts.provider.messageUnreadRepository).navigation(); + messageUnreadRepository.loadMessageUnreadData(); } if (UserManager.getInstance().getLoginTokenEntity() != null) { + IEnergyTaskProvider energyTaskHelper = (IEnergyTaskProvider) ARouter.getInstance().build(RouteConsts.provider.energyTask).navigation(); if (UserManager.getInstance().getLoginTokenEntity().isFirstLogin()) { - EnergyTaskHelper.postEnergyTask("register"); + energyTaskHelper.postEnergyTask("register"); } else { - EnergyTaskHelper.postEnergyTask("login"); + energyTaskHelper.postEnergyTask("login"); } } dispatchOnLoginToFlutter(); @@ -538,11 +555,12 @@ public class UserRepository { super.onApiFailure(e); mLoginObsResponseUserInfo.postValue(e); if (loginTag != null) { - ErrorHelper.handleLoginError(mContext, e.getHttpException()); + IErrorHelperProvider errorHelper = (IErrorHelperProvider) ARouter.getInstance().build(RouteConsts.provider.errorHelper).navigation(); + errorHelper.handleLoginError(mContext, e.getHttpException()); logout(); } - if (CommonDebug.IS_DEBUG) { +// if (CommonDebug.IS_DEBUG) { try { HttpException httpException = e.getHttpException(); ResponseBody responseBody = httpException.response().errorBody(); @@ -550,7 +568,7 @@ public class UserRepository { } catch (Exception e1) { e1.printStackTrace(); } - } +// } } }; } @@ -585,7 +603,8 @@ public class UserRepository { if (isEditUserInfo) { mEditObsResponseUserInfo.postValue(new ApiResponse<>(userInfoEntity)); } else { - DataUtils.getDeviceCertification(HaloApp.getInstance().getGid()); + IDataUtilsProvider dataUtils = (IDataUtilsProvider) ARouter.getInstance().build(RouteConsts.provider.dataUtils).navigation(); + dataUtils.getDeviceCertification(); } } diff --git a/app/src/main/java/com/gh/gamecenter/user/UserViewModel.java b/module_login/src/main/java/com/gh/gamecenter/login/user/UserViewModel.java similarity index 97% rename from app/src/main/java/com/gh/gamecenter/user/UserViewModel.java rename to module_login/src/main/java/com/gh/gamecenter/login/user/UserViewModel.java index 0f5dc8ef97..3deda23ef6 100644 --- a/app/src/main/java/com/gh/gamecenter/user/UserViewModel.java +++ b/module_login/src/main/java/com/gh/gamecenter/login/user/UserViewModel.java @@ -1,12 +1,7 @@ -package com.gh.gamecenter.user; +package com.gh.gamecenter.login.user; import android.app.Application; -import com.gh.gamecenter.common.retrofit.ApiResponse; -import com.gh.gamecenter.entity.UserInfoEntity; - -import org.json.JSONObject; - import androidx.annotation.NonNull; import androidx.lifecycle.AndroidViewModel; import androidx.lifecycle.LiveData; @@ -14,6 +9,11 @@ import androidx.lifecycle.MediatorLiveData; import androidx.lifecycle.ViewModel; import androidx.lifecycle.ViewModelProvider; +import com.gh.gamecenter.common.retrofit.ApiResponse; +import com.gh.gamecenter.login.entity.UserInfoEntity; + +import org.json.JSONObject; + /** * Created by khy on 28/11/17. */ diff --git a/app/src/main/java/com/gh/common/util/AccessTokenKeeper.java b/module_login/src/main/java/com/gh/gamecenter/login/utils/AccessTokenKeeper.java similarity index 98% rename from app/src/main/java/com/gh/common/util/AccessTokenKeeper.java rename to module_login/src/main/java/com/gh/gamecenter/login/utils/AccessTokenKeeper.java index e296f72462..187bea7f6f 100644 --- a/app/src/main/java/com/gh/common/util/AccessTokenKeeper.java +++ b/module_login/src/main/java/com/gh/gamecenter/login/utils/AccessTokenKeeper.java @@ -1,4 +1,4 @@ -package com.gh.common.util; +package com.gh.gamecenter.login.utils; import android.content.Context; import android.content.SharedPreferences; diff --git a/app/src/main/java/com/gh/common/util/LoginHelper.kt b/module_login/src/main/java/com/gh/gamecenter/login/utils/LoginHelper.kt similarity index 86% rename from app/src/main/java/com/gh/common/util/LoginHelper.kt rename to module_login/src/main/java/com/gh/gamecenter/login/utils/LoginHelper.kt index 5c0067d830..485cbba03f 100644 --- a/app/src/main/java/com/gh/common/util/LoginHelper.kt +++ b/module_login/src/main/java/com/gh/gamecenter/login/utils/LoginHelper.kt @@ -1,16 +1,18 @@ -package com.gh.common.util +package com.gh.gamecenter.login.utils import android.app.Activity import android.content.Intent -import com.gh.common.constant.Config -import com.gh.gamecenter.R import com.gh.gamecenter.common.constant.Constants -import com.gh.gamecenter.common.utils.tryWithDefaultCatch +import com.alibaba.android.arouter.launcher.ARouter +import com.gh.gamecenter.common.constant.RouteConsts import com.gh.gamecenter.core.utils.SPUtils +import com.gh.gamecenter.common.utils.tryWithDefaultCatch +import com.gh.gamecenter.core.provider.IConfigProvider import com.gh.gamecenter.core.utils.SentryHelper -import com.gh.gamecenter.user.LoginTag -import com.halo.assistant.HaloApp import com.lightgame.utils.RuntimeUtils +import com.gh.gamecenter.login.HaloApp +import com.gh.gamecenter.login.R +import com.gh.gamecenter.login.user.LoginTag import com.lightgame.utils.Utils import com.sina.weibo.sdk.auth.AuthInfo import com.sina.weibo.sdk.auth.Oauth2AccessToken @@ -46,9 +48,10 @@ object LoginHelper { private var mLoginCallback: LoginCallback? = null init { - val context = HaloApp.getInstance().application.applicationContext - mTencent = Tencent.createInstance(Config.TENCENT_APPID, context) //初始化QQ分享 - mIWXAPI = WXAPIFactory.createWXAPI(context, Config.WECHAT_APPID, true) //初始化微信分享 + val context = HaloApp.getInstance().applicationContext + val config = ARouter.getInstance().build(RouteConsts.provider.config).navigation() as? IConfigProvider + mTencent = Tencent.createInstance(config?.getTencentAppId(), context) //初始化QQ分享 + mIWXAPI = WXAPIFactory.createWXAPI(context, config?.getWechatAppId(), true) //初始化微信分享 mQqLoginListener = object : IUiListener { override fun onComplete(o: Any?) { @@ -147,7 +150,7 @@ object LoginHelper { @JvmStatic fun logoutWithQQ() { if (mTencent.isSessionValid) { - mTencent.logout(HaloApp.getInstance().application.applicationContext) + mTencent.logout(HaloApp.getInstance().applicationContext) } } @@ -155,16 +158,17 @@ object LoginHelper { @JvmStatic fun loginWithWechat(loginCallback: LoginCallback) { mLoginCallback = loginCallback - val register = mIWXAPI.registerApp(Config.WECHAT_APPID) + val config = ARouter.getInstance().build(RouteConsts.provider.config).navigation() as? IConfigProvider + val register = mIWXAPI.registerApp(config?.getWechatAppId()) val req = SendAuth.Req() req.scope = "snsapi_userinfo" - req.state = HaloApp.getInstance().application.getString(R.string.app_name) + req.state = HaloApp.getInstance().getString(R.string.app_name) val b = mIWXAPI.sendReq(req) Utils.log("微信注册状态::$register\n 发送状态::$b") if (!register || !b) { loginCallback.onLoginFailure(LoginTag.wechat, "请检查是否安装微信客户端") - Utils.toast(HaloApp.getInstance().application, "请检查是否安装微信客户端") + Utils.toast(HaloApp.getInstance(), "请检查是否安装微信客户端") } } @@ -182,9 +186,10 @@ object LoginHelper { mWBAPI = WBAPIFactory.createWBAPI(context) //初始化微博分享 mLoginCallback = loginCallback + val config = ARouter.getInstance().build(RouteConsts.provider.config).navigation() as? IConfigProvider mWBAPI.registerApp( context, - AuthInfo(context, Config.WEIBO_APPKEY, "http://www.sina.com", WEIBO_SCOPE) + AuthInfo(context, config?.getWeiboAppKey(), "http://www.sina.com", WEIBO_SCOPE) ) mWBAPI.authorizeClient(context, object : WbAuthListener { override fun onComplete(token: Oauth2AccessToken?) { diff --git a/app/src/main/java/com/gh/common/util/LoginUtils.java b/module_login/src/main/java/com/gh/gamecenter/login/utils/LoginUtils.java similarity index 99% rename from app/src/main/java/com/gh/common/util/LoginUtils.java rename to module_login/src/main/java/com/gh/gamecenter/login/utils/LoginUtils.java index 4f5bdcf7dc..9431ddc6d8 100644 --- a/app/src/main/java/com/gh/common/util/LoginUtils.java +++ b/module_login/src/main/java/com/gh/gamecenter/login/utils/LoginUtils.java @@ -1,11 +1,11 @@ -package com.gh.common.util; +package com.gh.gamecenter.login.utils; import android.content.Context; import com.gh.gamecenter.common.utils.DeviceUtils; import com.gh.gamecenter.common.retrofit.JSONObjectResponse; import com.gh.gamecenter.common.retrofit.Response; -import com.gh.gamecenter.retrofit.RetrofitManager; +import com.gh.gamecenter.login.retrofit.RetrofitManager; import com.lightgame.utils.Utils; import org.json.JSONException; diff --git a/module_login/src/main/java/com/gh/gamecenter/login/utils/NewLogUtils.kt b/module_login/src/main/java/com/gh/gamecenter/login/utils/NewLogUtils.kt new file mode 100644 index 0000000000..75d91fb350 --- /dev/null +++ b/module_login/src/main/java/com/gh/gamecenter/login/utils/NewLogUtils.kt @@ -0,0 +1,41 @@ +package com.gh.gamecenter.login.utils + +import com.gh.gamecenter.common.json.JsonObjectBuilder +import com.gh.gamecenter.common.json.json +import com.gh.gamecenter.common.loghub.LoghubUtils +import com.gh.gamecenter.common.utils.LogUtils +import com.lightgame.utils.Utils +import org.json.JSONObject + +object NewLogUtils { + + private fun log(jsonObject: JSONObject, logStore: String, uploadImmediately: Boolean) { + Utils.log("NewLogUtils", jsonObject.toString(4)) + LoghubUtils.log(jsonObject, logStore, uploadImmediately) + } + + fun parseAndPutMeta(): JsonObjectBuilder.() -> Unit = { + val meta = LogUtils.getMetaObject() + val metaKeys = meta.keys() + while (metaKeys.hasNext()) { + val key: String = metaKeys.next().toString() + val value = meta.getString(key) + key to value + } + } + + /** + * 记录实名认证结果 + * @param result 0 失败, 1 成功但未成年 2 成功且成年 3 认证中 + */ + fun logCertificationResult(isForced: Boolean, result: Int) { + val json = json { + "event" to "verification_finished" + "trigger" to if (isForced) "实名认证流程" else "" + "result" to result + "timestamp" to System.currentTimeMillis() / 1000 + parseAndPutMeta().invoke(this) + } + log(json, "event", false) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/gh/common/util/QuickLoginHelper.kt b/module_login/src/main/java/com/gh/gamecenter/login/utils/QuickLoginHelper.kt similarity index 81% rename from app/src/main/java/com/gh/common/util/QuickLoginHelper.kt rename to module_login/src/main/java/com/gh/gamecenter/login/utils/QuickLoginHelper.kt index e3f2fd43b3..7e13c925b2 100644 --- a/app/src/main/java/com/gh/common/util/QuickLoginHelper.kt +++ b/module_login/src/main/java/com/gh/gamecenter/login/utils/QuickLoginHelper.kt @@ -1,4 +1,4 @@ -package com.gh.common.util +package com.gh.gamecenter.login.utils import android.Manifest import android.annotation.SuppressLint @@ -11,30 +11,33 @@ import android.view.LayoutInflater import android.view.View import android.view.Window import android.view.WindowManager +import com.alibaba.android.arouter.launcher.ARouter import com.cmic.sso.sdk.AuthThemeConfig import com.cmic.sso.sdk.auth.AuthnHelper import com.cmic.sso.sdk.auth.LoginClickListener import com.cmic.sso.sdk.auth.TokenListener -import com.gh.common.constant.Config -import com.gh.gamecenter.LoginActivity -import com.gh.gamecenter.R import com.gh.gamecenter.common.callback.BiCallback -import com.gh.gamecenter.common.callback.CancelListener -import com.gh.gamecenter.common.callback.ConfirmListener import com.gh.gamecenter.common.constant.Constants +import com.gh.gamecenter.common.constant.RouteConsts import com.gh.gamecenter.common.databinding.SetWaitDialogBinding +import com.gh.gamecenter.common.retrofit.ApiResponse import com.gh.gamecenter.common.utils.* +import com.gh.gamecenter.common.utils.DialogUtils.checkDialogContext import com.gh.gamecenter.common.utils.PermissionHelper.checkReadPhoneStatePermissionBeforeAction +import com.gh.gamecenter.core.provider.IConfigProvider +import com.gh.gamecenter.core.provider.ILogUtilsProvider import com.gh.gamecenter.core.runOnUiThread import com.gh.gamecenter.core.utils.ClickUtils import com.gh.gamecenter.core.utils.EmptyCallback import com.gh.gamecenter.core.utils.SPUtils import com.gh.gamecenter.core.utils.ToastUtils.toast -import com.gh.gamecenter.databinding.DialogQuickLoginBinding -import com.gh.gamecenter.entity.LoginTokenEntity -import com.gh.gamecenter.common.retrofit.ApiResponse -import com.gh.gamecenter.user.LoginTag -import com.gh.gamecenter.user.UserRepository +import com.gh.gamecenter.login.R +import com.gh.gamecenter.login.databinding.DialogQuickLoginBinding +import com.gh.gamecenter.login.databinding.DialogQuickLoginPermissionBinding +import com.gh.gamecenter.login.entity.LoginTokenEntity +import com.gh.gamecenter.login.user.LoginTag +import com.gh.gamecenter.login.user.UserRepository +import com.gh.gamecenter.login.view.LoginActivity import com.lightgame.utils.AppManager import com.lightgame.utils.Utils import org.json.JSONObject @@ -45,6 +48,8 @@ import org.json.JSONObject * 2.授权请求 * 3.获取token * 4.请求登录接口 + * + * 一键登录SDK对接文档:http://dev.10086.cn/docInside?contentId=10000067541479 */ object QuickLoginHelper { @@ -73,9 +78,11 @@ object QuickLoginHelper { AuthnHelper.setDebugMode(true) } + + val config = ARouter.getInstance().build(RouteConsts.provider.config).navigation() as? IConfigProvider AuthnHelper.getInstance(context.applicationContext).getPhoneInfo( - Config.QUICK_LOGIN_APPID, - Config.QUICK_LOGIN_APPKEY, + config?.getQuickLoginAppId(), + config?.getQuickLoginAppKey(), { requestCode: Int, jsonObject: JSONObject -> val code = jsonObject.optString("resultCode") // “103000”为成功 @@ -113,29 +120,50 @@ object QuickLoginHelper { if (context.checkCallingOrSelfPermission(Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED) { loginAuth(context) } else { - DialogUtils.showQuickLoginPermissionDialog( - context, object : ConfirmListener { - override fun onConfirm() { - checkReadPhoneStatePermissionBeforeAction(context, object : EmptyCallback { - override fun onCallback() { - loginAuth(context) - } - }) - } - }, object : CancelListener { - override fun onCancel() { - startCodeLoginPage( - context, - entrance = ENTRANCE_PERMISSION_DIALOG, - isFinishAuth = false, - isFromPermission = true - ) - } + showQuickLoginPermissionDialog( + context, + { + checkReadPhoneStatePermissionBeforeAction(context, object : EmptyCallback { + override fun onCallback() { + loginAuth(context) + } + }) + }, + { + startCodeLoginPage( + context, + entrance = ENTRANCE_PERMISSION_DIALOG, + isFinishAuth = false, + isFromPermission = true + ) } ) } } + @JvmStatic + fun showQuickLoginPermissionDialog(context: Context, confirm: () -> Unit, cancel: () -> Unit) { + val solidContext = checkDialogContext(context) + + val dialog = Dialog(solidContext, R.style.DialogWindowTransparent) + val binding: DialogQuickLoginPermissionBinding = + DialogQuickLoginPermissionBinding.inflate(LayoutInflater.from(solidContext)) + + binding.confirmBtn.setOnClickListener { + dialog.dismiss() + confirm.invoke() + } + + binding.cancelBtn.setOnClickListener { + dialog.dismiss() + cancel.invoke() + } + + dialog.requestWindowFeature(Window.FEATURE_NO_TITLE) + dialog.setContentView(binding.root) + dialog.show() + } + private fun initSDK(context: Context, entrance: String) { mAuthnHelper = AuthnHelper.getInstance(context.applicationContext) mAuthnHelper?.run { @@ -153,7 +181,7 @@ object QuickLoginHelper { mOpenAuthPageSuccess = true } else { // 不成功就调起验证码登录页 toastCode(code) - startCodeLoginPage(context, true) +// startCodeLoginPage(context, true) } } } @@ -191,7 +219,8 @@ object QuickLoginHelper { } } // 2.授权请求 - mAuthnHelper?.loginAuth(Config.QUICK_LOGIN_APPID, Config.QUICK_LOGIN_APPKEY, mTokenListener, REQUEST_LOGIN_AUTH_CODE) + val config = ARouter.getInstance().build(RouteConsts.provider.config).navigation() as? IConfigProvider + mAuthnHelper?.loginAuth(config?.getQuickLoginAppId(), config?.getQuickLoginAppKey(), mTokenListener, REQUEST_LOGIN_AUTH_CODE) } private fun getConfig(context: Context, entrance: String): AuthThemeConfig { @@ -207,7 +236,7 @@ object QuickLoginHelper { .setNumberColor(R.color.text_title.toColor()) //手机号码字体颜色 .setNumFieldOffsetY(95) //号码栏Y偏移量 // 登录按钮 - .setLogBtnImgPath("login_btn_bg") //登录按钮背景 + .setLogBtnImgPath("download_button_normal_style") //登录按钮背景 .setLogBtnText("本机号码一键登录", Color.WHITE, 16, false) //登录按钮相关 .setLogBtnOffsetY(170) //登录按钮Y偏移量 .setLogBtn(1000, 44) //登录按钮相关宽高 @@ -216,7 +245,8 @@ object QuickLoginHelper { .setBackPressedListener {} //返回键回调 .setLogBtnClickListener(object : LoginClickListener { override fun onLoginClickStart(context: Context, jsonObj: JSONObject?) { - LogUtils.login("logging", "一键登录", entrance) + val logUtils = ARouter.getInstance().build(RouteConsts.provider.logUtils).navigation() as? ILogUtilsProvider + logUtils?.login("logging", "一键登录", entrance) mDialog = Dialog(context, R.style.DialogWindowTransparent).apply { val binding = SetWaitDialogBinding.inflate(LayoutInflater.from(context)).apply { setWaitMessage.text = R.string.logging.toResString() @@ -245,7 +275,8 @@ object QuickLoginHelper { SPUtils.setBoolean(Constants.SP_HAS_GET_PHONE_INFO, false) - LogUtils.login("success", "一键登录", entrance) + val logUtils = ARouter.getInstance().build(RouteConsts.provider.logUtils).navigation() as? ILogUtilsProvider + logUtils?.login("success", "一键登录", entrance) finishAuthActivity() } diff --git a/app/src/main/java/com/gh/gamecenter/LoginActivity.java b/module_login/src/main/java/com/gh/gamecenter/login/view/LoginActivity.java similarity index 93% rename from app/src/main/java/com/gh/gamecenter/LoginActivity.java rename to module_login/src/main/java/com/gh/gamecenter/login/view/LoginActivity.java index a653b68c31..7d9b17e44b 100644 --- a/app/src/main/java/com/gh/gamecenter/LoginActivity.java +++ b/module_login/src/main/java/com/gh/gamecenter/login/view/LoginActivity.java @@ -1,4 +1,4 @@ -package com.gh.gamecenter; +package com.gh.gamecenter.login.view; import android.content.Context; import android.content.Intent; @@ -8,12 +8,12 @@ import androidx.annotation.NonNull; import com.alibaba.android.arouter.facade.annotation.Route; import com.gh.gamecenter.common.base.activity.ToolBarActivity; -import com.gh.common.util.QuickLoginHelper; import com.gh.gamecenter.common.constant.EntranceConsts; import com.gh.gamecenter.common.constant.RouteConsts; import com.gh.gamecenter.common.utils.ExtensionsKt; import com.gh.gamecenter.core.utils.DisplayUtils; -import com.gh.gamecenter.fragment.LoginFragment; +import com.gh.gamecenter.login.R; +import com.gh.gamecenter.login.utils.QuickLoginHelper; /** * Created by khy on 14/08/17. diff --git a/app/src/main/java/com/gh/gamecenter/fragment/LoginFragment.java b/module_login/src/main/java/com/gh/gamecenter/login/view/LoginFragment.java similarity index 86% rename from app/src/main/java/com/gh/gamecenter/fragment/LoginFragment.java rename to module_login/src/main/java/com/gh/gamecenter/login/view/LoginFragment.java index b82a1adc79..41097fdce6 100644 --- a/app/src/main/java/com/gh/gamecenter/fragment/LoginFragment.java +++ b/module_login/src/main/java/com/gh/gamecenter/login/view/LoginFragment.java @@ -1,4 +1,4 @@ -package com.gh.gamecenter.fragment; +package com.gh.gamecenter.login.view; import android.Manifest; import android.app.Activity; @@ -29,36 +29,35 @@ import androidx.lifecycle.Lifecycle; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProviders; -import com.gh.common.util.CheckLoginUtils; -import com.gh.common.util.DialogUtils; -import com.gh.common.util.EnergyTaskHelper; -import com.gh.common.util.LogUtils; -import com.gh.common.util.LoginHelper; -import com.gh.common.util.LoginUtils; -import com.gh.common.util.QuickLoginHelper; -import com.gh.gamecenter.R; -import com.gh.gamecenter.WebActivity; +import com.alibaba.android.arouter.launcher.ARouter; +import com.gh.gamecenter.login.utils.LoginHelper; import com.gh.gamecenter.common.base.fragment.ToolbarFragment; import com.gh.gamecenter.common.base.fragment.WaitingDialogFragment; import com.gh.gamecenter.common.constant.Constants; import com.gh.gamecenter.common.constant.EntranceConsts; +import com.gh.gamecenter.common.constant.RouteConsts; +import com.gh.gamecenter.common.eventbus.EBReuse; +import com.gh.gamecenter.common.retrofit.ApiResponse; import com.gh.gamecenter.common.utils.ExtensionsKt; import com.gh.gamecenter.common.utils.PackageFlavorHelper; import com.gh.gamecenter.common.utils.PermissionHelper; +import com.gh.gamecenter.core.provider.IEnergyTaskProvider; +import com.gh.gamecenter.core.provider.ILogUtilsProvider; +import com.gh.gamecenter.core.provider.IWebProvider; import com.gh.gamecenter.core.utils.ClickUtils; import com.gh.gamecenter.core.utils.MtaHelper; import com.gh.gamecenter.core.utils.PatternUtils; import com.gh.gamecenter.core.utils.SPUtils; -import com.gh.gamecenter.databinding.FragmentLoginBinding; -import com.gh.gamecenter.entity.LoginTokenEntity; -import com.gh.gamecenter.entity.UserInfoEntity; -import com.gh.gamecenter.eventbus.EBReuse; -import com.gh.gamecenter.manager.UserManager; -import com.gh.gamecenter.security.BindPhoneActivity; -import com.gh.gamecenter.common.retrofit.ApiResponse; -import com.gh.gamecenter.user.LoginTag; -import com.gh.gamecenter.user.UserViewModel; -import com.halo.assistant.HaloApp; +import com.gh.gamecenter.login.HaloApp; +import com.gh.gamecenter.login.R; +import com.gh.gamecenter.login.databinding.FragmentLoginBinding; +import com.gh.gamecenter.login.entity.LoginTokenEntity; +import com.gh.gamecenter.login.entity.UserInfoEntity; +import com.gh.gamecenter.login.user.LoginTag; +import com.gh.gamecenter.login.user.UserManager; +import com.gh.gamecenter.login.user.UserViewModel; +import com.gh.gamecenter.login.utils.LoginUtils; +import com.gh.gamecenter.login.utils.QuickLoginHelper; import com.lightgame.utils.AppManager; import org.greenrobot.eventbus.EventBus; @@ -142,7 +141,7 @@ public class LoginFragment mStatus = QuickLoginHelper.STATUS_DEFAULT; } - final UserViewModel.Factory factory = new UserViewModel.Factory(HaloApp.getInstance().getApplication()); + final UserViewModel.Factory factory = new UserViewModel.Factory(HaloApp.getInstance()); mUserViewModel = ViewModelProviders.of(this, factory).get(UserViewModel.class); mUserViewModel.getLoginObsUserinfo().observe(this, this); @@ -210,8 +209,11 @@ public class LoginFragment @Override public void onClick(@NonNull View widget) { MtaHelper.onEvent("我的光环_新", "登录页面", "隐私政策"); - Intent intent = WebActivity.getWebIntent(requireContext(), requireContext().getString(R.string.privacy_policy_title), requireContext().getString(R.string.privacy_policy_url)); - startActivity(intent); + IWebProvider webActivity = (IWebProvider) ARouter.getInstance().build(RouteConsts.provider.webActivity).navigation(); + Intent intent = webActivity.getWebIntent(requireContext(), requireContext().getString(R.string.privacy_policy_title), requireContext().getString(R.string.privacy_policy_url)); + if (intent != null) { + startActivity(intent); + } } }, privacyContent.length() - 6, privacyContent.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); @@ -227,7 +229,11 @@ public class LoginFragment @Override public void onClick(@NonNull View widget) { MtaHelper.onEvent("我的光环_新", "登录页面", "用户协议"); - startActivity(WebActivity.getWebIntent(requireContext(), requireContext().getString(R.string.disclaimer_title), requireContext().getString(R.string.disclaimer_url))); + IWebProvider webActivity = (IWebProvider) ARouter.getInstance().build(RouteConsts.provider.webActivity).navigation(); + Intent intent = webActivity.getWebIntent(requireContext(), requireContext().getString(R.string.disclaimer_title), requireContext().getString(R.string.disclaimer_url)); + if (intent != null) { + startActivity(intent); + } } }, privacyContent.length() - 13, privacyContent.length() - 7, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); @@ -247,6 +253,7 @@ public class LoginFragment } else if (id == R.id.checkIv || id == R.id.checkClickView1 || id == R.id.checkClickView2) { updatePolicyCheckedStatus(); } else if (id == R.id.login_captcha) { + QuickLoginHelper.showQuickLoginPermissionDialog(requireContext(), () -> null, () -> null); MtaHelper.onEvent("我的光环_新", "登录页面", "获取验证码"); final String phoneNum = mBinding.loginPhoneEt.getText().toString().trim().replaceAll(" ", ""); if (PatternUtils.isPhoneNum(phoneNum) && phoneNum.length() == 11) { @@ -285,11 +292,13 @@ public class LoginFragment if (requireContext().checkCallingOrSelfPermission(Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED) { startQuickLogin(); } else { - DialogUtils.showQuickLoginPermissionDialog( + QuickLoginHelper.showQuickLoginPermissionDialog( requireContext(), - () -> PermissionHelper.checkReadPhoneStatePermissionBeforeAction(requireContext(), this::startQuickLogin), () -> { - } + PermissionHelper.checkReadPhoneStatePermissionBeforeAction(requireContext(), this::startQuickLogin); + return null; + }, + () -> null ); } } @@ -388,18 +397,20 @@ public class LoginFragment String inviteCode = mBinding.loginInviteEt.getText().toString().trim().replaceAll(" ", ""); if (!TextUtils.isEmpty(inviteCode)) { SPUtils.setBoolean(Constants.SP_HAS_COMPLETE_INVITE_CODE, true); - EnergyTaskHelper.postInviteCodeTask(inviteCode, "mobile_login", null); + IEnergyTaskProvider energyTaskHelper = (IEnergyTaskProvider) ARouter.getInstance().build(RouteConsts.provider.energyTask).navigation(); + energyTaskHelper.postInviteCodeTask(inviteCode, "mobile_login", null); } String loginType = loginTokenEntity.getLoginType(); + ILogUtilsProvider logUtils = (ILogUtilsProvider) ARouter.getInstance().build(RouteConsts.provider.logUtils).navigation(); if (LoginTag.qq.name().equals(loginType) || LoginTag.wechat.name().equals(loginType) || LoginTag.weibo.name().equals(loginType) || LoginTag.douyin.name().equals(loginType) || LoginTag.oauth.name().equals(loginType)) { - LogUtils.login("success", loginType, mEntrance); + logUtils.login("success", loginType, mEntrance); } else { - LogUtils.login("success", "mobile", mEntrance); + logUtils.login("success", "mobile", mEntrance); } // 第三方登录方式登录后跳转绑定手机页面(https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1206) @@ -409,7 +420,10 @@ public class LoginFragment || LoginTag.douyin.name().equals(loginType); if (isThirdPartyLogin && TextUtils.isEmpty(response.getData().getLoginMobile())) { - startActivity(BindPhoneActivity.getLoginSuccessIntent(requireContext())); + ARouter.getInstance().build(RouteConsts.activity.bindPhoneActivity) + .withBoolean(EntranceConsts.KEY_FROM_LOGIN, true) + .withBoolean(EntranceConsts.KEY_CHANGE_PHONE, false) + .navigation(); } } // 防止UserManager数据丢失后重复登录 @@ -425,7 +439,7 @@ public class LoginFragment EntranceUtils.ENTRANCE_BROWSER, "")); }*/ - if (getActivity() != null && CheckLoginUtils.isLogin()) { + if (getActivity() != null && UserManager.getInstance().isLoggedIn()) { getActivity().finish(); // 如果是从一键登录页跳转过来的,登录成功后也要finish一键登录页 if (mStatus == QuickLoginHelper.STATUS_FROM_QUICK_LOGIN_PAGE) { @@ -451,10 +465,11 @@ public class LoginFragment } private void login(JSONObject content, LoginTag loginTag) { + ILogUtilsProvider logUtils = (ILogUtilsProvider) ARouter.getInstance().build(RouteConsts.provider.logUtils).navigation(); if (loginTag.equals(LoginTag.phone)) { - LogUtils.login("logging", "mobile", mEntrance); + logUtils.login("logging", "mobile", mEntrance); } else { - LogUtils.login("logging", loginTag.name(), mEntrance); + logUtils.login("logging", loginTag.name(), mEntrance); } if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) { mLoginDialog = WaitingDialogFragment.newInstance(getString(R.string.logging)); diff --git a/app/src/main/java/com/gh/gamecenter/wxapi/WXEntryActivity.java b/module_login/src/main/java/com/gh/gamecenter/wxapi/WXEntryActivity.java similarity index 86% rename from app/src/main/java/com/gh/gamecenter/wxapi/WXEntryActivity.java rename to module_login/src/main/java/com/gh/gamecenter/wxapi/WXEntryActivity.java index 3812e36d51..703dc01c1c 100644 --- a/app/src/main/java/com/gh/gamecenter/wxapi/WXEntryActivity.java +++ b/module_login/src/main/java/com/gh/gamecenter/wxapi/WXEntryActivity.java @@ -6,13 +6,15 @@ import android.os.Bundle; import android.text.TextUtils; import android.widget.TextView; -import com.gh.common.DefaultUrlHandler; -import com.gh.common.constant.Config; -import com.gh.common.util.EnergyTaskHelper; -import com.gh.common.util.LoginHelper; -import com.gh.gamecenter.R; +import com.alibaba.android.arouter.launcher.ARouter; +import com.gh.gamecenter.login.utils.LoginHelper; +import com.gh.gamecenter.common.constant.RouteConsts; import com.gh.gamecenter.common.eventbus.EBShare; import com.gh.gamecenter.common.utils.ShareUtils; +import com.gh.gamecenter.core.provider.IConfigProvider; +import com.gh.gamecenter.core.provider.IDefaultUrlHandlerProvider; +import com.gh.gamecenter.core.provider.IEnergyTaskProvider; +import com.gh.gamecenter.login.R; import com.lightgame.utils.Utils; import com.tencent.mm.opensdk.modelbase.BaseReq; import com.tencent.mm.opensdk.modelbase.BaseResp; @@ -39,7 +41,8 @@ public class WXEntryActivity extends Activity implements IWXAPIEventHandler, WeC @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - mWxApi = WXAPIFactory.createWXAPI(this, Config.WECHAT_APPID, false); + IConfigProvider config = (IConfigProvider) ARouter.getInstance().build(RouteConsts.provider.config).navigation(); + mWxApi = WXAPIFactory.createWXAPI(this, config.getWechatAppId(), false); mWxApi.handleIntent(getIntent(), this); TextView textView = new TextView(this); textView.setSingleLine(true); @@ -57,7 +60,8 @@ public class WXEntryActivity extends Activity implements IWXAPIEventHandler, WeC if (baseReq instanceof ShowMessageFromWX.Req) { String messageExt = ((ShowMessageFromWX.Req) baseReq).message.messageExt; if (!TextUtils.isEmpty(messageExt)) { - DefaultUrlHandler.interceptUrl(this, messageExt, "浏览器", true); + IDefaultUrlHandlerProvider defaultUrlHandler = (IDefaultUrlHandlerProvider) ARouter.getInstance().build(RouteConsts.provider.defaultUrlHandler).navigation(); + defaultUrlHandler.interceptUrl(this, messageExt, "浏览器", true); finishActivity(); } } @@ -74,7 +78,8 @@ public class WXEntryActivity extends Activity implements IWXAPIEventHandler, WeC EventBus.getDefault().post(new EBShare(ShareUtils.shareEntrance)); com.gh.gamecenter.common.utils.LogUtils.uploadShareResult(ShareUtils.shareType, ShareUtils.shareEntrance.getName(), "success", ShareUtils.shareEntity.getShareUrl(), ShareUtils.shareEntity.getShareTitle(), ShareUtils.shareEntity.getSummary(), ShareUtils.resourceId); - EnergyTaskHelper.postEnergyTaskForShare(ShareUtils.shareEntrance.getName(), ShareUtils.resourceId, ShareUtils.shareEntity.getShareUrl()); + IEnergyTaskProvider energyTaskProvider = (IEnergyTaskProvider) ARouter.getInstance().build(RouteConsts.provider.energyTask).navigation(); + energyTaskProvider.postEnergyTaskForShare(ShareUtils.shareEntrance.getName(), ShareUtils.resourceId, ShareUtils.shareEntity.getShareUrl()); if (ShareUtils.shareEntrance == ShareUtils.ShareEntrance.askNormal || ShareUtils.shareEntrance == ShareUtils.ShareEntrance.communityArticle || ShareUtils.shareEntrance == ShareUtils.ShareEntrance.video) { diff --git a/app/src/main/java/com/gh/gamecenter/wxapi/WeChatUserInfoThread.java b/module_login/src/main/java/com/gh/gamecenter/wxapi/WeChatUserInfoThread.java similarity index 90% rename from app/src/main/java/com/gh/gamecenter/wxapi/WeChatUserInfoThread.java rename to module_login/src/main/java/com/gh/gamecenter/wxapi/WeChatUserInfoThread.java index 5ab0b73572..f20d800567 100644 --- a/app/src/main/java/com/gh/gamecenter/wxapi/WeChatUserInfoThread.java +++ b/module_login/src/main/java/com/gh/gamecenter/wxapi/WeChatUserInfoThread.java @@ -3,7 +3,9 @@ package com.gh.gamecenter.wxapi; import android.content.Context; import android.text.TextUtils; -import com.gh.common.constant.Config; +import com.alibaba.android.arouter.launcher.ARouter; +import com.gh.gamecenter.common.constant.RouteConsts; +import com.gh.gamecenter.core.provider.IConfigProvider; import com.lightgame.utils.Utils; import org.json.JSONObject; @@ -38,9 +40,10 @@ public class WeChatUserInfoThread extends Thread { public void run() { super.run(); try { + IConfigProvider config = (IConfigProvider) ARouter.getInstance().build(RouteConsts.provider.config).navigation(); String tokenUrl = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" + - Config.WECHAT_APPID + "&secret=" + - Config.WECHAT_SECRET + "&code=" + + config.getWechatAppId() + "&secret=" + + config.getWechatSecret() + "&code=" + mCode + "&grant_type=authorization_code"; String jsonResult = getJsonResultByUrlPath(tokenUrl); JSONObject jsonObject = new JSONObject(jsonResult); diff --git a/app/src/main/res/anim/anim_auth_in.xml b/module_login/src/main/res/anim/anim_auth_in.xml similarity index 100% rename from app/src/main/res/anim/anim_auth_in.xml rename to module_login/src/main/res/anim/anim_auth_in.xml diff --git a/app/src/main/res/anim/anim_auth_out.xml b/module_login/src/main/res/anim/anim_auth_out.xml similarity index 100% rename from app/src/main/res/anim/anim_auth_out.xml rename to module_login/src/main/res/anim/anim_auth_out.xml diff --git a/app/src/main/res/anim/cycle_interpolator.xml b/module_login/src/main/res/anim/cycle_interpolator.xml similarity index 100% rename from app/src/main/res/anim/cycle_interpolator.xml rename to module_login/src/main/res/anim/cycle_interpolator.xml diff --git a/app/src/main/res/anim/login_policy_shake.xml b/module_login/src/main/res/anim/login_policy_shake.xml similarity index 100% rename from app/src/main/res/anim/login_policy_shake.xml rename to module_login/src/main/res/anim/login_policy_shake.xml diff --git a/app/src/main/res/drawable-xxhdpi/bg_quick_login_permission_dialog.webp b/module_login/src/main/res/drawable-xxhdpi/bg_quick_login_permission_dialog.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/bg_quick_login_permission_dialog.webp rename to module_login/src/main/res/drawable-xxhdpi/bg_quick_login_permission_dialog.webp diff --git a/app/src/main/res/drawable-xxhdpi/ic_login_close.webp b/module_login/src/main/res/drawable-xxhdpi/ic_login_close.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_login_close.webp rename to module_login/src/main/res/drawable-xxhdpi/ic_login_close.webp diff --git a/app/src/main/res/drawable-xxhdpi/ic_login_qq.webp b/module_login/src/main/res/drawable-xxhdpi/ic_login_qq.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_login_qq.webp rename to module_login/src/main/res/drawable-xxhdpi/ic_login_qq.webp diff --git a/app/src/main/res/drawable-xxhdpi/ic_login_wechat.webp b/module_login/src/main/res/drawable-xxhdpi/ic_login_wechat.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_login_wechat.webp rename to module_login/src/main/res/drawable-xxhdpi/ic_login_wechat.webp diff --git a/app/src/main/res/drawable-xxhdpi/ic_login_weibo.webp b/module_login/src/main/res/drawable-xxhdpi/ic_login_weibo.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_login_weibo.webp rename to module_login/src/main/res/drawable-xxhdpi/ic_login_weibo.webp diff --git a/app/src/main/res/drawable-xxhdpi/ic_quick_login_check.webp b/module_login/src/main/res/drawable-xxhdpi/ic_quick_login_check.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_quick_login_check.webp rename to module_login/src/main/res/drawable-xxhdpi/ic_quick_login_check.webp diff --git a/app/src/main/res/drawable-xxhdpi/ic_quick_login_close.webp b/module_login/src/main/res/drawable-xxhdpi/ic_quick_login_close.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_quick_login_close.webp rename to module_login/src/main/res/drawable-xxhdpi/ic_quick_login_close.webp diff --git a/app/src/main/res/drawable-xxhdpi/ic_quick_login_dialog_phone.webp b/module_login/src/main/res/drawable-xxhdpi/ic_quick_login_dialog_phone.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_quick_login_dialog_phone.webp rename to module_login/src/main/res/drawable-xxhdpi/ic_quick_login_dialog_phone.webp diff --git a/app/src/main/res/drawable-xxhdpi/ic_quick_login_uncheck.webp b/module_login/src/main/res/drawable-xxhdpi/ic_quick_login_uncheck.webp similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_quick_login_uncheck.webp rename to module_login/src/main/res/drawable-xxhdpi/ic_quick_login_uncheck.webp diff --git a/app/src/main/res/drawable-xxxhdpi/bg_quick_login_dialog.webp b/module_login/src/main/res/drawable-xxxhdpi/bg_quick_login_dialog.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/bg_quick_login_dialog.webp rename to module_login/src/main/res/drawable-xxxhdpi/bg_quick_login_dialog.webp diff --git a/app/src/main/res/drawable-xxxhdpi/bg_quick_login_permission_dialog.webp b/module_login/src/main/res/drawable-xxxhdpi/bg_quick_login_permission_dialog.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/bg_quick_login_permission_dialog.webp rename to module_login/src/main/res/drawable-xxxhdpi/bg_quick_login_permission_dialog.webp diff --git a/app/src/main/res/drawable-xxxhdpi/ic_quick_login_dialog_phone.webp b/module_login/src/main/res/drawable-xxxhdpi/ic_quick_login_dialog_phone.webp similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/ic_quick_login_dialog_phone.webp rename to module_login/src/main/res/drawable-xxxhdpi/ic_quick_login_dialog_phone.webp diff --git a/app/src/main/res/drawable/bg_invite_dialog.xml b/module_login/src/main/res/drawable/bg_invite_dialog.xml similarity index 100% rename from app/src/main/res/drawable/bg_invite_dialog.xml rename to module_login/src/main/res/drawable/bg_invite_dialog.xml diff --git a/app/src/main/res/drawable/bg_login_edit.xml b/module_login/src/main/res/drawable/bg_login_edit.xml similarity index 100% rename from app/src/main/res/drawable/bg_login_edit.xml rename to module_login/src/main/res/drawable/bg_login_edit.xml diff --git a/app/src/main/res/drawable/bg_shape_fa_radius_8.xml b/module_login/src/main/res/drawable/bg_shape_fa_radius_8.xml similarity index 100% rename from app/src/main/res/drawable/bg_shape_fa_radius_8.xml rename to module_login/src/main/res/drawable/bg_shape_fa_radius_8.xml diff --git a/app/src/main/res/drawable/selector_ic_login_checkbox.xml b/module_login/src/main/res/drawable/selector_ic_login_checkbox.xml similarity index 100% rename from app/src/main/res/drawable/selector_ic_login_checkbox.xml rename to module_login/src/main/res/drawable/selector_ic_login_checkbox.xml diff --git a/app/src/main/res/layout/dialog_quick_login.xml b/module_login/src/main/res/layout/dialog_quick_login.xml similarity index 100% rename from app/src/main/res/layout/dialog_quick_login.xml rename to module_login/src/main/res/layout/dialog_quick_login.xml diff --git a/app/src/main/res/layout/dialog_quick_login_permission.xml b/module_login/src/main/res/layout/dialog_quick_login_permission.xml similarity index 100% rename from app/src/main/res/layout/dialog_quick_login_permission.xml rename to module_login/src/main/res/layout/dialog_quick_login_permission.xml diff --git a/app/src/main/res/layout/fragment_login.xml b/module_login/src/main/res/layout/fragment_login.xml similarity index 99% rename from app/src/main/res/layout/fragment_login.xml rename to module_login/src/main/res/layout/fragment_login.xml index 61e84029cf..abcb244515 100644 --- a/app/src/main/res/layout/fragment_login.xml +++ b/module_login/src/main/res/layout/fragment_login.xml @@ -83,12 +83,12 @@ android:layout_width="wrap_content" android:layout_height="25dp" android:layout_alignParentRight="true" - android:layout_marginRight="16dp" android:layout_centerVertical="true" + android:layout_marginRight="16dp" android:gravity="center" android:text="@string/login_get_captcha" android:textColor="@color/text_subtitleDesc" - android:textSize="14sp"/> + android:textSize="14sp" /> + + + module_login + 光环助手 + 登录异常,请稍后重试 + 登录异常(%1$d),请稍后重试 + 登录成功 + 登录中... + 输入手机号码 + 输入验证码 + 获取验证码 + 输入邀请码(选填) + +86 + 登录 + 一键登录 > + QQ + 微信 + 新浪微博 + 第三方账号快捷登录 + + 权限申请 + 完成一键登录,需向你申请授权以下权限: + 电话权限 + 识别具体运营商,方便对应运营商完成一键\n登录服务 + 马上授权 + 暂不授权,验证码登录 + + \ No newline at end of file diff --git a/module_login/src/main/res/values/styles.xml b/module_login/src/main/res/values/styles.xml new file mode 100644 index 0000000000..94e2612f84 --- /dev/null +++ b/module_login/src/main/res/values/styles.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/xml/network_security_config.xml b/module_login/src/main/res/xml/network_security_config.xml similarity index 100% rename from app/src/main/res/xml/network_security_config.xml rename to module_login/src/main/res/xml/network_security_config.xml diff --git a/module_login/src/test/java/com/gh/gamecenter/login/ExampleUnitTest.kt b/module_login/src/test/java/com/gh/gamecenter/login/ExampleUnitTest.kt new file mode 100644 index 0000000000..2d61d82c3d --- /dev/null +++ b/module_login/src/test/java/com/gh/gamecenter/login/ExampleUnitTest.kt @@ -0,0 +1,17 @@ +package com.gh.gamecenter.login + +import org.junit.Test + +import org.junit.Assert.* + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index e8f501e9cb..23a54a0400 100644 --- a/settings.gradle +++ b/settings.gradle @@ -7,3 +7,5 @@ include ':vspace-bridge:vspace' //evaluate(new File(settingsDir, "assistant_flutter/.android/include_flutter.groovy")) include ':module_core' include ':module_common' +include ':module_login' +include ':module_energy'