Optimize app size, Fix first launch, Fix intro video on old android

This commit is contained in:
MrLetsplay 2023-10-07 13:57:41 +02:00
parent 8dac0a71ac
commit b507fbc92e
Signed by: mr
SSH Key Fingerprint: SHA256:92jBH80vpXyaZHjaIl47pjRq+Yt7XGTArqQg1V7hSqg
28 changed files with 14 additions and 10 deletions

View File

@ -28,7 +28,7 @@ public class IntroActivity extends BaseActivity {
binding = ActivityIntroBinding.inflate(getLayoutInflater()); binding = ActivityIntroBinding.inflate(getLayoutInflater());
Uri uri = Uri.parse(String.format("android.resource://%s/%s", getPackageName(), R.raw.intro)); Uri uri = Uri.parse(String.format("android.resource://%s/%s", getPackageName(), R.raw.intro_vp9));
binding.videoView.setVideoURI(uri); binding.videoView.setVideoURI(uri);
binding.videoView.start(); binding.videoView.start();

View File

@ -39,6 +39,7 @@ import com.cringe_studios.code_guard.util.ThemeUtil;
import com.google.mlkit.vision.common.InputImage; import com.google.mlkit.vision.common.InputImage;
import java.io.IOException; import java.io.IOException;
import java.util.List;
import java.util.UUID; import java.util.UUID;
public class MainActivity extends BaseActivity { public class MainActivity extends BaseActivity {
@ -243,20 +244,23 @@ public class MainActivity extends BaseActivity {
binding.fabMenu.setOnClickListener(view -> NavigationUtil.openMenu(this, null)); binding.fabMenu.setOnClickListener(view -> NavigationUtil.openMenu(this, null));
if(SettingsUtil.isFirstLaunch(this) && SettingsUtil.getGroups(this).isEmpty()) {
SettingsUtil.addGroup(this, UUID.randomUUID().toString(), "My Codes");
DialogUtil.showYesNo(this, R.string.enable_encryption_title, R.string.enable_encryption_message, () -> NavigationUtil.navigate(this, SettingsFragment.class, null), null);
SettingsUtil.setFirstLaunch(this, false);
}
Fragment fragment = NavigationUtil.getCurrentFragment(this); Fragment fragment = NavigationUtil.getCurrentFragment(this);
if(fragment instanceof NamedFragment) { if(fragment instanceof NamedFragment) {
ActionBar bar = getSupportActionBar(); ActionBar bar = getSupportActionBar();
if(bar != null) bar.setTitle(((NamedFragment) fragment).getName()); if(bar != null) bar.setTitle(((NamedFragment) fragment).getName());
}else { }else {
List<String> groups = SettingsUtil.getGroups(this);
if(!groups.isEmpty()) {
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putString(GroupFragment.BUNDLE_GROUP, SettingsUtil.getGroups(this).get(0)); bundle.putString(GroupFragment.BUNDLE_GROUP, SettingsUtil.getGroups(this).get(0));
NavigationUtil.navigate(this, GroupFragment.class, bundle); NavigationUtil.navigate(this, GroupFragment.class, bundle);
} }
if(SettingsUtil.isFirstLaunch(this) && SettingsUtil.getGroups(this).isEmpty()) {
SettingsUtil.addGroup(this, UUID.randomUUID().toString(), "My Codes");
DialogUtil.showYesNo(this, R.string.enable_encryption_title, R.string.enable_encryption_message, () -> NavigationUtil.navigate(this, SettingsFragment.class, null), null);
SettingsUtil.setFirstLaunch(this, false);
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 MiB

Binary file not shown.

Binary file not shown.