mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-21 09:01:56 -07:00
Settings, Password Autfill, and Righthanded flip
This commit is contained in:
parent
0b3478a5af
commit
6cd284fc24
14 changed files with 197 additions and 335 deletions
|
|
@ -41,24 +41,7 @@
|
|||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity android:name="net.kdt.pojavlaunch.ImportControlActivity"
|
||||
android:exported="true"
|
||||
android:windowSoftInputMode="stateVisible"
|
||||
android:launchMode="singleInstance"
|
||||
android:configChanges="keyboard|keyboardHidden"
|
||||
>
|
||||
|
||||
<intent-filter android:scheme="content"
|
||||
android:label="@string/import_control_label"
|
||||
tools:ignore="AppLinkUrlError">
|
||||
<action android:name="android.intent.action.VIEW"/>
|
||||
<action android:name="android.intent.action.SEND"/>
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
<data android:mimeType="application/json"/>
|
||||
<data android:mimeType="text/json"/>
|
||||
<data android:mimeType="text/plain"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name=".SettingsMenu"></activity>
|
||||
|
||||
<activity
|
||||
android:theme="@style/MenuDialog"
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ import androidx.annotation.Nullable;
|
|||
|
||||
import java.io.*;
|
||||
|
||||
import net.kdt.pojavlaunch.multirt.MultiRTConfigDialog;
|
||||
import net.kdt.pojavlaunch.multirt.MultiRTUtils;
|
||||
import net.kdt.pojavlaunch.prefs.*;
|
||||
|
||||
|
|
@ -22,7 +21,6 @@ public abstract class BaseLauncherActivity extends BaseActivity {
|
|||
public Button mPlayButton;
|
||||
public ProgressBar mLaunchProgress;
|
||||
public Spinner mVersionSelector;
|
||||
public MultiRTConfigDialog mRuntimeConfigDialog;
|
||||
public TextView mLaunchTextStatus;
|
||||
|
||||
public String[] mAvailableVersions;
|
||||
|
|
@ -93,8 +91,6 @@ public abstract class BaseLauncherActivity extends BaseActivity {
|
|||
}
|
||||
LauncherPreferences.DEFAULT_PREF.registerOnSharedPreferenceChangeListener(listRefreshListener);
|
||||
System.out.println("call to onResumeFragments");
|
||||
mRuntimeConfigDialog = new MultiRTConfigDialog();
|
||||
mRuntimeConfigDialog.prepare(this);
|
||||
|
||||
//TODO ADD CRASH CHECK AND FOCUS
|
||||
System.out.println("call to onResumeFragments; E");
|
||||
|
|
@ -110,30 +106,6 @@ public abstract class BaseLauncherActivity extends BaseActivity {
|
|||
barrier.setCancelable(false);
|
||||
barrier.show();
|
||||
|
||||
// Install the runtime
|
||||
if (requestCode == MultiRTConfigDialog.MULTIRT_PICK_RUNTIME) {
|
||||
if (data == null) return;
|
||||
|
||||
final Uri uri = data.getData();
|
||||
Thread t = new Thread(() -> {
|
||||
try {
|
||||
String name = getFileName(this, uri);
|
||||
MultiRTUtils.installRuntimeNamed(getContentResolver().openInputStream(uri), name,
|
||||
(resid, stuff) -> BaseLauncherActivity.this.runOnUiThread(
|
||||
() -> barrier.setMessage(BaseLauncherActivity.this.getString(resid, stuff))));
|
||||
MultiRTUtils.postPrepare(BaseLauncherActivity.this, name);
|
||||
} catch (IOException e) {
|
||||
Tools.showError(BaseLauncherActivity.this, e);
|
||||
}
|
||||
BaseLauncherActivity.this.runOnUiThread(() -> {
|
||||
barrier.dismiss();
|
||||
mRuntimeConfigDialog.refresh();
|
||||
mRuntimeConfigDialog.dialog.show();
|
||||
});
|
||||
});
|
||||
t.start();
|
||||
}
|
||||
|
||||
// Run a mod installer
|
||||
if (requestCode == RUN_MOD_INSTALLER) {
|
||||
if (data == null) return;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package net.kdt.pojavlaunch;
|
|||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.*;
|
||||
import android.os.Vibrator;
|
||||
import android.util.Log;
|
||||
|
|
@ -21,6 +22,8 @@ import org.lwjgl.glfw.*;
|
|||
|
||||
import static net.kdt.pojavlaunch.utils.MathUtils.map;
|
||||
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import com.kdt.LoggerView;
|
||||
|
||||
public class JavaGUILauncherActivity extends BaseActivity implements View.OnTouchListener {
|
||||
|
|
@ -94,6 +97,34 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTou
|
|||
findViewById(R.id.camera).setOnTouchListener(this);
|
||||
findViewById(R.id.mb2).setOnTouchListener(this);
|
||||
|
||||
// Righthanded Flip UI
|
||||
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
if(Boolean.parseBoolean(preferences.getString("righthanded",""))){
|
||||
RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) findViewById(R.id.keyboard).getLayoutParams();
|
||||
lp.addRule(RelativeLayout.ALIGN_PARENT_END);
|
||||
RelativeLayout.LayoutParams lp1 = (RelativeLayout.LayoutParams) findViewById(R.id.mb2).getLayoutParams();
|
||||
lp1.addRule(RelativeLayout.LEFT_OF,R.id.keyboard);
|
||||
lp1.addRule(RelativeLayout.RIGHT_OF); // Clear right of prop
|
||||
RelativeLayout.LayoutParams lp2 = (RelativeLayout.LayoutParams) findViewById(R.id.main_toggle_mouse).getLayoutParams();
|
||||
lp2.addRule(RelativeLayout.LEFT_OF,R.id.keyboard);
|
||||
RelativeLayout.LayoutParams lp3 = (RelativeLayout.LayoutParams) findViewById(R.id.installmod_scale_down).getLayoutParams();
|
||||
lp3.addRule(RelativeLayout.LEFT_OF,R.id.keyboard);
|
||||
RelativeLayout.LayoutParams lp4 = (RelativeLayout.LayoutParams) findViewById(R.id.menu).getLayoutParams();
|
||||
lp4.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
|
||||
} else {
|
||||
// Just a hack to get the settings icon to align to right by default.
|
||||
RelativeLayout.LayoutParams lp4 = (RelativeLayout.LayoutParams) findViewById(R.id.menu).getLayoutParams();
|
||||
lp4.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
|
||||
}
|
||||
|
||||
|
||||
// Launch Settings Popup
|
||||
findViewById(R.id.menu).setOnTouchListener((view, motionEvent) -> {
|
||||
if(motionEvent.getAction() == MotionEvent.ACTION_DOWN){
|
||||
startActivity(new Intent(JavaGUILauncherActivity.this, SettingsMenu.class));
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
this.touchPad = findViewById(R.id.main_touchpad);
|
||||
touchPad.setVisibility(View.VISIBLE);
|
||||
|
|
@ -399,6 +430,12 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTou
|
|||
|
||||
public int launchJavaRuntime(File miniclient, String javaArgs,File config) {
|
||||
JREUtils.redirectAndPrintJRELog(this);
|
||||
|
||||
// Load saved username and password
|
||||
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
String name = preferences.getString("username","");
|
||||
String pass= preferences.getString("password","");
|
||||
|
||||
try {
|
||||
JREUtils.jreReleaseList = JREUtils.readJREReleaseProperties();
|
||||
|
||||
|
|
@ -413,8 +450,8 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTou
|
|||
javaArgList.add("-jar");
|
||||
javaArgList.add(miniclient.getAbsolutePath());
|
||||
javaArgList.add(config.getAbsolutePath()); // Pass client config as arg0
|
||||
javaArgList.add("username=miniclientparam:");
|
||||
javaArgList.add("password=miniclientparam:");
|
||||
javaArgList.add("username=miniclientparam:"+name);
|
||||
javaArgList.add("password=miniclientparam:"+pass);
|
||||
}
|
||||
|
||||
Logger.getInstance().appendToLog("Info: Java arguments: " + Arrays.toString(javaArgList.toArray(new String[0])));
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ import androidx.annotation.Nullable;
|
|||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import net.kdt.pojavlaunch.multirt.MultiRTConfigDialog;
|
||||
import net.kdt.pojavlaunch.multirt.MultiRTUtils;
|
||||
import net.kdt.pojavlaunch.prefs.LauncherPreferences;
|
||||
|
||||
|
|
@ -254,7 +253,6 @@ public class PojavLoginActivity extends BaseActivity
|
|||
unpackComponent(am, "caciocavallo");
|
||||
unpackComponent(am, "lwjgl3");
|
||||
if(!installRuntimeAutomatically(am,MultiRTUtils.getRuntimes().size() > 0)) {
|
||||
MultiRTConfigDialog.openRuntimeSelector(this, MultiRTConfigDialog.MULTIRT_PICK_RUNTIME_STARTUP);
|
||||
synchronized (mLockSelectJRE) {
|
||||
mLockSelectJRE.wait();
|
||||
}
|
||||
|
|
@ -265,34 +263,6 @@ public class PojavLoginActivity extends BaseActivity
|
|||
Tools.showError(this, e);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if(resultCode == Activity.RESULT_OK) {
|
||||
if (requestCode == MultiRTConfigDialog.MULTIRT_PICK_RUNTIME_STARTUP) {
|
||||
if (data != null) {
|
||||
final Uri uri = data.getData();
|
||||
Thread t = new Thread(() -> {
|
||||
try {
|
||||
MultiRTUtils.installRuntimeNamed(getContentResolver().openInputStream(uri), getFileName(this, uri),
|
||||
(resid, stuff) -> PojavLoginActivity.this.runOnUiThread(
|
||||
() -> {
|
||||
if (startupTextView != null)
|
||||
startupTextView.setText(PojavLoginActivity.this.getString(resid, stuff));
|
||||
}));
|
||||
synchronized (mLockSelectJRE) {
|
||||
mLockSelectJRE.notifyAll();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
Tools.showError(PojavLoginActivity.this
|
||||
, e);
|
||||
}
|
||||
});
|
||||
t.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private boolean installRuntimeAutomatically(AssetManager am, boolean otherRuntimesAvailable) {
|
||||
/* Check if JRE is included */
|
||||
String rt_version = null;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,73 @@
|
|||
package net.kdt.pojavlaunch;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Switch;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
public class SettingsMenu extends Activity {
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.settings_menu);
|
||||
DisplayMetrics dm = new DisplayMetrics();
|
||||
getWindowManager().getDefaultDisplay().getMetrics(dm);
|
||||
int width = dm.widthPixels;
|
||||
int height = dm.heightPixels;
|
||||
getWindow().setLayout(((int)(width*0.8)),((int)(height*0.8)));
|
||||
|
||||
final EditText username = findViewById(R.id.username);
|
||||
final EditText password = findViewById(R.id.password);
|
||||
final Switch righthanded = findViewById(R.id.righthanded);
|
||||
|
||||
|
||||
//For storing string value in sharedPreference
|
||||
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
SharedPreferences.Editor editor = preferences.edit();
|
||||
|
||||
// Restore from saved values
|
||||
username.setText(preferences.getString("username",""));
|
||||
password.setText(preferences.getString("password",""));
|
||||
righthanded.setChecked(Boolean.parseBoolean(preferences.getString("righthanded","")));
|
||||
|
||||
|
||||
username.setOnKeyListener((v, keyCode, event) -> {
|
||||
if (event.getAction() == KeyEvent.ACTION_DOWN && keyCode == KeyEvent.KEYCODE_ENTER) {
|
||||
System.out.println("Username: "+username.getText());
|
||||
editor.putString("username",username.getText().toString());
|
||||
editor.commit();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
password.setOnKeyListener((v, keyCode, event) -> {
|
||||
if (event.getAction() == KeyEvent.ACTION_DOWN && keyCode == KeyEvent.KEYCODE_ENTER) {
|
||||
System.out.println("Password: "+password.getText());
|
||||
editor.putString("password",password.getText().toString());
|
||||
editor.commit();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
righthanded.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
// do something, the isChecked will be
|
||||
// true if the switch is in the On position
|
||||
System.out.println(isChecked);
|
||||
editor.putString("righthanded",""+isChecked);
|
||||
editor.commit();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
package net.kdt.pojavlaunch.multirt;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Intent;
|
||||
import android.webkit.MimeTypeMap;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import net.kdt.pojavlaunch.BaseLauncherActivity;
|
||||
import net.kdt.pojavlaunch.R;
|
||||
|
||||
public class MultiRTConfigDialog {
|
||||
public static final int MULTIRT_PICK_RUNTIME = 2048;
|
||||
public static final int MULTIRT_PICK_RUNTIME_STARTUP = 2049;
|
||||
public AlertDialog dialog;
|
||||
public RecyclerView dialogView;
|
||||
public void prepare(BaseLauncherActivity ctx) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(ctx);
|
||||
builder.setTitle(R.string.multirt_config_title);
|
||||
dialogView = new RecyclerView(ctx);
|
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(ctx);
|
||||
linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
|
||||
dialogView.setLayoutManager(linearLayoutManager);
|
||||
dialogView.setAdapter(new RTRecyclerViewAdapter(this));
|
||||
builder.setView(dialogView);
|
||||
builder.setPositiveButton(R.string.multirt_config_add, (dialog, which) -> openRuntimeSelector(ctx,MULTIRT_PICK_RUNTIME));
|
||||
builder.setNegativeButton(R.string.mcn_exit_call, (dialog, which) -> dialog.cancel());
|
||||
dialog = builder.create();
|
||||
}
|
||||
public void refresh() {
|
||||
RecyclerView.Adapter adapter = dialogView.getAdapter();
|
||||
if(adapter != null)dialogView.getAdapter().notifyDataSetChanged();
|
||||
}
|
||||
public static void openRuntimeSelector(Activity ctx, int code) {
|
||||
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension("xz");
|
||||
if(mimeType == null) mimeType = "*/*";
|
||||
intent.setType(mimeType);
|
||||
ctx.startActivityForResult(intent,code);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,132 +0,0 @@
|
|||
package net.kdt.pojavlaunch.multirt;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.Color;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import net.kdt.pojavlaunch.R;
|
||||
import net.kdt.pojavlaunch.Tools;
|
||||
import net.kdt.pojavlaunch.prefs.LauncherPreferences;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
public class RTRecyclerViewAdapter extends RecyclerView.Adapter<RTRecyclerViewAdapter.RTViewHolder> {
|
||||
MultiRTConfigDialog dialog;
|
||||
public RTRecyclerViewAdapter(MultiRTConfigDialog dialog) {
|
||||
this.dialog = dialog;
|
||||
}
|
||||
@NonNull
|
||||
@Override
|
||||
public RTViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View recyclableView = LayoutInflater.from(parent.getContext()).inflate(R.layout.multirt_recyclable_view,parent,false);
|
||||
return new RTViewHolder(recyclableView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RTViewHolder holder, int position) {
|
||||
final List<MultiRTUtils.Runtime> runtimes = MultiRTUtils.getRuntimes();
|
||||
holder.bindRuntime(runtimes.get(position),position);
|
||||
}
|
||||
public boolean isDefaultRuntime(MultiRTUtils.Runtime rt) {
|
||||
return LauncherPreferences.PREF_DEFAULT_RUNTIME.equals(rt.name);
|
||||
}
|
||||
public void setDefault(MultiRTUtils.Runtime rt){
|
||||
LauncherPreferences.PREF_DEFAULT_RUNTIME = rt.name;
|
||||
LauncherPreferences.DEFAULT_PREF.edit().putString("defaultRuntime",LauncherPreferences.PREF_DEFAULT_RUNTIME).apply();
|
||||
RTRecyclerViewAdapter.this.notifyDataSetChanged();
|
||||
}
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return MultiRTUtils.getRuntimes().size();
|
||||
}
|
||||
public class RTViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener{
|
||||
final TextView javaVersionView;
|
||||
final TextView fullJavaVersionView;
|
||||
final ColorStateList defaultColors;
|
||||
final Button setDefaultButton;
|
||||
final Context ctx;
|
||||
MultiRTUtils.Runtime currentRuntime;
|
||||
int currentPosition;
|
||||
public RTViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
javaVersionView = itemView.findViewById(R.id.multirt_view_java_version);
|
||||
fullJavaVersionView = itemView.findViewById(R.id.multirt_view_java_version_full);
|
||||
itemView.findViewById(R.id.multirt_view_removebtn).setOnClickListener(this);
|
||||
setDefaultButton = itemView.findViewById(R.id.multirt_view_setdefaultbtn);
|
||||
setDefaultButton.setOnClickListener(this);
|
||||
defaultColors = fullJavaVersionView.getTextColors();
|
||||
ctx = itemView.getContext();
|
||||
}
|
||||
public void bindRuntime(MultiRTUtils.Runtime rt, int pos) {
|
||||
currentRuntime = rt;
|
||||
currentPosition = pos;
|
||||
if(rt.versionString != null) {
|
||||
javaVersionView.setText(ctx.getString(R.string.multirt_java_ver, rt.name, rt.javaVersion));
|
||||
fullJavaVersionView.setText(rt.versionString);
|
||||
fullJavaVersionView.setTextColor(defaultColors);
|
||||
setDefaultButton.setVisibility(View.VISIBLE);
|
||||
boolean default_ = isDefaultRuntime(rt);
|
||||
setDefaultButton.setEnabled(!default_);
|
||||
setDefaultButton.setText(default_?R.string.multirt_config_setdefault_already:R.string.multirt_config_setdefault);
|
||||
}else{
|
||||
javaVersionView.setText(rt.name);
|
||||
fullJavaVersionView.setText(R.string.multirt_runtime_corrupt);
|
||||
fullJavaVersionView.setTextColor(Color.RED);
|
||||
setDefaultButton.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if(v.getId() == R.id.multirt_view_removebtn) {
|
||||
if (currentRuntime != null) {
|
||||
if(MultiRTUtils.getRuntimes().size() < 2) {
|
||||
AlertDialog.Builder bldr = new AlertDialog.Builder(ctx);
|
||||
bldr.setTitle(R.string.global_error);
|
||||
bldr.setMessage(R.string.multirt_config_removeerror_last);
|
||||
bldr.setPositiveButton(android.R.string.ok,(adapter, which)->adapter.dismiss());
|
||||
bldr.show();
|
||||
return;
|
||||
}
|
||||
|
||||
final ProgressDialog barrier = new ProgressDialog(ctx);
|
||||
barrier.setMessage(ctx.getString(R.string.global_waiting));
|
||||
barrier.setProgressStyle(ProgressDialog.STYLE_SPINNER);
|
||||
barrier.setCancelable(false);
|
||||
barrier.show();
|
||||
Thread t = new Thread(() -> {
|
||||
try {
|
||||
MultiRTUtils.removeRuntimeNamed(currentRuntime.name);
|
||||
} catch (IOException e) {
|
||||
Tools.showError(itemView.getContext(), e);
|
||||
}
|
||||
v.post(() -> {
|
||||
if(isDefaultRuntime(currentRuntime)) setDefault(MultiRTUtils.getRuntimes().get(0));
|
||||
barrier.dismiss();
|
||||
RTRecyclerViewAdapter.this.notifyDataSetChanged();
|
||||
dialog.dialog.show();
|
||||
});
|
||||
});
|
||||
t.start();
|
||||
}
|
||||
}else if(v.getId() == R.id.multirt_view_setdefaultbtn) {
|
||||
if(currentRuntime != null) {
|
||||
setDefault(currentRuntime);
|
||||
RTRecyclerViewAdapter.this.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -56,28 +56,9 @@ public class RTSpinnerAdapter implements SpinnerAdapter {
|
|||
return true;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
|
||||
View v = convertView!=null?
|
||||
convertView:
|
||||
LayoutInflater.from(ctx).inflate(R.layout.multirt_recyclable_view,parent,false);
|
||||
|
||||
MultiRTUtils.Runtime rt = runtimes.get(position);
|
||||
|
||||
final TextView javaVersionView = v.findViewById(R.id.multirt_view_java_version);
|
||||
final TextView fullJavaVersionView = v.findViewById(R.id.multirt_view_java_version_full);
|
||||
v.findViewById(R.id.multirt_view_removebtn).setVisibility(View.GONE);
|
||||
v.findViewById(R.id.multirt_view_setdefaultbtn).setVisibility(View.GONE);
|
||||
|
||||
if(rt.versionString != null) {
|
||||
javaVersionView.setText(ctx.getString(R.string.multirt_java_ver, rt.name, rt.javaVersion));
|
||||
fullJavaVersionView.setText(rt.versionString);
|
||||
}else{
|
||||
javaVersionView.setText(rt.name);
|
||||
fullJavaVersionView.setText(R.string.multirt_runtime_corrupt);
|
||||
}
|
||||
return v;
|
||||
public View getView(int i, View view, ViewGroup viewGroup) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
5
app_2009scape/src/main/res/drawable/settings.xml
Normal file
5
app_2009scape/src/main/res/drawable/settings.xml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.8,11.69 4.8,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z"/>
|
||||
</vector>
|
||||
|
|
@ -33,8 +33,8 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_above="@id/keyboard"
|
||||
android:background="@drawable/control_button"
|
||||
android:gravity="center"
|
||||
android:focusable="false"
|
||||
android:gravity="center"
|
||||
android:minWidth="70dip"
|
||||
android:minHeight="40dip"
|
||||
android:onClick="toggleVirtualMouse"
|
||||
|
|
@ -77,24 +77,42 @@
|
|||
android:id="@+id/installmod_scale_down"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:background="@drawable/control_button"
|
||||
android:focusable="false"
|
||||
android:minWidth="70dip"
|
||||
android:minHeight="40dip"
|
||||
android:onClick="scaleDown"
|
||||
android:focusable="false"
|
||||
android:text="-" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/menu"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:minWidth="70dip"
|
||||
android:minHeight="40dip"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:alpha="0.1"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/settings" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/installmod_scale_up"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toEndOf="@+id/installmod_scale_down"
|
||||
android:background="@drawable/control_button"
|
||||
android:focusable="false"
|
||||
android:minWidth="70dip"
|
||||
android:minHeight="40dip"
|
||||
android:onClick="scaleUp"
|
||||
android:focusable="false"
|
||||
android:text="+" />
|
||||
|
||||
|
||||
|
|
@ -103,6 +121,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="50px"
|
||||
android:background="@drawable/control_button"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
|
|
@ -110,8 +129,7 @@
|
|||
android:minWidth="70dip"
|
||||
android:minHeight="40dip"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="20dip"
|
||||
android:layout_marginBottom="50px">
|
||||
android:paddingLeft="20dip">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
|||
|
|
@ -3,4 +3,5 @@
|
|||
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"/>
|
||||
android:layout_height="match_parent"
|
||||
android:background="#000000" />
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
<?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="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/multirt_view_java_version"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="Java 8"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/multirt_view_java_version_full"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="1.8.0_292"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintStart_toStartOf="@+id/multirt_view_java_version"
|
||||
app:layout_constraintTop_toBottomOf="@+id/multirt_view_java_version" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/multirt_view_removebtn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/multirt_view_java_version_full"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/multirt_view_java_version"
|
||||
app:srcCompat="@drawable/ic_remove" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/multirt_view_setdefaultbtn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/multirt_config_setdefault"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/multirt_view_removebtn"
|
||||
app:layout_constraintTop_toTopOf="@+id/multirt_view_removebtn" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
50
app_2009scape/src/main/res/layout/settings_menu.xml
Normal file
50
app_2009scape/src/main/res/layout/settings_menu.xml
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
<?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/loginText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:text="Auto Login (Requires relaunch)"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/username"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/loginText"
|
||||
android:layout_marginTop="43dp"
|
||||
android:hint="Username"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/loginText" />
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/username"
|
||||
android:layout_marginTop="28dp"
|
||||
android:hint="Password"
|
||||
android:inputType="textPassword"
|
||||
app:layout_constraintTop_toBottomOf="@+id/username"
|
||||
tools:layout_editor_absoluteX="-1dp" />
|
||||
|
||||
<Switch
|
||||
android:id="@+id/righthanded"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="35dp"
|
||||
android:text="Right Handed Mode"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/password" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue