1.6.5 beta更新
This commit is contained in:
2
.idea/compiler.xml
generated
2
.idea/compiler.xml
generated
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="21" />
|
||||
<bytecodeTargetLevel target="17" />
|
||||
</component>
|
||||
</project>
|
||||
3
.idea/misc.xml
generated
3
.idea/misc.xml
generated
@@ -1,10 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="FrameworkDetectionExcludesConfiguration">
|
||||
<file type="web" url="file://$PROJECT_DIR$" />
|
||||
</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" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
||||
@@ -11,7 +11,7 @@ android {
|
||||
minSdk 29
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "1.6.4"
|
||||
versionName "1.6.5 beta"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.app.PendingIntent;
|
||||
import android.content.*;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.nfc.NdefMessage;
|
||||
@@ -63,10 +64,27 @@ public class MainActivity extends AppCompatActivity implements ImagePickerListen
|
||||
super.onCreate(savedInstanceState);
|
||||
SharedPreferences preferences = getSharedPreferences("setting", MODE_PRIVATE);
|
||||
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);
|
||||
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();
|
||||
//return;
|
||||
}
|
||||
|
||||
@@ -126,7 +126,8 @@ public class PageActivity extends AppCompatActivity {
|
||||
TextView textView5 = findViewById(R.id.areaTextView);
|
||||
textView5.setText(area);
|
||||
TextView t1 = findViewById(R.id.num5);
|
||||
|
||||
TextView t2 = findViewById(R.id.num6);
|
||||
t2.setText("国机 " + num);
|
||||
SharedPreferences preferences = getSharedPreferences("setting", MODE_PRIVATE);
|
||||
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));
|
||||
textView4.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")) {
|
||||
textView.setTextColor(ContextCompat.getColor(this, R.color.textcolorPrimary2));
|
||||
textView2.setTextColor(ContextCompat.getColor(this, R.color.textcolorPrimary2));
|
||||
textView3.setTextColor(ContextCompat.getColor(this, R.color.textcolorPrimary2));
|
||||
textView4.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")) {
|
||||
textView.setTextColor(ContextCompat.getColor(this, R.color.lineBaseGreen));
|
||||
textView2.setTextColor(ContextCompat.getColor(this, R.color.lineBaseGreen));
|
||||
textView3.setTextColor(ContextCompat.getColor(this, R.color.lineBaseGreen));
|
||||
textView4.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")) {
|
||||
textView.setTextColor(ContextCompat.getColor(this, R.color.white));
|
||||
textView2.setTextColor(ContextCompat.getColor(this, R.color.white));
|
||||
textView3.setTextColor(ContextCompat.getColor(this, R.color.white));
|
||||
textView4.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")) {
|
||||
textView.setTextColor(ContextCompat.getColor(this, R.color.black));
|
||||
textView2.setTextColor(ContextCompat.getColor(this, R.color.black));
|
||||
textView3.setTextColor(ContextCompat.getColor(this, R.color.black));
|
||||
textView4.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);
|
||||
@@ -170,8 +186,7 @@ public class PageActivity extends AppCompatActivity {
|
||||
type_code = "chu";
|
||||
t1.setText("中二总机台 " + (num + numJ));
|
||||
}
|
||||
TextView t2 = findViewById(R.id.num6);
|
||||
t2.setText("国机 " + num);
|
||||
|
||||
TextView t3 = findViewById(R.id.num7);
|
||||
tagXY = new double[]{x,y};
|
||||
tagplace = name;
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.app.AlertDialog;
|
||||
import android.content.*;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.*;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.location.Address;
|
||||
@@ -126,7 +127,11 @@ public class HomeFragment extends Fragment {
|
||||
String savedData = shoucang.getString("key_name", "default_value");
|
||||
// 使用 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 ) {
|
||||
try {
|
||||
File backgroundFile =FileUtils.getBackground(requireContext(), "background.jpg");
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.app.UiModeManager;
|
||||
import android.content.*;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
@@ -217,7 +218,12 @@ public class SlideshowFragment extends Fragment {
|
||||
binding.vits.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.view3.setBackgroundColor(R.color.black);
|
||||
return root;
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
<FrameLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:id="@+id/fraName"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
>
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
<color name="primary_light">#D1C4E9</color>
|
||||
<color name="accent">#D5C4ED</color>
|
||||
<color name="primary_text">#8C8181</color>
|
||||
<color name="primary_back2">#323232</color>
|
||||
|
||||
<color name="backg">#CCA4A4</color>
|
||||
|
||||
<color name="secondary_text">#727272</color>
|
||||
|
||||
Reference in New Issue
Block a user