修复盾牌参数问题
This commit is contained in:
		| @@ -1,8 +1,8 @@ | ||||
| #Created by .winboll/winboll_app_build.gradle | ||||
| #Sun May 04 21:09:14 HKT 2025 | ||||
| #Sun May 04 19:53:51 GMT 2025 | ||||
| stageCount=1 | ||||
| libraryProject= | ||||
| baseVersion=15.3 | ||||
| publishVersion=15.3.0 | ||||
| buildCount=0 | ||||
| buildCount=22 | ||||
| baseBetaVersion=15.3.1 | ||||
|   | ||||
| @@ -10,6 +10,7 @@ import android.content.Context; | ||||
| import android.os.Bundle; | ||||
| import android.view.ViewGroup; | ||||
| import android.widget.LinearLayout; | ||||
| import androidx.appcompat.app.AppCompatActivity; | ||||
| import androidx.appcompat.widget.Toolbar; | ||||
| import cc.winboll.studio.contacts.R; | ||||
| import cc.winboll.studio.libaes.winboll.APPInfo; | ||||
| @@ -17,7 +18,7 @@ import cc.winboll.studio.libaes.winboll.AboutView; | ||||
| import cc.winboll.studio.libappbase.GlobalApplication; | ||||
| import cc.winboll.studio.libappbase.winboll.IWinBoLLActivity; | ||||
|  | ||||
| public class AboutActivity extends WinBoLLActivity implements IWinBoLLActivity { | ||||
| public class AboutActivity extends AppCompatActivity implements IWinBoLLActivity { | ||||
|  | ||||
|     public static final String TAG = "AboutActivity"; | ||||
|  | ||||
|   | ||||
| @@ -202,6 +202,11 @@ public class SettingsActivity extends AppCompatActivity implements IWinBoLLActiv | ||||
|         settingsModel.setIsEnableDun(isEnableDun); | ||||
|         Rules.getInstance(this).saveDun(); | ||||
|         Rules.getInstance(this).reload(); | ||||
|          | ||||
|         // 重新加载盾牌参数 | ||||
|         etDunTotalCount.setText(Integer.toString(settingsModel.getDunTotalCount())); | ||||
|         etDunResumeSecondCount.setText(Integer.toString(settingsModel.getDunResumeSecondCount())); | ||||
|         etDunResumeCount.setText(Integer.toString(settingsModel.getDunResumeCount())); | ||||
|     } | ||||
|  | ||||
|     void updateStreamVolumeTextView() { | ||||
|   | ||||
| @@ -1,60 +0,0 @@ | ||||
| package cc.winboll.studio.contacts.activities; | ||||
|  | ||||
| /** | ||||
|  * @Author ZhanGSKen@AliYun.Com | ||||
|  * @Date 2025/03/31 15:16:45 | ||||
|  * @Describe 应用窗口基类 | ||||
|  */ | ||||
| import android.app.Activity; | ||||
| import android.os.Bundle; | ||||
| import android.view.MenuItem; | ||||
| import androidx.appcompat.app.AppCompatActivity; | ||||
| import cc.winboll.studio.libaes.beans.AESThemeBean; | ||||
| import cc.winboll.studio.libaes.utils.AESThemeUtil; | ||||
| import cc.winboll.studio.libappbase.winboll.IWinBoLLActivity; | ||||
|  | ||||
| public class WinBoLLActivity extends AppCompatActivity implements IWinBoLLActivity { | ||||
|  | ||||
|     public static final String TAG = "WinBoLLActivity"; | ||||
|  | ||||
|     protected volatile AESThemeBean.ThemeType mThemeType; | ||||
|  | ||||
|     @Override | ||||
|     public Activity getActivity() { | ||||
|         return this; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public String getTag() { | ||||
|         return TAG; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     protected void onCreate(Bundle savedInstanceState) { | ||||
|         mThemeType = getThemeType(); | ||||
|         setThemeStyle(); | ||||
|         super.onCreate(savedInstanceState); | ||||
|     } | ||||
|  | ||||
|     AESThemeBean.ThemeType getThemeType() { | ||||
|         /*SharedPreferences sharedPreferences = getSharedPreferences( | ||||
|          SHAREDPREFERENCES_NAME, MODE_PRIVATE); | ||||
|          return AESThemeBean.ThemeType.values()[((sharedPreferences.getInt(DRAWER_THEME_TYPE, AESThemeBean.ThemeType.DEFAULT.ordinal())))]; | ||||
|          */ | ||||
|         return AESThemeBean.getThemeStyleType(AESThemeUtil.getThemeTypeID(getApplicationContext())); | ||||
|     } | ||||
|  | ||||
|     void setThemeStyle() { | ||||
|         //setTheme(AESThemeBean.getThemeStyle(getThemeType())); | ||||
|         setTheme(AESThemeUtil.getThemeTypeID(getApplicationContext())); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public boolean onOptionsItemSelected(MenuItem item) { | ||||
|         if(item.getItemId() == android.R.id.home) { | ||||
|             finish(); | ||||
|             return true; | ||||
|         } | ||||
|         return super.onOptionsItemSelected(item); | ||||
|     } | ||||
| } | ||||
| @@ -84,7 +84,7 @@ public class Rules { | ||||
|         LogUtils.d(TAG, String.format("saveRules()")); | ||||
|         PhoneConnectRuleModel.saveBeanList(mContext, _PhoneConnectRuleModelList, PhoneConnectRuleModel.class); | ||||
|     } | ||||
|      | ||||
|  | ||||
|     public void resetDefaultBoBullToonURL() { | ||||
|         mSettingsModel.setBoBullToon_URL(TomCat.getInstance(mContext).getDefaultBobulltoonUrl()); | ||||
|         saveDun(); | ||||
| @@ -124,8 +124,12 @@ public class Rules { | ||||
|         boolean isDefend = false; // 盾牌是否生效 | ||||
|         boolean isConnect = true; // 防御结果是否连接 | ||||
|  | ||||
|         // 进行盾牌层数预计缩减计算 | ||||
|         int nDunCurrentCount = mSettingsModel.getDunCurrentCount() - 1; | ||||
|         LogUtils.d(TAG, String.format("nDunCurrentCount : %d", nDunCurrentCount)); | ||||
|  | ||||
|         // 如果盾值小于1,则解除防御 | ||||
|         if (!isDefend && mSettingsModel.getDunCurrentCount() < 1) { | ||||
|         if (!isDefend && nDunCurrentCount < 1) { | ||||
|             // 盾层为1以下,防御解除 | ||||
|             LogUtils.d(TAG, "盾层为1以下,防御解除"); | ||||
|             isDefend = true; | ||||
| @@ -189,17 +193,17 @@ public class Rules { | ||||
|             // 就减少防御盾牌层数。 | ||||
|             // 每校验一次规则,云盾防御层数减1 | ||||
|             // 当云盾防御层数为0时,再次进行以下程序段则恢复满值防御。 | ||||
|             int newDunCount = mSettingsModel.getDunCurrentCount() - 1; | ||||
|             int newDunCount = nDunCurrentCount; | ||||
|             LogUtils.d(TAG, String.format("新的防御层数预计为 %d", newDunCount)); | ||||
|  | ||||
|             // 保证盾值在[0,DunTotalCount]之内其他值一律重置为 DunTotalCount。 | ||||
|             if (newDunCount < 0 || newDunCount > mSettingsModel.getDunTotalCount()) { | ||||
|                 mSettingsModel.setDunCurrentCount(mSettingsModel.getDunTotalCount()); | ||||
|                 LogUtils.d(TAG, String.format("盾值不在[0,%d]区间,恢复防御最大值%d", mSettingsModel.getDunTotalCount(), mSettingsModel.getDunTotalCount())); | ||||
|             } else { | ||||
|             // 保证盾值在[1,DunTotalCount]之内其他值一律重置为 DunTotalCount。 | ||||
|             if (newDunCount > 0 && newDunCount < mSettingsModel.getDunTotalCount()) { | ||||
|                 mSettingsModel.setDunCurrentCount(newDunCount); | ||||
|                 LogUtils.d(TAG, String.format("设置防御层数为 %d", newDunCount)); | ||||
|             } | ||||
|             } else { | ||||
|                 mSettingsModel.setDunCurrentCount(mSettingsModel.getDunTotalCount()); | ||||
|                 LogUtils.d(TAG, String.format("盾值不在[0,%d]区间,恢复防御最大值%d", mSettingsModel.getDunTotalCount(), mSettingsModel.getDunTotalCount())); | ||||
|             }  | ||||
|  | ||||
|             saveDun(); | ||||
|             SettingsActivity.notifyDunInfoUpdate(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 ZhanGSKen
					ZhanGSKen