mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-21 09:01:56 -07:00
- Removed all traces of the UI V1 in the code, the PojavLauncherActivity now uses the revamped layout.
- Started to revamp the select account UI as well
This commit is contained in:
parent
7f5d419641
commit
c453815e80
11 changed files with 246 additions and 757 deletions
|
|
@ -75,10 +75,7 @@ public abstract class BaseLauncherActivity extends BaseActivity {
|
|||
case 2: // Custom controls
|
||||
startActivity(new Intent(BaseLauncherActivity.this, CustomControlsActivity.class));
|
||||
break;
|
||||
case 3: // Settings
|
||||
startActivity(new Intent(BaseLauncherActivity.this, LauncherPreferenceActivity.class));
|
||||
break;
|
||||
case 4: { // About
|
||||
case 3: { // About
|
||||
final AlertDialog.Builder aboutB = new AlertDialog.Builder(BaseLauncherActivity.this);
|
||||
aboutB.setTitle(R.string.mcl_option_about);
|
||||
try {
|
||||
|
|
@ -224,6 +221,7 @@ public abstract class BaseLauncherActivity extends BaseActivity {
|
|||
if(CrashFragment.isNewCrash(lastCrashFile) || !mCrashView.getLastCrash().isEmpty()){
|
||||
mCrashView.resetCrashLog = false;
|
||||
selectTabPage(2);
|
||||
|
||||
} /*else throw new Exception();*/
|
||||
} catch(Throwable e) {
|
||||
e.printStackTrace();
|
||||
|
|
@ -239,5 +237,4 @@ public abstract class BaseLauncherActivity extends BaseActivity {
|
|||
}
|
||||
|
||||
protected abstract void selectTabPage(int pageIndex);
|
||||
protected abstract float updateWidthHeight();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,170 +0,0 @@
|
|||
package net.kdt.pojavlaunch;
|
||||
|
||||
import android.os.*;
|
||||
|
||||
import androidx.core.app.*;
|
||||
import androidx.core.view.*;
|
||||
import androidx.appcompat.app.*;
|
||||
|
||||
import android.view.*;
|
||||
import android.widget.*;
|
||||
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
import net.kdt.pojavlaunch.fragments.*;
|
||||
|
||||
import org.lwjgl.glfw.*;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import android.support.design.widget.VerticalTabLayout.*;
|
||||
|
||||
//import android.support.v7.view.menu.*;
|
||||
//import net.zhuoweizhang.boardwalk.downloader.*;
|
||||
|
||||
public class MCLauncherActivity extends BaseLauncherActivity
|
||||
{
|
||||
//private FragmentTabHost mTabHost;
|
||||
private LinearLayout fullTab;
|
||||
/*
|
||||
private PojavLauncherViewPager viewPager;
|
||||
private VerticalTabLayout tabLayout;
|
||||
*/
|
||||
|
||||
private ViewPager viewPager;
|
||||
private TabLayout tabLayout;
|
||||
|
||||
private TextView tvUsernameView;
|
||||
private ViewPagerAdapter viewPageAdapter;
|
||||
|
||||
private Button switchUsrBtn, logoutBtn; // MineButtons
|
||||
private ViewGroup leftView, rightView;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
if (BuildConfig.DEBUG) {
|
||||
Toast.makeText(this, "Launcher process id: " + android.os.Process.myPid(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
setContentView(R.layout.launcher_main);
|
||||
|
||||
fullTab = findViewById(R.id.launchermainFragmentTabView);
|
||||
tabLayout = findViewById(R.id.launchermainTabLayout);
|
||||
viewPager = findViewById(R.id.launchermainTabPager);
|
||||
|
||||
mConsoleView = new ConsoleFragment();
|
||||
mCrashView = new CrashFragment();
|
||||
|
||||
viewPageAdapter = new ViewPagerAdapter(getSupportFragmentManager());
|
||||
|
||||
viewPageAdapter.addFragment(new LauncherFragment(), 0, getStr(R.string.mcl_tab_news));
|
||||
viewPageAdapter.addFragment(mConsoleView, 0, getStr(R.string.mcl_tab_console));
|
||||
viewPageAdapter.addFragment(mCrashView, 0, getStr(R.string.mcl_tab_crash));
|
||||
|
||||
viewPager.setAdapter(viewPageAdapter);
|
||||
tabLayout.setupWithViewPager(viewPager);
|
||||
|
||||
tvUsernameView = (TextView) findViewById(R.id.launchermain_text_welcome);
|
||||
mTextVersion = (TextView) findViewById(R.id.launcherMainVersionView);
|
||||
|
||||
try {
|
||||
mProfile = PojavProfile.getCurrentProfileContent(this);
|
||||
|
||||
tvUsernameView.setText(getString(R.string.main_welcome, mProfile.username));
|
||||
} catch(Exception e) {
|
||||
Tools.showError(this, e);
|
||||
}
|
||||
|
||||
//showProfileInfo();
|
||||
|
||||
List<String> versions = new ArrayList<String>();
|
||||
final File fVers = new File(Tools.DIR_HOME_VERSION);
|
||||
|
||||
try {
|
||||
if (fVers.listFiles().length < 1) {
|
||||
throw new Exception(getStr(R.string.error_no_version));
|
||||
}
|
||||
|
||||
for (File fVer : fVers.listFiles()) {
|
||||
if (fVer.isDirectory())
|
||||
versions.add(fVer.getName());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
versions.add(getStr(R.string.global_error) + ":");
|
||||
versions.add(e.getMessage());
|
||||
|
||||
} finally {
|
||||
mAvailableVersions = versions.toArray(new String[0]);
|
||||
}
|
||||
|
||||
//availableVersions;
|
||||
|
||||
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, mAvailableVersions);
|
||||
adapter.setDropDownViewResource(android.R.layout.simple_list_item_single_choice);
|
||||
mVersionSelector = (Spinner) findViewById(R.id.launcherMainSelectVersion);
|
||||
mVersionSelector.setAdapter(adapter);
|
||||
|
||||
mLaunchProgress = (ProgressBar) findViewById(R.id.progressDownloadBar);
|
||||
mLaunchTextStatus = (TextView) findViewById(R.id.progressDownloadText);
|
||||
LinearLayout exitLayout = (LinearLayout) findViewById(R.id.launcherMainExitbtns);
|
||||
switchUsrBtn = (Button) exitLayout.getChildAt(0);
|
||||
logoutBtn = (Button) exitLayout.getChildAt(1);
|
||||
|
||||
leftView = (LinearLayout) findViewById(R.id.launcherMainLeftLayout);
|
||||
mPlayButton = (Button) findViewById(R.id.launcherMainPlayButton);
|
||||
rightView = (ViewGroup) findViewById(R.id.launcherMainRightLayout);
|
||||
|
||||
statusIsLaunching(false);
|
||||
}
|
||||
// DEBUG
|
||||
//new android.support.design.widget.NavigationView(this);
|
||||
|
||||
private String getStr(int id, Object... val) {
|
||||
if (val != null && val.length > 0) {
|
||||
return getResources().getString(id, val);
|
||||
} else {
|
||||
return getResources().getString(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float updateWidthHeight() {
|
||||
float leftRightWidth = (float) CallbackBridge.windowWidth / 100f * 32f;
|
||||
float mPlayButtonWidth = CallbackBridge.windowWidth - leftRightWidth * 2f;
|
||||
LinearLayout.LayoutParams leftRightParams = new LinearLayout.LayoutParams((int) leftRightWidth, (int) Tools.dpToPx(CallbackBridge.windowHeight / 9));
|
||||
LinearLayout.LayoutParams mPlayButtonParams = new LinearLayout.LayoutParams((int) mPlayButtonWidth, (int) Tools.dpToPx(CallbackBridge.windowHeight / 9));
|
||||
leftView.setLayoutParams(leftRightParams);
|
||||
rightView.setLayoutParams(leftRightParams);
|
||||
mPlayButton.setLayoutParams(mPlayButtonParams);
|
||||
|
||||
return leftRightWidth;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void selectTabPage(int pageIndex) {
|
||||
if (tabLayout.getSelectedTabPosition() != pageIndex) {
|
||||
tabLayout.setScrollPosition(pageIndex,0f,true);
|
||||
viewPager.setCurrentItem(pageIndex);
|
||||
}
|
||||
}
|
||||
|
||||
public void statusIsLaunching(boolean isLaunching) {
|
||||
LinearLayout.LayoutParams reparam = new LinearLayout.LayoutParams((int) updateWidthHeight(), LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
ViewGroup.MarginLayoutParams lmainTabParam = (ViewGroup.MarginLayoutParams) fullTab.getLayoutParams();
|
||||
int launchVisibility = isLaunching ? View.VISIBLE : View.GONE;
|
||||
mLaunchProgress.setVisibility(launchVisibility);
|
||||
mLaunchTextStatus.setVisibility(launchVisibility);
|
||||
lmainTabParam.bottomMargin = reparam.height;
|
||||
leftView.setLayoutParams(reparam);
|
||||
|
||||
switchUsrBtn.setEnabled(!isLaunching);
|
||||
logoutBtn.setEnabled(!isLaunching);
|
||||
mVersionSelector.setEnabled(!isLaunching);
|
||||
canBack = !isLaunching;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,86 +1,96 @@
|
|||
package net.kdt.pojavlaunch;
|
||||
|
||||
import android.os.*;
|
||||
import android.support.design.widget.*;
|
||||
import android.support.design.widget.VerticalTabLayout.*;
|
||||
import androidx.core.view.*;
|
||||
import androidx.appcompat.app.*;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Bundle;
|
||||
import android.support.design.widget.VerticalTabLayout.ViewPagerAdapter;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import android.util.*;
|
||||
import android.view.*;
|
||||
import android.widget.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
import net.kdt.pojavlaunch.fragments.*;
|
||||
import net.kdt.pojavlaunch.prefs.*;
|
||||
|
||||
import org.lwjgl.glfw.*;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import net.kdt.pojavlaunch.value.*;
|
||||
//import android.support.v7.view.menu.*;
|
||||
//import net.zhuoweizhang.boardwalk.downloader.*;
|
||||
|
||||
import net.kdt.pojavlaunch.fragments.ConsoleFragment;
|
||||
import net.kdt.pojavlaunch.fragments.CrashFragment;
|
||||
import net.kdt.pojavlaunch.fragments.LauncherFragment;
|
||||
import net.kdt.pojavlaunch.prefs.LauncherPreferenceFragment;
|
||||
import net.kdt.pojavlaunch.value.MinecraftAccount;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PojavLauncherActivity extends BaseLauncherActivity
|
||||
{
|
||||
//private FragmentTabHost mTabHost;
|
||||
private LinearLayout fullTab, leftTab;
|
||||
/*
|
||||
private PojavLauncherViewPager viewPager;
|
||||
private VerticalTabLayout tabLayout;
|
||||
*/
|
||||
|
||||
private ViewPager viewPager;
|
||||
private VerticalTabLayout tabLayout;
|
||||
|
||||
private TextView tvUsernameView;
|
||||
private Spinner accountSelector;
|
||||
private ViewPagerAdapter viewPageAdapter;
|
||||
private final Button[] Tabs = new Button[4];
|
||||
private View selected;
|
||||
|
||||
private Button switchUsrBtn, logoutBtn; // MineButtons
|
||||
private ViewGroup leftView, rightView;
|
||||
|
||||
public PojavLauncherActivity() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.launcher_main_v4);
|
||||
|
||||
|
||||
if (BuildConfig.DEBUG) {
|
||||
Toast.makeText(this, "Launcher process id: " + android.os.Process.myPid(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
setContentView(R.layout.launcher_main_v3);
|
||||
// setContentView(R.layout.launcher_main);
|
||||
|
||||
leftTab = findViewById(R.id.launchermain_layout_leftmenu);
|
||||
leftTab.setLayoutParams(new LinearLayout.LayoutParams(
|
||||
CallbackBridge.windowWidth / 4,
|
||||
LinearLayout.LayoutParams.MATCH_PARENT));
|
||||
|
||||
fullTab = findViewById(R.id.launchermain_layout_viewpager);
|
||||
tabLayout = findViewById(R.id.launchermainTabLayout);
|
||||
|
||||
viewPager = findViewById(R.id.launchermainTabPager);
|
||||
selected = findViewById(R.id.viewTabSelected);
|
||||
|
||||
mConsoleView = new ConsoleFragment();
|
||||
mCrashView = new CrashFragment();
|
||||
|
||||
viewPageAdapter = new ViewPagerAdapter(getSupportFragmentManager());
|
||||
viewPageAdapter.addFragment(new LauncherFragment(), R.drawable.ic_menu_news, getString(R.string.mcl_tab_news));
|
||||
viewPageAdapter.addFragment(mConsoleView, R.drawable.ic_menu_java, getString(R.string.mcl_tab_console));
|
||||
viewPageAdapter.addFragment(new LauncherFragment(), 0, getString(R.string.mcl_tab_news));
|
||||
viewPageAdapter.addFragment(mConsoleView, 0, getString(R.string.mcl_tab_console));
|
||||
viewPageAdapter.addFragment(mCrashView, 0, getString(R.string.mcl_tab_crash));
|
||||
viewPageAdapter.addFragment(new LauncherPreferenceFragment(), R.drawable.ic_menu_settings,
|
||||
getString(R.string.mcl_option_settings));
|
||||
|
||||
viewPageAdapter.addFragment(new LauncherPreferenceFragment(), 0, getString(R.string.mcl_option_settings));
|
||||
|
||||
viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
setTabActive(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
|
||||
}
|
||||
});
|
||||
viewPager.setAdapter(viewPageAdapter);
|
||||
// tabLayout.setTabMode(VerticalTabLayout.MODE_SCROLLABLE);
|
||||
tabLayout.setupWithViewPager(viewPager);
|
||||
tabLayout.setLastTabAsBottom();
|
||||
|
||||
tvUsernameView = (TextView) findViewById(R.id.launchermain_text_welcome);
|
||||
mTextVersion = (TextView) findViewById(R.id.launcherMainVersionView);
|
||||
|
||||
Tabs[0] = findViewById(R.id.btnTab1);
|
||||
Tabs[1] = findViewById(R.id.btnTab2);
|
||||
Tabs[2] = findViewById(R.id.btnTab3);
|
||||
Tabs[3] = findViewById(R.id.btnTab4);
|
||||
|
||||
pickAccount();
|
||||
|
||||
/*
|
||||
|
|
@ -128,6 +138,7 @@ public class PojavLauncherActivity extends BaseLauncherActivity
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
accountSelector.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener(){
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> p1, View p2, int position, long p4) {
|
||||
|
|
@ -167,7 +178,6 @@ public class PojavLauncherActivity extends BaseLauncherActivity
|
|||
}
|
||||
|
||||
//mAvailableVersions;
|
||||
|
||||
ArrayAdapter<String> adapterVer = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, mAvailableVersions);
|
||||
adapterVer.setDropDownViewResource(android.R.layout.simple_list_item_single_choice);
|
||||
mVersionSelector = (Spinner) findViewById(R.id.launchermain_spinner_version);
|
||||
|
|
@ -175,40 +185,21 @@ public class PojavLauncherActivity extends BaseLauncherActivity
|
|||
|
||||
mLaunchProgress = (ProgressBar) findViewById(R.id.progressDownloadBar);
|
||||
mLaunchTextStatus = (TextView) findViewById(R.id.progressDownloadText);
|
||||
LinearLayout exitLayout = (LinearLayout) findViewById(R.id.launcherMainExitbtns);
|
||||
switchUsrBtn = (Button) exitLayout.getChildAt(0);
|
||||
logoutBtn = (Button) exitLayout.getChildAt(1);
|
||||
switchUsrBtn = (Button) findViewById(R.id.infoDevBtn);
|
||||
logoutBtn = (Button) findViewById(R.id.switchUserBtn);
|
||||
|
||||
leftView = (LinearLayout) findViewById(R.id.launcherMainLeftLayout);
|
||||
mPlayButton = (Button) findViewById(R.id.launcherMainPlayButton);
|
||||
rightView = (ViewGroup) findViewById(R.id.launcherMainRightLayout);
|
||||
mPlayButton = (Button) findViewById(R.id.launchermainPlayButton);
|
||||
|
||||
statusIsLaunching(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float updateWidthHeight() {
|
||||
float leftRightWidth = (float) CallbackBridge.windowWidth / 100f * 32f;
|
||||
float mPlayButtonWidth = CallbackBridge.windowWidth - leftRightWidth * 2f;
|
||||
LinearLayout.LayoutParams leftRightParams = new LinearLayout.LayoutParams((int) leftRightWidth,
|
||||
(int) Tools.dpToPx(CallbackBridge.windowHeight / 9));
|
||||
LinearLayout.LayoutParams mPlayButtonParams = new LinearLayout.LayoutParams((int) mPlayButtonWidth,
|
||||
(int) Tools.dpToPx(CallbackBridge.windowHeight / 9));
|
||||
leftView.setLayoutParams(leftRightParams);
|
||||
rightView.setLayoutParams(leftRightParams);
|
||||
mPlayButton.setLayoutParams(mPlayButtonParams);
|
||||
|
||||
return leftRightWidth;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void selectTabPage(int pageIndex){
|
||||
if (tabLayout.getSelectedTabPosition() != pageIndex) {
|
||||
tabLayout.setScrollPosition(pageIndex,0f,true);
|
||||
viewPager.setCurrentItem(pageIndex);
|
||||
}
|
||||
viewPager.setCurrentItem(pageIndex);
|
||||
setTabActive(pageIndex);
|
||||
}
|
||||
|
||||
|
||||
private void pickAccount() {
|
||||
try {
|
||||
mProfile = PojavProfile.getCurrentProfileContent(this);
|
||||
|
|
@ -221,19 +212,39 @@ public class PojavLauncherActivity extends BaseLauncherActivity
|
|||
}
|
||||
|
||||
public void statusIsLaunching(boolean isLaunching) {
|
||||
LinearLayout.LayoutParams reparam = new LinearLayout.LayoutParams((int) updateWidthHeight(),
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
ViewGroup.MarginLayoutParams lmainTabParam = (ViewGroup.MarginLayoutParams) fullTab.getLayoutParams();
|
||||
int launchVisibility = isLaunching ? View.VISIBLE : View.GONE;
|
||||
mLaunchProgress.setVisibility(launchVisibility);
|
||||
mLaunchTextStatus.setVisibility(launchVisibility);
|
||||
lmainTabParam.bottomMargin = reparam.height;
|
||||
leftView.setLayoutParams(reparam);
|
||||
|
||||
switchUsrBtn.setEnabled(!isLaunching);
|
||||
logoutBtn.setEnabled(!isLaunching);
|
||||
mVersionSelector.setEnabled(!isLaunching);
|
||||
canBack = !isLaunching;
|
||||
}
|
||||
|
||||
public void onTabClicked(View view) {
|
||||
for(int i=0; i<Tabs.length;i++){
|
||||
if(view.getId() == Tabs[i].getId()) {
|
||||
selectTabPage(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setTabActive(int index){
|
||||
for (Button tab : Tabs) {
|
||||
tab.setTypeface(null, Typeface.NORMAL);
|
||||
tab.setTextColor(Color.rgb(220,220,220)); //Slightly less bright white.
|
||||
}
|
||||
Tabs[index].setTypeface(Tabs[index].getTypeface(), Typeface.BOLD);
|
||||
Tabs[index].setTextColor(Color.WHITE);
|
||||
|
||||
//Animating the white bar on the left
|
||||
ValueAnimator animation = ValueAnimator.ofFloat(selected.getY(), Tabs[index].getY()+(Tabs[index].getHeight()-selected.getHeight())/2f);
|
||||
animation.setDuration(250);
|
||||
animation.addUpdateListener(animation1 -> selected.setY((float) animation1.getAnimatedValue()));
|
||||
animation.start();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
package net.kdt.pojavlaunch;
|
||||
|
||||
import android.*;
|
||||
import android.app.Dialog;
|
||||
import android.content.*;
|
||||
import android.content.pm.*;
|
||||
import android.content.res.*;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.net.*;
|
||||
import android.os.*;
|
||||
|
||||
|
|
@ -666,94 +669,82 @@ public class PojavLoginActivity extends BaseActivity
|
|||
}
|
||||
|
||||
public void loginSavedAcc(View view) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
final Dialog accountDialog = new Dialog(PojavLoginActivity.this);
|
||||
|
||||
if (Tools.ENABLE_DEV_FEATURES) {
|
||||
builder.setNegativeButton("Toggle UI v2", new DialogInterface.OnClickListener(){
|
||||
accountDialog.setContentView(R.layout.simple_account_list_holder);
|
||||
accountDialog.getWindow().setLayout(800,500);
|
||||
|
||||
LinearLayout accountListLayout = accountDialog.findViewById(R.id.accountListLayout);
|
||||
LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface p1, int p2)
|
||||
{
|
||||
int ver = PojavV2ActivityManager.getLauncherRemakeInt(PojavLoginActivity.this) == 0 ? 1 : 0;
|
||||
PojavV2ActivityManager.setLauncherRemakeVer(PojavLoginActivity.this, ver);
|
||||
Toast.makeText(PojavLoginActivity.this, "Changed to use v" + (ver + 1), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
final ArrayAdapter<String> listAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1);
|
||||
for (String s : new File(Tools.DIR_ACCOUNT_NEW).list()) {
|
||||
listAdapter.add(s.substring(0, s.length() - 5));
|
||||
}
|
||||
|
||||
builder.setPositiveButton(android.R.string.cancel, null);
|
||||
builder.setTitle(this.getString(R.string.login_select_account));
|
||||
builder.setSingleChoiceItems(listAdapter, 0, new DialogInterface.OnClickListener(){
|
||||
View child = inflater.inflate(R.layout.simple_account_list_item, null);
|
||||
TextView accountName = child.findViewById(R.id.accountName);
|
||||
ImageButton removeButton = child.findViewById(R.id.removeBtn);
|
||||
|
||||
accountName.setText(s.substring(0, s.length() - 5));
|
||||
|
||||
accountListLayout.addView(child);
|
||||
|
||||
accountName.setOnClickListener(new View.OnClickListener() {
|
||||
final String selectedAccName = accountName.getText().toString();
|
||||
@Override
|
||||
public void onClick(final DialogInterface di, final int selectedIndex) {
|
||||
PopupMenu popup = new PopupMenu(PojavLoginActivity.this, getViewFromList(selectedIndex, ((AlertDialog) di).getListView()));
|
||||
popup.inflate(R.menu.menu_options_account);
|
||||
popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
|
||||
public void onClick(View v) {
|
||||
try {
|
||||
RefreshListener authListener = new RefreshListener(){
|
||||
@Override
|
||||
public boolean onMenuItemClick(MenuItem item) {
|
||||
final String selectedAccName = listAdapter.getItem(selectedIndex);
|
||||
switch (item.getItemId()) {
|
||||
case R.id.menu_account_select:
|
||||
try {
|
||||
RefreshListener authListener = new RefreshListener(){
|
||||
@Override
|
||||
public void onFailed(Throwable e) {
|
||||
Tools.showError(PojavLoginActivity.this, e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(MinecraftAccount out) {
|
||||
di.dismiss();
|
||||
mProfile = out;
|
||||
playProfile(true);
|
||||
}
|
||||
};
|
||||
|
||||
MinecraftAccount acc = MinecraftAccount.load(selectedAccName);
|
||||
if (acc.isMicrosoft){
|
||||
new MicrosoftAuthTask(PojavLoginActivity.this, authListener)
|
||||
.execute("true", acc.msaRefreshToken);
|
||||
} else if (acc.accessToken.length() >= 5) {
|
||||
PojavProfile.updateTokens(PojavLoginActivity.this, selectedAccName, authListener);
|
||||
} else {
|
||||
di.dismiss();
|
||||
PojavProfile.launch(PojavLoginActivity.this, selectedAccName);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Tools.showError(PojavLoginActivity.this, e);
|
||||
}
|
||||
break;
|
||||
|
||||
case R.id.menu_account_remove:
|
||||
AlertDialog.Builder builder2 = new AlertDialog.Builder(PojavLoginActivity.this);
|
||||
builder2.setTitle(selectedAccName);
|
||||
builder2.setMessage(R.string.warning_remove_account);
|
||||
builder2.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener(){
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface p1, int p2) {
|
||||
new InvalidateTokenTask(PojavLoginActivity.this)
|
||||
.execute(selectedAccName);
|
||||
listAdapter.remove(selectedAccName);
|
||||
listAdapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
builder2.setNegativeButton(android.R.string.cancel, null);
|
||||
builder2.show();
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
public void onFailed(Throwable e) {
|
||||
Tools.showError(PojavLoginActivity.this, e);
|
||||
}
|
||||
});
|
||||
popup.show();
|
||||
|
||||
@Override
|
||||
public void onSuccess(MinecraftAccount out) {
|
||||
accountDialog.dismiss();
|
||||
mProfile = out;
|
||||
playProfile(true);
|
||||
}
|
||||
};
|
||||
|
||||
MinecraftAccount acc = MinecraftAccount.load(selectedAccName);
|
||||
if (acc.isMicrosoft){
|
||||
new MicrosoftAuthTask(PojavLoginActivity.this, authListener)
|
||||
.execute("true", acc.msaRefreshToken);
|
||||
} else if (acc.accessToken.length() >= 5) {
|
||||
PojavProfile.updateTokens(PojavLoginActivity.this, selectedAccName, authListener);
|
||||
} else {
|
||||
accountDialog.dismiss();
|
||||
PojavProfile.launch(PojavLoginActivity.this, selectedAccName);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Tools.showError(PojavLoginActivity.this, e);
|
||||
}
|
||||
}
|
||||
});
|
||||
builder.show();
|
||||
removeButton.setOnClickListener(new View.OnClickListener() {
|
||||
final String selectedAccName = accountName.getText().toString();
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
AlertDialog.Builder builder2 = new AlertDialog.Builder(PojavLoginActivity.this);
|
||||
builder2.setTitle(selectedAccName);
|
||||
builder2.setMessage(R.string.warning_remove_account);
|
||||
builder2.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener(){
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface p1, int p2) {
|
||||
new InvalidateTokenTask(PojavLoginActivity.this)
|
||||
.execute(selectedAccName);
|
||||
accountListLayout.removeAllViewsInLayout();
|
||||
}
|
||||
});
|
||||
builder2.setNegativeButton(android.R.string.cancel, null);
|
||||
builder2.show();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
accountDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
accountDialog.show();
|
||||
}
|
||||
|
||||
private MinecraftAccount loginOffline() {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ public class PojavProfile
|
|||
private static String PROFILE_PREF = "pojav_profile";
|
||||
private static String PROFILE_PREF_FILE = "file";
|
||||
public static String PROFILE_PREF_TEMP_CONTENT = "tempContent";
|
||||
|
||||
|
||||
public static SharedPreferences getPrefs(Context ctx) {
|
||||
return ctx.getSharedPreferences(PROFILE_PREF, Context.MODE_PRIVATE);
|
||||
}
|
||||
|
|
@ -58,7 +58,7 @@ public class PojavProfile
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static String getCurrentProfileName(Context ctx) {
|
||||
String name = getPrefs(ctx).getString(PROFILE_PREF_FILE, "");
|
||||
// A dirty fix
|
||||
|
|
@ -101,7 +101,7 @@ public class PojavProfile
|
|||
public static void launch(Activity ctx, Object o) {
|
||||
PojavProfile.setCurrentProfile(ctx, o);
|
||||
|
||||
Intent intent = new Intent(ctx, PojavV2ActivityManager.getLauncherRemakeVer(ctx)); //MCLauncherActivity.class);
|
||||
Intent intent = new Intent(ctx, PojavLauncherActivity.class); //MCLauncherActivity.class);
|
||||
ctx.startActivity(intent);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,37 +0,0 @@
|
|||
package net.kdt.pojavlaunch;
|
||||
import android.content.*;
|
||||
|
||||
public class PojavV2ActivityManager
|
||||
{
|
||||
public static String CATEGORY_LAUNCHER = "launcher";
|
||||
public static Class<?> LAUNCHER_V1 = MCLauncherActivity.class;
|
||||
public static Class<?> LAUNCHER_V2 = PojavLauncherActivity.class;
|
||||
|
||||
public static boolean setLauncherRemakeClass(Context context, Class<?> cls) {
|
||||
return setLauncherRemakeVer(context, cls.getName().equals(LAUNCHER_V1.getName()) ? 0 : 1);
|
||||
}
|
||||
|
||||
public static boolean setLauncherRemakeVer(Context context, int i) {
|
||||
Context context2 = context;
|
||||
int i2 = i;
|
||||
if (i2 >= 0 && i2 <= 1) {
|
||||
return getPref(context2).edit().putInt(CATEGORY_LAUNCHER, i2).commit();
|
||||
} else throw new IllegalArgumentException("ver must be 0 or 1");
|
||||
}
|
||||
|
||||
public static int getLauncherRemakeInt(Context context) {
|
||||
if (Tools.ENABLE_DEV_FEATURES) {
|
||||
return getPref(context).getInt(CATEGORY_LAUNCHER, 0);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static Class<?> getLauncherRemakeVer(Context context) {
|
||||
return getLauncherRemakeInt(context) == 0 ? LAUNCHER_V1 : LAUNCHER_V2;
|
||||
}
|
||||
|
||||
private static SharedPreferences getPref(Context ctx) {
|
||||
return ctx.getSharedPreferences("remake", Context.MODE_PRIVATE);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,174 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/launchermainFragmentTabView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.0"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/launchermainTabLayout"/>
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:id="@+id/launchermainTabPager"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_alignParentBottom="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressDownloadBar"
|
||||
android:layout_width="match_parent"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_height="10dp"
|
||||
android:layout_above="@id/launchermainFragmentTabView"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="20dp"
|
||||
android:layout_below="@id/progressDownloadBar"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/global_waiting"
|
||||
android:id="@+id/progressDownloadText"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_alignParentBottom="true"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/launcherMainLeftLayout"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="80dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_alignParentLeft="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lMTVVer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="@string/main_version"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<Spinner
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:id="@+id/launcherMainSelectVersion"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
style="?android:attr/buttonBarButtonStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:onClick="launcherMenu"
|
||||
android:text="@string/main_options" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.kdt.mcgui.MineButton
|
||||
android:id="@+id/launcherMainPlayButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="80dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_margin="5dp"
|
||||
android:layout_toLeftOf="@id/launcherMainLeftLayout"
|
||||
android:layout_toRightOf="@id/lMTVVer"
|
||||
android:onClick="launchGame"
|
||||
android:text="@string/main_play" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/launcherMainRightLayout"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="80dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_alignParentRight="true">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginRight="4dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/main_welcome"
|
||||
android:textSize="12sp"
|
||||
android:id="@+id/launchermain_text_welcome"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:text="@string/global_waiting"
|
||||
android:id="@+id/launcherMainVersionView"
|
||||
android:textSize="12sp"
|
||||
android:gravity="center"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/launcherMainExitbtns"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<Button
|
||||
style="?android:attr/buttonBarButtonStyle"
|
||||
android:layout_width="88dp"
|
||||
android:layout_height="40dp"
|
||||
android:onClick="mcaccSwitchUser"
|
||||
android:text="@string/main_infodev"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<Button
|
||||
style="?android:attr/buttonBarButtonStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:onClick="mcaccLogout"
|
||||
android:text="@string/main_switchuser"
|
||||
android:textSize="10sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
@ -1,209 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/launchermain_layout_leftmenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.0"
|
||||
android:orientation="horizontal"
|
||||
android:background="#1D1D1D">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<Spinner
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/launchermain_spinner_account"/>
|
||||
|
||||
<TextView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="Connected"
|
||||
android:id="@+id/launchermain_text_accountstatus"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<android.support.design.widget.VerticalTabLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/launchermainTabLayout"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="1.0">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/launchermain_layout_viewpager"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="1.0">
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/launchermainTabPager"
|
||||
android:background="#272727"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressDownloadBar"
|
||||
android:layout_width="match_parent"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_height="10dp"
|
||||
android:layout_above="@id/launchermainFragmentTabView"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="20dp"
|
||||
android:layout_below="@id/progressDownloadBar"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/global_waiting"
|
||||
android:id="@+id/progressDownloadText"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_alignParentBottom="true"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/launcherMainLeftLayout"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="80dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_alignParentLeft="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lMTVVer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="@string/main_version"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textSize="12sp"/>
|
||||
|
||||
<Spinner
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:id="@+id/launchermain_spinner_version"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
style="?android:attr/buttonBarButtonStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:onClick="launcherMenu"
|
||||
android:text="@string/main_options"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.kdt.mcgui.MineButton
|
||||
android:id="@+id/launcherMainPlayButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="80dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_margin="5dp"
|
||||
android:layout_toLeftOf="@id/launcherMainLeftLayout"
|
||||
android:layout_toRightOf="@id/lMTVVer"
|
||||
android:onClick="launchGame"
|
||||
android:text="@string/main_play"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/launcherMainRightLayout"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="80dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_alignParentRight="true">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginRight="4dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/main_welcome"
|
||||
android:textSize="12sp"
|
||||
android:id="@+id/launchermain_text_welcome"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:text="@string/global_waiting"
|
||||
android:id="@+id/launcherMainVersionView"
|
||||
android:textSize="12sp"
|
||||
android:gravity="center"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/launcherMainExitbtns"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<Button
|
||||
style="?android:attr/buttonBarButtonStyle"
|
||||
android:layout_width="88dp"
|
||||
android:layout_height="40dp"
|
||||
android:onClick="mcaccSwitchUser"
|
||||
android:text="@string/main_infodev"
|
||||
android:textSize="10sp"/>
|
||||
|
||||
<Button
|
||||
style="?android:attr/buttonBarButtonStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:onClick="mcaccLogout"
|
||||
android:text="@string/main_switchuser"
|
||||
android:textSize="10sp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/accountListLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginEnd="0dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:layout_marginBottom="0dp"
|
||||
|
||||
|
||||
android:background="#424242"
|
||||
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.0">
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/accountName"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="?android:attr/listPreferredItemHeightSmall"
|
||||
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
|
||||
android:textAppearance="?android:attr/textAppearanceListItemSmall"
|
||||
|
||||
android:text="Name Placeholder"
|
||||
|
||||
app:layout_constraintEnd_toStartOf="@+id/removeBtn"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/removeBtn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:paddingStart="10dp"
|
||||
|
||||
android:paddingEnd="10dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/accountName"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_remove" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
@ -4,7 +4,6 @@
|
|||
<item>@string/mcl_option_modinstall</item>
|
||||
<item>@string/mcl_option_modinstallwitharg</item>
|
||||
<item>@string/mcl_option_customcontrol</item>
|
||||
<item>@string/mcl_option_settings</item>
|
||||
<item>@string/mcl_option_about</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue