mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-17 00:29:50 -04:00
- Fixed heads not being DPI aware
This commit is contained in:
parent
cf7a5ec357
commit
35b5941387
@ -32,6 +32,7 @@ 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;
|
||||||
@ -651,6 +652,7 @@ public class PojavLoginActivity extends BaseActivity
|
|||||||
View child = inflater.inflate(R.layout.simple_account_list_item, null);
|
View child = inflater.inflate(R.layout.simple_account_list_item, null);
|
||||||
TextView accountName = child.findViewById(R.id.accountitem_text_name);
|
TextView accountName = child.findViewById(R.id.accountitem_text_name);
|
||||||
ImageButton removeButton = child.findViewById(R.id.accountitem_button_remove);
|
ImageButton removeButton = child.findViewById(R.id.accountitem_button_remove);
|
||||||
|
ImageView imageView = child.findViewById(R.id.account_head);
|
||||||
|
|
||||||
String accNameStr = s.substring(0, s.length() - 5);
|
String accNameStr = s.substring(0, s.length() - 5);
|
||||||
String skinFaceBase64 = MinecraftAccount.load(accNameStr).skinFaceBase64;
|
String skinFaceBase64 = MinecraftAccount.load(accNameStr).skinFaceBase64;
|
||||||
@ -658,8 +660,8 @@ public class PojavLoginActivity extends BaseActivity
|
|||||||
byte[] faceIconBytes = Base64.decode(skinFaceBase64, Base64.DEFAULT);
|
byte[] faceIconBytes = Base64.decode(skinFaceBase64, Base64.DEFAULT);
|
||||||
Bitmap bitmap = BitmapFactory.decodeByteArray(faceIconBytes, 0, faceIconBytes.length);
|
Bitmap bitmap = BitmapFactory.decodeByteArray(faceIconBytes, 0, faceIconBytes.length);
|
||||||
|
|
||||||
accountName.setCompoundDrawablesWithIntrinsicBounds(new BitmapDrawable(getResources(),
|
imageView.setImageDrawable(new BitmapDrawable(getResources(),
|
||||||
bitmap), null, null, null);
|
bitmap));
|
||||||
}
|
}
|
||||||
accountName.setText(accNameStr);
|
accountName.setText(accNameStr);
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
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:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -8,20 +7,19 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/accountitem_text_name"
|
android:id="@+id/accountitem_text_name"
|
||||||
android:layout_width="240dp"
|
android:layout_width="185dp"
|
||||||
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"
|
||||||
|
android:maxHeight="?android:attr/listPreferredItemHeightSmall"
|
||||||
android:minHeight="?android:attr/listPreferredItemHeightSmall"
|
android:minHeight="?android:attr/listPreferredItemHeightSmall"
|
||||||
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
|
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
|
||||||
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
|
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
|
||||||
android:text="Name Placeholder"
|
|
||||||
|
|
||||||
|
android:text="Name Placeholder"
|
||||||
android:textAppearance="?android:attr/textAppearanceListItemSmall"
|
android:textAppearance="?android:attr/textAppearanceListItemSmall"
|
||||||
android:drawablePadding="20dp"
|
|
||||||
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/accountitem_button_remove"
|
app:layout_constraintEnd_toStartOf="@+id/accountitem_button_remove"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
@ -37,5 +35,15 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:srcCompat="@drawable/ic_remove" />
|
app:srcCompat="@drawable/ic_remove" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/account_head"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:maxHeight="?android:attr/listPreferredItemHeightSmall"
|
||||||
|
android:minHeight="?android:attr/listPreferredItemHeightSmall"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/accountitem_text_name"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:srcCompat="@tools:sample/avatars" />
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user