refactor:使用 Jetpack Compose 实现设置功能模块的 UI https://git.shanqu.cc/halo/android/assistant-android/-/issues/88

This commit is contained in:
叶子维
2022-11-04 11:36:25 +08:00
parent 26d6e4086a
commit 431aa52e49
95 changed files with 8348 additions and 82 deletions

View File

@ -93,8 +93,8 @@ 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.setting.view.security.BindPhoneActivity;
import com.gh.gamecenter.setting.view.GameDownloadSettingFragment;
import com.gh.gamecenter.setting.compose.activity.ComposeBindPhoneActivity;
import com.gh.gamecenter.setting.compose.activity.ComposeGameDownloadSettingActivity;
import com.gh.gamecenter.suggest.SuggestType;
import com.lightgame.adapter.BaseRecyclerAdapter;
import com.lightgame.download.DownloadEntity;
@ -216,7 +216,7 @@ public class DialogUtils {
} else if (NetworkUtils.isWifiConnected(context)
|| filter4GorSize(context, size)) {
callBack.onResponse(false);
} else if (!SPUtils.getBoolean(GameDownloadSettingFragment.getTrafficDownloadHintKey(), true)) {
} else if (!SPUtils.getBoolean(ComposeGameDownloadSettingActivity.getTrafficDownloadHintKey(), true)) {
AppExecutor.getUiExecutor().executeWithDelay(() -> Utils.toast(context, "当前使用移动网络下载,请注意流量消耗"), 500);
callBack.onResponse(false);
} else {
@ -288,7 +288,7 @@ public class DialogUtils {
// MtaHelper.onEvent("移动网络下载", NetworkUtils.getMobileNetworkType(finalContext), "连上WiFi后自动下载");
});
allowAlways.setOnClickListener(v -> {
SPUtils.setBoolean(GameDownloadSettingFragment.getTrafficDownloadHintKey(), false);
SPUtils.setBoolean(ComposeGameDownloadSettingActivity.getTrafficDownloadHintKey(), false);
AppExecutor.getUiExecutor().executeWithDelay(() -> {
// 显示了弹窗以后,即便下面这个 toast 放在 listener.onConfirm 后调用也是显示 listener.onConfirm 里的 toast
// 喷了,延时包治疑难杂症
@ -2080,7 +2080,7 @@ public class DialogUtils {
binding.bindPhoneBtn.setOnClickListener(v -> {
dialog.dismiss();
Intent intent = BindPhoneActivity.getNormalIntent(finalContext, false);
Intent intent = ComposeBindPhoneActivity.getNormalIntent(finalContext, false);
finalContext.startActivity(intent);
});