openinganimation now works again...

destroyed everything else...
This commit is contained in:
JG-Cody 2024-02-25 12:26:54 +01:00
parent c634995e41
commit 8ef4ab761d
8 changed files with 15 additions and 46 deletions

View File

@ -1,13 +1,9 @@
package com.example.onetap_ssh; package com.example.onetap_ssh;
import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences;
import android.media.MediaPlayer; import android.media.MediaPlayer;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.Toast; import android.widget.Toast;
@ -17,8 +13,6 @@ import com.example.onetap_ssh.util.SettingsUtil;
public class IntroActivity extends BaseActivity { public class IntroActivity extends BaseActivity {
public static boolean show_logoanimation = false;
private ActivityIntroBinding binding; private ActivityIntroBinding binding;
private MediaPlayer mMediaPlayer; private MediaPlayer mMediaPlayer;
@ -52,26 +46,6 @@ public class IntroActivity extends BaseActivity {
}); });
setContentView(binding.getRoot()); 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() { public void openMainActivity() {

View File

@ -50,7 +50,7 @@ import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.UUID; import java.util.UUID;
public class MainActivity extends AppCompatActivity { public class MainActivity extends BaseActivity {
private AppBarConfiguration mAppBarConfiguration; private AppBarConfiguration mAppBarConfiguration;
private ActivityMainBinding binding; private ActivityMainBinding binding;
@ -91,7 +91,7 @@ public class MainActivity extends AppCompatActivity {
NavigationUI.setupWithNavController(navigationView, navController); NavigationUI.setupWithNavController(navigationView, navController);
SharedPreferences p = getSharedPreferences("appsettings", Activity.MODE_PRIVATE); SharedPreferences p = getSharedPreferences("appsettings", Activity.MODE_PRIVATE);
button_vibration = p.getBoolean("Vibration", false ); button_vibration = p.getBoolean("Vibration", false );
IntroActivity.show_logoanimation = p.getBoolean("Logoanimation", true );
launchApp(); launchApp();
navigationView.getMenu().getItem(4).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { navigationView.getMenu().getItem(4).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {

View File

@ -223,7 +223,6 @@ public class HomeFragment extends Fragment {
passwordInput.setVisibility(View.VISIBLE); passwordInput.setVisibility(View.VISIBLE);
reboot_Button.setVisibility(View.GONE); reboot_Button.setVisibility(View.GONE);
shutdown_Button.setVisibility(View.GONE); shutdown_Button.setVisibility(View.GONE);
backgroundoverlay_bottom.setVisibility(View.INVISIBLE);
} else { } else {
logoutButton.setVisibility(View.VISIBLE); logoutButton.setVisibility(View.VISIBLE);
reboot_Button.setVisibility(View.VISIBLE); reboot_Button.setVisibility(View.VISIBLE);

View File

@ -17,7 +17,7 @@ public class ThemeUtil {
activity.setTheme(theme.getStyle()); activity.setTheme(theme.getStyle());
if(SettingsUtil.isMinimalistThemeEnabled(activity)) { 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()); AppCompatDelegate.setDefaultNightMode(SettingsUtil.getAppearance(activity).getValue());

View File

@ -45,6 +45,8 @@
android:background="#80FFFFFF" android:background="#80FFFFFF"
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:src="@drawable/background_red_blue" 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_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5" app:layout_constraintHorizontal_bias="0.5"
@ -88,6 +90,8 @@
android:ems="10" android:ems="10"
android:hint="@string/login_ipaddress" android:hint="@string/login_ipaddress"
android:inputType="text" 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_constraintEnd_toEndOf="@+id/text_home"
app:layout_constraintHorizontal_bias="0.5" app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="@+id/text_home" app:layout_constraintStart_toStartOf="@+id/text_home"
@ -102,6 +106,8 @@
android:hint="@string/login_username" android:hint="@string/login_username"
android:inputType="textEmailAddress" android:inputType="textEmailAddress"
android:singleLine="false" 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_constraintEnd_toEndOf="@+id/text_home"
app:layout_constraintHorizontal_bias="0.5" app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="@+id/text_home" app:layout_constraintStart_toStartOf="@+id/text_home"
@ -115,6 +121,8 @@
android:ems="10" android:ems="10"
android:hint="@string/login_password" android:hint="@string/login_password"
android:inputType="textPassword" 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_constraintEnd_toEndOf="@+id/text_home"
app:layout_constraintHorizontal_bias="0.5" app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="@+id/text_home" app:layout_constraintStart_toStartOf="@+id/text_home"

View File

@ -1,18 +1,6 @@
<resources xmlns:tools="http://schemas.android.com/tools"> <resources xmlns:tools="http://schemas.android.com/tools">
<style name="Theme.OneTap_SSH" parent="Base.Theme.OneTap_SSH"> <style name="Theme.OneTap_SSH." parent="Base.Theme.OneTap_SSH">
<item name="android:textColor">@color/white</item> <item name="android:textColor">@color/white</item>
<item name="colorOnBackground">@color/background_grey</item> <item name="colorOnBackground">@color/background_grey</item>
</style> </style>
<style name="Theme.OneTap_SSH.PopupOverlay">
<item name="colorTheme1">@color/color_blue</item>
<item name="colorTheme2">@color/color_light_green</item>
</style>
<style name="Theme.OneTap_SSH.AppBarOverlay">
<item name="colorTheme1">@color/color_blue</item>
<item name="colorTheme2">@color/color_light_green</item>
</style>
<style name="DialogAnimation">
<item name="android:windowEnterAnimation">@anim/dialog_in</item>
<item name="android:windowExitAnimation">@anim/dialog_out</item>
</style>
</resources> </resources>

View File

@ -189,8 +189,8 @@
<string name="nav_header_subtitle">1</string> <string name="nav_header_subtitle">1</string>
<string name="nav_header_title">1</string> <string name="nav_header_title">1</string>
<string name="nav_header_desc">1</string> <string name="nav_header_desc">1</string>
<string name="menu_home">1</string> <string name="menu_home">Home</string>
<string name="menu_gallery">1</string> <string name="menu_gallery">Gallery</string>
<string name="menu_slideshow">1</string> <string name="menu_slideshow">1</string>

View File

@ -50,7 +50,7 @@
<item name="colorTheme1">@color/color_orange</item> <item name="colorTheme1">@color/color_orange</item>
<item name="colorTheme2">@color/color_turquoise</item> <item name="colorTheme2">@color/color_turquoise</item>
</style> </style>
<style name="Theme.CringeAuthenticator.Minimalist" parent=""> <style name="Theme.OneTap_SSH.Minimalist" parent="">
<item name="dialogBackground">?android:attr/colorBackground</item> <item name="dialogBackground">?android:attr/colorBackground</item>
<item name="menuBackground">?android:attr/colorBackground</item> <item name="menuBackground">?android:attr/colorBackground</item>
<item name="buttonBackground">@drawable/button_simple</item> <item name="buttonBackground">@drawable/button_simple</item>