模块/组件化前期改造(解耦ToolBarActivity) https://git.shanqu.cc/halo/android/assistant-android/-/issues/64

This commit is contained in:
张玉久
2022-05-20 17:00:50 +08:00
parent 6401711f7e
commit c05dfebf1b
183 changed files with 665 additions and 634 deletions

View File

@ -1,5 +1,6 @@
package com.gh.gamecenter;
import static com.gh.common.util.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;
@ -10,7 +11,6 @@ import static com.gh.gamecenter.common.constant.EntranceConsts.KEY_MARKET_DETAIL
import static com.gh.gamecenter.common.constant.EntranceConsts.KEY_NEXT_TO;
import static com.gh.gamecenter.common.constant.EntranceConsts.KEY_TO;
import static com.gh.gamecenter.common.constant.EntranceConsts.KEY_TYPE;
import static com.gh.common.util.LoginHelper.WEIBO_SCOPE;
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;
@ -40,10 +40,8 @@ import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProviders;
import com.gh.base.AppUncaughtHandler;
import com.gh.gamecenter.common.base.BaseActivity;
import com.gh.gamecenter.common.base.fragment.BaseFragment_ViewPager;
import com.gh.gamecenter.common.base.ToolBarActivity;
import com.gh.common.DefaultUrlHandler;
import com.gh.gamecenter.common.avoidcallback.AvoidOnResultManager;
import com.gh.common.constant.Config;
import com.gh.common.history.HistoryDatabase;
import com.gh.common.history.HistoryHelper;
@ -55,7 +53,6 @@ import com.gh.common.util.DataUtils;
import com.gh.common.util.DeviceTokenUtils;
import com.gh.common.util.DialogUtils;
import com.gh.common.util.DirectUtils;
import com.gh.gamecenter.common.constant.EntranceConsts;
import com.gh.common.util.EntranceUtils;
import com.gh.common.util.ErrorHelper;
import com.gh.common.util.HomePluggableHelper;
@ -66,14 +63,21 @@ 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.gamecenter.common.utils.ShareUtils;
import com.gh.common.util.WechatBindHelper;
import com.gh.download.DownloadManager;
import com.gh.gamecenter.common.avoidcallback.AvoidOnResultManager;
import com.gh.gamecenter.common.base.BaseActivity;
import com.gh.gamecenter.common.base.fragment.BaseFragment_ViewPager;
import com.gh.gamecenter.common.base.fragment.ToolbarFragment;
import com.gh.gamecenter.common.constant.Constants;
import com.gh.gamecenter.common.constant.EntranceConsts;
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.DialogHelper;
import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.common.utils.ShareUtils;
import com.gh.gamecenter.core.AppExecutor;
import com.gh.gamecenter.core.utils.ClassUtils;
import com.gh.gamecenter.core.utils.DisplayUtils;
@ -97,10 +101,7 @@ import com.gh.gamecenter.home.skip.PackageSkipActivity;
import com.gh.gamecenter.manager.DataCollectionManager;
import com.gh.gamecenter.manager.UpdateManager;
import com.gh.gamecenter.manager.UserManager;
import com.gh.gamecenter.common.base.fragment.NormalFragment;
import com.gh.gamecenter.packagehelper.PackageViewModel;
import com.gh.gamecenter.common.retrofit.BiResponse;
import com.gh.gamecenter.common.retrofit.Response;
import com.gh.gamecenter.retrofit.RetrofitManager;
import com.gh.gamecenter.room.AppDatabase;
import com.gh.gamecenter.room.dao.SimulatorGameDao;
@ -571,8 +572,8 @@ public class MainActivity extends BaseActivity {
bundle.putInt(BaseFragment_ViewPager.ARGS_INDEX, 1);
}
if (NormalFragment.class.isAssignableFrom(clazz)) {
NormalActivity.startFragment(MainActivity.this, (Class<? extends NormalFragment>) clazz, bundle);
if (ToolbarFragment.class.isAssignableFrom(clazz)) {
ToolBarActivity.startFragment(MainActivity.this, (Class<? extends ToolbarFragment>) clazz, bundle);
} else {
Intent skipIntent = new Intent(MainActivity.this, clazz);
skipIntent.putExtras(bundle);