From 8ef4ab761d03d70596f4a28c83503c3f6ec9d006 Mon Sep 17 00:00:00 2001 From: JG-Cody Date: Sun, 25 Feb 2024 12:26:54 +0100 Subject: [PATCH] openinganimation now works again... destroyed everything else... --- .../com/example/onetap_ssh/IntroActivity.java | 26 ------------------- .../com/example/onetap_ssh/MainActivity.java | 4 +-- .../onetap_ssh/ui/home/HomeFragment.java | 1 - .../example/onetap_ssh/util/ThemeUtil.java | 2 +- app/src/main/res/layout/fragment_home.xml | 8 ++++++ app/src/main/res/values-night/themes.xml | 14 +--------- app/src/main/res/values/strings.xml | 4 +-- app/src/main/res/values/themes.xml | 2 +- 8 files changed, 15 insertions(+), 46 deletions(-) diff --git a/app/src/main/java/com/example/onetap_ssh/IntroActivity.java b/app/src/main/java/com/example/onetap_ssh/IntroActivity.java index 6852e24..43d30ed 100644 --- a/app/src/main/java/com/example/onetap_ssh/IntroActivity.java +++ b/app/src/main/java/com/example/onetap_ssh/IntroActivity.java @@ -1,13 +1,9 @@ package com.example.onetap_ssh; -import android.app.Activity; import android.content.Intent; -import android.content.SharedPreferences; import android.media.MediaPlayer; import android.net.Uri; import android.os.Bundle; -import android.os.Handler; -import android.os.Looper; import android.view.ViewGroup; import android.widget.Toast; @@ -17,8 +13,6 @@ import com.example.onetap_ssh.util.SettingsUtil; public class IntroActivity extends BaseActivity { - public static boolean show_logoanimation = false; - private ActivityIntroBinding binding; private MediaPlayer mMediaPlayer; @@ -52,26 +46,6 @@ public class IntroActivity extends BaseActivity { }); setContentView(binding.getRoot()); - - SharedPreferences p = getSharedPreferences("appsettings", Activity.MODE_PRIVATE); - show_logoanimation = p.getBoolean("Logoanimation", true); - if (show_logoanimation) { - setContentView(R.layout.activity_intro); - final Handler handler = new Handler(Looper.getMainLooper()); - handler.postDelayed(new Runnable() { - @Override - public void run() { - //Do something after 4000ms - Intent m = new Intent(getApplicationContext(), MainActivity.class); - m.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION); - startActivity(m); - } - }, 4000); - } else { - Intent m = new Intent(getApplicationContext(), MainActivity.class); - m.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION); - startActivity(m); - } } public void openMainActivity() { diff --git a/app/src/main/java/com/example/onetap_ssh/MainActivity.java b/app/src/main/java/com/example/onetap_ssh/MainActivity.java index 3e41de6..830b7ee 100644 --- a/app/src/main/java/com/example/onetap_ssh/MainActivity.java +++ b/app/src/main/java/com/example/onetap_ssh/MainActivity.java @@ -50,7 +50,7 @@ import java.util.Map; import java.util.Objects; import java.util.UUID; -public class MainActivity extends AppCompatActivity { +public class MainActivity extends BaseActivity { private AppBarConfiguration mAppBarConfiguration; private ActivityMainBinding binding; @@ -91,7 +91,7 @@ public class MainActivity extends AppCompatActivity { NavigationUI.setupWithNavController(navigationView, navController); SharedPreferences p = getSharedPreferences("appsettings", Activity.MODE_PRIVATE); button_vibration = p.getBoolean("Vibration", false ); - IntroActivity.show_logoanimation = p.getBoolean("Logoanimation", true ); + launchApp(); navigationView.getMenu().getItem(4).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { diff --git a/app/src/main/java/com/example/onetap_ssh/ui/home/HomeFragment.java b/app/src/main/java/com/example/onetap_ssh/ui/home/HomeFragment.java index 860516f..cb5dadb 100644 --- a/app/src/main/java/com/example/onetap_ssh/ui/home/HomeFragment.java +++ b/app/src/main/java/com/example/onetap_ssh/ui/home/HomeFragment.java @@ -223,7 +223,6 @@ public class HomeFragment extends Fragment { passwordInput.setVisibility(View.VISIBLE); reboot_Button.setVisibility(View.GONE); shutdown_Button.setVisibility(View.GONE); - backgroundoverlay_bottom.setVisibility(View.INVISIBLE); } else { logoutButton.setVisibility(View.VISIBLE); reboot_Button.setVisibility(View.VISIBLE); diff --git a/app/src/main/java/com/example/onetap_ssh/util/ThemeUtil.java b/app/src/main/java/com/example/onetap_ssh/util/ThemeUtil.java index 880efb6..365a87b 100644 --- a/app/src/main/java/com/example/onetap_ssh/util/ThemeUtil.java +++ b/app/src/main/java/com/example/onetap_ssh/util/ThemeUtil.java @@ -17,7 +17,7 @@ public class ThemeUtil { activity.setTheme(theme.getStyle()); if(SettingsUtil.isMinimalistThemeEnabled(activity)) { - activity.getTheme().applyStyle(R.style.Theme_CringeAuthenticator_Minimalist, true); + activity.getTheme().applyStyle(R.style.Theme_OneTap_SSH_Minimalist, true); } AppCompatDelegate.setDefaultNightMode(SettingsUtil.getAppearance(activity).getValue()); diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index 4515018..2cca294 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -45,6 +45,8 @@ android:background="#80FFFFFF" android:scaleType="centerCrop" android:src="@drawable/background_red_blue" + android:textColor="@color/mtrl_btn_text_color_selector" + android:textColorHint="@color/mtrl_btn_text_color_selector" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.5" @@ -88,6 +90,8 @@ android:ems="10" android:hint="@string/login_ipaddress" android:inputType="text" + android:textColor="@color/mtrl_btn_text_color_selector" + android:textColorHint="@color/mtrl_btn_text_color_selector" app:layout_constraintEnd_toEndOf="@+id/text_home" app:layout_constraintHorizontal_bias="0.5" app:layout_constraintStart_toStartOf="@+id/text_home" @@ -102,6 +106,8 @@ android:hint="@string/login_username" android:inputType="textEmailAddress" android:singleLine="false" + android:textColor="@color/mtrl_btn_text_color_selector" + android:textColorHint="@color/mtrl_btn_text_color_selector" app:layout_constraintEnd_toEndOf="@+id/text_home" app:layout_constraintHorizontal_bias="0.5" app:layout_constraintStart_toStartOf="@+id/text_home" @@ -115,6 +121,8 @@ android:ems="10" android:hint="@string/login_password" android:inputType="textPassword" + android:textColor="@color/mtrl_btn_text_color_selector" + android:textColorHint="@color/mtrl_btn_text_color_selector" app:layout_constraintEnd_toEndOf="@+id/text_home" app:layout_constraintHorizontal_bias="0.5" app:layout_constraintStart_toStartOf="@+id/text_home" diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml index 261172a..9639aef 100644 --- a/app/src/main/res/values-night/themes.xml +++ b/app/src/main/res/values-night/themes.xml @@ -1,18 +1,6 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 05dedf1..9ae5798 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -189,8 +189,8 @@ 1 1 1 - 1 - 1 + Home + Gallery 1 diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index f79b0c0..e92ab36 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -50,7 +50,7 @@ @color/color_orange @color/color_turquoise -