mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-19 01:27:18 -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){
|
private void restoreOldLook(boolean oldLookState){
|
||||||
|
Guideline guideLine = findViewById(R.id.guidelineLeft);
|
||||||
|
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) guideLine.getLayoutParams();
|
||||||
if(oldLookState){
|
if(oldLookState){
|
||||||
//UI v1 Style
|
//UI v1 Style
|
||||||
//Hide the sidebar
|
//Hide the sidebar
|
||||||
Guideline guideLine = findViewById(R.id.guidelineLeft);
|
|
||||||
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) guideLine.getLayoutParams();
|
|
||||||
params.guidePercent = 0; // 0%, range: 0 <-> 1
|
params.guidePercent = 0; // 0%, range: 0 <-> 1
|
||||||
guideLine.setLayoutParams(params);
|
|
||||||
|
|
||||||
//Remove the selected Tab
|
//Remove the selected Tab
|
||||||
selected.setVisibility(View.GONE);
|
selected.setVisibility(View.GONE);
|
||||||
|
|
||||||
//Enlarge the button, but just a bit.
|
//Enlarge the button, but just a bit.
|
||||||
params = (ConstraintLayout.LayoutParams) mPlayButton.getLayoutParams();
|
params = (ConstraintLayout.LayoutParams) mPlayButton.getLayoutParams();
|
||||||
params.width = (int)(params.width*1.80);
|
params.matchConstraintPercentWidth = 0.35f;
|
||||||
mPlayButton.setLayoutParams(params);
|
|
||||||
}else{
|
}else{
|
||||||
//UI v2 Style
|
//UI v2 Style
|
||||||
//Show the sidebar back
|
//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
|
params.guidePercent = 0.23f; // 23%, range: 0 <-> 1
|
||||||
guideLine.setLayoutParams(params);
|
guideLine.setLayoutParams(params);
|
||||||
|
|
||||||
@ -312,12 +308,9 @@ public class PojavLauncherActivity extends BaseLauncherActivity
|
|||||||
|
|
||||||
//Set the default button size
|
//Set the default button size
|
||||||
params = (ConstraintLayout.LayoutParams) mPlayButton.getLayoutParams();
|
params = (ConstraintLayout.LayoutParams) mPlayButton.getLayoutParams();
|
||||||
params.width = (int) TypedValue.applyDimension(
|
params.matchConstraintPercentWidth = 0.25f;
|
||||||
TypedValue.COMPLEX_UNIT_DIP,
|
}
|
||||||
160,
|
|
||||||
getResources().getDisplayMetrics());
|
|
||||||
mPlayButton.setLayoutParams(params);
|
mPlayButton.setLayoutParams(params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -242,14 +242,15 @@
|
|||||||
|
|
||||||
<com.kdt.mcgui.MineButton
|
<com.kdt.mcgui.MineButton
|
||||||
android:id="@+id/launchermainPlayButton"
|
android:id="@+id/launchermainPlayButton"
|
||||||
android:layout_width="160dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:onClick="launchGame"
|
android:onClick="launchGame"
|
||||||
android:text="@string/main_play"
|
android:text="@string/main_play"
|
||||||
|
app:layout_constraintWidth_default="percent"
|
||||||
|
app:layout_constraintWidth_percent="0.25"
|
||||||
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.5"
|
|
||||||
app:layout_constraintStart_toStartOf="@+id/guidelineLeft"
|
app:layout_constraintStart_toStartOf="@+id/guidelineLeft"
|
||||||
app:layout_constraintTop_toTopOf="@+id/guidelineBottom" />
|
app:layout_constraintTop_toTopOf="@+id/guidelineBottom" />
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user