1.6.5 beta更新

This commit is contained in:
2025-05-25 22:45:13 +08:00
parent e6254b5ea4
commit e72ace70ca
9 changed files with 56 additions and 10 deletions

2
.idea/compiler.xml generated
View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="CompilerConfiguration"> <component name="CompilerConfiguration">
<bytecodeTargetLevel target="21" /> <bytecodeTargetLevel target="17" />
</component> </component>
</project> </project>

3
.idea/misc.xml generated
View File

@@ -1,10 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" /> <component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="FrameworkDetectionExcludesConfiguration"> <component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" /> <file type="web" url="file://$PROJECT_DIR$" />
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">

View File

@@ -11,7 +11,7 @@ android {
minSdk 29 minSdk 29
targetSdk 34 targetSdk 34
versionCode 1 versionCode 1
versionName "1.6.4" versionName "1.6.5 beta"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }

View File

@@ -6,6 +6,7 @@ import android.app.PendingIntent;
import android.content.*; import android.content.*;
import android.content.pm.PackageInfo; import android.content.pm.PackageInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.net.Uri; import android.net.Uri;
import android.nfc.NdefMessage; import android.nfc.NdefMessage;
@@ -63,10 +64,27 @@ public class MainActivity extends AppCompatActivity implements ImagePickerListen
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
SharedPreferences preferences = getSharedPreferences("setting", MODE_PRIVATE); SharedPreferences preferences = getSharedPreferences("setting", MODE_PRIVATE);
String selectedTheme = preferences.getString("selected_theme", "Theme.FindMaimaiUltra"); String selectedTheme = preferences.getString("selected_theme", "Theme.FindMaimaiUltra");
// Check if the system is in night mode
int nightModeFlags = getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
boolean isNightMode = nightModeFlags == Configuration.UI_MODE_NIGHT_YES;
// If the theme is gray and night mode is active, switch to white theme
if ("Theme.FindMaimaiUltra.Gray".equals(selectedTheme) && isNightMode) {
SharedPreferences.Editor editor = preferences.edit();
editor.putString("selected_theme", "Theme.FindMaimaiUltra.White");
editor.apply();
recreate(); // Recreate the activity to apply the new theme
}else if ("Theme.FindMaimaiUltra.White".equals(selectedTheme) && !isNightMode) {
SharedPreferences.Editor editor = preferences.edit();
editor.putString("selected_theme", "Theme.FindMaimaiUltra.Gray");
editor.apply();
recreate(); // Recreate the activity to apply the new theme
}
nfcAdapter = NfcAdapter.getDefaultAdapter(this); nfcAdapter = NfcAdapter.getDefaultAdapter(this);
if (nfcAdapter == null) { if (nfcAdapter == null) {
Snackbar.make(findViewById(R.id.nav_host_fragment_content_main), "NFC 不可用", Snackbar.LENGTH_LONG).show(); //使用根对象
Toast.makeText(this, "NFC 不可用", Toast.LENGTH_LONG).show();
//Snackbar.make(binding.getRoot() , "NFC 不可用", Snackbar.LENGTH_LONG).show();
//finish(); //finish();
//return; //return;
} }

View File

