VUI fixes & improvements pt. 1

Re-enabled multi-process and fixed controls notch offset in multi-process
Used ThreadPoolExecutor for task execution with 0 starting threads
Used translation strings instead of hardcoded strings
Added terminate button for lazy service
Added arrow for tasks list
This commit is contained in:
artdeell 2022-11-09 22:34:49 +03:00 committed by ArtDev
parent d3a8c0bf17
commit 93396eff44
11 changed files with 72 additions and 46 deletions

View file

@ -101,25 +101,7 @@ public class MainActivity extends BaseActivity {
// Recompute the gui scale when options are changed
MCOptionUtils.MCOptionListener optionListener = MCOptionUtils::getMcScale;
MCOptionUtils.addMCOptionListener(optionListener);
try {
// Load keys
mControlLayout.loadLayout(
minecraftProfile.controlFile == null
? LauncherPreferences.PREF_DEFAULTCTRL_PATH
: Tools.CTRLMAP_PATH + minecraftProfile.controlFile);
} catch(IOException e) {
try {
Log.w("MainActivity", "Unable to load the control file, loading the default now");
mControlLayout.loadLayout(Tools.CTRLDEF_FILE);
} catch (IOException ioException) {
Tools.showError(this, ioException);
}
} catch (Throwable th) {
Tools.showError(this, th);
}
mControlLayout.setModifiable(false);
mControlLayout.toggleControlVisible();
}
protected void initLayout(int resId) {
@ -202,6 +184,32 @@ public class MainActivity extends BaseActivity {
}
}
private void loadControls() {
try {
// Load keys
mControlLayout.loadLayout(
minecraftProfile.controlFile == null
? LauncherPreferences.PREF_DEFAULTCTRL_PATH
: Tools.CTRLMAP_PATH + minecraftProfile.controlFile);
} catch(IOException e) {
try {
Log.w("MainActivity", "Unable to load the control file, loading the default now");
mControlLayout.loadLayout(Tools.CTRLDEF_FILE);
} catch (IOException ioException) {
Tools.showError(this, ioException);
}
} catch (Throwable th) {
Tools.showError(this, th);
}
mControlLayout.toggleControlVisible();
}
@Override
public void onAttachedToWindow() {
LauncherPreferences.computeNotchSize(this);
loadControls();
}
/** Boilerplate binding */
private void bindValues(){
mControlLayout = findViewById(R.id.main_control_layout);