mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-20 13:30:15 -07:00
- Added a new option: Hide SideBar ! Requres a UI restart for now.
This commit is contained in:
parent
e47301a811
commit
a2e383c5e5
5 changed files with 34 additions and 0 deletions
|
|
@ -16,6 +16,8 @@ import android.widget.Spinner;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.constraintlayout.widget.Guideline;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import net.kdt.pojavlaunch.fragments.ConsoleFragment;
|
||||
|
|
@ -28,6 +30,8 @@ import java.io.File;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static net.kdt.pojavlaunch.prefs.LauncherPreferences.PREF_HIDE_SIDEBAR;
|
||||
|
||||
public class PojavLauncherActivity extends BaseLauncherActivity
|
||||
{
|
||||
|
||||
|
|
@ -199,6 +203,7 @@ public class PojavLauncherActivity extends BaseLauncherActivity
|
|||
statusIsLaunching(false);
|
||||
|
||||
initTabs(0);
|
||||
restoreOldLook(PREF_HIDE_SIDEBAR);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -265,5 +270,23 @@ public class PojavLauncherActivity extends BaseLauncherActivity
|
|||
}, 500);
|
||||
}
|
||||
|
||||
private void restoreOldLook(boolean oldLookState){
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue