mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-17 08:35:37 -04:00
Merge pull request #679 from serpentspirale/v3_openjdk
Fix improper play button size on big screen devices, such as tablets
This commit is contained in:
commit
b6da9961dd
@ -284,26 +284,22 @@ public class PojavLauncherActivity extends BaseLauncherActivity
|
||||
}
|
||||
|
||||
private void restoreOldLook(boolean oldLookState){
|
||||
Guideline guideLine = findViewById(R.id.guidelineLeft);
|
||||
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) guideLine.getLayoutParams();
|
||||
if(oldLookState){
|
||||
//UI v1 Style
|
||||
//Hide the sidebar
|
||||
Guideline guideLine = findViewById(R.id.guidelineLeft);
|
||||
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) guideLine.getLayoutParams();
|
||||
params.guidePercent = 0; // 0%, range: 0 <-> 1
|
||||
guideLine.setLayoutParams(params);
|
||||
|
||||
//Remove the selected Tab
|
||||
selected.setVisibility(View.GONE);
|
||||
|
||||
//Enlarge the button, but just a bit.
|
||||
params = (ConstraintLayout.LayoutParams) mPlayButton.getLayoutParams();
|
||||
params.width = (int)(params.width*1.80);
|
||||
mPlayButton.setLayoutParams(params);
|
||||
params.matchConstraintPercentWidth = 0.35f;
|
||||
}else{
|
||||
//UI v2 Style
|
||||
//Show the sidebar back
|
||||
Guideline guideLine = findViewById(R.id.guidelineLeft);
|
||||
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) guideLine.getLayoutParams();
|
||||
params.guidePercent = 0.23f; // 23%, range: 0 <-> 1
|
||||
guideLine.setLayoutParams(params);
|
||||
|
||||
@ -312,12 +308,9 @@ public class PojavLauncherActivity extends BaseLauncherActivity
|
||||
|
||||
//Set the default button size
|
||||
params = (ConstraintLayout.LayoutParams) mPlayButton.getLayoutParams();
|
||||
params.width = (int) TypedValue.applyDimension(
|
||||
TypedValue.COMPLEX_UNIT_DIP,
|
||||
160,
|
||||
getResources().getDisplayMetrics());
|
||||
mPlayButton.setLayoutParams(params);
|
||||
params.matchConstraintPercentWidth = 0.25f;
|
||||
}
|
||||
mPlayButton.setLayoutParams(params);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -242,14 +242,15 @@
|
||||
|
||||
<com.kdt.mcgui.MineButton
|
||||
android:id="@+id/launchermainPlayButton"
|
||||
android:layout_width="160dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:onClick="launchGame"
|
||||
android:text="@string/main_play"
|
||||
app:layout_constraintWidth_default="percent"
|
||||
app:layout_constraintWidth_percent="0.25"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="@+id/guidelineLeft"
|
||||
app:layout_constraintTop_toTopOf="@+id/guidelineBottom" />
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user