Merge pull request #937 from Mathias-Boulay/portait_support

- Improved portrait support
This commit is contained in:
ArtDev 2021-02-22 13:55:52 +03:00 committed by GitHub
commit c0437cd432
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 240 additions and 262 deletions

View File

@ -34,28 +34,11 @@ public abstract class BaseLauncherActivity extends BaseActivity {
public abstract void statusIsLaunching(boolean isLaunching); public abstract void statusIsLaunching(boolean isLaunching);
public void mcaccSwitchUser(View view) {
showProfileInfo();
}
public void mcaccLogout(View view) { public void mcaccLogout(View view) {
//PojavProfile.reset(); //PojavProfile.reset();
finish(); finish();
} }
private void showProfileInfo() {
/*
new AlertDialog.Builder(this)
.setTitle("Info player")
.setMessage(
"AccessToken=" + profile.getAccessToken() + "\n" +
"ClientID=" + profile.getClientID() + "\n" +
"ProfileID=" + profile.getProfileID() + "\n" +
"Username=" + profile.getUsername() + "\n" +
"Version=" + profile.getVersion()
).show();
*/
}
public void launcherMenu(View view) { public void launcherMenu(View view) {
AlertDialog.Builder builder = new AlertDialog.Builder(this); AlertDialog.Builder builder = new AlertDialog.Builder(this);

View File

@ -2,6 +2,7 @@ package net.kdt.pojavlaunch;
import android.animation.ValueAnimator; import android.animation.ValueAnimator;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.Typeface; import android.graphics.Typeface;
import android.os.Build; import android.os.Build;
@ -52,7 +53,7 @@ public class PojavLauncherActivity extends BaseLauncherActivity
private final Button[] Tabs = new Button[4]; private final Button[] Tabs = new Button[4];
private View selected; private View selected;
private Button switchUsrBtn, logoutBtn; // MineButtons private Button logoutBtn; // MineButtons
public PojavLauncherActivity() { public PojavLauncherActivity() {
} }
@ -185,7 +186,6 @@ public class PojavLauncherActivity extends BaseLauncherActivity
mLaunchProgress = (ProgressBar) findViewById(R.id.progressDownloadBar); mLaunchProgress = (ProgressBar) findViewById(R.id.progressDownloadBar);
mLaunchTextStatus = (TextView) findViewById(R.id.progressDownloadText); mLaunchTextStatus = (TextView) findViewById(R.id.progressDownloadText);
switchUsrBtn = (Button) findViewById(R.id.infoDevBtn);
logoutBtn = (Button) findViewById(R.id.switchUserBtn); logoutBtn = (Button) findViewById(R.id.switchUserBtn);
mPlayButton = (Button) findViewById(R.id.launchermainPlayButton); mPlayButton = (Button) findViewById(R.id.launchermainPlayButton);
@ -198,7 +198,7 @@ public class PojavLauncherActivity extends BaseLauncherActivity
@Override @Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
if(key.equals("hideSidebar")){ if(key.equals("hideSidebar")){
restoreOldLook(sharedPreferences.getBoolean("hideSidebar",false)); changeLookAndFeel(sharedPreferences.getBoolean("hideSidebar",false));
return; return;
} }
@ -208,7 +208,7 @@ public class PojavLauncherActivity extends BaseLauncherActivity
} }
} }
}); });
restoreOldLook(PREF_HIDE_SIDEBAR); changeLookAndFeel(PREF_HIDE_SIDEBAR);
ignoreNotch(PREF_IGNORE_NOTCH, PojavLauncherActivity.this); ignoreNotch(PREF_IGNORE_NOTCH, PojavLauncherActivity.this);
} }
@ -235,7 +235,7 @@ public class PojavLauncherActivity extends BaseLauncherActivity
mLaunchProgress.setVisibility(launchVisibility); mLaunchProgress.setVisibility(launchVisibility);
mLaunchTextStatus.setVisibility(launchVisibility); mLaunchTextStatus.setVisibility(launchVisibility);
switchUsrBtn.setEnabled(!isLaunching);
logoutBtn.setEnabled(!isLaunching); logoutBtn.setEnabled(!isLaunching);
mVersionSelector.setEnabled(!isLaunching); mVersionSelector.setEnabled(!isLaunching);
canBack = !isLaunching; canBack = !isLaunching;
@ -276,10 +276,11 @@ public class PojavLauncherActivity extends BaseLauncherActivity
}, 500); }, 500);
} }
private void restoreOldLook(boolean oldLookState){ private void changeLookAndFeel(boolean useOldLook){
Guideline guideLine = findViewById(R.id.guidelineLeft); Guideline guideLine = findViewById(R.id.guidelineLeft);
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) guideLine.getLayoutParams(); ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) guideLine.getLayoutParams();
if(oldLookState){
if(useOldLook || getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT){
//UI v1 Style //UI v1 Style
//Hide the sidebar //Hide the sidebar
params.guidePercent = 0; // 0%, range: 0 <-> 1 params.guidePercent = 0; // 0%, range: 0 <-> 1

View File

@ -1,6 +1,7 @@
package net.kdt.pojavlaunch; package net.kdt.pojavlaunch;
import android.Manifest; import android.Manifest;
import android.annotation.SuppressLint;
import android.app.Dialog; import android.app.Dialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
@ -31,7 +32,6 @@ import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.ListView; import android.widget.ListView;
import android.widget.ProgressBar; import android.widget.ProgressBar;
@ -74,39 +74,26 @@ import org.apache.commons.io.IOUtils;
public class PojavLoginActivity extends BaseActivity public class PojavLoginActivity extends BaseActivity
// MineActivity // MineActivity
{ {
private Object mLockStoragePerm = new Object(), private final Object mLockStoragePerm = new Object();
mLockSelectJRE = new Object(); private final Object mLockSelectJRE = new Object();
private EditText edit2, edit3; private EditText edit2, edit3;
private int REQUEST_STORAGE_REQUEST_CODE = 1; private final int REQUEST_STORAGE_REQUEST_CODE = 1;
private ProgressBar prb;
private CheckBox sRemember, sOffline; private CheckBox sRemember, sOffline;
private LinearLayout loginLayout;
private Spinner spinnerChgLang;
private ImageView imageLogo;
private TextView startupTextView; private TextView startupTextView;
private SharedPreferences firstLaunchPrefs; private SharedPreferences firstLaunchPrefs;
private MinecraftAccount mProfile = null;
private static boolean isSkipInit = false; private static boolean isSkipInit = false;
public static final String PREF_IS_INSTALLED_JAVARUNTIME = "isJavaRuntimeInstalled"; public static final String PREF_IS_INSTALLED_JAVARUNTIME = "isJavaRuntimeInstalled";
public static final String PREF_JAVARUNTIME_VER = "javaRuntimeVersion";
@Override @Override
protected void onCreate(Bundle savedInstanceState){ protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState); // false); super.onCreate(savedInstanceState); // false;
Tools.updateWindowSize(this); Tools.updateWindowSize(this);
ControlData[] specialButtons = ControlData.getSpecialButtons();
specialButtons[0].name = getString(R.string.control_keyboard);
specialButtons[1].name = getString(R.string.control_toggle);
specialButtons[2].name = getString(R.string.control_primary);
specialButtons[3].name = getString(R.string.control_secondary);
specialButtons[4].name = getString(R.string.control_mouse);
firstLaunchPrefs = getSharedPreferences("pojav_extract", MODE_PRIVATE); firstLaunchPrefs = getSharedPreferences("pojav_extract", MODE_PRIVATE);
new InitTask().execute(isSkipInit); new InitTask().execute(isSkipInit);
} }
@ -115,12 +102,8 @@ public class PojavLoginActivity extends BaseActivity
private AlertDialog startAle; private AlertDialog startAle;
private ProgressBar progress; private ProgressBar progress;
private ProgressBar progressSpin;
private AlertDialog progDlg;
@Override @Override
protected void onPreExecute() protected void onPreExecute() {
{
LinearLayout startScr = new LinearLayout(PojavLoginActivity.this); LinearLayout startScr = new LinearLayout(PojavLoginActivity.this);
LayoutInflater.from(PojavLoginActivity.this).inflate(R.layout.start_screen, startScr); LayoutInflater.from(PojavLoginActivity.this).inflate(R.layout.start_screen, startScr);
@ -147,14 +130,13 @@ public class PojavLoginActivity extends BaseActivity
@Override @Override
protected Integer doInBackground(Boolean[] params) { protected Integer doInBackground(Boolean[] params) {
// If trigger a quick restart // If trigger a quick restart
if (params[0] == true) { if (params[0]) return 0;
return 0;
}
try { try {
Thread.sleep(2000); Thread.sleep(2000);
} catch (InterruptedException e) {} } catch (InterruptedException e) {}
publishProgress("visible"); publishProgress("visible");
while (Build.VERSION.SDK_INT >= 23 && !isStorageAllowed()){ while (Build.VERSION.SDK_INT >= 23 && !isStorageAllowed()){
@ -195,26 +177,14 @@ public class PojavLoginActivity extends BaseActivity
@Override @Override
protected void onPostExecute(Integer obj) { protected void onPostExecute(Integer obj) {
startAle.dismiss(); startAle.dismiss();
if (progressSpin != null) progressSpin.setVisibility(View.GONE); if (obj == 0) uiInit();
if (obj == 0) {
if (progDlg != null) progDlg.dismiss();
uiInit();
}
} }
} }
private void uiInit() { private void uiInit() {
setContentView(R.layout.launcher_login_v2); setContentView(R.layout.launcher_login_v3);
loginLayout = findViewById(R.id.login_layout_linear); Spinner spinnerChgLang = findViewById(R.id.login_spinner_language);
spinnerChgLang = findViewById(R.id.login_spinner_language);
imageLogo = findViewById(R.id.login_image_logo);
loginLayout.postDelayed(new Runnable(){
@Override
public void run(){
imageLogo.setTranslationY(loginLayout.getY() - (imageLogo.getHeight() / 2f));
}
}, 100);
String defaultLang = LocaleUtils.DEFAULT_LOCALE.getDisplayName(); String defaultLang = LocaleUtils.DEFAULT_LOCALE.getDisplayName();
SpannableString defaultLangChar = new SpannableString(defaultLang); SpannableString defaultLangChar = new SpannableString(defaultLang);
@ -270,7 +240,7 @@ public class PojavLoginActivity extends BaseActivity
} }
LauncherPreferences.PREF_LANGUAGE = locale.getLanguage(); LauncherPreferences.PREF_LANGUAGE = locale.getLanguage();
LauncherPreferences.DEFAULT_PREF.edit().putString("language", LauncherPreferences.PREF_LANGUAGE).commit(); LauncherPreferences.DEFAULT_PREF.edit().putString("language", LauncherPreferences.PREF_LANGUAGE).apply();
// Restart to apply language change // Restart to apply language change
finish(); finish();
@ -283,7 +253,6 @@ public class PojavLoginActivity extends BaseActivity
edit2 = (EditText) findViewById(R.id.login_edit_email); edit2 = (EditText) findViewById(R.id.login_edit_email);
edit3 = (EditText) findViewById(R.id.login_edit_password); edit3 = (EditText) findViewById(R.id.login_edit_password);
if(prb == null) prb = (ProgressBar) findViewById(R.id.launcherAccProgress);
sRemember = findViewById(R.id.login_switch_remember); sRemember = findViewById(R.id.login_switch_remember);
sOffline = findViewById(R.id.login_switch_offline); sOffline = findViewById(R.id.login_switch_offline);
@ -305,10 +274,6 @@ public class PojavLoginActivity extends BaseActivity
Tools.updateWindowSize(this); Tools.updateWindowSize(this);
if (loginLayout != null && imageLogo != null) {
imageLogo.setTranslationY(loginLayout.getY() - (imageLogo.getHeight() / 2f));
}
// Clear current profile // Clear current profile
PojavProfile.setCurrentProfile(this, null); PojavProfile.setCurrentProfile(this, null);
} }
@ -568,6 +533,7 @@ public class PojavLoginActivity extends BaseActivity
} }
final String tarEntryName = tarEntry.getName(); final String tarEntryName = tarEntry.getName();
runOnUiThread(new Runnable(){ runOnUiThread(new Runnable(){
@SuppressLint("StringFormatInvalid")
@Override @Override
public void run() { public void run() {
startupTextView.setText(getString(R.string.global_unpacking, tarEntryName)); startupTextView.setText(getString(R.string.global_unpacking, tarEntryName));
@ -675,12 +641,8 @@ public class PojavLoginActivity extends BaseActivity
final Dialog accountDialog = new Dialog(PojavLoginActivity.this); final Dialog accountDialog = new Dialog(PojavLoginActivity.this);
int xScreen = PojavLoginActivity.this.getResources().getDisplayMetrics().widthPixels;
int yScreen = PojavLoginActivity.this.getResources().getDisplayMetrics().heightPixels;
accountDialog.setContentView(R.layout.simple_account_list_holder); accountDialog.setContentView(R.layout.simple_account_list_holder);
LinearLayout accountListLayout = accountDialog.findViewById(R.id.accountListLayout); LinearLayout accountListLayout = accountDialog.findViewById(R.id.accountListLayout);
LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE); LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);
@ -764,12 +726,14 @@ public class PojavLoginActivity extends BaseActivity
public void onClick(DialogInterface p1, int p2) { public void onClick(DialogInterface p1, int p2) {
new InvalidateTokenTask(PojavLoginActivity.this).execute(selectedAccName); new InvalidateTokenTask(PojavLoginActivity.this).execute(selectedAccName);
accountListLayout.removeViewsInLayout(accountIndex_final, 1); accountListLayout.removeViewsInLayout(accountIndex_final, 1);
//Resize the window
if (accountListLayout.getChildCount() == 0) { if (accountListLayout.getChildCount() == 0) {
accountDialog.dismiss(); //No need to keep it, since there is no account accountDialog.dismiss(); //No need to keep it, since there is no account
return; return;
} }
accountDialog.getWindow().setLayout((int)(xScreen*0.4),(int) Math.min((yScreen*0.8), (73 + accountListLayout.getChildCount()*55)*(PojavLoginActivity.this.getResources().getDisplayMetrics().densityDpi/160f) )); //Refreshes the layout with the same settings so it take the missing child into account.
accountListLayout.setLayoutParams(accountListLayout.getLayoutParams());
} }
}); });
builder2.setNegativeButton(android.R.string.cancel, null); builder2.setNegativeButton(android.R.string.cancel, null);
@ -778,9 +742,6 @@ public class PojavLoginActivity extends BaseActivity
}); });
} }
//The value 73 and 56 are dp numbers, converted into px in order to resize the layout.
accountDialog.getWindow().setLayout((int)(xScreen*0.4),(int)Math.min((yScreen*0.8), (73 + accountListLayout.getChildCount()*56)*(PojavLoginActivity.this.getResources().getDisplayMetrics().densityDpi/160f) ));
accountDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); accountDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
accountDialog.show(); accountDialog.show();
} }
@ -805,7 +766,7 @@ public class PojavLoginActivity extends BaseActivity
return null; return null;
} }
private MinecraftAccount mProfile = null;
public void loginMC(final View v) public void loginMC(final View v)
{ {
@ -813,8 +774,10 @@ public class PojavLoginActivity extends BaseActivity
mProfile = loginOffline(); mProfile = loginOffline();
playProfile(false); playProfile(false);
} else { } else {
ProgressBar prb = findViewById(R.id.launcherAccProgress);
new LoginTask().setLoginListener(new LoginListener(){ new LoginTask().setLoginListener(new LoginListener(){
@Override @Override
public void onBeforeLogin() { public void onBeforeLogin() {
v.setEnabled(false); v.setEnabled(false);

View File

@ -1,143 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/sign_in_background"
android:scaleType="centerCrop"
android:adjustViewBounds="true"
android:layout_height="match_parent"
android:layout_width="match_parent">
<Spinner
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/login_spinner_language"/>
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="25dp"
android:background="#272727"
android:layout_gravity="center"
android:id="@+id/login_layout_linear">
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/login_online_username_hint"
android:layout_gravity="start"/>
<com.kdt.mcgui.MineEditText
android:imeOptions="flagNoExtractUi"
android:layout_width="match_parent"
android:layout_height="30dp"
android:id="@+id/login_edit_email"
android:inputType="textEmailAddress"
android:layout_marginBottom="5dp"/>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="start"
android:text="@string/login_online_password_hint"/>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="-10dp"
app:passwordToggleEnabled="true"
app:passwordToggleTint="@android:color/white"
>
<com.kdt.mcgui.MineEditText
android:imeOptions="flagNoExtractUi"
android:layout_width="match_parent"
android:layout_height="30dp"
android:id="@+id/login_edit_password"
android:inputType="textPassword"
/>
</com.google.android.material.textfield.TextInputLayout>
<CheckBox
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="start"
android:text="@string/login_online_check_keeplogin"
android:id="@+id/login_switch_remember"/>
<CheckBox
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="start"
android:text="@string/login_offline_label"
android:id="@+id/login_switch_offline"/>
<LinearLayout
android:layout_height="42dp"
android:layout_width="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="10dp"
android:gravity="bottom|center_vertical">
<RelativeLayout
android:layout_height="match_parent"
android:layout_width="210dp"
android:layout_marginRight="10dp">
<com.kdt.mcgui.MineButton
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/mine_button_background"
android:text="@string/login_online_login_label"
android:textColor="@android:color/white"
android:onClick="loginMC"
android:gravity="center"
/>
<ProgressBar
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#88000000"
android:id="@+id/launcherAccProgress"
android:visibility="gone"
android:layout_centerInParent="true"/>
</RelativeLayout>
<com.kdt.mcgui.MineButton
android:layout_width="210dip"
android:layout_height="match_parent"
android:background="@drawable/mine_button_background"
android:text="@string/login_select_account"
android:textColor="@android:color/white"
android:onClick="loginSavedAcc"
/>
</LinearLayout>
<com.kdt.mcgui.MineButton
android:layout_height="42dp"
android:layout_width="match_parent"
android:background="@drawable/mine_button_background"
android:text="@string/login_microsoft"
android:textColor="@android:color/white"
android:onClick="loginMicrosoft"
/>
</LinearLayout>
<ImageView
android:layout_height="48dp"
android:layout_width="300dp"
android:src="@drawable/logo"
android:id="@+id/login_image_logo"
android:layout_gravity="center_horizontal"/>
</FrameLayout>

View File

@ -0,0 +1,188 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guidelineLeft"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:elevation="-10dp"
android:src="@drawable/sign_in_background"
android:scaleType="centerCrop"
/>
<Spinner
android:id="@+id/login_spinner_language"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/login_image_logo"
android:layout_width="300dp"
android:layout_height="48dp"
android:src="@drawable/logo"
app:layout_constraintBottom_toTopOf="@+id/login_menu"
app:layout_constraintEnd_toStartOf="@+id/guidelineLeft"
app:layout_constraintStart_toStartOf="@+id/guidelineLeft"
app:layout_constraintTop_toTopOf="@+id/login_menu" />
<View
android:id="@+id/login_menu"
android:layout_width="0dp"
app:layout_constraintWidth_max="480dp"
android:layout_height="300dp"
android:background="#272727"
android:translationZ="-1dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/login_online_username_hint"
app:layout_constraintBottom_toTopOf="@+id/login_edit_email"
app:layout_constraintStart_toStartOf="@+id/login_edit_email" />
<com.kdt.mcgui.MineEditText
android:id="@+id/login_edit_email"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_margin="25dp"
android:imeOptions="flagNoExtractUi"
android:inputType="textEmailAddress"
app:layout_constraintBottom_toBottomOf="@+id/login_menu"
app:layout_constraintEnd_toEndOf="@+id/login_menu"
app:layout_constraintHorizontal_bias="0.48"
app:layout_constraintStart_toStartOf="@+id/login_menu"
app:layout_constraintTop_toTopOf="@+id/login_menu"
app:layout_constraintVertical_bias="0.088" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/login_online_password_hint"
app:layout_constraintBottom_toTopOf="@+id/textInputLayout"
app:layout_constraintStart_toStartOf="@+id/textInputLayout"
app:layout_constraintTop_toTopOf="@+id/textInputLayout" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="@+id/login_menu"
app:layout_constraintEnd_toEndOf="@+id/login_edit_email"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="@+id/login_edit_email"
app:layout_constraintTop_toBottomOf="@+id/login_edit_email"
app:layout_constraintVertical_bias="0.08"
app:passwordToggleEnabled="true"
app:passwordToggleTint="@android:color/white">
<com.kdt.mcgui.MineEditText
android:id="@+id/login_edit_password"
android:layout_width="match_parent"
android:layout_height="30dp"
android:imeOptions="flagNoExtractUi"
android:inputType="textPassword" />
</com.google.android.material.textfield.TextInputLayout>
<CheckBox
android:id="@+id/login_switch_remember"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:text="@string/login_online_check_keeplogin"
app:layout_constraintStart_toStartOf="@+id/textInputLayout"
app:layout_constraintTop_toBottomOf="@+id/textInputLayout" />
<CheckBox
android:id="@+id/login_switch_offline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:text="@string/login_offline_label"
app:layout_constraintStart_toStartOf="@+id/login_switch_remember"
app:layout_constraintTop_toBottomOf="@+id/login_switch_remember" />
<com.kdt.mcgui.MineButton
android:id="@+id/mineButton"
android:layout_width="0dp"
android:layout_height="42dp"
android:layout_marginRight="5dp"
android:background="@drawable/mine_button_background"
android:onClick="loginMC"
android:text="@string/login_online_login_label"
android:textColor="@android:color/white"
app:layout_constraintEnd_toStartOf="@+id/guidelineLeft"
app:layout_constraintStart_toStartOf="@+id/login_switch_offline"
app:layout_constraintTop_toBottomOf="@+id/login_switch_offline" />
<ProgressBar
android:id="@+id/launcherAccProgress"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="#88000000"
android:elevation="1dp"
android:translationZ="1dp"
android:visibility="invisible"
app:layout_constraintTop_toTopOf="@+id/mineButton"
app:layout_constraintBottom_toBottomOf="@+id/mineButton"
app:layout_constraintEnd_toEndOf="@+id/mineButton"
app:layout_constraintStart_toStartOf="@+id/mineButton"/>
<com.kdt.mcgui.MineButton
android:id="@+id/mineButton2"
android:layout_width="0dp"
android:layout_height="42dp"
android:layout_marginLeft="5dp"
android:background="@drawable/mine_button_background"
android:onClick="loginSavedAcc"
android:text="@string/login_select_account"
android:textColor="@android:color/white"
app:layout_constraintBottom_toBottomOf="@+id/mineButton"
app:layout_constraintEnd_toEndOf="@+id/textInputLayout"
app:layout_constraintStart_toStartOf="@+id/guidelineLeft"
app:layout_constraintTop_toTopOf="@+id/mineButton" />
<com.kdt.mcgui.MineButton
android:layout_width="0dp"
android:layout_height="42dp"
android:background="@drawable/mine_button_background"
android:onClick="loginMicrosoft"
android:text="@string/login_microsoft"
android:textColor="@android:color/white"
app:layout_constraintBottom_toBottomOf="@+id/login_menu"
app:layout_constraintEnd_toEndOf="@+id/mineButton2"
app:layout_constraintStart_toStartOf="@+id/mineButton"
app:layout_constraintTop_toBottomOf="@+id/mineButton" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -205,20 +205,6 @@
app:layout_constraintStart_toStartOf="@+id/guidelineLeft" app:layout_constraintStart_toStartOf="@+id/guidelineLeft"
tools:visibility="visible" /> tools:visibility="visible" />
<TextView
android:id="@+id/lMTVVer"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:gravity="center"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/main_version"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="12sp"
app:layout_constraintBottom_toTopOf="@+id/guidelineBottom2"
app:layout_constraintStart_toStartOf="@+id/guidelineLeft"
app:layout_constraintTop_toTopOf="@+id/guidelineBottom" />
<Spinner <Spinner
android:id="@+id/launchermain_spinner_version" android:id="@+id/launchermain_spinner_version"
@ -226,15 +212,19 @@
android:layout_height="0dp" android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@+id/guidelineBottom2" app:layout_constraintBottom_toTopOf="@+id/guidelineBottom2"
app:layout_constraintEnd_toStartOf="@+id/launchermainPlayButton" app:layout_constraintEnd_toStartOf="@+id/launchermainPlayButton"
app:layout_constraintStart_toEndOf="@+id/lMTVVer" app:layout_constraintStart_toStartOf="@+id/guidelineLeft"
app:layout_constraintTop_toTopOf="@+id/guidelineBottom" /> app:layout_constraintTop_toTopOf="@+id/guidelineBottom" />
<Button <Button
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:onClick="launcherMenu" android:onClick="launcherMenu"
android:text="@string/main_options" android:text="@string/main_options"
style="?android:attr/buttonBarButtonStyle"
android:background="?attr/selectableItemBackground"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/launchermainPlayButton" app:layout_constraintEnd_toStartOf="@+id/launchermainPlayButton"
app:layout_constraintStart_toStartOf="@+id/guidelineLeft" app:layout_constraintStart_toStartOf="@+id/guidelineLeft"
@ -259,8 +249,8 @@
<TextView <TextView
android:id="@+id/launchermain_text_welcome" android:id="@+id/launchermain_text_welcome"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="20dp" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:text="@string/main_welcome" android:text="@string/main_welcome"
android:textSize="12sp" android:textSize="12sp"
@ -285,22 +275,13 @@
app:layout_constraintStart_toEndOf="@+id/launchermainPlayButton" app:layout_constraintStart_toEndOf="@+id/launchermainPlayButton"
app:layout_constraintTop_toBottomOf="@+id/launchermain_text_welcome" /> app:layout_constraintTop_toBottomOf="@+id/launchermain_text_welcome" />
<Button
android:id="@+id/infoDevBtn"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="0dp"
android:onClick="mcaccSwitchUser"
android:text="@string/main_infodev"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/guidelineRight"
app:layout_constraintStart_toEndOf="@+id/launchermainPlayButton"
app:layout_constraintTop_toTopOf="@+id/guidelineBottom2" />
<Button <Button
android:id="@+id/switchUserBtn" android:id="@+id/switchUserBtn"
style="?android:attr/buttonBarButtonStyle" style="?android:attr/buttonBarButtonStyle"
android:background="?attr/selectableItemBackground"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:onClick="mcaccLogout" android:onClick="mcaccLogout"
@ -308,7 +289,7 @@
android:textSize="12sp" android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/guidelineRight" app:layout_constraintStart_toEndOf="@+id/launchermainPlayButton"
app:layout_constraintTop_toTopOf="@+id/guidelineBottom2" /> app:layout_constraintTop_toTopOf="@+id/guidelineBottom2" />
<View <View

View File

@ -3,19 +3,21 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:background="#424242" android:background="#424242"
android:layout_width="match_parent" android:layout_width="300dp"
android:layout_height="match_parent"> android:layout_height="match_parent">
<TextView <TextView
android:id="@+id/TextViewTitle" android:id="@+id/TextViewTitle"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingTop="20dp"
android:paddingTop="15dp"
android:paddingBottom="20dp" android:paddingBottom="20dp"
android:textSize="26sp" android:textSize="26sp"
android:textStyle="bold" android:textStyle="bold"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:gravity="center"
android:text="@string/login_select_account" android:text="@string/login_select_account"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
@ -25,8 +27,10 @@
<ScrollView <ScrollView
android:id="@+id/accountScrollView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="wrap_content"
app:layout_constraintHeight_max="200dp"
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.0" app:layout_constraintHorizontal_bias="0.0"
@ -36,7 +40,8 @@
<LinearLayout <LinearLayout
android:id="@+id/accountListLayout" android:id="@+id/accountListLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="100dp"
android:maxHeight="100dp"
android:layout_marginStart="0dp" android:layout_marginStart="0dp"
android:layout_marginTop="0dp" android:layout_marginTop="0dp"
android:layout_marginEnd="0dp" android:layout_marginEnd="0dp"

View File

@ -8,7 +8,7 @@
<TextView <TextView
android:id="@+id/accountitem_text_name" android:id="@+id/accountitem_text_name"
android:layout_width="0dp" android:layout_width="240dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
android:gravity="center_vertical" android:gravity="center_vertical"