From d02e5cdff2ef4bd9a3791c7a88212c8bb721e37c Mon Sep 17 00:00:00 2001 From: khanhduytran0 Date: Mon, 3 Aug 2020 09:25:32 +0700 Subject: [PATCH] Little compatible with dark theme; Attempt to bring Minecraft logo as similar as Minecraft Launcher PC --- .../kdt/pojavlaunch/PojavLoginActivity.java | 12 +- app/src/main/res/layout/launcher_login_v2.xml | 181 ++++++++---------- app/src/main/res/layout/launcher_main.xml | 1 - 3 files changed, 92 insertions(+), 102 deletions(-) diff --git a/app/src/main/java/net/kdt/pojavlaunch/PojavLoginActivity.java b/app/src/main/java/net/kdt/pojavlaunch/PojavLoginActivity.java index 73281ea83..773dc69f0 100644 --- a/app/src/main/java/net/kdt/pojavlaunch/PojavLoginActivity.java +++ b/app/src/main/java/net/kdt/pojavlaunch/PojavLoginActivity.java @@ -234,12 +234,16 @@ public class PojavLoginActivity extends AppCompatActivity private void uiInit() { setContentView(R.layout.launcher_login_v2); - edit2 = (EditText) findViewById(R.id.launcherAccEmail); - edit3 = (EditText) findViewById(R.id.launcherAccPassword); + LinearLayout loginLayout = findViewById(R.id.login_layout_linear); + ImageView imageLogo = findViewById(R.id.login_image_logo); + imageLogo.setTranslationY(loginLayout.getY() - (imageLogo.getHeight() / 4f)); + + edit2 = (EditText) findViewById(R.id.login_edit_email); + edit3 = (EditText) findViewById(R.id.login_edit_password); if(prb == null) prb = (ProgressBar) findViewById(R.id.launcherAccProgress); - sRemember = (Switch) findViewById(R.id.launcherAccRememberSwitch); - sOffline = (Switch) findViewById(R.id.launcherAccOffSwitch); + sRemember = (Switch) findViewById(R.id.login_switch_remember); + sOffline = (Switch) findViewById(R.id.login_switch_offline); sOffline.setOnCheckedChangeListener(new OnCheckedChangeListener(){ @Override diff --git a/app/src/main/res/layout/launcher_login_v2.xml b/app/src/main/res/layout/launcher_login_v2.xml index 058163bd8..e57cfa72c 100644 --- a/app/src/main/res/layout/launcher_login_v2.xml +++ b/app/src/main/res/layout/launcher_login_v2.xml @@ -11,117 +11,104 @@ android:adjustViewBounds="true" android:background="@drawable/sign_in_background"/> - + android:layout_height="wrap_content" + android:gravity="center" + android:padding="25dp" + android:background="#272727" + android:layout_gravity="center" + android:id="@+id/login_layout_linear"> - + android:layout_width="wrap_content" + android:text="@string/login_online_username_hint" + android:layout_gravity="left"/> - + - + - + + + + + + + + + + + android:layout_height="match_parent" + android:text="@string/login_online_login_label" + android:onClick="loginMC" + android:gravity="center"/> - - - + android:layout_height="match_parent" + android:background="#88000000" + android:id="@+id/launcherAccProgress" + android:visibility="gone" + android:layout_centerInParent="true"/> - + - + - + - + - - - - - - - - - - - - - - - - - + diff --git a/app/src/main/res/layout/launcher_main.xml b/app/src/main/res/layout/launcher_main.xml index 30570e379..0a49620ce 100644 --- a/app/src/main/res/layout/launcher_main.xml +++ b/app/src/main/res/layout/launcher_main.xml @@ -36,7 +36,6 @@ android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="#EEEEEE" android:gravity="center_horizontal">