Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
runawaysheep committed Aug 30, 2019
0 parents commit 8c43d3b
Show file tree
Hide file tree
Showing 39 changed files with 3,181 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# RPAssistant
23 changes: 23 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "28.0.3"

defaultConfig {
applicationId "com.rAs.android.rpgamepad"
minSdkVersion 19
targetSdkVersion 26
multiDexEnabled true
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}

dependencies {
compileOnly 'de.robv.android.xposed:api:82'
}
36 changes: 36 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rAs.android.rpgamepad"
android:versionCode="6"
android:versionName="0.9.190805" >

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:largeHeap="true"
android:label="@string/app_name" >

<meta-data android:name="xposedmodule" android:value="true"/>
<meta-data android:name="xposedminversion" android:value="2.0*"/>
<meta-data android:name="xposeddescription" android:value="It assist you can use game controllers in Remote Play."/>

<activity
android:name=".SettingActivity"
android:launchMode="singleTask"
android:configChanges="orientation|keyboard|keyboardHidden"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".TestActivity"
android:launchMode="singleTask"
android:screenOrientation="fullSensor"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
android:configChanges="orientation|keyboard|keyboardHidden">
</activity>
</application>

</manifest>
1 change: 1 addition & 0 deletions app/src/main/assets/xposed_init
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.rAs.android.rpgamepad.XRPAssistant
53 changes: 53 additions & 0 deletions app/src/main/java/com/rAs/android/rpgamepad/InputDialog.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.rAs.android.rpgamepad;

import android.app.AlertDialog;
import android.content.Context;
import android.view.MotionEvent;

public class InputDialog extends AlertDialog {

interface OnMotionEventListener {
boolean onGenericMotionEvent(MotionEvent event);
}

private OnMotionEventListener onMotionEventListener;
private Context mContext;

public InputDialog(Context context, int theme) {
super(context, theme);
mContext = context;
}

public InputDialog(Context context, boolean cancelable, OnCancelListener cancelListener) {
super(context, cancelable, cancelListener);
mContext = context;
}

public InputDialog(Context context) {
super(context);
mContext = context;
}

public void setOnInputListener(OnMotionEventListener onInputListener) {
this.onMotionEventListener = onInputListener;
}

@Override
public boolean dispatchGenericMotionEvent(MotionEvent event) {
if(onMotionEventListener != null)
return onMotionEventListener.onGenericMotionEvent(event);
return super.dispatchGenericMotionEvent(event);
}

public void setPositiveButton(int textId, final OnClickListener listener) {
setButton(BUTTON_POSITIVE, mContext.getText(textId), listener);
}

public void setNegativeButton(int textId, final OnClickListener listener) {
setButton(BUTTON_NEGATIVE, mContext.getText(textId), listener);
}

public void setNeutralButton(int textId, final OnClickListener listener) {
setButton(BUTTON_NEUTRAL, mContext.getText(textId), listener);
}
}
47 changes: 47 additions & 0 deletions app/src/main/java/com/rAs/android/rpgamepad/InputInfo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package com.rAs.android.rpgamepad;

public class InputInfo {
private int keyCode;
private int output;
private boolean isAxis;
private boolean isWithCombine;
private boolean isNegative;
private String toProfile;

public int getKeyCode() {
return keyCode;
}
public void setKeyCode(int keyCode) {
this.keyCode = keyCode;
}
public int getOutput() {
return output;
}
public void setOutput(int output) {
this.output = output;
}
public boolean isAxis() {
return isAxis;
}
public void setAxis(boolean isAxis) {
this.isAxis = isAxis;
}
public boolean isWithCombine() {
return isWithCombine;
}
public void setWithCombine(boolean isWithCombine) {
this.isWithCombine = isWithCombine;
}
public boolean isNegative() {
return isNegative;
}
public void setNegative(boolean isNegative) {
this.isNegative = isNegative;
}
public String getToProfile() {
return toProfile;
}
public void setToProfile(String toProfile) {
this.toProfile = toProfile;
}
}
Loading

0 comments on commit 8c43d3b

Please sign in to comment.