@@ -126,7 +126,8 @@ public class PageActivity extends AppCompatActivity {
TextView textView5 = findViewById(R.id.areaTextView); TextView textView5 = findViewById(R.id.areaTextView);
textView5.setText(area); textView5.setText(area);
TextView t1 = findViewById(R.id.num5); TextView t1 = findViewById(R.id.num5);
TextView t2 = findViewById(R.id.num6);
t2.setText("国机 " + num);
SharedPreferences preferences = getSharedPreferences("setting", MODE_PRIVATE); SharedPreferences preferences = getSharedPreferences("setting", MODE_PRIVATE);
String selectedTheme = preferences.getString("selected_theme", "Theme.FindMaimaiUltra"); String selectedTheme = preferences.getString("selected_theme", "Theme.FindMaimaiUltra");
@@ -137,30 +138,45 @@ public class PageActivity extends AppCompatActivity {
textView3.setTextColor(ContextCompat.getColor(this, R.color.colorPrimary)); textView3.setTextColor(ContextCompat.getColor(this, R.color.colorPrimary));
textView4.setTextColor(ContextCompat.getColor(this, R.color.colorPrimary)); textView4.setTextColor(ContextCompat.getColor(this, R.color.colorPrimary));
textView5.setTextColor(ContextCompat.getColor(this, R.color.colorPrimary)); textView5.setTextColor(ContextCompat.getColor(this, R.color.colorPrimary));
t1.setTextColor(ContextCompat.getColor(this, R.color.colorPrimary));
t2.setTextColor(ContextCompat.getColor(this, R.color.colorPrimary));
} else if (selectedTheme.contains("Blue")) { } else if (selectedTheme.contains("Blue")) {
textView.setTextColor(ContextCompat.getColor(this, R.color.textcolorPrimary2)); textView.setTextColor(ContextCompat.getColor(this, R.color.textcolorPrimary2));
textView2.setTextColor(ContextCompat.getColor(this, R.color.textcolorPrimary2)); textView2.setTextColor(ContextCompat.getColor(this, R.color.textcolorPrimary2));
textView3.setTextColor(ContextCompat.getColor(this, R.color.textcolorPrimary2)); textView3.setTextColor(ContextCompat.getColor(this, R.color.textcolorPrimary2));
textView4.setTextColor(ContextCompat.getColor(this, R.color.textcolorPrimary2)); textView4.setTextColor(ContextCompat.getColor(this, R.color.textcolorPrimary2));
textView5.setTextColor(ContextCompat.getColor(this, R.color.textcolorPrimary2)); textView5.setTextColor(ContextCompat.getColor(this, R.color.textcolorPrimary2));
t1.setTextColor(ContextCompat.getColor(this, R.color.textcolorPrimary2));
t2.setTextColor(ContextCompat.getColor(this, R.color.textcolorPrimary2));
} else if (selectedTheme.contains("Green")) { } else if (selectedTheme.contains("Green")) {
textView.setTextColor(ContextCompat.getColor(this, R.color.lineBaseGreen)); textView.setTextColor(ContextCompat.getColor(this, R.color.lineBaseGreen));
textView2.setTextColor(ContextCompat.getColor(this, R.color.lineBaseGreen)); textView2.setTextColor(ContextCompat.getColor(this, R.color.lineBaseGreen));
textView3.setTextColor(ContextCompat.getColor(this, R.color.lineBaseGreen)); textView3.setTextColor(ContextCompat.getColor(this, R.color.lineBaseGreen));
textView4.setTextColor(ContextCompat.getColor(this, R.color.lineBaseGreen)); textView4.setTextColor(ContextCompat.getColor(this, R.color.lineBaseGreen));
textView5.setTextColor(ContextCompat.getColor(this, R.color.lineBaseGreen)); textView5.setTextColor(ContextCompat.getColor(this, R.color.lineBaseGreen));
t1.setTextColor(ContextCompat.getColor(this, R.color.lineBaseGreen));
t2.setTextColor(ContextCompat.getColor(this, R.color.lineBaseGreen));
}else if (selectedTheme.contains("White")) { }else if (selectedTheme.contains("White")) {
textView.setTextColor(ContextCompat.getColor(this, R.color.white)); textView.setTextColor(ContextCompat.getColor(this, R.color.white));
textView2.setTextColor(ContextCompat.getColor(this, R.color.white)); textView2.setTextColor(ContextCompat.getColor(this, R.color.white));
textView3.setTextColor(ContextCompat.getColor(this, R.color.white)); textView3.setTextColor(ContextCompat.getColor(this, R.color.white));
textView4.setTextColor(ContextCompat.getColor(this, R.color.white)); textView4.setTextColor(ContextCompat.getColor(this, R.color.white));
textView5.setTextColor(ContextCompat.getColor(this, R.color.white)); textView5.setTextColor(ContextCompat.getColor(this, R.color.white));
t1.setTextColor(ContextCompat.getColor(this, R.color.white));
t2.setTextColor(ContextCompat.getColor(this, R.color.white));
}else if (selectedTheme.contains("Gray")) { }else if (selectedTheme.contains("Gray")) {
textView.setTextColor(ContextCompat.getColor(this, R.color.black)); textView.setTextColor(ContextCompat.getColor(this, R.color.black));
textView2.setTextColor(ContextCompat.getColor(this, R.color.black)); textView2.setTextColor(ContextCompat.getColor(this, R.color.black));
textView3.setTextColor(ContextCompat.getColor(this, R.color.black)); textView3.setTextColor(ContextCompat.getColor(this, R.color.black));
textView4.setTextColor(ContextCompat.getColor(this, R.color.black)); textView4.setTextColor(ContextCompat.getColor(this, R.color.black));
textView5.setTextColor(ContextCompat.getColor(this, R.color.black)); textView5.setTextColor(ContextCompat.getColor(this, R.color.black));
t1.setTextColor(ContextCompat.getColor(this, R.color.black));
t2.setTextColor(ContextCompat.getColor(this, R.color.black));
} }
adminIt = findViewById(R.id.admin); adminIt = findViewById(R.id.admin);
@@ -170,8 +186,7 @@ public class PageActivity extends AppCompatActivity {
type_code = "chu"; type_code = "chu";
t1.setText("中二总机台 " + (num + numJ)); t1.setText("中二总机台 " + (num + numJ));
} }
TextView t2 = findViewById(R.id.num6);
t2.setText("国机 " + num);
TextView t3 = findViewById(R.id.num7); TextView t3 = findViewById(R.id.num7);
tagXY = new double[]{x,y}; tagXY = new double[]{x,y};
tagplace = name; tagplace = name;

