Optimize app size, Fix first launch, Fix intro video on old android
@ -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();
|
||||||
|
|
||||||
|
@ -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 {
|
||||||
Bundle bundle = new Bundle();
|
List<String> groups = SettingsUtil.getGroups(this);
|
||||||
bundle.putString(GroupFragment.BUNDLE_GROUP, SettingsUtil.getGroups(this).get(0));
|
if(!groups.isEmpty()) {
|
||||||
NavigationUtil.navigate(this, GroupFragment.class, bundle);
|
Bundle bundle = new Bundle();
|
||||||
}
|
bundle.putString(GroupFragment.BUNDLE_GROUP, SettingsUtil.getGroups(this).get(0));
|
||||||
|
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BIN
app/src/main/res/drawable/background_blue_green.jpg
Normal file
After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 5.4 MiB |
BIN
app/src/main/res/drawable/background_blue_green_light.jpg
Normal file
After Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 6.4 MiB |
BIN
app/src/main/res/drawable/background_blue_yellow.jpg
Normal file
After Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 6.1 MiB |
BIN
app/src/main/res/drawable/background_blue_yellow_light.jpg
Normal file
After Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 6.4 MiB |
BIN
app/src/main/res/drawable/background_green_yellow.jpg
Normal file
After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 4.9 MiB |
BIN
app/src/main/res/drawable/background_green_yellow_light.jpg
Normal file
After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 6.4 MiB |
BIN
app/src/main/res/drawable/background_orange_turquoise.jpg
Normal file
After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 6.0 MiB |
BIN
app/src/main/res/drawable/background_orange_turquoise_light.jpg
Normal file
After Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 6.3 MiB |
BIN
app/src/main/res/drawable/background_pink_green.jpg
Normal file
After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 6.1 MiB |
BIN
app/src/main/res/drawable/background_pink_green_light.jpg
Normal file
After Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 6.4 MiB |
BIN
app/src/main/res/drawable/background_red_blue.jpg
Normal file
After Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 5.3 MiB |
BIN
app/src/main/res/drawable/background_red_blue_light.jpg
Normal file
After Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 5.8 MiB |