mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-13 06:39:54 -04:00
Design [Login screen]: Logo are half in another layout now; Add Minecraft-Ten font
This commit is contained in:
parent
d02e5cdff2
commit
efffa26f2f
BIN
app/src/main/assets/font/minecraft-ten.ttf
Normal file
BIN
app/src/main/assets/font/minecraft-ten.ttf
Normal file
Binary file not shown.
@ -7,9 +7,12 @@ import android.util.*;
|
|||||||
import android.view.*;
|
import android.view.*;
|
||||||
import android.widget.*;
|
import android.widget.*;
|
||||||
import android.view.View.*;
|
import android.view.View.*;
|
||||||
|
import net.kdt.pojavlaunch.*;
|
||||||
|
|
||||||
public class MineButton extends Button
|
public class MineButton extends Button
|
||||||
{
|
{
|
||||||
|
private static FontChanger fontChangerMinecraftTen;
|
||||||
|
|
||||||
private ColorDrawable left = new ColorDrawable(Color.parseColor("#80000000"));
|
private ColorDrawable left = new ColorDrawable(Color.parseColor("#80000000"));
|
||||||
private ColorDrawable top = new ColorDrawable(Color.parseColor("#64FC20"));
|
private ColorDrawable top = new ColorDrawable(Color.parseColor("#64FC20"));
|
||||||
private ColorDrawable right = new ColorDrawable(Color.parseColor("#40000000"));
|
private ColorDrawable right = new ColorDrawable(Color.parseColor("#40000000"));
|
||||||
@ -42,20 +45,19 @@ public class MineButton extends Button
|
|||||||
|
|
||||||
private LayerDrawable layerdrawable, layerdrawablefocus;
|
private LayerDrawable layerdrawable, layerdrawablefocus;
|
||||||
|
|
||||||
public MineButton(Context ctx)
|
public MineButton(Context ctx) {
|
||||||
{
|
this(ctx, null);
|
||||||
super(ctx);
|
|
||||||
init();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MineButton(Context ctx, AttributeSet attrs)
|
public MineButton(Context ctx, AttributeSet attrs) {
|
||||||
{
|
|
||||||
super(ctx, attrs);
|
super(ctx, attrs);
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void init()
|
public void init()
|
||||||
{
|
{
|
||||||
|
if (fontChangerMinecraftTen == null) fontChangerMinecraftTen = new FontChanger(getContext().getAssets(), "font/minecraft-ten.ttf");
|
||||||
|
fontChangerMinecraftTen.replaceFont(this);
|
||||||
getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onGlobalLayout() {
|
public void onGlobalLayout() {
|
||||||
|
@ -9,13 +9,11 @@ public class FontChanger
|
|||||||
{
|
{
|
||||||
private Typeface typeface;
|
private Typeface typeface;
|
||||||
|
|
||||||
public FontChanger(Typeface typeface)
|
public FontChanger(Typeface typeface) {
|
||||||
{
|
|
||||||
this.typeface = typeface;
|
this.typeface = typeface;
|
||||||
}
|
}
|
||||||
|
|
||||||
public FontChanger(AssetManager assets, String assetsFontFileName)
|
public FontChanger(AssetManager assets, String assetsFontFileName) {
|
||||||
{
|
|
||||||
typeface = Typeface.createFromAsset(assets, assetsFontFileName);
|
typeface = Typeface.createFromAsset(assets, assetsFontFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,9 +234,14 @@ public class PojavLoginActivity extends AppCompatActivity
|
|||||||
private void uiInit() {
|
private void uiInit() {
|
||||||
setContentView(R.layout.launcher_login_v2);
|
setContentView(R.layout.launcher_login_v2);
|
||||||
|
|
||||||
LinearLayout loginLayout = findViewById(R.id.login_layout_linear);
|
final LinearLayout loginLayout = findViewById(R.id.login_layout_linear);
|
||||||
ImageView imageLogo = findViewById(R.id.login_image_logo);
|
final ImageView imageLogo = findViewById(R.id.login_image_logo);
|
||||||
imageLogo.setTranslationY(loginLayout.getY() - (imageLogo.getHeight() / 4f));
|
loginLayout.postDelayed(new Runnable(){
|
||||||
|
@Override
|
||||||
|
public void run(){
|
||||||
|
imageLogo.setTranslationY(loginLayout.getY() - (imageLogo.getHeight() / 2f));
|
||||||
|
}
|
||||||
|
}, 100);
|
||||||
|
|
||||||
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);
|
||||||
|
@ -106,7 +106,6 @@
|
|||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
android:layout_width="300dp"
|
android:layout_width="300dp"
|
||||||
android:src="@drawable/logo"
|
android:src="@drawable/logo"
|
||||||
android:layout_centerInParent="true"
|
|
||||||
android:id="@+id/login_image_logo"
|
android:id="@+id/login_image_logo"
|
||||||
android:layout_gravity="center_horizontal"/>
|
android:layout_gravity="center_horizontal"/>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user