View File

@@ -7,6 +7,7 @@ import android.app.AlertDialog;
import android.content.*; import android.content.*;
import android.content.pm.PackageInfo; import android.content.pm.PackageInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.graphics.*; import android.graphics.*;
import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.BitmapDrawable;
import android.location.Address; import android.location.Address;
@@ -126,7 +127,11 @@ public class HomeFragment extends Fragment {
String savedData = shoucang.getString("key_name", "default_value"); String savedData = shoucang.getString("key_name", "default_value");
// 使用 savedData // 使用 savedData
} }
int nightModeFlags = getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
boolean isNightMode = nightModeFlags == Configuration.UI_MODE_NIGHT_YES;
if (isNightMode) {
recyclerView.setBackgroundColor(getResources().getColor(R.color.primary_back2));
}
if (settingProperties2.getString("image_uri", null) != null ) { if (settingProperties2.getString("image_uri", null) != null ) {
try { try {
File backgroundFile =FileUtils.getBackground(requireContext(), "background.jpg"); File backgroundFile =FileUtils.getBackground(requireContext(), "background.jpg");

View File

@@ -6,6 +6,7 @@ import android.app.UiModeManager;
import android.content.*; import android.content.*;
import android.content.pm.PackageInfo; import android.content.pm.PackageInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.os.Bundle; import android.os.Bundle;
import android.provider.Settings; import android.provider.Settings;
import android.util.Log; import android.util.Log;
@@ -217,7 +218,12 @@ public class SlideshowFragment extends Fragment {
binding.vits.setTextColor(ContextCompat.getColor(requireContext(), R.color.black)); binding.vits.setTextColor(ContextCompat.getColor(requireContext(), R.color.black));
binding.themeText.setTextColor(ContextCompat.getColor(requireContext(), R.color.black)); binding.themeText.setTextColor(ContextCompat.getColor(requireContext(), R.color.black));
} }
int nightModeFlags = getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
boolean isNightMode = nightModeFlags == Configuration.UI_MODE_NIGHT_YES;
if (isNightMode) {
binding.scrollView.setBackgroundColor(getResources().getColor(R.color.primary_back2));
binding.fraName.setBackgroundColor(getResources().getColor(R.color.primary_back2));
}
binding.view2.setBackgroundColor(R.color.black); binding.view2.setBackgroundColor(R.color.black);
binding.view3.setBackgroundColor(R.color.black); binding.view3.setBackgroundColor(R.color.black);
return root; return root;

View File

@@ -38,6 +38,7 @@
<FrameLayout <FrameLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1" android:layout_weight="1"
android:id="@+id/fraName"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/white" android:background="@color/white"
> >

View File

@@ -14,6 +14,8 @@
<color name="primary_light">#D1C4E9</color> <color name="primary_light">#D1C4E9</color>
<color name="accent">#D5C4ED</color> <color name="accent">#D5C4ED</color>
<color name="primary_text">#8C8181</color> <color name="primary_text">#8C8181</color>
<color name="primary_back2">#323232</color>
<color name="backg">#CCA4A4</color> <color name="backg">#CCA4A4</color>
<color name="secondary_text">#727272</color> <color name="secondary_text">#727272</color>