Icons are back for SD

This commit is contained in:
downthecrop 2023-10-18 01:02:19 -07:00
parent 2962c55adf
commit 1f6f4f2b4e
16 changed files with 153 additions and 52 deletions

View file

@ -1,5 +1,5 @@
plugins {
id 'com.android.application' version '7.4.2'
id 'com.android.application' version '8.1.2'
}
static def getDate() { return new Date().format('yyyyMMdd') }
@ -81,9 +81,6 @@ android {
compileSdk = 33
lintOptions {
abortOnError false
}
signingConfigs {
customDebug {
@ -168,6 +165,9 @@ android {
}
buildToolsVersion = '33.0.2'
lint {
abortOnError false
}
}
dependencies {

View file

@ -1 +1 @@
1697525451441
1697613347540

View file

@ -4,6 +4,7 @@ import static net.kdt.pojavlaunch.MainActivity.fullyExit;
import android.annotation.SuppressLint;
import android.content.ClipboardManager;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.GestureDetector;
@ -111,6 +112,9 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTouc
if (mGestureDetector.onTouchEvent(event)) {
sendScaledMousePosition(mouseX,mouseY);
AWTInputBridge.sendMousePress(AWTInputEvent.BUTTON1_DOWN_MASK);
if(rcState) {
clearRC();
}
} else {
if (action == MotionEvent.ACTION_MOVE) { // 2
mouseX = Math.max(0, Math.min(CallbackBridge.physicalWidth, mouseX + x - prevX));
@ -143,6 +147,9 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTouc
if (mGestureDetector.onTouchEvent(event)) {
sendScaledMousePosition(x + mTextureView.getX(), y);
AWTInputBridge.sendMousePress(AWTInputEvent.BUTTON1_DOWN_MASK);
if(rcState) {
clearRC();
}
return true;
}
@ -253,9 +260,11 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTouc
Log.i("downthecrop", "Hello from the camrea Button");
AWTInputBridge.sendKey((char) AWTInputEvent.VK_F9, AWTInputEvent.VK_F9); // Send F9
cameraMode = true;
findViewById(R.id.camera).setBackground(getResources().getDrawable( R.drawable.control_button_pressed ));
} else { // Camera Mode off
AWTInputBridge.sendKey((char) AWTInputEvent.VK_F8, AWTInputEvent.VK_F8);
cameraMode = false;
findViewById(R.id.camera).setBackground(getResources().getDrawable( R.drawable.control_button_normal ));
}
break;
case R.id.mouseMode:
@ -281,11 +290,13 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTouc
private void clearRC(){
rcState = false;
findViewById(R.id.mb2).setBackground(getResources().getDrawable( R.drawable.control_button_normal ));
AWTInputBridge.sendKey((char)AWTInputEvent.VK_F10,AWTInputEvent.VK_F10);
}
private void activateRC(){
rcState = true;
findViewById(R.id.mb2).setBackground(getResources().getDrawable( R.drawable.control_button_pressed ));
AWTInputBridge.sendKey((char)AWTInputEvent.VK_F11,AWTInputEvent.VK_F11);
}
@ -307,6 +318,12 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTouc
public void toggleVirtualMouse(View v) {
mIsVirtualMouseEnabled = !mIsVirtualMouseEnabled;
ImageView view = findViewById(R.id.mouseModeIco);
if(!mIsVirtualMouseEnabled){
view.setImageResource(R.drawable.touch);
} else{
view.setImageResource(R.drawable.ic_mouse3);
}
mTouchPad.setVisibility(mIsVirtualMouseEnabled ? View.VISIBLE : View.GONE);
Toast.makeText(this,
mIsVirtualMouseEnabled ? R.string.control_mouseon : R.string.control_mouseoff,

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@color/control_button_pressed_color" />
<item android:drawable="@color/control_button_color" />
<item android:state_pressed="true" android:drawable="@drawable/control_button_pressed" />
<item android:drawable="@drawable/control_button_normal" />
</selector>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#807f7f7f" />
<stroke android:width="2.0dip" android:color="#dd7f7f7f" />
<padding android:left="8.0dip" android:top="0.0dip" android:right="8.0dip" android:bottom="0.0dip" />
</shape>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#dd7f7f7f" />
<stroke android:width="2.0dip" android:color="#dd7f7f7f" />
<padding android:left="8.0dip" android:top="0.0dip" android:right="8.0dip" android:bottom="0.0dip" />
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 827 B

View file

@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#FFFFFF"
android:alpha="0.8">
<path
android:fillColor="@android:color/white"
android:pathData="M20,5L4,5c-1.1,0 -1.99,0.9 -1.99,2L2,17c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,7c0,-1.1 -0.9,-2 -2,-2zM11,8h2v2h-2L11,8zM11,11h2v2h-2v-2zM8,8h2v2L8,10L8,8zM8,11h2v2L8,13v-2zM7,13L5,13v-2h2v2zM7,10L5,10L5,8h2v2zM16,17L8,17v-2h8v2zM16,13h-2v-2h2v2zM16,10h-2L14,8h2v2zM19,13h-2v-2h2v2zM19,10h-2L17,8h2v2z"/>
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 843 B

View 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="M9,11.24V7.5C9,6.12 10.12,5 11.5,5S14,6.12 14,7.5v3.74c1.21,-0.81 2,-2.18 2,-3.74C16,5.01 13.99,3 11.5,3S7,5.01 7,7.5C7,9.06 7.79,10.43 9,11.24zM18.84,15.87l-4.54,-2.26c-0.17,-0.07 -0.35,-0.11 -0.54,-0.11H13v-6C13,6.67 12.33,6 11.5,6S10,6.67 10,7.5v10.74c-3.6,-0.76 -3.54,-0.75 -3.67,-0.75c-0.31,0 -0.59,0.13 -0.79,0.33l-0.79,0.8l4.94,4.94C9.96,23.83 10.34,24 10.75,24h6.79c0.75,0 1.33,-0.55 1.44,-1.28l0.75,-5.27c0.01,-0.07 0.02,-0.14 0.02,-0.2C19.75,16.63 19.37,16.09 18.84,15.87z"/>
</vector>

View file

@ -48,41 +48,95 @@
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/keyboardFrame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:scaleType="fitCenter"
android:src="@drawable/ic_keyboard" />
<Button
android:id="@+id/keyboard"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/control_button"
android:text="K"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
android:background="@drawable/control_button" />
</FrameLayout>
<FrameLayout
android:id="@+id/mb2Frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/keyboardFrame">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:scaleType="fitCenter"
android:src="@drawable/ic_mouse2" />
<Button
android:id="@+id/mb2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/control_button"
android:text="MB2"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/keyboard" />
android:background="@drawable/control_button" />
</FrameLayout>
<FrameLayout
android:id="@+id/mouseModeFrame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="@id/keyboardFrame"
app:layout_constraintStart_toStartOf="@id/keyboardFrame">
<ImageView
android:id="@+id/mouseModeIco"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:scaleType="fitCenter"
android:src="@drawable/touch" />
<Button
android:id="@+id/mouseMode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/control_button"
android:text="M"
app:layout_constraintBottom_toTopOf="@+id/keyboard"
app:layout_constraintStart_toStartOf="@+id/keyboard" />
android:background="@drawable/control_button" />
</FrameLayout>
<FrameLayout
android:id="@+id/cameraFrame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="@id/mb2Frame"
app:layout_constraintStart_toStartOf="@id/mb2Frame">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:scaleType="fitCenter"
android:src="@drawable/ic_camera" />
<Button
android:id="@+id/camera"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/control_button"
android:text="C"
app:layout_constraintBottom_toTopOf="@+id/mb2"
app:layout_constraintStart_toStartOf="@+id/mb2" />
android:background="@drawable/control_button" />
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -38,17 +38,6 @@
app2:seekBarIncrement="10"
android:icon="@drawable/ic_setting_gesture_time"
/>
<net.kdt.pojavlaunch.prefs.CustomSeekBarPreference
android:id="@+id/customSeekBarPreference"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:icon="@drawable/ic_setting_gesture_time"
android:key="xinset"
android:summary="Custom Insets"
android:title="Inset the gameframe"
app2:seekBarIncrement="10"
app2:selectable="false"
app2:showSeekBarValue="true" />
</PreferenceCategory>

View file

@ -32,6 +32,17 @@
android:icon="@drawable/ic_setting_screen_resolution"
/>
<net.kdt.pojavlaunch.prefs.CustomSeekBarPreference
android:id="@+id/customSeekBarPreference"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:icon="@drawable/ic_setting_gesture_time"
android:key="xinset"
android:summary="Add padding/insets around the HD Client to help with reachability"
android:title="Canvas Padding"
app2:seekBarIncrement="10"
app2:selectable="false"
app2:showSeekBarValue="true" />
<SwitchPreference
android:title="@string/preference_sustained_performance_title"
android:summary="@string/preference_sustained_performance_description"

View file

@ -3,3 +3,6 @@ org.gradle.configureondemand=true
android.useAndroidX=true
android.bundle.language.enableSplit=false
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false

View file

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists