add Mio custom button
This commit is contained in:
parent
f8cae4ae46
commit
0901330045
|
@ -33,6 +33,7 @@ dependencies {
|
|||
implementation project(path: ':FCLCore')
|
||||
implementation project(path: ':FCLLibrary')
|
||||
implementation project(path: ':FCLauncher')
|
||||
implementation project(path: ':MioCustom')
|
||||
implementation 'org.nanohttpd:nanohttpd:2.3.1'
|
||||
implementation 'org.apache.commons:commons-compress:1.23.0'
|
||||
implementation 'org.tukaani:xz:1.9'
|
||||
|
|
|
@ -4,7 +4,6 @@ import android.content.res.Configuration;
|
|||
import android.graphics.Rect;
|
||||
import android.graphics.SurfaceTexture;
|
||||
import android.os.Bundle;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.Surface;
|
||||
import android.view.TextureView;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -17,6 +16,7 @@ import com.tungsten.fcl.control.MenuCallback;
|
|||
import com.tungsten.fcl.control.MenuType;
|
||||
import com.tungsten.fcl.control.GameMenu;
|
||||
import com.tungsten.fcl.control.JavaGuiMenu;
|
||||
import com.tungsten.fcl.control.MioMainCustom;
|
||||
import com.tungsten.fcl.setting.GameOption;
|
||||
import com.tungsten.fclauncher.bridge.FCLBridge;
|
||||
import com.tungsten.fclcore.util.Logging;
|
||||
|
@ -69,7 +69,6 @@ public class JVMActivity extends FCLActivity implements TextureView.SurfaceTextu
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSurfaceTextureAvailable(@NonNull SurfaceTexture surfaceTexture, int i, int i1) {
|
||||
Logging.LOG.log(Level.INFO, "surface ready, start jvm now!");
|
||||
|
@ -78,6 +77,7 @@ public class JVMActivity extends FCLActivity implements TextureView.SurfaceTextu
|
|||
gameOption.set("overrideWidth", "" + i);
|
||||
gameOption.set("overrideHeight", "" + i1);
|
||||
gameOption.save();
|
||||
MioMainCustom.getInstance().init((GameMenu) menu,i,i1);
|
||||
surfaceTexture.setDefaultBufferSize((int) (i * fclBridge.getScaleFactor()), (int) (i1 * fclBridge.getScaleFactor()));
|
||||
fclBridge.execute(new Surface(surfaceTexture), menu.getCallbackBridge());
|
||||
fclBridge.pushEventWindow((int) (i * fclBridge.getScaleFactor()), (int) (i1 * fclBridge.getScaleFactor()));
|
||||
|
|
|
@ -44,7 +44,7 @@ public class FCLInput {
|
|||
}
|
||||
|
||||
public void setPointer(int x, int y, String id) {
|
||||
if (id.equals(pointerId) || id.equals("Gyro")) {
|
||||
if (id.equals(pointerId) || id.equals("Gyro") || id.equals("miocustom")) {
|
||||
if (menu.getCursorMode() == FCLBridge.CursorEnabled) {
|
||||
menu.getCursor().setX(x);
|
||||
menu.getCursor().setY(y);
|
||||
|
|
|
@ -0,0 +1,342 @@
|
|||
package com.tungsten.fcl.control;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.os.Environment;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import com.mio.customcontrol.MioCrossingKeyboard;
|
||||
import com.mio.customcontrol.MioCustomButton;
|
||||
import com.mio.customcontrol.MioCustomManager;
|
||||
import com.mio.customcontrol.MioCustomUtils;
|
||||
import com.tungsten.fcl.control.data.ControlViewGroup;
|
||||
import com.tungsten.fclauncher.FCLKeycodes;
|
||||
import com.tungsten.fclauncher.bridge.FCLBridge;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class MioMainCustom implements MioCrossingKeyboard.MioListener, MioCustomManager.自定义按键回调 {
|
||||
private static MioMainCustom INSTANCE;
|
||||
private MioCustomManager mioCustomManager;
|
||||
private MioCrossingKeyboard mioCrossingKeyboard;
|
||||
private GameMenu menu;
|
||||
private FCLBridge fclBridge;
|
||||
private static boolean isShown = false;
|
||||
private Button openKeyboard;
|
||||
|
||||
private MioMainCustom() {
|
||||
}
|
||||
|
||||
public static MioMainCustom getInstance() {
|
||||
if (INSTANCE == null) {
|
||||
INSTANCE = new MioMainCustom();
|
||||
}
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
public static boolean isShown() {
|
||||
return isShown;
|
||||
}
|
||||
|
||||
public void init(GameMenu menu, int width, int height) {
|
||||
this.menu = menu;
|
||||
this.fclBridge = menu.getBridge();
|
||||
Context context = menu.getBaseLayout().getContext();
|
||||
mioCrossingKeyboard = new MioCrossingKeyboard(context);
|
||||
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(MioCustomUtils.dip2px(context, 170), MioCustomUtils.dip2px(context, 170));
|
||||
params.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
|
||||
params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
|
||||
params.setMargins(MioCustomUtils.dip2px(context, 50), 0, 0, MioCustomUtils.dip2px(context, 50));
|
||||
menu.getBaseLayout().addView(mioCrossingKeyboard, params);
|
||||
mioCrossingKeyboard.setListener(this);
|
||||
MioCustomManager.设置屏幕高宽(height, width);
|
||||
mioCustomManager = new MioCustomManager();
|
||||
String path = menu.getBridge().getGameDir();
|
||||
if (!new File(path, "Miokey.json").exists()) {
|
||||
path = Environment.getExternalStorageDirectory().getAbsolutePath() + "/FCL";
|
||||
}
|
||||
mioCustomManager.初始化(context, menu.getBaseLayout(), path);
|
||||
mioCustomManager.设置自定义按键回调(this);
|
||||
Button mioCustomSwitch = new Button(context);
|
||||
mioCustomSwitch.setBackgroundColor(Color.parseColor("#00FFFFFF"));
|
||||
params = new RelativeLayout.LayoutParams(MioCustomUtils.dip2px(context, 40), MioCustomUtils.dip2px(context, 40));
|
||||
params.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
|
||||
params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
|
||||
menu.getBaseLayout().addView(mioCustomSwitch, params);
|
||||
|
||||
openKeyboard = new Button(context);
|
||||
GradientDrawable drawable = new GradientDrawable();
|
||||
drawable.setShape(GradientDrawable.RECTANGLE);
|
||||
drawable.setColor(Color.parseColor("#00FFFFFF"));
|
||||
drawable.setCornerRadius(25);
|
||||
drawable.setStroke(1, Color.WHITE);
|
||||
openKeyboard.setBackground(drawable);
|
||||
openKeyboard.setText("键盘");
|
||||
openKeyboard.setTextColor(Color.WHITE);
|
||||
openKeyboard.setOnClickListener(v->{
|
||||
menu.getTouchCharInput().switchKeyboardState();
|
||||
});
|
||||
params = new RelativeLayout.LayoutParams(MioCustomUtils.dip2px(context, 40), MioCustomUtils.dip2px(context, 40));
|
||||
params.addRule(RelativeLayout.CENTER_HORIZONTAL);
|
||||
params.addRule(RelativeLayout.ALIGN_PARENT_TOP);
|
||||
menu.getBaseLayout().addView(openKeyboard, params);
|
||||
|
||||
mioCustomSwitch.setOnClickListener(v -> {
|
||||
if (mioCrossingKeyboard.getVisibility() != View.VISIBLE) {
|
||||
return;
|
||||
}
|
||||
if (!mioCustomManager.获取开关状态()) {
|
||||
mioCustomManager.自定义开关();
|
||||
mioCrossingKeyboard.自定义();
|
||||
} else {
|
||||
if (mioCustomManager.获取按键选择模式()) {
|
||||
mioCustomManager.设置按键选择模式(false);
|
||||
if (mioCustomManager.获取按键修改模式()) {
|
||||
mioCustomManager.自定义按键对话框(false);
|
||||
if (mioCustomManager.获取当前按键().get按键类型().equals("显隐控制按键")) {
|
||||
for (String 标识 : mioCustomManager.获取当前按键().get目标按键标识()) {
|
||||
MioCustomButton b = mioCustomManager.获取按键(标识);
|
||||
b.setTextColor(Color.parseColor(b.get文本颜色()));
|
||||
b.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mioCustomManager.自定义按键对话框(true);
|
||||
}
|
||||
} else {
|
||||
mioCustomManager.自定义按键对话框(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
mioCustomSwitch.setOnLongClickListener(v -> {
|
||||
if (mioCustomManager.获取开关状态()) {
|
||||
mioCustomManager.自定义开关();
|
||||
mioCrossingKeyboard.自定义();
|
||||
} else {
|
||||
switchVisbility();
|
||||
}
|
||||
return true;
|
||||
});
|
||||
switchVisbility();
|
||||
}
|
||||
|
||||
private void switchVisbility() {
|
||||
mioCustomManager.按键显示隐藏();
|
||||
if (mioCrossingKeyboard.getVisibility() == View.VISIBLE) {
|
||||
mioCrossingKeyboard.setVisibility(View.INVISIBLE);
|
||||
openKeyboard.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
mioCrossingKeyboard.setVisibility(View.VISIBLE);
|
||||
openKeyboard.setVisibility(View.VISIBLE);
|
||||
}
|
||||
for (ControlViewGroup viewGroup : menu.getController().viewGroups()) {
|
||||
menu.getViewManager().switchViewGroupVisibility(viewGroup);
|
||||
}
|
||||
}
|
||||
|
||||
//自定义按键
|
||||
@Override
|
||||
public void 命令接收事件(String 命令) {
|
||||
input(命令);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void 键值接收事件(int 键值, boolean 按下) {
|
||||
fclBridge.pushEventKey(键值, 0, 按下);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void 控制鼠标指针移动事件(int x, int y) {
|
||||
if (menu.getCursorMode() == FCLBridge.CursorDisabled) {
|
||||
x = menu.getPointerX() + x;
|
||||
y = menu.getPointerY() + y;
|
||||
if (menu.getMenuSetting().isEnableGyroscope()) {
|
||||
menu.setPointerX(x);
|
||||
menu.setPointerY(y);
|
||||
} else {
|
||||
menu.getInput().setPointer(x, y, "miocustom");
|
||||
}
|
||||
} else {
|
||||
x = menu.getCursorX() + x;
|
||||
y = menu.getCursorY() + y;
|
||||
menu.getInput().setPointer(x, y, "miocustom");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void 鼠标回调(int 键值, boolean 按下) {
|
||||
fclBridge.pushEventMouseButton(键值, 按下);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void 按下() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void 抬起() {
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
private boolean upFromCenter = false;
|
||||
private boolean upToCenter = false;
|
||||
private boolean isShift = false;
|
||||
|
||||
@Override
|
||||
public void onLeftUp() {
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_W, 0, true);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_A, 0, true);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_S, 0, false);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_D, 0, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUp() {
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_W, 0, true);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_A, 0, false);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_S, 0, false);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_D, 0, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRightUp() {
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_W, 0, true);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_A, 0, false);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_S, 0, false);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_D, 0, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLeft() {
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_W, 0, false);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_A, 0, true);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_S, 0, false);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_D, 0, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCenter(boolean direct) {
|
||||
if (direct) {
|
||||
isShift = true;
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_LEFTSHIFT, 0, true);
|
||||
} else {
|
||||
upFromCenter = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRight() {
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_W, 0, false);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_A, 0, false);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_S, 0, false);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_D, 0, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLeftDown() {
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_W, 0, false);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_A, 0, true);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_S, 0, true);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_D, 0, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDown() {
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_W, 0, false);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_A, 0, false);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_S, 0, true);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_D, 0, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRightDown() {
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_W, 0, false);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_A, 0, false);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_S, 0, true);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_D, 0, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlipLeftUp() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlipUp() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlipRightUp() {
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_E, 0, true);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_E, 0, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlipLeft() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlipRight() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlipLeftDown() {
|
||||
// showKeyboard();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlipDown() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlipRightDown() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpToCenter() {
|
||||
if (upToCenter) {
|
||||
upToCenter = false;
|
||||
} else {
|
||||
upToCenter = true;
|
||||
}
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_SPACE, 0, upToCenter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFingerUp() {
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_W, 0, false);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_A, 0, false);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_S, 0, false);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_D, 0, false);
|
||||
if (upToCenter) {
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_SPACE, 0, false);
|
||||
upToCenter = false;
|
||||
}
|
||||
if (isShift) {
|
||||
isShift = false;
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_LEFTSHIFT, 0, false);
|
||||
}
|
||||
}
|
||||
|
||||
public void input(String str) {
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_SLASH, 0, true);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_SLASH, 0, false);
|
||||
new Thread(() -> {
|
||||
try {
|
||||
Thread.sleep(300);
|
||||
for (char ch : str.replace("/", "").toCharArray()) {
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_RESERVED, ch, true);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_RESERVED, ch, false);
|
||||
Thread.sleep(50);
|
||||
}
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_ENTER, '\n', true);
|
||||
fclBridge.pushEventKey(FCLKeycodes.KEY_ENTER, '\n', false);
|
||||
} catch (InterruptedException e) {
|
||||
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
compileSdkVersion 33
|
||||
buildToolsVersion "30.0.3"
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 33
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.larswerkman:HoloColorPicker:1.5'
|
||||
compileOnly 'com.google.code.gson:gson:2.8.6'
|
||||
compileOnly fileTree(dir: 'libs', include: ['*.jar'])
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
# Add project specific ProGuard rules here.
|
||||
# By default, the flags in this file are appended to flags specified
|
||||
# in D:\studioSDK/tools/proguard/proguard-android.txt
|
||||
# You can edit the include path and order by changing the proguardFiles
|
||||
# directive in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# Add any project specific keep options here:
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
|
@ -0,0 +1,2 @@
|
|||
<manifest package="com.mio.mclauncher.customcontrol">
|
||||
</manifest>
|
|
@ -0,0 +1,167 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2008 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package com.aof.mcinabox.gamecontroller.codes;
|
||||
|
||||
/**
|
||||
* Boat key codes, from linux/input-event-codes.h
|
||||
*/
|
||||
public final class BoatKeycodes {
|
||||
public static final int KEY_RESERVED = 0;
|
||||
|
||||
public static final int KEY_ESC = 1;
|
||||
public static final int KEY_1 = 2;
|
||||
public static final int KEY_2 = 3;
|
||||
public static final int KEY_3 = 4;
|
||||
public static final int KEY_4 = 5;
|
||||
public static final int KEY_5 = 6;
|
||||
public static final int KEY_6 = 7;
|
||||
public static final int KEY_7 = 8;
|
||||
public static final int KEY_8 = 9;
|
||||
public static final int KEY_9 = 10;
|
||||
public static final int KEY_0 = 11;
|
||||
public static final int KEY_MINUS = 12;
|
||||
public static final int KEY_EQUAL = 13;
|
||||
public static final int KEY_BACKSPACE = 14;
|
||||
public static final int KEY_TAB = 15;
|
||||
public static final int KEY_Q = 16;
|
||||
public static final int KEY_W = 17;
|
||||
public static final int KEY_E = 18;
|
||||
public static final int KEY_R = 19;
|
||||
public static final int KEY_T = 20;
|
||||
public static final int KEY_Y = 21;
|
||||
public static final int KEY_U = 22;
|
||||
public static final int KEY_I = 23;
|
||||
public static final int KEY_O = 24;
|
||||
public static final int KEY_P = 25;
|
||||
public static final int KEY_LEFTBRACE = 26;
|
||||
public static final int KEY_RIGHTBRACE = 27;
|
||||
public static final int KEY_ENTER = 28;
|
||||
public static final int KEY_LEFTCTRL = 29;
|
||||
public static final int KEY_A = 30;
|
||||
public static final int KEY_S = 31;
|
||||
public static final int KEY_D = 32;
|
||||
public static final int KEY_F = 33;
|
||||
public static final int KEY_G = 34;
|
||||
public static final int KEY_H = 35;
|
||||
public static final int KEY_J = 36;
|
||||
public static final int KEY_K = 37;
|
||||
public static final int KEY_L = 38;
|
||||
public static final int KEY_SEMICOLON = 39;
|
||||
public static final int KEY_APOSTROPHE = 40;
|
||||
public static final int KEY_GRAVE = 41;
|
||||
public static final int KEY_LEFTSHIFT = 42;
|
||||
public static final int KEY_BACKSLASH = 43;
|
||||
public static final int KEY_Z = 44;
|
||||
public static final int KEY_X = 45;
|
||||
public static final int KEY_C = 46;
|
||||
public static final int KEY_V = 47;
|
||||
public static final int KEY_B = 48;
|
||||
public static final int KEY_N = 49;
|
||||
public static final int KEY_M = 50;
|
||||
public static final int KEY_COMMA = 51;
|
||||
public static final int KEY_DOT = 52;
|
||||
public static final int KEY_SLASH = 53;
|
||||
public static final int KEY_RIGHTSHIFT = 54;
|
||||
public static final int KEY_KPASTERISK = 55;
|
||||
public static final int KEY_LEFTALT = 56;
|
||||
public static final int KEY_SPACE = 57;
|
||||
public static final int KEY_CAPSLOCK = 58;
|
||||
public static final int KEY_F1 = 59;
|
||||
public static final int KEY_F2 = 60;
|
||||
public static final int KEY_F3 = 61;
|
||||
public static final int KEY_F4 = 62;
|
||||
public static final int KEY_F5 = 63;
|
||||
public static final int KEY_F6 = 64;
|
||||
public static final int KEY_F7 = 65;
|
||||
public static final int KEY_F8 = 66;
|
||||
public static final int KEY_F9 = 67;
|
||||
public static final int KEY_F10 = 68;
|
||||
public static final int KEY_NUMLOCK = 69;
|
||||
public static final int KEY_SCROLLLOCK = 70;
|
||||
public static final int KEY_KP7 = 71;
|
||||
public static final int KEY_KP8 = 72;
|
||||
public static final int KEY_KP9 = 73;
|
||||
public static final int KEY_KPMINUS = 74;
|
||||
public static final int KEY_KP4 = 75;
|
||||
public static final int KEY_KP5 = 76;
|
||||
public static final int KEY_KP6 = 77;
|
||||
public static final int KEY_KPPLUS = 78;
|
||||
public static final int KEY_KP1 = 79;
|
||||
public static final int KEY_KP2 = 80;
|
||||
public static final int KEY_KP3 = 81;
|
||||
public static final int KEY_KP0 = 82;
|
||||
public static final int KEY_KPDOT = 83;
|
||||
|
||||
public static final int KEY_F11 = 87;
|
||||
public static final int KEY_F12 = 88;
|
||||
|
||||
public static final int KEY_KPENTER = 96;
|
||||
public static final int KEY_RIGHTCTRL = 97;
|
||||
public static final int KEY_KPSLASH = 98;
|
||||
public static final int KEY_SYSRQ = 99;
|
||||
public static final int KEY_RIGHTALT = 100;
|
||||
|
||||
public static final int KEY_HOME = 102;
|
||||
public static final int KEY_UP = 103;
|
||||
public static final int KEY_PAGEUP = 104;
|
||||
public static final int KEY_LEFT = 105;
|
||||
public static final int KEY_RIGHT = 106;
|
||||
public static final int KEY_END = 107;
|
||||
public static final int KEY_DOWN = 108;
|
||||
public static final int KEY_PAGEDOWN = 109;
|
||||
public static final int KEY_INSERT = 110;
|
||||
public static final int KEY_DELETE = 111;
|
||||
|
||||
public static final int KEY_KPEQUAL = 117;
|
||||
|
||||
public static final int KEY_PAUSE = 119;
|
||||
|
||||
public static final int KEY_KPCOMMA = 121;
|
||||
|
||||
public static final int KEY_LEFTMATA = 125;
|
||||
public static final int KEY_RIGHTMETA = 126;
|
||||
|
||||
public static final int KEY_F13 = 183;
|
||||
public static final int KEY_F14 = 184;
|
||||
public static final int KEY_F15 = 185;
|
||||
public static final int KEY_F16 = 186;
|
||||
public static final int KEY_F17 = 187;
|
||||
public static final int KEY_F18 = 188;
|
||||
public static final int KEY_F19 = 189;
|
||||
public static final int KEY_F20 = 190;
|
||||
public static final int KEY_F21 = 191;
|
||||
public static final int KEY_F22 = 192;
|
||||
public static final int KEY_F23 = 193;
|
||||
public static final int KEY_F24 = 194;
|
||||
|
||||
public static final int KEY_UNKNOWN = 240;
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.aof.mcinabox.gamecontroller.codes;
|
||||
|
||||
public class BoatMousecodes {
|
||||
public static final int BOAT_MOUSE_BUTTON_LEFT = 1;
|
||||
public static final int BOAT_MOUSE_BUTTON_MIDDLE = 2;
|
||||
public static final int BOAT_MOUSE_BUTTON_RIGHT = 3;
|
||||
public static final int BOAT_MOUSE_WHEEL_UP = 4;
|
||||
public static final int BOAT_MOUSE_WHEEL_DOWN = 5;
|
||||
public static final int BOAT_MOUSE_BUTTON_tilt_left = 6; /*rare*/
|
||||
public static final int BOAT_MOUSE_BUTTON_tilt_right = 7; /*rare*/
|
||||
public static final int BOAT_MOUSE_BUTTON_back = 8; /* only definned in org.lwjgl.opengl.BoatMouse.java */
|
||||
public static final int BOAT_MOUSE_BUTTON_froward = 9; /* only definned in org.lwjgl.opengl.BoatMouse.java */
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package com.aof.mcinabox.gamecontroller.codes;
|
||||
|
||||
public interface CoKeyMap {
|
||||
Object translate(Object keyCode);
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.aof.mcinabox.gamecontroller.codes;
|
||||
|
||||
public class Translation {
|
||||
|
||||
private final CoKeyMap xKeyMap;
|
||||
|
||||
public Translation(int mode) {
|
||||
xKeyMap = new XKeyMap();
|
||||
}
|
||||
|
||||
public int trans(String s) {
|
||||
return (int) xKeyMap.translate(s);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,150 @@
|
|||
package com.aof.mcinabox.gamecontroller.codes;
|
||||
|
||||
import com.aof.mcinabox.gamecontroller.definitions.map.KeyMap;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import static com.aof.mcinabox.gamecontroller.codes.BoatKeycodes.*;
|
||||
import static com.aof.mcinabox.gamecontroller.codes.BoatMousecodes.BOAT_MOUSE_BUTTON_LEFT;
|
||||
import static com.aof.mcinabox.gamecontroller.codes.BoatMousecodes.BOAT_MOUSE_BUTTON_MIDDLE;
|
||||
import static com.aof.mcinabox.gamecontroller.codes.BoatMousecodes.BOAT_MOUSE_BUTTON_RIGHT;
|
||||
import static com.aof.mcinabox.gamecontroller.codes.BoatMousecodes.BOAT_MOUSE_WHEEL_DOWN;
|
||||
import static com.aof.mcinabox.gamecontroller.codes.BoatMousecodes.BOAT_MOUSE_WHEEL_UP;
|
||||
import static com.aof.mcinabox.gamecontroller.definitions.map.MouseMap.MOUSEMAP_BUTTON_LEFT;
|
||||
import static com.aof.mcinabox.gamecontroller.definitions.map.MouseMap.MOUSEMAP_BUTTON_MIDDLE;
|
||||
import static com.aof.mcinabox.gamecontroller.definitions.map.MouseMap.MOUSEMAP_BUTTON_RIGHT;
|
||||
import static com.aof.mcinabox.gamecontroller.definitions.map.MouseMap.MOUSEMAP_WHEEL_DOWN;
|
||||
import static com.aof.mcinabox.gamecontroller.definitions.map.MouseMap.MOUSEMAP_WHEEL_UP;
|
||||
|
||||
public class XKeyMap implements KeyMap, CoKeyMap {
|
||||
|
||||
private final HashMap<String, Integer> xKeyMap;
|
||||
|
||||
public XKeyMap() {
|
||||
xKeyMap = new HashMap<>();
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
xKeyMap.put(KEYMAP_KEY_0, KEY_0);
|
||||
xKeyMap.put(KEYMAP_KEY_1, KEY_1);
|
||||
xKeyMap.put(KEYMAP_KEY_2, KEY_2);
|
||||
xKeyMap.put(KEYMAP_KEY_3, KEY_3);
|
||||
xKeyMap.put(KEYMAP_KEY_4, KEY_4);
|
||||
xKeyMap.put(KEYMAP_KEY_5, KEY_5);
|
||||
xKeyMap.put(KEYMAP_KEY_6, KEY_6);
|
||||
xKeyMap.put(KEYMAP_KEY_7, KEY_7);
|
||||
xKeyMap.put(KEYMAP_KEY_8, KEY_8);
|
||||
xKeyMap.put(KEYMAP_KEY_9, KEY_9);
|
||||
xKeyMap.put(KEYMAP_KEY_A, KEY_A);
|
||||
xKeyMap.put(KEYMAP_KEY_B, KEY_B);
|
||||
xKeyMap.put(KEYMAP_KEY_C, KEY_C);
|
||||
xKeyMap.put(KEYMAP_KEY_D, KEY_D);
|
||||
xKeyMap.put(KEYMAP_KEY_E, KEY_E);
|
||||
xKeyMap.put(KEYMAP_KEY_F, KEY_F);
|
||||
xKeyMap.put(KEYMAP_KEY_G, KEY_G);
|
||||
xKeyMap.put(KEYMAP_KEY_H, KEY_H);
|
||||
xKeyMap.put(KEYMAP_KEY_I, KEY_I);
|
||||
xKeyMap.put(KEYMAP_KEY_J, KEY_J);
|
||||
xKeyMap.put(KEYMAP_KEY_K, KEY_K);
|
||||
xKeyMap.put(KEYMAP_KEY_L, KEY_L);
|
||||
xKeyMap.put(KEYMAP_KEY_M, KEY_M);
|
||||
xKeyMap.put(KEYMAP_KEY_N, KEY_N);
|
||||
xKeyMap.put(KEYMAP_KEY_O, KEY_O);
|
||||
xKeyMap.put(KEYMAP_KEY_P, KEY_P);
|
||||
xKeyMap.put(KEYMAP_KEY_Q, KEY_Q);
|
||||
xKeyMap.put(KEYMAP_KEY_R, KEY_R);
|
||||
xKeyMap.put(KEYMAP_KEY_S, KEY_S);
|
||||
xKeyMap.put(KEYMAP_KEY_T, KEY_T);
|
||||
xKeyMap.put(KEYMAP_KEY_U, KEY_U);
|
||||
xKeyMap.put(KEYMAP_KEY_V, KEY_V);
|
||||
xKeyMap.put(KEYMAP_KEY_W, KEY_W);
|
||||
xKeyMap.put(KEYMAP_KEY_X, KEY_X);
|
||||
xKeyMap.put(KEYMAP_KEY_Y, KEY_Y);
|
||||
xKeyMap.put(KEYMAP_KEY_Z, KEY_Z);
|
||||
xKeyMap.put(KEYMAP_KEY_MINUS, KEY_MINUS);
|
||||
xKeyMap.put(KEYMAP_KEY_EQUALS, KEY_EQUAL);
|
||||
xKeyMap.put(KEYMAP_KEY_LBRACKET, KEY_LEFTBRACE);
|
||||
xKeyMap.put(KEYMAP_KEY_RBRACKET, KEY_RIGHTBRACE);
|
||||
xKeyMap.put(KEYMAP_KEY_SEMICOLON, KEY_SEMICOLON);
|
||||
xKeyMap.put(KEYMAP_KEY_APOSTROPHE, KEY_APOSTROPHE);
|
||||
xKeyMap.put(KEYMAP_KEY_GRAVE, KEY_GRAVE);
|
||||
xKeyMap.put(KEYMAP_KEY_BACKSLASH, KEY_BACKSLASH);
|
||||
xKeyMap.put(KEYMAP_KEY_COMMA, KEY_COMMA);
|
||||
xKeyMap.put(KEYMAP_KEY_PERIOD, KEY_DOT);
|
||||
xKeyMap.put(KEYMAP_KEY_SLASH, KEY_SLASH);
|
||||
xKeyMap.put(KEYMAP_KEY_ESC, 1);
|
||||
xKeyMap.put(KEYMAP_KEY_F1, KEY_F1);
|
||||
xKeyMap.put(KEYMAP_KEY_F2, KEY_F2);
|
||||
xKeyMap.put(KEYMAP_KEY_F3, KEY_F3);
|
||||
xKeyMap.put(KEYMAP_KEY_F4, KEY_F4);
|
||||
xKeyMap.put(KEYMAP_KEY_F5, KEY_F5);
|
||||
xKeyMap.put(KEYMAP_KEY_F6, KEY_F6);
|
||||
xKeyMap.put(KEYMAP_KEY_F7, KEY_F7);
|
||||
xKeyMap.put(KEYMAP_KEY_F8, KEY_F8);
|
||||
xKeyMap.put(KEYMAP_KEY_F9, KEY_F9);
|
||||
xKeyMap.put(KEYMAP_KEY_F10, KEY_F10);
|
||||
xKeyMap.put(KEYMAP_KEY_F11, KEY_F11);
|
||||
xKeyMap.put(KEYMAP_KEY_F12, KEY_F12);
|
||||
xKeyMap.put(KEYMAP_KEY_TAB, KEY_TAB);
|
||||
xKeyMap.put(KEYMAP_KEY_BACKSPACE, KEY_BACKSPACE);
|
||||
xKeyMap.put(KEYMAP_KEY_SPACE, KEY_SPACE);
|
||||
xKeyMap.put(KEYMAP_KEY_CAPITAL, KEY_CAPSLOCK);
|
||||
xKeyMap.put(KEYMAP_KEY_ENTER, KEY_ENTER);
|
||||
xKeyMap.put(KEYMAP_KEY_LSHIFT, KEY_LEFTSHIFT);
|
||||
xKeyMap.put(KEYMAP_KEY_LCTRL, KEY_LEFTCTRL);
|
||||
xKeyMap.put(KEYMAP_KEY_LALT, KEY_LEFTALT);
|
||||
xKeyMap.put(KEYMAP_KEY_RSHIFT, KEY_RIGHTSHIFT);
|
||||
xKeyMap.put(KEYMAP_KEY_RCTRL, KEY_RIGHTCTRL);
|
||||
xKeyMap.put(KEYMAP_KEY_RALT, KEY_RIGHTALT);
|
||||
xKeyMap.put(KEYMAP_KEY_UP, KEY_UP);
|
||||
xKeyMap.put(KEYMAP_KEY_DOWN, KEY_DOWN);
|
||||
xKeyMap.put(KEYMAP_KEY_LEFT, KEY_LEFT);
|
||||
xKeyMap.put(KEYMAP_KEY_RIGHT, KEY_RIGHT);
|
||||
xKeyMap.put(KEYMAP_KEY_PAGEUP, KEY_PAGEUP);
|
||||
xKeyMap.put(KEYMAP_KEY_PAGEDOWN, KEY_PAGEDOWN);
|
||||
xKeyMap.put(KEYMAP_KEY_HOME, KEY_HOME);
|
||||
xKeyMap.put(KEYMAP_KEY_END, KEY_END);
|
||||
xKeyMap.put(KEYMAP_KEY_INSERT, KEY_INSERT);
|
||||
xKeyMap.put(KEYMAP_KEY_DELETE, KEY_DELETE);
|
||||
xKeyMap.put(KEYMAP_KEY_PAUSE, KEY_PAUSE);
|
||||
xKeyMap.put(KEYMAP_KEY_NUMPAD0, KEY_KP0);
|
||||
xKeyMap.put(KEYMAP_KEY_NUMPAD1, KEY_KP1);
|
||||
xKeyMap.put(KEYMAP_KEY_NUMPAD2, KEY_KP2);
|
||||
xKeyMap.put(KEYMAP_KEY_NUMPAD3, KEY_KP3);
|
||||
xKeyMap.put(KEYMAP_KEY_NUMPAD4, KEY_KP4);
|
||||
xKeyMap.put(KEYMAP_KEY_NUMPAD5, KEY_KP5);
|
||||
xKeyMap.put(KEYMAP_KEY_NUMPAD6, KEY_KP6);
|
||||
xKeyMap.put(KEYMAP_KEY_NUMPAD7, KEY_KP7);
|
||||
xKeyMap.put(KEYMAP_KEY_NUMPAD8, KEY_KP8);
|
||||
xKeyMap.put(KEYMAP_KEY_NUMPAD9, KEY_KP9);
|
||||
xKeyMap.put(KEYMAP_KEY_NUMLOCK, KEY_NUMLOCK);
|
||||
xKeyMap.put(KEYMAP_KEY_SCROLL, KEY_SCROLLLOCK);
|
||||
xKeyMap.put(KEYMAP_KEY_SUBTRACT, KEY_KPMINUS);
|
||||
xKeyMap.put(KEYMAP_KEY_ADD, KEY_KPPLUS);
|
||||
xKeyMap.put(KEYMAP_KEY_DECIMAL, KEY_KPDOT);
|
||||
xKeyMap.put(KEYMAP_KEY_NUMPADENTER, KEY_KPENTER);
|
||||
xKeyMap.put(KEYMAP_KEY_DIVIDE, KEY_KPSLASH);
|
||||
xKeyMap.put(KEYMAP_KEY_MULTIPLY, KEY_KPASTERISK);
|
||||
xKeyMap.put(KEYMAP_KEY_PRINT, KEY_P);
|
||||
// xKeyMap.put(KEYMAP_KEY_LWIN, KEY_SUPER_L);
|
||||
// xKeyMap.put(KEYMAP_KEY_RWIN, KEY_SUPER_R);
|
||||
/* missing RightK in BoatKeycodes.java */
|
||||
|
||||
/* Mouse buttons codes */
|
||||
xKeyMap.put(MOUSEMAP_BUTTON_LEFT, BOAT_MOUSE_BUTTON_LEFT);
|
||||
xKeyMap.put(MOUSEMAP_BUTTON_RIGHT, BOAT_MOUSE_BUTTON_RIGHT);
|
||||
xKeyMap.put(MOUSEMAP_BUTTON_MIDDLE, BOAT_MOUSE_BUTTON_MIDDLE);
|
||||
xKeyMap.put(MOUSEMAP_WHEEL_UP, BOAT_MOUSE_WHEEL_UP);
|
||||
xKeyMap.put(MOUSEMAP_WHEEL_DOWN, BOAT_MOUSE_WHEEL_DOWN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object translate(Object keyCode) {
|
||||
if (xKeyMap.containsKey(keyCode)) {
|
||||
return xKeyMap.get(keyCode);
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.aof.mcinabox.gamecontroller.definitions.id.key;
|
||||
|
||||
public interface KeyEvent {
|
||||
//Define Type ID
|
||||
int KEYBOARD_BUTTON = 11;
|
||||
int MOUSE_BUTTON = 12;
|
||||
int MOUSE_POINTER = 13;
|
||||
int MOUSE_POINTER_INC = 15;
|
||||
int TYPE_WORDS = 14;
|
||||
|
||||
int KEYMAP_TO_LWJGL = 21;
|
||||
int KEYMAP_TO_GLFW = 22;
|
||||
int KEYMAP_TO_X = 23;
|
||||
int ANDROID_TO_KEYMAP = 24;
|
||||
|
||||
String MARK_KEYNAME_SPLIT = "\\|";
|
||||
String MARK_KEYNAME_SPLIT_STRING = "|";
|
||||
}
|
|
@ -0,0 +1,115 @@
|
|||
package com.aof.mcinabox.gamecontroller.definitions.map;
|
||||
|
||||
public interface KeyMap {
|
||||
String
|
||||
/* basic keys on main keyboard */
|
||||
KEYMAP_KEY_0 = "0",
|
||||
KEYMAP_KEY_1 = "1",
|
||||
KEYMAP_KEY_2 = "2",
|
||||
KEYMAP_KEY_3 = "3",
|
||||
KEYMAP_KEY_4 = "4",
|
||||
KEYMAP_KEY_5 = "5",
|
||||
KEYMAP_KEY_6 = "6",
|
||||
KEYMAP_KEY_7 = "7",
|
||||
KEYMAP_KEY_8 = "8",
|
||||
KEYMAP_KEY_9 = "9",
|
||||
KEYMAP_KEY_A = "A",
|
||||
KEYMAP_KEY_B = "B",
|
||||
KEYMAP_KEY_C = "C",
|
||||
KEYMAP_KEY_D = "D",
|
||||
KEYMAP_KEY_E = "E",
|
||||
KEYMAP_KEY_F = "F",
|
||||
KEYMAP_KEY_G = "G",
|
||||
KEYMAP_KEY_H = "H",
|
||||
KEYMAP_KEY_I = "I",
|
||||
KEYMAP_KEY_J = "J",
|
||||
KEYMAP_KEY_K = "K",
|
||||
KEYMAP_KEY_L = "L",
|
||||
KEYMAP_KEY_M = "M",
|
||||
KEYMAP_KEY_N = "N",
|
||||
KEYMAP_KEY_O = "O",
|
||||
KEYMAP_KEY_P = "P",
|
||||
KEYMAP_KEY_Q = "Q",
|
||||
KEYMAP_KEY_R = "R",
|
||||
KEYMAP_KEY_S = "S",
|
||||
KEYMAP_KEY_T = "T",
|
||||
KEYMAP_KEY_U = "U",
|
||||
KEYMAP_KEY_V = "V",
|
||||
KEYMAP_KEY_W = "W",
|
||||
KEYMAP_KEY_X = "X",
|
||||
KEYMAP_KEY_Y = "Y",
|
||||
KEYMAP_KEY_Z = "Z",
|
||||
KEYMAP_KEY_MINUS = "-", // - on main keyboard
|
||||
KEYMAP_KEY_EQUALS = "=", // = on main keyboard
|
||||
KEYMAP_KEY_LBRACKET = "[", // [ on main keyboard
|
||||
KEYMAP_KEY_RBRACKET = "]", // ] on main keyboard
|
||||
KEYMAP_KEY_SEMICOLON = ";", // ; on main keyboard
|
||||
KEYMAP_KEY_APOSTROPHE = "'", // ' on main keyboard
|
||||
KEYMAP_KEY_GRAVE = "`", // ` on main keyboard
|
||||
KEYMAP_KEY_BACKSLASH = "\\", // \ on main keyboard
|
||||
KEYMAP_KEY_COMMA = ",", // , on main keyboard
|
||||
KEYMAP_KEY_PERIOD = ".", // . on main keyboard
|
||||
KEYMAP_KEY_SLASH = "/", // / on main keyboard
|
||||
|
||||
/* function keys on main keyboard */
|
||||
KEYMAP_KEY_ESC = "ESC",
|
||||
KEYMAP_KEY_F1 = "F1",
|
||||
KEYMAP_KEY_F2 = "F2",
|
||||
KEYMAP_KEY_F3 = "F3",
|
||||
KEYMAP_KEY_F4 = "F4",
|
||||
KEYMAP_KEY_F5 = "F5",
|
||||
KEYMAP_KEY_F6 = "F6",
|
||||
KEYMAP_KEY_F7 = "F7",
|
||||
KEYMAP_KEY_F8 = "F8",
|
||||
KEYMAP_KEY_F9 = "F9",
|
||||
KEYMAP_KEY_F10 = "F10",
|
||||
KEYMAP_KEY_F11 = "F11",
|
||||
KEYMAP_KEY_F12 = "F12",
|
||||
KEYMAP_KEY_TAB = "TAB",
|
||||
KEYMAP_KEY_BACKSPACE = "BACK",
|
||||
KEYMAP_KEY_SPACE = "SPACE",
|
||||
KEYMAP_KEY_CAPITAL = "CAPITAL", //Caps Lock
|
||||
KEYMAP_KEY_ENTER = "ENTER",
|
||||
KEYMAP_KEY_LSHIFT = "LSHIFT",
|
||||
KEYMAP_KEY_LCTRL = "LCTRL",
|
||||
KEYMAP_KEY_LALT = "LALT",
|
||||
KEYMAP_KEY_RSHIFT = "RSHIFT",
|
||||
KEYMAP_KEY_RCTRL = "RCTRL",
|
||||
KEYMAP_KEY_RALT = "RALT",
|
||||
KEYMAP_KEY_UP = "UP",
|
||||
KEYMAP_KEY_DOWN = "DOWN",
|
||||
KEYMAP_KEY_LEFT = "LEFT",
|
||||
KEYMAP_KEY_RIGHT = "RIGHT",
|
||||
KEYMAP_KEY_PAGEUP = "PGUP",
|
||||
KEYMAP_KEY_PAGEDOWN = "PGDN",
|
||||
KEYMAP_KEY_HOME = "HOME",
|
||||
KEYMAP_KEY_END = "END",
|
||||
KEYMAP_KEY_INSERT = "INSERT",
|
||||
KEYMAP_KEY_DELETE = "DELETE",
|
||||
KEYMAP_KEY_PAUSE = "PAUSE", // pause & break
|
||||
KEYMAP_KEY_PRINT = "PRINT",
|
||||
KEYMAP_KEY_LWIN = "LWIN",
|
||||
KEYMAP_KEY_RWIN = "RWIN",
|
||||
KEYMAP_KEY_RIGHTK = "RIGHTK", // Sec Button in Mouse, how to achieve this in Keyboard?
|
||||
|
||||
/* keys on numeric keypad */
|
||||
KEYMAP_KEY_NUMPAD0 = "NUMPAD0",
|
||||
KEYMAP_KEY_NUMPAD1 = "NUMPAD1",
|
||||
KEYMAP_KEY_NUMPAD2 = "NUMPAD2",
|
||||
KEYMAP_KEY_NUMPAD3 = "NUMPAD3",
|
||||
KEYMAP_KEY_NUMPAD4 = "NUMPAD4",
|
||||
KEYMAP_KEY_NUMPAD5 = "NUMPAD5",
|
||||
KEYMAP_KEY_NUMPAD6 = "NUMPAD6",
|
||||
KEYMAP_KEY_NUMPAD7 = "NUMPAD7",
|
||||
KEYMAP_KEY_NUMPAD8 = "NUMPAD8",
|
||||
KEYMAP_KEY_NUMPAD9 = "NUMPAD9",
|
||||
KEYMAP_KEY_NUMLOCK = "NUMLOCK", //Num Lock
|
||||
KEYMAP_KEY_SCROLL = "SCROLL", //Scroll Lock
|
||||
KEYMAP_KEY_SUBTRACT = "NUMPAD-", // -
|
||||
KEYMAP_KEY_ADD = "NUMPAD+", // +
|
||||
KEYMAP_KEY_DECIMAL = "NUMPAD.", // .
|
||||
KEYMAP_KEY_NUMPADENTER = "NUMPADENTER", // Enter on numeric keypad
|
||||
KEYMAP_KEY_DIVIDE = "NUMPAD\\", // /
|
||||
KEYMAP_KEY_MULTIPLY = "NUMPAD*";
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.aof.mcinabox.gamecontroller.definitions.map;
|
||||
|
||||
public interface MouseMap {
|
||||
String
|
||||
MOUSEMAP_BUTTON_LEFT = "MOUSE_BUTTON_LEFT",
|
||||
MOUSEMAP_BUTTON_RIGHT = "MOUSE_BUTTON_RIGHT",
|
||||
MOUSEMAP_BUTTON_MIDDLE = "MOUSE_BUTTON_MIDDLE",
|
||||
MOUSEMAP_WHEEL_UP = "MOUSE_WHEEL_UP",
|
||||
MOUSEMAP_WHEEL_DOWN = "MOUSE_WHEEL_DOWN";
|
||||
|
||||
}
|
|
@ -0,0 +1,534 @@
|
|||
package com.mio.customcontrol;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.view.View.OnTouchListener;
|
||||
import android.view.MotionEvent;
|
||||
import android.widget.Toast;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class MioCrossingKeyboard extends RelativeLayout implements OnTouchListener {
|
||||
|
||||
private MioListener mListener;
|
||||
private LinearLayout main;
|
||||
private Button touchPad;
|
||||
private final Context context;
|
||||
private LinearLayout layout_up;
|
||||
private Button btn_leftUp,
|
||||
btn_up,
|
||||
btn_rightUp;
|
||||
|
||||
private LinearLayout layout_center;
|
||||
private Button btn_left,
|
||||
btn_center,
|
||||
btn_right;
|
||||
|
||||
private LinearLayout layout_down;
|
||||
private Button btn_leftDown,
|
||||
btn_down,
|
||||
btn_rightDown;
|
||||
|
||||
private boolean fromCenter=false;
|
||||
private boolean fromUp=false;
|
||||
public MioCrossingKeyboard(Context context) {
|
||||
super(context);
|
||||
this.context = context;
|
||||
init();
|
||||
hideBtn();
|
||||
}
|
||||
public MioCrossingKeyboard(Context context,AttributeSet attr) {
|
||||
super(context, attr);
|
||||
this.context = context;
|
||||
init();
|
||||
hideBtn();
|
||||
}
|
||||
public MioCrossingKeyboard(Context context,AttributeSet attr, int defStyle) {
|
||||
super(context, attr, defStyle);
|
||||
this.context = context;
|
||||
init();
|
||||
hideBtn();
|
||||
}
|
||||
public void setListener(MioListener mListener) {
|
||||
this.mListener = mListener;
|
||||
}
|
||||
private void init() {
|
||||
main = new LinearLayout(context);
|
||||
main.setOrientation(LinearLayout.VERTICAL);
|
||||
layout_up = new LinearLayout(context);
|
||||
layout_up.setOrientation(LinearLayout.HORIZONTAL);
|
||||
layout_center = new LinearLayout(context);
|
||||
layout_center.setOrientation(LinearLayout.HORIZONTAL);
|
||||
layout_down = new LinearLayout(context);
|
||||
layout_down.setOrientation(LinearLayout.HORIZONTAL);
|
||||
|
||||
btn_leftUp = createButton("◤", 25);
|
||||
btn_up = createButton("▲", 32);
|
||||
btn_rightUp = createButton("◥", 25);
|
||||
|
||||
btn_left = createButton("◀", 32);
|
||||
btn_center = createButton("◆", 32);
|
||||
btn_right = createButton("▶", 32);
|
||||
|
||||
btn_leftDown = createButton("◣", 25);
|
||||
btn_down = createButton("▼", 32);
|
||||
btn_rightDown = createButton("◢", 25);
|
||||
|
||||
layout_up.addView(btn_leftUp);
|
||||
layout_up.addView(btn_up);
|
||||
layout_up.addView(btn_rightUp);
|
||||
|
||||
layout_center.addView(btn_left);
|
||||
layout_center.addView(btn_center);
|
||||
layout_center.addView(btn_right);
|
||||
|
||||
layout_down.addView(btn_leftDown);
|
||||
layout_down.addView(btn_down);
|
||||
layout_down.addView(btn_rightDown);
|
||||
LinearLayout.LayoutParams params1=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
1.0f);
|
||||
main.addView(layout_up, params1);
|
||||
main.addView(layout_center, params1);
|
||||
main.addView(layout_down, params1);
|
||||
LinearLayout.LayoutParams params=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
LinearLayout.LayoutParams.MATCH_PARENT);
|
||||
this.addView(main, params);
|
||||
touchPad = new Button(context);
|
||||
touchPad.setOnTouchListener(this);
|
||||
touchPad.setAlpha(0);
|
||||
this.addView(touchPad, params);
|
||||
|
||||
}
|
||||
private Button createButton(String text, float textSize) {
|
||||
Button b=new Button(context);
|
||||
b.setText(text);
|
||||
LinearLayout.LayoutParams params=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
1.0f);
|
||||
b.setLayoutParams(params);
|
||||
b.setTextSize(textSize);
|
||||
b.setTextColor(Color.WHITE);
|
||||
GradientDrawable drawable = new GradientDrawable();
|
||||
drawable.setShape(GradientDrawable.RECTANGLE);
|
||||
drawable.setColor(Color.parseColor("#00FFFFFF"));
|
||||
drawable.setCornerRadius(25);
|
||||
drawable.setStroke(1, Color.WHITE);
|
||||
b.setBackground(drawable);
|
||||
b.setFocusable(false);
|
||||
b.setEnabled(false);
|
||||
return b;
|
||||
}
|
||||
public void 自定义(){
|
||||
自定义= !自定义;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算两个点的距离
|
||||
*
|
||||
* @param event 事件
|
||||
* @return 返回数值
|
||||
*/
|
||||
private double spacing(MotionEvent event) {
|
||||
if (event.getPointerCount() == 2) {
|
||||
float x = event.getX(0) - event.getX(1);
|
||||
float y = event.getY(0) - event.getY(1);
|
||||
return Math.sqrt(x * x + y * y);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置放大缩小
|
||||
*
|
||||
* @param scale 缩放值
|
||||
*/
|
||||
public void setScale(float scale) {
|
||||
setScaleX(scale);
|
||||
setScaleY(scale);
|
||||
mScale=scale;
|
||||
}
|
||||
//最大的缩放比例
|
||||
public float mScale;
|
||||
public static final float SCALE_MAX = 3.0f;
|
||||
public static final float SCALE_MIN = 0.5f;
|
||||
|
||||
private double oldDist = 0;
|
||||
private double moveDist = 0;
|
||||
|
||||
private TouchInfo mInfo;
|
||||
private int lastPos=0;
|
||||
private final int LEFT_UP=1,UP=2,RIGHT_UP=3;
|
||||
private final int LEFT=4,CENTER=5,RIGHT=6;
|
||||
private final int LEFT_DOWN=7,DOWN=8,RIGHT_DOWN=9;
|
||||
private boolean 自定义=false;
|
||||
|
||||
private int 触摸点横坐标;
|
||||
|
||||
private int 触摸点纵坐标;
|
||||
|
||||
private int 横坐标偏移;
|
||||
|
||||
private int 纵坐标偏移;
|
||||
|
||||
private int 左边距;
|
||||
|
||||
private int 上边距;
|
||||
|
||||
private int 右边距;
|
||||
|
||||
private int 下边距;
|
||||
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
if (自定义){
|
||||
if (event.getPointerCount()==1){
|
||||
if (event.getAction()==MotionEvent.ACTION_DOWN){
|
||||
触摸点横坐标 = (int)event.getX();
|
||||
触摸点纵坐标 = (int)event.getY();
|
||||
}else if (event.getAction()==MotionEvent.ACTION_MOVE) {
|
||||
ViewGroup mViewGroup = (ViewGroup) getParent();
|
||||
横坐标偏移 = (int)event.getX() - 触摸点横坐标;
|
||||
纵坐标偏移 = (int)event.getY() - 触摸点纵坐标;
|
||||
左边距 = this.getLeft() + 横坐标偏移;
|
||||
上边距 = this.getTop() + 纵坐标偏移;
|
||||
右边距 = this.getRight() + 横坐标偏移;
|
||||
下边距 = mViewGroup.getHeight() - this.getBottom() - 纵坐标偏移;
|
||||
this.layout(左边距, 上边距, 右边距, 下边距);
|
||||
|
||||
RelativeLayout.LayoutParams params=(RelativeLayout.LayoutParams)this.getLayoutParams();
|
||||
params.leftMargin=左边距;
|
||||
params.bottomMargin=下边距;
|
||||
// params.setMargins(左边距, 上边距, 右边距, 下边距);
|
||||
this.setLayoutParams(params);
|
||||
}else if (event.getAction()==MotionEvent.ACTION_UP){
|
||||
|
||||
}
|
||||
}else if (event.getPointerCount()==2){
|
||||
switch (event.getActionMasked()){
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
moveDist = spacing(event);
|
||||
double space = moveDist - oldDist;
|
||||
float scale = (float) (getScaleX() + space / getWidth());
|
||||
if (scale > SCALE_MIN && scale < SCALE_MAX) {
|
||||
setScale(scale);
|
||||
} else if (scale < SCALE_MIN) {
|
||||
setScale(SCALE_MIN);
|
||||
}
|
||||
break;
|
||||
case MotionEvent.ACTION_POINTER_DOWN:
|
||||
//两点按下时的距离
|
||||
oldDist = spacing(event);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}else {
|
||||
if (mInfo == null) {
|
||||
mInfo = new TouchInfo();
|
||||
mInfo.setLayoutWidth(v.getWidth());
|
||||
mInfo.setLayoutHeight(v.getHeight());
|
||||
}
|
||||
mInfo.setFingerX(event.getX() - v.getLeft());
|
||||
mInfo.setFingerY(event.getY() - v.getTop());
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
mInfo.setDownX(event.getX() - v.getLeft());
|
||||
mInfo.setDownY(event.getY() - v.getTop());
|
||||
}
|
||||
if (mInfo.getFingerY() < mInfo.getLayoutHeight() / 3) {
|
||||
if (mInfo.getFingerX() < mInfo.getLayoutWidth() / 3) {
|
||||
if (fromCenter) {
|
||||
if (event.getAction() == MotionEvent.ACTION_UP) {
|
||||
if (Math.abs(mInfo.getDownX() - mInfo.getFingerX()) > mInfo.getLayoutWidth() / 2 && Math.abs(mInfo.getDownY() - mInfo.getFingerY()) > mInfo.getLayoutHeight() / 2) {
|
||||
mListener.onSlipLeftUp();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
showBtn(btn_leftUp);
|
||||
if (mListener != null&&lastPos!=LEFT_UP) {
|
||||
mListener.onLeftUp();
|
||||
lastPos=LEFT_UP;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (mInfo.getFingerX() < mInfo.getLayoutWidth() * 2 / 3) {
|
||||
if (fromCenter) {
|
||||
if (event.getAction() == MotionEvent.ACTION_UP) {
|
||||
if (Math.abs(mInfo.getDownX() - mInfo.getFingerX()) < mInfo.getLayoutWidth() / 2 && Math.abs(mInfo.getDownY() - mInfo.getFingerY()) > mInfo.getLayoutHeight() / 2) {
|
||||
mListener.onSlipUp();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
fromUp=true;
|
||||
hideBtn();
|
||||
btn_leftUp.setAlpha(1);
|
||||
btn_rightUp.setAlpha(1);
|
||||
if (mListener != null&&lastPos!=UP) {
|
||||
mListener.onUp();
|
||||
lastPos=UP;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (fromCenter) {
|
||||
if (event.getAction() == MotionEvent.ACTION_UP) {
|
||||
if (Math.abs(mInfo.getDownX() - mInfo.getFingerX()) > mInfo.getLayoutWidth() / 2 && Math.abs(mInfo.getDownY() - mInfo.getFingerY()) > mInfo.getLayoutHeight() / 2) {
|
||||
mListener.onSlipRightUp();
|
||||
}
|
||||
}
|
||||
}else if (mInfo.getFingerX() < mInfo.getLayoutWidth()) {
|
||||
showBtn(btn_rightUp);
|
||||
if (mListener != null&&lastPos!=RIGHT_UP) {
|
||||
mListener.onRightUp();
|
||||
lastPos=RIGHT_UP;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (mInfo.getFingerY() < mInfo.getLayoutHeight() * 2 / 3) {
|
||||
if (mInfo.getFingerX() < mInfo.getLayoutWidth() / 3) {
|
||||
if (fromCenter) {
|
||||
if (event.getAction() == MotionEvent.ACTION_UP) {
|
||||
if (Math.abs(mInfo.getDownX() - mInfo.getFingerX()) > mInfo.getLayoutWidth() / 2 && Math.abs(mInfo.getDownY() - mInfo.getFingerY()) < mInfo.getLayoutHeight() / 2) {
|
||||
mListener.onSlipLeft();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
hideBtn();
|
||||
btn_leftUp.setAlpha(1);
|
||||
btn_leftDown.setAlpha(1);
|
||||
if (mListener != null&&lastPos!=LEFT) {
|
||||
mListener.onLeft();
|
||||
lastPos=LEFT;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (mInfo.getFingerX() < mInfo.getLayoutWidth() * 2 / 3) {
|
||||
if(fromUp&&lastPos!=CENTER){
|
||||
mListener.onUpToCenter();
|
||||
}
|
||||
hideBtn();
|
||||
if (mListener != null&&lastPos!=CENTER) {
|
||||
mListener.onCenter(lastPos == 0);
|
||||
lastPos=CENTER;
|
||||
}
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
fromCenter = true;
|
||||
}
|
||||
} else {
|
||||
if (fromCenter) {
|
||||
if (event.getAction() == MotionEvent.ACTION_UP) {
|
||||
if (Math.abs(mInfo.getFingerX() - mInfo.getDownX()) > mInfo.getLayoutWidth() / 2 && Math.abs(mInfo.getDownY() - mInfo.getFingerY()) < mInfo.getLayoutHeight() / 2) {
|
||||
mListener.onSlipRight();
|
||||
}
|
||||
}
|
||||
}else if (mInfo.getFingerX() < mInfo.getLayoutWidth()) {
|
||||
hideBtn();
|
||||
btn_rightDown.setAlpha(1);
|
||||
btn_rightUp.setAlpha(1);
|
||||
if (mListener != null&&lastPos!=RIGHT) {
|
||||
mListener.onRight();
|
||||
lastPos=RIGHT;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (mInfo.getFingerX() < mInfo.getLayoutWidth() / 3) {
|
||||
if (fromCenter) {
|
||||
if (event.getAction() == MotionEvent.ACTION_UP) {
|
||||
if (Math.abs(mInfo.getDownX() - mInfo.getFingerX()) > mInfo.getLayoutWidth() / 2 && Math.abs(mInfo.getDownY() - mInfo.getFingerY()) > mInfo.getLayoutHeight() / 2) {
|
||||
mListener.onSlipLeftDown();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
showBtn(btn_leftDown);
|
||||
if (mListener != null&&lastPos!=LEFT_DOWN) {
|
||||
mListener.onLeftDown();
|
||||
lastPos=LEFT_DOWN;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (mInfo.getFingerX() < mInfo.getLayoutWidth() * 2 / 3) {
|
||||
if (fromCenter) {
|
||||
if (event.getAction() == MotionEvent.ACTION_UP) {
|
||||
if (Math.abs(mInfo.getDownX() - mInfo.getFingerX()) < mInfo.getLayoutWidth() / 2 && Math.abs(mInfo.getDownY() - mInfo.getFingerY()) > mInfo.getLayoutHeight() / 2) {
|
||||
mListener.onSlipDown();
|
||||
}
|
||||
}
|
||||
}else{
|
||||
hideBtn();
|
||||
btn_leftDown.setAlpha(1);
|
||||
btn_rightDown.setAlpha(1);
|
||||
if (mListener != null&&lastPos!=DOWN) {
|
||||
lastPos=DOWN;
|
||||
mListener.onDown();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (fromCenter) {
|
||||
if (event.getAction() == MotionEvent.ACTION_UP) {
|
||||
if (Math.abs(mInfo.getDownX() - mInfo.getFingerX()) > mInfo.getLayoutWidth() / 2 && Math.abs(mInfo.getDownY() - mInfo.getFingerY()) > mInfo.getLayoutHeight() / 2) {
|
||||
mListener.onSlipRightDown();
|
||||
}
|
||||
}
|
||||
}else if (mInfo.getFingerX() < mInfo.getLayoutWidth()) {
|
||||
showBtn(btn_rightDown);
|
||||
if (mListener != null&&lastPos!=RIGHT_DOWN) {
|
||||
mListener.onRightDown();
|
||||
lastPos=RIGHT_DOWN;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
|
||||
}
|
||||
if (event.getAction() == MotionEvent.ACTION_MOVE) {
|
||||
|
||||
}
|
||||
if (event.getAction() == MotionEvent.ACTION_UP) {
|
||||
hideBtn();
|
||||
fromCenter = false;
|
||||
fromUp=false;
|
||||
mListener.onFingerUp();
|
||||
lastPos=0;
|
||||
}
|
||||
if(event.getAction()==MotionEvent.ACTION_CANCEL){
|
||||
hideBtn();
|
||||
fromCenter = false;
|
||||
fromUp=false;
|
||||
mListener.onFingerUp();
|
||||
lastPos=0;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
private List<Button> btnList;
|
||||
private void showBtn(Button b) {
|
||||
if (btnList == null) {
|
||||
btnList = new ArrayList<Button>();
|
||||
btnList.add(btn_leftUp);
|
||||
btnList.add(btn_leftDown);
|
||||
btnList.add(btn_rightUp);
|
||||
btnList.add(btn_rightDown);
|
||||
}
|
||||
for (Button bt:btnList) {
|
||||
if (bt != b) {
|
||||
bt.setAlpha(0);
|
||||
} else {
|
||||
bt.setAlpha(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
private void hideBtn() {
|
||||
if (btnList == null) {
|
||||
btnList = new ArrayList<Button>();
|
||||
btnList.add(btn_leftUp);
|
||||
btnList.add(btn_leftDown);
|
||||
btnList.add(btn_rightUp);
|
||||
btnList.add(btn_rightDown);
|
||||
}
|
||||
for (Button bt:btnList) {
|
||||
bt.setAlpha(0);
|
||||
}
|
||||
}
|
||||
private class TouchInfo {
|
||||
private int layoutWidth;
|
||||
private int layoutHeight;
|
||||
private float fingerX;
|
||||
private float fingerY;
|
||||
|
||||
private float downX;
|
||||
private float downY;
|
||||
|
||||
public void setDownX(float downX) {
|
||||
this.downX = downX;
|
||||
}
|
||||
|
||||
public float getDownX() {
|
||||
return downX;
|
||||
}
|
||||
|
||||
public void setDownY(float downY) {
|
||||
this.downY = downY;
|
||||
}
|
||||
|
||||
public float getDownY() {
|
||||
return downY;
|
||||
}
|
||||
|
||||
|
||||
public void setLayoutWidth(int layoutWidth) {
|
||||
this.layoutWidth = layoutWidth;
|
||||
}
|
||||
|
||||
public int getLayoutWidth() {
|
||||
return layoutWidth;
|
||||
}
|
||||
|
||||
public void setLayoutHeight(int layoutHeight) {
|
||||
this.layoutHeight = layoutHeight;
|
||||
}
|
||||
|
||||
public int getLayoutHeight() {
|
||||
return layoutHeight;
|
||||
}
|
||||
|
||||
public void setFingerX(float fingerX) {
|
||||
this.fingerX = fingerX;
|
||||
}
|
||||
|
||||
public float getFingerX() {
|
||||
return fingerX;
|
||||
}
|
||||
|
||||
public void setFingerY(float fingerY) {
|
||||
this.fingerY = fingerY;
|
||||
}
|
||||
|
||||
public float getFingerY() {
|
||||
return fingerY;
|
||||
}
|
||||
}
|
||||
public interface MioListener {
|
||||
void onLeftUp();
|
||||
void onUp();
|
||||
void onRightUp();
|
||||
void onLeft();
|
||||
void onCenter(boolean direct);
|
||||
void onRight();
|
||||
void onLeftDown();
|
||||
void onDown();
|
||||
void onRightDown();
|
||||
|
||||
void onSlipLeftUp();
|
||||
void onSlipUp();
|
||||
void onSlipRightUp();
|
||||
void onSlipLeft();
|
||||
void onSlipRight();
|
||||
void onSlipLeftDown();
|
||||
void onSlipDown();
|
||||
void onSlipRightDown();
|
||||
|
||||
void onUpToCenter();
|
||||
void onFingerUp();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,248 @@
|
|||
package com.mio.customcontrol;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.widget.Button;
|
||||
import com.google.gson.annotations.Expose;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MioCustomButton extends Button
|
||||
{
|
||||
|
||||
@Expose
|
||||
private String 唯一标识;
|
||||
|
||||
@Expose
|
||||
private String 文本;
|
||||
|
||||
@Expose
|
||||
private String 按键类型;//显隐控制按键 命令按键 普通按键
|
||||
|
||||
@Expose
|
||||
private List<String> 键值组;
|
||||
|
||||
@Expose
|
||||
private int 文本大小;
|
||||
|
||||
@Expose
|
||||
private List<Float> 位置;
|
||||
|
||||
@Expose
|
||||
private List<Integer> 大小;
|
||||
|
||||
@Expose
|
||||
private String 文本颜色;
|
||||
|
||||
@Expose
|
||||
private int 圆角半径;
|
||||
|
||||
@Expose
|
||||
private String 边框颜色;
|
||||
|
||||
@Expose
|
||||
private boolean 按键自动保持;
|
||||
|
||||
@Expose
|
||||
private boolean 默认隐藏;
|
||||
|
||||
@Expose
|
||||
private boolean 控制鼠标指针;
|
||||
|
||||
@Expose
|
||||
private String 命令;
|
||||
|
||||
@Expose
|
||||
private List<String> 目标按键标识;
|
||||
|
||||
private boolean 正在自动保持=false;
|
||||
|
||||
private final Context context;
|
||||
|
||||
public MioCustomButton(Context context){
|
||||
super(context);
|
||||
this.context=context;
|
||||
}
|
||||
|
||||
public void 初始化(){
|
||||
setText(文本);
|
||||
setTextSize(文本大小);
|
||||
setTextColor(Color.parseColor(文本颜色));
|
||||
GradientDrawable drawable = new GradientDrawable();
|
||||
drawable.setShape(GradientDrawable.RECTANGLE);
|
||||
drawable.setColor(Color.parseColor("#00FFFFFF"));
|
||||
drawable.setCornerRadius(圆角半径);
|
||||
drawable.setStroke(1, Color.parseColor(边框颜色));
|
||||
setBackground(drawable);
|
||||
MioCustomUtils.setViewSize(context,this,大小.get(0),大小.get(1));
|
||||
setAllCaps(false);
|
||||
setX(MioCustomUtils.percentTopx(位置.get(0),MioCustomManager.scrennWidth));
|
||||
setY(MioCustomUtils.percentTopx(位置.get(1),MioCustomManager.screenHeight));
|
||||
}
|
||||
|
||||
|
||||
public void 刷新(){
|
||||
List<Float> 位置=new ArrayList<>();
|
||||
位置.add(MioCustomUtils.pxToPercent(this.getX(),MioCustomManager.scrennWidth));
|
||||
位置.add(MioCustomUtils.pxToPercent(this.getY(),MioCustomManager.screenHeight));
|
||||
this.位置.clear();
|
||||
this.位置.addAll(位置);
|
||||
}
|
||||
|
||||
public void set唯一标识(String 唯一标识) {
|
||||
this.唯一标识 = 唯一标识;
|
||||
}
|
||||
|
||||
public String get唯一标识() {
|
||||
return 唯一标识;
|
||||
}
|
||||
|
||||
public void set文本(String 文本) {
|
||||
this.文本 = 文本;
|
||||
}
|
||||
|
||||
public String get文本() {
|
||||
return 文本;
|
||||
}
|
||||
|
||||
public void set按键类型(String 按键类型) {
|
||||
this.按键类型 = 按键类型;
|
||||
}
|
||||
|
||||
public String get按键类型() {
|
||||
return 按键类型;
|
||||
}
|
||||
|
||||
public void set键值组(List<String> 键值组) {
|
||||
this.键值组 = 键值组;
|
||||
}
|
||||
|
||||
public List<String> get键值组() {
|
||||
return 键值组;
|
||||
}
|
||||
|
||||
public void set文本大小(int 文本大小) {
|
||||
this.文本大小 = 文本大小;
|
||||
}
|
||||
|
||||
public int get文本大小() {
|
||||
return 文本大小;
|
||||
}
|
||||
|
||||
public void set位置(List<Float> 位置) {
|
||||
this.位置 = 位置;
|
||||
}
|
||||
|
||||
public List<Float> get位置() {
|
||||
return 位置;
|
||||
}
|
||||
|
||||
public void set大小(List<Integer> 大小) {
|
||||
this.大小 = 大小;
|
||||
}
|
||||
|
||||
public List<Integer> get大小() {
|
||||
return 大小;
|
||||
}
|
||||
|
||||
public void set文本颜色(String 文本颜色) {
|
||||
this.文本颜色 = 文本颜色;
|
||||
}
|
||||
|
||||
public String get文本颜色() {
|
||||
return 文本颜色;
|
||||
}
|
||||
|
||||
public void set圆角半径(int 圆角半径) {
|
||||
this.圆角半径 = 圆角半径;
|
||||
}
|
||||
|
||||
public int get圆角半径() {
|
||||
return 圆角半径;
|
||||
}
|
||||
|
||||
public void set边框颜色(String 边框颜色) {
|
||||
this.边框颜色 = 边框颜色;
|
||||
}
|
||||
|
||||
public String get边框颜色() {
|
||||
return 边框颜色;
|
||||
}
|
||||
|
||||
public void set按键自动保持(boolean 按键自动保持) {
|
||||
this.按键自动保持 = 按键自动保持;
|
||||
}
|
||||
|
||||
public boolean is按键自动保持() {
|
||||
return 按键自动保持;
|
||||
}
|
||||
|
||||
public void set控制鼠标指针(boolean 控制鼠标指针) {
|
||||
this.控制鼠标指针 = 控制鼠标指针;
|
||||
}
|
||||
|
||||
public boolean is控制鼠标指针() {
|
||||
return 控制鼠标指针;
|
||||
}
|
||||
|
||||
public void set命令(String 命令) {
|
||||
this.命令 = 命令;
|
||||
}
|
||||
|
||||
public String get命令() {
|
||||
return 命令;
|
||||
}
|
||||
|
||||
public void set目标按键标识(List<String> 目标按键标识) {
|
||||
this.目标按键标识 = 目标按键标识;
|
||||
}
|
||||
|
||||
public List<String> get目标按键标识() {
|
||||
return 目标按键标识;
|
||||
}
|
||||
|
||||
public void set默认隐藏(boolean 默认隐藏) {
|
||||
this.默认隐藏 = 默认隐藏;
|
||||
}
|
||||
|
||||
public boolean is默认隐藏() {
|
||||
return 默认隐藏;
|
||||
}
|
||||
|
||||
public void set正在自动保持(boolean 正在自动保持) {
|
||||
this.正在自动保持 = 正在自动保持;
|
||||
if(正在自动保持){
|
||||
this.setTextColor(Color.RED);
|
||||
}else{
|
||||
this.setTextColor(Color.parseColor(文本颜色));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean performClick() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean is正在自动保持() {
|
||||
return 正在自动保持;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "["+getClass().getCanonicalName()+"]"
|
||||
+ "\n唯一标识=" + 唯一标识
|
||||
+ ",\n文本=" + 文本
|
||||
+ ",\n按键类型=" + 按键类型
|
||||
+ ",\n键值组=" + 键值组
|
||||
+ ",\n文本大小=" + 文本大小
|
||||
+ ",\n位置=" + 位置.get(0)
|
||||
+ ",\n大小=" + 大小
|
||||
+ ",\n文本颜色=" + 文本颜色
|
||||
+ ",\n圆角半径=" + 圆角半径
|
||||
+ ",\n边框颜色=" + 边框颜色
|
||||
+ ",\n按键自动保持=" + 按键自动保持
|
||||
+ ",\n控制鼠标指针=" + 控制鼠标指针
|
||||
+ ",\n命令=" + 命令
|
||||
+ ",\n目标按键标识=" + 目标按键标识;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,914 @@
|
|||
package com.mio.customcontrol;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.Color;
|
||||
import android.os.Handler;
|
||||
import android.util.ArrayMap;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.View.OnTouchListener;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.aof.mcinabox.gamecontroller.codes.Translation;
|
||||
import com.aof.mcinabox.gamecontroller.definitions.id.key.KeyEvent;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonParseException;
|
||||
import com.larswerkman.holocolorpicker.ColorPicker;
|
||||
import com.larswerkman.holocolorpicker.OpacityBar;
|
||||
import com.larswerkman.holocolorpicker.SVBar;
|
||||
import com.mio.mclauncher.customcontrol.R;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileReader;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Type;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class MioCustomManager implements OnTouchListener,CompoundButton.OnCheckedChangeListener,OnClickListener {
|
||||
private boolean 是否已初始化=false;
|
||||
private String 储存路径;
|
||||
private Context context;
|
||||
private Gson mGson;
|
||||
public static int screenHeight,scrennWidth;
|
||||
|
||||
private ViewGroup 容器;
|
||||
|
||||
private Map<String,MioCustomButton> 自定义按键集合;
|
||||
private boolean 自定义开关=false;
|
||||
private Translation 键值转换器;
|
||||
|
||||
private AlertDialog 自定义按键对话框;
|
||||
private AlertDialog 颜色选择对话框;
|
||||
private View 自定义按键菜单布局容器;
|
||||
private EditText alert_miocustom_main_edit_name;
|
||||
private TextView alert_miocustom_main_tv_height_left;
|
||||
private EditText alert_miocustom_main_edit_height;
|
||||
private TextView alert_miocustom_main_tv_height_right;
|
||||
private TextView alert_miocustom_main_tv_width_left;
|
||||
private EditText alert_miocustom_main_edit_width;
|
||||
private TextView alert_miocustom_main_tv_width_right;
|
||||
private TextView alert_miocustom_main_tv_textsize_left;
|
||||
private EditText alert_miocustom_main_edit_textsize;
|
||||
private TextView alert_miocustom_main_tv_textsize_right;
|
||||
private TextView alert_miocustom_main_tv_round_left;
|
||||
private EditText alert_miocustom_main_edit_round;
|
||||
private TextView alert_miocustom_main_tv_round_right;
|
||||
private EditText alert_miocustom_main_edit_strokecolor;
|
||||
private EditText alert_miocustom_main_edit_textcolor;
|
||||
private RadioButton alert_miocustom_main_radio_normalbtn;
|
||||
private RadioButton alert_miocustom_main_radio_cmdbtn;
|
||||
private RadioButton alert_miocustom_main_radio_vsbbtn;
|
||||
private LinearLayout alert_miocustom_main_layout_normalbtn;
|
||||
private EditText alert_miocustom_main_edit_key1;
|
||||
private EditText alert_miocustom_main_edit_key2;
|
||||
private EditText alert_miocustom_main_edit_key3;
|
||||
private CheckBox alert_miocustom_main_check_autokeep;
|
||||
private CheckBox alert_miocustom_main_check_mousectrl;
|
||||
private LinearLayout alert_miocustom_main_layout_cmdbtn;
|
||||
private EditText alert_miocustom_main_edit_cmd;
|
||||
private LinearLayout alert_miocustom_main_layout_vsbbtn;
|
||||
private Button alert_miocustom_main_btn_btnselect;
|
||||
private Button alert_miocustom_main_btn_ok;
|
||||
private Button alert_miocustom_main_btn_cancle;
|
||||
private View alert_miocustom_main_view_strokecolor;
|
||||
private View alert_miocustom_main_view_textcolor;
|
||||
|
||||
private boolean 按键选择模式=false;
|
||||
|
||||
private 自定义按键回调 自定义按键回调;
|
||||
|
||||
private boolean 按键修改模式=false;
|
||||
|
||||
private int 指针横坐标;
|
||||
private int 指针纵坐标;
|
||||
|
||||
private MioDialogSelectKey 键值选择对话框;
|
||||
|
||||
private boolean 控制鼠标指针修复=false;
|
||||
|
||||
public interface 自定义按键回调 {
|
||||
void 命令接收事件(String 命令);
|
||||
void 键值接收事件(int 键值, boolean 按下);
|
||||
void 控制鼠标指针移动事件(int x, int y);
|
||||
void 鼠标回调(int 键值, boolean 按下);
|
||||
void 按下();
|
||||
void 抬起();
|
||||
}
|
||||
|
||||
public void set控制鼠标指针修复(boolean 控制鼠标指针修复){
|
||||
this.控制鼠标指针修复=控制鼠标指针修复;
|
||||
}
|
||||
public void 控制鼠标指针修复(){
|
||||
if(this.控制鼠标指针修复){
|
||||
this.控制鼠标指针修复=false;
|
||||
} else {
|
||||
this.控制鼠标指针修复=true;
|
||||
}
|
||||
}
|
||||
public boolean get控制鼠标指针修复(){
|
||||
return this.控制鼠标指针修复;
|
||||
}
|
||||
public void set储存路径(String 储存路径) {
|
||||
this.储存路径 = 储存路径;
|
||||
}
|
||||
|
||||
public String get储存路径() {
|
||||
return 储存路径;
|
||||
}
|
||||
|
||||
public void 初始化(Context context, ViewGroup 容器, String 储存路径) {
|
||||
if (!是否已初始化) {
|
||||
this.context = context;
|
||||
this.容器 = 容器;
|
||||
键值转换器 = new Translation(KeyEvent.KEYMAP_TO_X);
|
||||
set储存路径(储存路径);
|
||||
反序列化();
|
||||
添加按键至容器();
|
||||
是否已初始化 = true;
|
||||
目标按键标识 = new ArrayList<>();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public void 设置自定义按键回调(自定义按键回调 自定义按键回调) {
|
||||
this.自定义按键回调 = 自定义按键回调;
|
||||
}
|
||||
|
||||
public static void 设置屏幕高宽(int g, int k) {
|
||||
scrennWidth = k;
|
||||
screenHeight = g;
|
||||
}
|
||||
private void 反序列化() {
|
||||
GsonBuilder builder=new GsonBuilder();
|
||||
builder.excludeFieldsWithoutExposeAnnotation();
|
||||
builder.registerTypeAdapter(MioCustomButton.class, new MioDeserializer(context));
|
||||
mGson = builder.setPrettyPrinting().create();
|
||||
自定义按键集合 = new ArrayMap<>();
|
||||
try {
|
||||
FileReader reader=new FileReader(new File(储存路径, "Miokey.json"));
|
||||
BufferedReader bfr=new BufferedReader(reader);
|
||||
String tmp=null;
|
||||
String result="";
|
||||
while ((tmp = bfr.readLine()) != null) {
|
||||
result += tmp;
|
||||
}
|
||||
bfr.close();
|
||||
reader.close();
|
||||
JSONArray mJSONArray=new JSONArray(result);
|
||||
for (int i=0;i < mJSONArray.length();i++) {
|
||||
MioCustomButton mMioCustomButton=mGson.fromJson(mJSONArray.get(i).toString(), MioCustomButton.class);
|
||||
自定义按键集合.put(mMioCustomButton.get唯一标识(), mMioCustomButton);
|
||||
mMioCustomButton.setOnTouchListener(this);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void 添加按键至容器() {
|
||||
if (容器 != null&&自定义按键集合!=null) {
|
||||
Set<String> 标识集=自定义按键集合.keySet();
|
||||
for (String 标识:标识集) {
|
||||
容器.addView(自定义按键集合.get(标识));
|
||||
自定义按键集合.get(标识).初始化();
|
||||
}
|
||||
for (String 标识:标识集) {
|
||||
if (自定义按键集合.get(标识).get按键类型().equals("显隐控制按键")) {
|
||||
for (String 标识_:自定义按键集合.get(标识).get目标按键标识()) {
|
||||
if(获取按键(标识_)!=null){
|
||||
获取按键(标识_).setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
自定义按键集合.get(标识).setTextColor(Color.RED);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private List<String> 目标按键标识;
|
||||
private boolean 创建or修改=true;//创建true
|
||||
public void 创建按键() {
|
||||
try {
|
||||
JSONObject json=new JSONObject();
|
||||
json.put("文本", getText(alert_miocustom_main_edit_name));
|
||||
json.put("大小", new JSONArray().put(getText(alert_miocustom_main_edit_height)).put(getText(alert_miocustom_main_edit_width)));
|
||||
json.put("文本大小", getText(alert_miocustom_main_edit_textsize));
|
||||
json.put("文本颜色", getText(alert_miocustom_main_edit_textcolor));
|
||||
json.put("边框颜色", getText(alert_miocustom_main_edit_strokecolor));
|
||||
json.put("圆角半径", getText(alert_miocustom_main_edit_round));
|
||||
json.put("位置", new JSONArray().put(0.5).put(0.5));
|
||||
json.put("唯一标识", String.valueOf(System.currentTimeMillis()));
|
||||
json.put("默认隐藏", true);
|
||||
if (alert_miocustom_main_radio_normalbtn.isChecked()) {
|
||||
json.put("按键类型", "普通按键");
|
||||
} else if (alert_miocustom_main_radio_cmdbtn.isChecked()) {
|
||||
json.put("按键类型", "命令按键");
|
||||
} else if (alert_miocustom_main_radio_vsbbtn.isChecked()) {
|
||||
json.put("按键类型", "显隐控制按键");
|
||||
}
|
||||
json.put("按键自动保持", alert_miocustom_main_check_autokeep.isChecked());
|
||||
json.put("控制鼠标指针", alert_miocustom_main_check_mousectrl.isChecked());
|
||||
json.put("默认隐藏", true);
|
||||
json.put("命令", getText(alert_miocustom_main_edit_cmd));
|
||||
JSONArray mJ=new JSONArray();
|
||||
if (目标按键标识.size() > 0) {
|
||||
for (String s:目标按键标识) {
|
||||
mJ.put(s);
|
||||
}
|
||||
}
|
||||
json.put("目标按键标识", mJ);
|
||||
json.put("键值组", new JSONArray().put(getText(alert_miocustom_main_edit_key1)).put(getText(alert_miocustom_main_edit_key2)).put(getText(alert_miocustom_main_edit_key3)));
|
||||
MioCustomButton tmp=mGson.fromJson(json.toString(), MioCustomButton.class);
|
||||
自定义按键集合.put(tmp.get唯一标识(), tmp);
|
||||
容器.addView(tmp);
|
||||
tmp.初始化();
|
||||
tmp.setOnTouchListener(this);
|
||||
自定义按键对话框.dismiss();
|
||||
if (tmp.get按键类型().equals("显隐控制按键")) {
|
||||
for (String 标识:tmp.get目标按键标识()) {
|
||||
MioCustomButton b=获取按键(标识);
|
||||
b.setTextColor(Color.parseColor(b.get文本颜色()));
|
||||
}
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
private boolean vi=true;
|
||||
public void 按键显示隐藏(){
|
||||
Set<String> 标识集=自定义按键集合.keySet();
|
||||
if (vi){
|
||||
vi=false;
|
||||
for (String 标识:标识集) {
|
||||
MioCustomButton b=自定义按键集合.get(标识);
|
||||
if(b!=null){
|
||||
b.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
vi=true;
|
||||
for (String 标识:标识集) {
|
||||
MioCustomButton b=自定义按键集合.get(标识);
|
||||
if (b!=null){
|
||||
b.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private void 修改按键() {
|
||||
自定义按键集合.remove(当前按键.get唯一标识());
|
||||
try {
|
||||
Toast.makeText(context, "", Toast.LENGTH_LONG).show();
|
||||
JSONObject json=new JSONObject();
|
||||
json.put("文本", getText(alert_miocustom_main_edit_name));
|
||||
json.put("大小", new JSONArray().put(getText(alert_miocustom_main_edit_height)).put(getText(alert_miocustom_main_edit_width)));
|
||||
json.put("文本大小", getText(alert_miocustom_main_edit_textsize));
|
||||
json.put("文本颜色", getText(alert_miocustom_main_edit_textcolor));
|
||||
json.put("边框颜色", getText(alert_miocustom_main_edit_strokecolor));
|
||||
json.put("圆角半径", getText(alert_miocustom_main_edit_round));
|
||||
json.put("位置", new JSONArray().put(当前按键.get位置().get(0)).put(当前按键.get位置().get(1)));
|
||||
json.put("唯一标识", String.valueOf(System.currentTimeMillis()));
|
||||
json.put("默认隐藏", true);
|
||||
if (alert_miocustom_main_radio_normalbtn.isChecked()) {
|
||||
json.put("按键类型", "普通按键");
|
||||
} else if (alert_miocustom_main_radio_cmdbtn.isChecked()) {
|
||||
json.put("按键类型", "命令按键");
|
||||
} else if (alert_miocustom_main_radio_vsbbtn.isChecked()) {
|
||||
json.put("按键类型", "显隐控制按键");
|
||||
}
|
||||
json.put("按键自动保持", alert_miocustom_main_check_autokeep.isChecked());
|
||||
json.put("控制鼠标指针", alert_miocustom_main_check_mousectrl.isChecked());
|
||||
json.put("默认隐藏", true);
|
||||
json.put("命令", getText(alert_miocustom_main_edit_cmd));
|
||||
JSONArray mJ=new JSONArray();
|
||||
if (目标按键标识.size() > 0) {
|
||||
for (String s:目标按键标识) {
|
||||
mJ.put(s);
|
||||
}
|
||||
}
|
||||
json.put("目标按键标识", mJ);
|
||||
json.put("键值组", new JSONArray().put(getText(alert_miocustom_main_edit_key1)).put(getText(alert_miocustom_main_edit_key2)).put(getText(alert_miocustom_main_edit_key3)));
|
||||
MioCustomButton tmp=mGson.fromJson(json.toString(), MioCustomButton.class);
|
||||
自定义按键集合.put(tmp.get唯一标识(), tmp);
|
||||
容器.addView(tmp);
|
||||
tmp.初始化();
|
||||
tmp.setOnTouchListener(this);
|
||||
自定义按键对话框.dismiss();
|
||||
容器.removeView(当前按键);
|
||||
if (tmp.get按键类型().equals("显隐控制按键")) {
|
||||
for (String 标识:tmp.get目标按键标识()) {
|
||||
MioCustomButton b=获取按键(标识);
|
||||
b.setTextColor(Color.parseColor(b.get文本颜色()));
|
||||
}
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
|
||||
}
|
||||
}
|
||||
public void 清除按键() {
|
||||
Set<String> 标识集=自定义按键集合.keySet();
|
||||
for (String 标识:标识集) {
|
||||
容器.removeView(自定义按键集合.get(标识));
|
||||
}
|
||||
自定义按键集合.clear();
|
||||
}
|
||||
public void 保存按键() {
|
||||
try {
|
||||
FileOutputStream out=new FileOutputStream(new File(储存路径, "Miokey.json"));
|
||||
int i=1;
|
||||
StringBuilder builder=new StringBuilder();
|
||||
builder.append("[\n");
|
||||
Set<String> 标识集=自定义按键集合.keySet();
|
||||
for (String 标识:标识集) {
|
||||
if (自定义按键集合.size() > 1 && i > 1) {
|
||||
builder.append(",");
|
||||
}
|
||||
builder.append(mGson.toJson(自定义按键集合.get(标识), MioCustomButton.class));
|
||||
builder.append("\n");
|
||||
i++;
|
||||
}
|
||||
builder.append("\n]");
|
||||
out.write(builder.toString().getBytes(StandardCharsets.UTF_8));
|
||||
out.flush();
|
||||
out.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
public void 自定义开关() {
|
||||
if (自定义开关) {
|
||||
自定义开关 = false;
|
||||
保存按键();
|
||||
Set<String> 所有按键标识=自定义按键集合.keySet();
|
||||
for (String 标识:所有按键标识) {
|
||||
MioCustomButton 按键=自定义按键集合.get(标识);
|
||||
if (按键.get按键类型().equals("显隐控制按键")) {
|
||||
for (String 标识2:按键.get目标按键标识()) {
|
||||
MioCustomButton b=获取按键(标识2);
|
||||
if(b!=null){
|
||||
b.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Toast.makeText(context, "已退出自定义模式", Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
自定义开关 = true;
|
||||
Set<String> 所有按键标识=自定义按键集合.keySet();
|
||||
for (String 标识:所有按键标识) {
|
||||
MioCustomButton 按键=自定义按键集合.get(标识);
|
||||
if (按键.get按键类型().equals("显隐控制按键")) {
|
||||
for (String 标识2:按键.get目标按键标识()) {
|
||||
MioCustomButton b=获取按键(标识2);
|
||||
if(b!=null){
|
||||
b.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
RelativeLayout 触摸板=new RelativeLayout(context);
|
||||
RelativeLayout.LayoutParams params=new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,RelativeLayout.LayoutParams.MATCH_PARENT);
|
||||
容器.addView(触摸板,params);
|
||||
Toast.makeText(context, "已进入自定义模式", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
public void 自定义按键对话框(boolean 创建or修改) {
|
||||
if (!自定义开关) {
|
||||
return;
|
||||
}
|
||||
this.创建or修改 = 创建or修改;
|
||||
if (alert_miocustom_main_edit_name == null) {
|
||||
自定义按键菜单布局容器 = LayoutInflater.from(context).inflate(R.layout.alert_miocustom_main, null);
|
||||
初始化自定义按键对话框();
|
||||
自定义按键对话框 = new AlertDialog.Builder(context)
|
||||
.setView(自定义按键菜单布局容器)
|
||||
.create();
|
||||
自定义按键对话框.setCancelable(false);
|
||||
自定义按键对话框.setCanceledOnTouchOutside(false);
|
||||
}
|
||||
自定义按键对话框.show();
|
||||
}
|
||||
private String 当前颜色;
|
||||
private View 当前view;
|
||||
private EditText 当前编辑框;
|
||||
private void 颜色选择(View vi, EditText edit) {
|
||||
当前view = vi;
|
||||
当前编辑框 = edit;
|
||||
if (颜色选择对话框 == null) {
|
||||
View v=LayoutInflater.from(context).inflate(R.layout.dialog_colorpicker, null);
|
||||
ColorPicker colorpicker=v.findViewById(R.id.picker);
|
||||
OpacityBar opacityBar =v.findViewById(R.id.opacitybar);
|
||||
SVBar svbar=v.findViewById(R.id.svbar);
|
||||
colorpicker.addOpacityBar(opacityBar);
|
||||
colorpicker.addSVBar(svbar);
|
||||
colorpicker.setShowOldCenterColor(false);
|
||||
|
||||
当前颜色 = "#" + Integer.toHexString(colorpicker.getColor());
|
||||
colorpicker.setOnColorChangedListener(p1 -> {
|
||||
当前颜色 =Integer.toHexString(p1).length()<8?"10ffffff":Integer.toHexString(p1);
|
||||
Log.e("当前颜色",当前颜色);
|
||||
});
|
||||
颜色选择对话框 = new AlertDialog.Builder(context)
|
||||
.setTitle("颜色选择")
|
||||
.setView(v)
|
||||
.setPositiveButton("确定",(dialog, which) -> {
|
||||
当前编辑框.setText("#"+当前颜色);
|
||||
当前view.setBackgroundColor(Color.parseColor("#"+当前颜色));
|
||||
}).setNegativeButton("取消", new android.content.DialogInterface.OnClickListener(){
|
||||
@Override
|
||||
public void onClick(DialogInterface di, int p2) {
|
||||
|
||||
}
|
||||
}).create();
|
||||
}
|
||||
颜色选择对话框.show();
|
||||
}
|
||||
private void 初始化自定义按键对话框() {
|
||||
alert_miocustom_main_edit_name = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_edit_name);
|
||||
alert_miocustom_main_tv_height_left = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_tv_height_left);
|
||||
alert_miocustom_main_edit_height = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_edit_height);
|
||||
alert_miocustom_main_tv_height_right = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_tv_height_right);
|
||||
alert_miocustom_main_tv_width_left = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_tv_width_left);
|
||||
alert_miocustom_main_edit_width = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_edit_width);
|
||||
alert_miocustom_main_tv_width_right = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_tv_width_right);
|
||||
alert_miocustom_main_tv_textsize_left = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_tv_textsize_left);
|
||||
alert_miocustom_main_edit_textsize = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_edit_textsize);
|
||||
alert_miocustom_main_tv_textsize_right = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_tv_textsize_right);
|
||||
alert_miocustom_main_tv_round_left = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_tv_round_left);
|
||||
alert_miocustom_main_edit_round = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_edit_round);
|
||||
alert_miocustom_main_tv_round_right = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_tv_round_right);
|
||||
alert_miocustom_main_edit_strokecolor = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_edit_strokecolor);
|
||||
alert_miocustom_main_edit_textcolor = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_edit_textcolor);
|
||||
alert_miocustom_main_radio_normalbtn = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_radio_normalbtn);
|
||||
alert_miocustom_main_radio_cmdbtn = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_radio_cmdbtn);
|
||||
alert_miocustom_main_radio_vsbbtn = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_radio_vsbbtn);
|
||||
alert_miocustom_main_layout_normalbtn = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_layout_normalbtn);
|
||||
alert_miocustom_main_edit_key1 = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_edit_key1);
|
||||
alert_miocustom_main_edit_key2 = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_edit_key2);
|
||||
alert_miocustom_main_edit_key3 = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_edit_key3);
|
||||
alert_miocustom_main_check_autokeep = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_check_autokeep);
|
||||
alert_miocustom_main_check_mousectrl = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_check_mousectrl);
|
||||
alert_miocustom_main_layout_cmdbtn = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_layout_cmdbtn);
|
||||
alert_miocustom_main_edit_cmd = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_edit_cmd);
|
||||
alert_miocustom_main_layout_vsbbtn = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_layout_vsbbtn);
|
||||
alert_miocustom_main_btn_btnselect = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_btn_btnselect);
|
||||
alert_miocustom_main_btn_ok = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_btn_ok);
|
||||
alert_miocustom_main_btn_cancle = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_btn_cancle);
|
||||
alert_miocustom_main_view_strokecolor = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_view_strokecolor);
|
||||
alert_miocustom_main_view_textcolor = 自定义按键菜单布局容器.findViewById(R.id.alert_miocustom_main_view_textcolor);
|
||||
|
||||
alert_miocustom_main_radio_normalbtn.setOnCheckedChangeListener(this);
|
||||
alert_miocustom_main_radio_vsbbtn.setOnCheckedChangeListener(this);
|
||||
alert_miocustom_main_radio_cmdbtn.setOnCheckedChangeListener(this);
|
||||
alert_miocustom_main_tv_height_left.setOnClickListener(this);
|
||||
alert_miocustom_main_tv_height_right.setOnClickListener(this);
|
||||
alert_miocustom_main_tv_width_left.setOnClickListener(this);
|
||||
alert_miocustom_main_tv_width_right.setOnClickListener(this);
|
||||
alert_miocustom_main_tv_textsize_left.setOnClickListener(this);
|
||||
alert_miocustom_main_tv_textsize_right.setOnClickListener(this);
|
||||
alert_miocustom_main_tv_round_left.setOnClickListener(this);
|
||||
alert_miocustom_main_tv_round_right.setOnClickListener(this);
|
||||
alert_miocustom_main_view_strokecolor.setOnClickListener(this);
|
||||
alert_miocustom_main_view_textcolor.setOnClickListener(this);
|
||||
alert_miocustom_main_btn_btnselect.setOnClickListener(this);
|
||||
|
||||
alert_miocustom_main_layout_cmdbtn.setVisibility(View.GONE);
|
||||
alert_miocustom_main_layout_vsbbtn.setVisibility(View.GONE);
|
||||
|
||||
alert_miocustom_main_btn_ok.setOnClickListener(this);
|
||||
alert_miocustom_main_btn_cancle.setOnClickListener(this);
|
||||
|
||||
alert_miocustom_main_edit_key1.setOnClickListener(this);
|
||||
alert_miocustom_main_edit_key2.setOnClickListener(this);
|
||||
alert_miocustom_main_edit_key3.setOnClickListener(this);
|
||||
|
||||
|
||||
}
|
||||
private String getText(EditText edit) {
|
||||
return edit.getText().toString();
|
||||
}
|
||||
private void 重置自定义按键对话框() {
|
||||
alert_miocustom_main_edit_name.setText("");
|
||||
alert_miocustom_main_edit_key1.setText("");
|
||||
alert_miocustom_main_edit_key2.setText("");
|
||||
alert_miocustom_main_edit_key3.setText("");
|
||||
alert_miocustom_main_edit_cmd.setText("");
|
||||
alert_miocustom_main_radio_normalbtn.setChecked(true);
|
||||
alert_miocustom_main_view_strokecolor.setBackgroundColor(Color.WHITE);
|
||||
alert_miocustom_main_view_textcolor.setBackgroundColor(Color.WHITE);
|
||||
目标按键标识.clear();
|
||||
按键修改模式 = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (v == alert_miocustom_main_tv_height_left) {
|
||||
int tmp=Integer.parseInt(getText(alert_miocustom_main_edit_height));
|
||||
alert_miocustom_main_edit_height.setText(String.valueOf(tmp -= 1));
|
||||
} else if (v == alert_miocustom_main_tv_height_right) {
|
||||
int tmp=Integer.parseInt(getText(alert_miocustom_main_edit_height));
|
||||
alert_miocustom_main_edit_height.setText(String.valueOf(tmp += 1));
|
||||
} else if (v == alert_miocustom_main_tv_width_left) {
|
||||
int tmp=Integer.parseInt(getText(alert_miocustom_main_edit_width));
|
||||
alert_miocustom_main_edit_width.setText(String.valueOf(tmp -= 1));
|
||||
} else if (v == alert_miocustom_main_tv_width_right) {
|
||||
int tmp=Integer.parseInt(getText(alert_miocustom_main_edit_width));
|
||||
alert_miocustom_main_edit_width.setText(String.valueOf(tmp += 1));
|
||||
} else if (v == alert_miocustom_main_tv_textsize_left) {
|
||||
int tmp=Integer.parseInt(getText(alert_miocustom_main_edit_textsize));
|
||||
alert_miocustom_main_edit_textsize.setText(String.valueOf(tmp -= 1));
|
||||
} else if (v == alert_miocustom_main_tv_textsize_right) {
|
||||
int tmp=Integer.parseInt(getText(alert_miocustom_main_edit_textsize));
|
||||
alert_miocustom_main_edit_textsize.setText(String.valueOf(tmp += 1));
|
||||
} else if (v == alert_miocustom_main_tv_round_left) {
|
||||
int tmp=Integer.parseInt(getText(alert_miocustom_main_edit_round));
|
||||
alert_miocustom_main_edit_textsize.setText(String.valueOf(tmp -= 1));
|
||||
} else if (v == alert_miocustom_main_tv_round_right) {
|
||||
int tmp=Integer.parseInt(getText(alert_miocustom_main_edit_round));
|
||||
alert_miocustom_main_edit_textsize.setText(String.valueOf(tmp += 1));
|
||||
} else if (v == alert_miocustom_main_btn_ok) {
|
||||
if (!alert_miocustom_main_edit_name.getText().toString().trim().equals("")){
|
||||
if (创建or修改) {
|
||||
创建按键();
|
||||
} else {
|
||||
修改按键();
|
||||
}
|
||||
}else{
|
||||
Toast.makeText(context,"属性不能为空。",Toast.LENGTH_LONG).show();
|
||||
}
|
||||
重置自定义按键对话框();
|
||||
} else if (v == alert_miocustom_main_btn_cancle) {
|
||||
自定义按键对话框.dismiss();
|
||||
重置自定义按键对话框();
|
||||
} else if (v == alert_miocustom_main_view_strokecolor) {
|
||||
颜色选择(v, alert_miocustom_main_edit_strokecolor);
|
||||
} else if (v == alert_miocustom_main_view_textcolor) {
|
||||
颜色选择(v, alert_miocustom_main_edit_textcolor);
|
||||
} else if (v == alert_miocustom_main_btn_btnselect) {
|
||||
自定义按键对话框.dismiss();
|
||||
按键选择模式 = true;
|
||||
|
||||
if (当前按键!=null&&当前按键.get按键类型().equals("显隐控制按键") && 当前按键.is默认隐藏()) {
|
||||
for (String 标识:当前按键.get目标按键标识()) {
|
||||
MioCustomButton b=获取按键(标识);
|
||||
if (b!=null){
|
||||
b.setTextColor(Color.RED);
|
||||
b.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
Toast.makeText(context, "请点击需要隐藏的按键。点击黑色区域退出结束按键选择。", Toast.LENGTH_LONG).show();
|
||||
} else if (v == alert_miocustom_main_edit_key1 || v == alert_miocustom_main_edit_key2 || v == alert_miocustom_main_edit_key3) {
|
||||
EditText tmpEdit=(EditText)v;
|
||||
if (键值选择对话框 == null) {
|
||||
键值选择对话框 = new MioDialogSelectKey(context);
|
||||
}
|
||||
键值选择对话框.setEdit(tmpEdit);
|
||||
键值选择对话框.show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton v, boolean isChecked) {
|
||||
if (isChecked) {
|
||||
if (alert_miocustom_main_radio_normalbtn == v) {
|
||||
alert_miocustom_main_layout_normalbtn.setVisibility(View.VISIBLE);
|
||||
alert_miocustom_main_layout_cmdbtn.setVisibility(View.GONE);
|
||||
alert_miocustom_main_layout_vsbbtn.setVisibility(View.GONE);
|
||||
} else if (alert_miocustom_main_radio_cmdbtn == v) {
|
||||
alert_miocustom_main_layout_normalbtn.setVisibility(View.GONE);
|
||||
alert_miocustom_main_layout_cmdbtn.setVisibility(View.VISIBLE);
|
||||
alert_miocustom_main_layout_vsbbtn.setVisibility(View.GONE);
|
||||
} else if (alert_miocustom_main_radio_vsbbtn == v) {
|
||||
alert_miocustom_main_layout_normalbtn.setVisibility(View.GONE);
|
||||
alert_miocustom_main_layout_cmdbtn.setVisibility(View.GONE);
|
||||
alert_miocustom_main_layout_vsbbtn.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
private int 横坐标偏移,纵坐标偏移;
|
||||
private int 触摸点横坐标,触摸点纵坐标;
|
||||
private int 上边距,下边距,左边距,右边距;
|
||||
private long 按下时间;
|
||||
private final Handler 长按计时器=new Handler();
|
||||
private final Runnable 长按计时任务=new Runnable(){
|
||||
@Override
|
||||
public void run() {
|
||||
AlertDialog dialog = new AlertDialog.Builder(context)
|
||||
.setTitle("警告")
|
||||
.setMessage("是否删除该按键?")
|
||||
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dia, int which) {
|
||||
容器.removeView(当前按键);
|
||||
自定义按键集合.remove(当前按键.get唯一标识());
|
||||
}
|
||||
})
|
||||
.setNegativeButton("取消", null)
|
||||
.create();
|
||||
dialog.show();
|
||||
}
|
||||
};
|
||||
public boolean 获取按键选择模式(){
|
||||
return 按键选择模式;
|
||||
}
|
||||
public void 设置按键选择模式(boolean a){
|
||||
this.按键选择模式=a;
|
||||
}
|
||||
public boolean 获取按键修改模式(){
|
||||
return 按键修改模式;
|
||||
}
|
||||
public void 设置按键修改模式(boolean a){
|
||||
this.按键修改模式=a;
|
||||
}
|
||||
public MioCustomButton 获取当前按键(){
|
||||
return 当前按键;
|
||||
}
|
||||
public boolean 获取开关状态(){
|
||||
return 自定义开关;
|
||||
}
|
||||
private MioCustomButton 当前按键;
|
||||
private float downX,downY;
|
||||
int currentPointerID;
|
||||
boolean shouldBeDown;
|
||||
int lastPointerCount;
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
// TODO: Implement this method
|
||||
if (!按键选择模式) {
|
||||
当前按键 = (MioCustomButton)v;
|
||||
}
|
||||
if (自定义开关 && !按键选择模式) {
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
触摸点横坐标 = (int)event.getX();
|
||||
触摸点纵坐标 = (int)event.getY();
|
||||
按下时间 = System.currentTimeMillis();
|
||||
长按计时器.postDelayed(长按计时任务, 500);
|
||||
} else if (event.getAction() == MotionEvent.ACTION_MOVE) {
|
||||
横坐标偏移 = (int)event.getX() - 触摸点横坐标;
|
||||
纵坐标偏移 = (int)event.getY() - 触摸点纵坐标;
|
||||
左边距 = v.getLeft() + 横坐标偏移;
|
||||
上边距 = v.getTop() + 纵坐标偏移;
|
||||
右边距 = v.getRight() + 横坐标偏移;
|
||||
下边距 = v.getBottom() + 纵坐标偏移;
|
||||
RelativeLayout.LayoutParams lParams;
|
||||
lParams = (RelativeLayout.LayoutParams)v.getLayoutParams();
|
||||
lParams.leftMargin=左边距;
|
||||
lParams.topMargin=上边距;
|
||||
v.setLayoutParams(lParams);
|
||||
当前按键.刷新();
|
||||
// v.layout(左边距, 上边距, 右边距, 下边距);
|
||||
if (Math.abs(event.getX() - 触摸点横坐标) >= 3 || Math.abs(event.getY() - 触摸点纵坐标) >= 3) {
|
||||
长按计时器.removeCallbacks(长按计时任务);
|
||||
}
|
||||
|
||||
} else if (event.getAction() == MotionEvent.ACTION_UP||event.getAction()==MotionEvent.ACTION_CANCEL) {
|
||||
if ((System.currentTimeMillis() - 按下时间) < 100) {
|
||||
自定义按键对话框(false);
|
||||
按键修改模式 = true;
|
||||
alert_miocustom_main_edit_name.setText(当前按键.get文本());
|
||||
alert_miocustom_main_edit_cmd.setText(当前按键.get命令());
|
||||
alert_miocustom_main_edit_height.setText("" + 当前按键.get大小().get(0));
|
||||
alert_miocustom_main_edit_width.setText("" + 当前按键.get大小().get(1));
|
||||
alert_miocustom_main_edit_textsize.setText("" + 当前按键.get文本大小());
|
||||
alert_miocustom_main_edit_textcolor.setText(当前按键.get文本颜色());
|
||||
alert_miocustom_main_edit_strokecolor.setText(当前按键.get边框颜色());
|
||||
alert_miocustom_main_edit_round.setText("" + 当前按键.get圆角半径());
|
||||
alert_miocustom_main_check_autokeep.setChecked(当前按键.is按键自动保持());
|
||||
alert_miocustom_main_check_mousectrl.setChecked(当前按键.is控制鼠标指针());
|
||||
alert_miocustom_main_edit_key1.setText(当前按键.get键值组().get(0));
|
||||
alert_miocustom_main_edit_key2.setText(当前按键.get键值组().get(1));
|
||||
alert_miocustom_main_edit_key3.setText(当前按键.get键值组().get(2));
|
||||
目标按键标识.clear();
|
||||
目标按键标识.addAll(当前按键.get目标按键标识());
|
||||
if (当前按键.get按键类型().equals(alert_miocustom_main_radio_normalbtn.getHint())) {
|
||||
alert_miocustom_main_radio_normalbtn.setChecked(true);
|
||||
} else if (当前按键.get按键类型().equals(alert_miocustom_main_radio_cmdbtn.getHint())) {
|
||||
alert_miocustom_main_radio_cmdbtn.setChecked(true);
|
||||
} else if (当前按键.get按键类型().equals(alert_miocustom_main_radio_vsbbtn.getHint())) {
|
||||
alert_miocustom_main_radio_vsbbtn.setChecked(true);
|
||||
}
|
||||
alert_miocustom_main_view_strokecolor.setBackgroundColor(Color.parseColor(当前按键.get边框颜色()));
|
||||
alert_miocustom_main_view_textcolor.setBackgroundColor(Color.parseColor(当前按键.get文本颜色()));
|
||||
|
||||
}
|
||||
长按计时器.removeCallbacks(长按计时任务);
|
||||
RelativeLayout.LayoutParams params=(RelativeLayout.LayoutParams)当前按键.getLayoutParams();
|
||||
params.setMargins(左边距, 上边距, 右边距, 下边距);
|
||||
当前按键.setLayoutParams(params);
|
||||
}
|
||||
} else if (按键选择模式) {
|
||||
MioCustomButton 选择按键=(MioCustomButton)v;
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
if (目标按键标识.contains(选择按键.get唯一标识())) {
|
||||
目标按键标识.remove(选择按键.get唯一标识());
|
||||
选择按键.setTextColor(Color.parseColor(选择按键.get文本颜色()));
|
||||
Toast.makeText(context, "已取消选择按键:" + 选择按键.get文本(), Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
目标按键标识.add(选择按键.get唯一标识());
|
||||
选择按键.setTextColor(Color.RED);
|
||||
Toast.makeText(context, "已选择按键:" + 选择按键.get文本(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
if (当前按键.is控制鼠标指针()) {
|
||||
currentPointerID = event.getPointerId(0);
|
||||
downX = (int) event.getX();
|
||||
downY = (int) event.getY();
|
||||
}
|
||||
if (当前按键.get按键类型().equals("普通按键")) {
|
||||
for (String key:当前按键.get键值组()) {
|
||||
if (当前按键.is控制鼠标指针()){
|
||||
自定义按键回调.按下();
|
||||
}
|
||||
if (!key.equals("")) {
|
||||
int 键值=键值转换器.trans(key);
|
||||
if (key.contains("MOUSE")) {
|
||||
自定义按键回调.鼠标回调(键值, true);
|
||||
Log.d("鼠标",key);
|
||||
} else {
|
||||
自定义按键回调.键值接收事件(键值, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
触摸点横坐标 = (int)event.getX();
|
||||
触摸点纵坐标 = (int)event.getY();
|
||||
按下时间 = System.currentTimeMillis();
|
||||
} else if (event.getAction() == MotionEvent.ACTION_MOVE) {
|
||||
if (当前按键.is控制鼠标指针()) {
|
||||
int pointerCount = event.getPointerCount();
|
||||
int pointerIndex = event.findPointerIndex(currentPointerID);
|
||||
if (pointerIndex == -1 || lastPointerCount != pointerCount || !shouldBeDown) {
|
||||
shouldBeDown = true;
|
||||
currentPointerID = event.getPointerId(0);
|
||||
downX = (int) event.getX();
|
||||
downY = (int) event.getY();
|
||||
} else {
|
||||
int deltaX = (int) (event.getX(pointerIndex) - downX);
|
||||
int deltaY = (int) (event.getY(pointerIndex) - downY);
|
||||
自定义按键回调.控制鼠标指针移动事件(deltaX, deltaY);
|
||||
downX = (int) event.getX(pointerIndex);
|
||||
downY = (int) event.getY(pointerIndex);
|
||||
}
|
||||
}
|
||||
} else if (event.getAction() == MotionEvent.ACTION_UP||event.getAction()==MotionEvent.ACTION_CANCEL) {
|
||||
if (当前按键.is控制鼠标指针()) {
|
||||
shouldBeDown = false;
|
||||
currentPointerID = -1;
|
||||
}
|
||||
if (当前按键.get按键类型().equals("普通按键")) {
|
||||
if (当前按键.is控制鼠标指针()){
|
||||
自定义按键回调.抬起();
|
||||
}
|
||||
if (当前按键.is按键自动保持()) {
|
||||
if (!当前按键.is正在自动保持()) {
|
||||
当前按键.set正在自动保持(true);
|
||||
} else {
|
||||
当前按键.set正在自动保持(false);
|
||||
for (String key:当前按键.get键值组()) {
|
||||
if (!key.equals("")) {
|
||||
int 键值=键值转换器.trans(key);
|
||||
if (key.contains("MOUSE")) {
|
||||
自定义按键回调.鼠标回调(键值, false);
|
||||
} else {
|
||||
自定义按键回调.键值接收事件(键值, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (String key:当前按键.get键值组()) {
|
||||
if (!key.equals("")) {
|
||||
int 键值=键值转换器.trans(key);
|
||||
if (key.contains("MOUSE")) {
|
||||
自定义按键回调.鼠标回调(键值, false);
|
||||
} else {
|
||||
自定义按键回调.键值接收事件(键值, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ((System.currentTimeMillis() - 按下时间) < 100 && Math.abs(event.getX() - 触摸点横坐标) <= 20 && Math.abs(event.getY() - 触摸点纵坐标) <= 20) {
|
||||
if (当前按键.get按键类型().equals("命令按键")) {
|
||||
if (自定义按键回调 != null) {
|
||||
自定义按键回调.命令接收事件(当前按键.get命令());
|
||||
}
|
||||
|
||||
} else if (当前按键.get按键类型().equals("显隐控制按键")) {
|
||||
if (获取按键(当前按键.get目标按键标识().get(0)).getVisibility() == View.VISIBLE) {
|
||||
for (String 标识:当前按键.get目标按键标识()) {
|
||||
try {
|
||||
获取按键(标识).setVisibility(View.GONE);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
当前按键.setTextColor(Color.RED);
|
||||
} else {
|
||||
for (String 标识:当前按键.get目标按键标识()) {
|
||||
try {
|
||||
获取按键(标识).setVisibility(View.VISIBLE);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
当前按键.setTextColor(Color.parseColor(当前按键.get文本颜色()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
lastPointerCount = event.getPointerCount();
|
||||
return true;
|
||||
}
|
||||
public MioCustomButton 获取按键(String 标识) {
|
||||
try {
|
||||
if (自定义按键集合.size() != 0) {
|
||||
return 自定义按键集合.get(标识);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
Toast.makeText(context, "未找到相应按键", Toast.LENGTH_LONG).show();
|
||||
return new MioCustomButton(context);
|
||||
}
|
||||
|
||||
private class MioDeserializer implements JsonDeserializer<MioCustomButton> {
|
||||
Context mContext;
|
||||
@Override
|
||||
public MioCustomButton deserialize(JsonElement json, Type typeOfT,
|
||||
JsonDeserializationContext context) throws JsonParseException {
|
||||
MioCustomButton target=new MioCustomButton(mContext);
|
||||
GsonBuilder builder=new GsonBuilder();
|
||||
builder.excludeFieldsWithoutExposeAnnotation();
|
||||
Gson mGson=builder.create();
|
||||
MioCustomButton tmp=mGson.fromJson(json, MioCustomButton.class);
|
||||
|
||||
return 合并对象(tmp, target);
|
||||
}
|
||||
public MioDeserializer(Context context) {
|
||||
this.mContext = context;
|
||||
}
|
||||
private MioCustomButton 合并对象(Object sourceBean, Object targetBean) {
|
||||
Class sourceBeanClass = sourceBean.getClass();
|
||||
Class targetBeanClass = targetBean.getClass();
|
||||
|
||||
Field[] sourceFields = sourceBeanClass.getDeclaredFields();
|
||||
Field[] targetFields = sourceBeanClass.getDeclaredFields();
|
||||
for (int i = 0; i < sourceFields.length; i++) {
|
||||
Field sourceField = sourceFields[i];
|
||||
Field targetField = targetFields[i];
|
||||
sourceField.setAccessible(true);
|
||||
targetField.setAccessible(true);
|
||||
try {
|
||||
if (!(sourceField.get(sourceBean) == null)) {
|
||||
targetField.set(targetBean, sourceField.get(sourceBean));
|
||||
}
|
||||
} catch (IllegalArgumentException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return (MioCustomButton)targetBean;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.mio.customcontrol;
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
public class MioCustomUtils
|
||||
{
|
||||
public static void setViewSize(Context context,View view, int height, int width) {
|
||||
ViewGroup.LayoutParams params = view.getLayoutParams();
|
||||
params.width = dip2px(context, (width));
|
||||
params.height = dip2px(context, (height));
|
||||
view.setLayoutParams(params);
|
||||
}
|
||||
public static int dip2px(Context context, float dpValue) {
|
||||
final float scale = context.getResources().getDisplayMetrics().density;
|
||||
return (int) (dpValue * scale + 0.5f);
|
||||
}
|
||||
public static int sp2px(Context context, float spValue) {
|
||||
final float fontScale = context.getResources().getDisplayMetrics().scaledDensity;
|
||||
return (int) (spValue * fontScale + 0.5f);
|
||||
}
|
||||
public static float percentTopx(float percent, int screen) {
|
||||
return (float) (((double) screen) * percent);
|
||||
}
|
||||
|
||||
public static float pxToPercent(float px, int screen) {
|
||||
return px / screen;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
package com.mio.customcontrol;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import com.aof.mcinabox.gamecontroller.definitions.map.MouseMap;
|
||||
import com.mio.mclauncher.customcontrol.R;
|
||||
|
||||
public class MioDialogSelectKey extends AlertDialog.Builder implements OnClickListener {
|
||||
private final Context context;
|
||||
private LinearLayout mMainLayout;
|
||||
private LinearLayout mKeyboardLayout;
|
||||
private AlertDialog mDialog;
|
||||
private Button 鼠标左;
|
||||
private Button 鼠标右;
|
||||
private Button 鼠标中;
|
||||
private Button 滚轮上;
|
||||
private Button 滚轮下;
|
||||
private Button 确定;
|
||||
private Button 取消;
|
||||
private TextView 键值;
|
||||
private EditText edit;
|
||||
private OnClickListener 手动按键事件;
|
||||
public MioDialogSelectKey(Context context){
|
||||
super(context,R.style.FullDialog);
|
||||
this.context=context;
|
||||
init();
|
||||
}
|
||||
public void init(){
|
||||
mMainLayout=(LinearLayout)LayoutInflater.from(context).inflate(R.layout.dialog_selectkey,null);
|
||||
mKeyboardLayout=mMainLayout.findViewById(R.id.selecter_keyboard);
|
||||
for(int i=0;i<mKeyboardLayout.getChildCount();i++){
|
||||
if(mKeyboardLayout.getChildAt(i) instanceof LinearLayout){
|
||||
LinearLayout t=(LinearLayout)mKeyboardLayout.getChildAt(i);
|
||||
for(int j=0;j<t.getChildCount();j++){
|
||||
if(t.getChildAt(j) instanceof MioSelectButton){
|
||||
t.getChildAt(j).setOnClickListener(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
setView(mMainLayout);
|
||||
手动按键事件 = v -> {
|
||||
if(v==鼠标左){
|
||||
键值.setText(MouseMap.MOUSEMAP_BUTTON_LEFT);
|
||||
}else if(v==鼠标中){
|
||||
键值.setText(MouseMap.MOUSEMAP_BUTTON_MIDDLE);
|
||||
}else if(v==鼠标右){
|
||||
键值.setText(MouseMap.MOUSEMAP_BUTTON_RIGHT);
|
||||
}else if(v==确定){
|
||||
edit.setText(键值.getText());
|
||||
mDialog.dismiss();
|
||||
}else if(v==取消){
|
||||
mDialog.dismiss();
|
||||
}else if(v==滚轮上){
|
||||
键值.setText(MouseMap.MOUSEMAP_WHEEL_UP);
|
||||
}else if(v==滚轮下){
|
||||
键值.setText(MouseMap.MOUSEMAP_WHEEL_DOWN);
|
||||
}
|
||||
};
|
||||
鼠标左=mMainLayout.findViewById(R.id.dialog_selectkey_mouse_left);
|
||||
鼠标右=mMainLayout.findViewById(R.id.dialog_selectkey_mouse_right);
|
||||
鼠标中=mMainLayout.findViewById(R.id.dialog_selectkey_mouse_center);
|
||||
滚轮上=mMainLayout.findViewById(R.id.dialog_selectkey_mouse_wheel_up);
|
||||
滚轮下=mMainLayout.findViewById(R.id.dialog_selectkey_mouse_wheel_down);
|
||||
确定=mMainLayout.findViewById(R.id.dialog_selectkey_btn_ok);
|
||||
取消=mMainLayout.findViewById(R.id.dialog_selectkey_btn_cancel);
|
||||
键值=mMainLayout.findViewById(R.id.dialog_selectkey_text_key);
|
||||
鼠标左.setOnClickListener(手动按键事件);
|
||||
鼠标中.setOnClickListener(手动按键事件);
|
||||
鼠标右.setOnClickListener(手动按键事件);
|
||||
滚轮上.setOnClickListener(手动按键事件);
|
||||
滚轮下.setOnClickListener(手动按键事件);
|
||||
确定.setOnClickListener(手动按键事件);
|
||||
取消.setOnClickListener(手动按键事件);
|
||||
mDialog= super.create();
|
||||
mDialog.setCancelable(false);
|
||||
mDialog.setCanceledOnTouchOutside(false);
|
||||
}
|
||||
public void setEdit(EditText edit){
|
||||
this.edit=edit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AlertDialog show() {
|
||||
mDialog.show();
|
||||
return null;
|
||||
}
|
||||
|
||||
public void dismiss(){
|
||||
mDialog.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View p1)
|
||||
{
|
||||
MioSelectButton mBtn=(MioSelectButton)p1;
|
||||
键值.setText(mBtn.getKey());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package com.mio.customcontrol;
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.Button;
|
||||
import com.mio.mclauncher.customcontrol.R;
|
||||
|
||||
public class MioSelectButton extends Button {
|
||||
|
||||
public MioSelectButton(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.MioSelectButton);
|
||||
setKey(array.getString(R.styleable.MioSelectButton_key));
|
||||
array.recycle();
|
||||
}
|
||||
|
||||
private String key;
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:state_pressed="true"
|
||||
android:drawable="@drawable/background_button_pressed" />
|
||||
<item android:drawable="@drawable/background_button_normal" />
|
||||
</selector>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<!-- 填充的颜色 -->
|
||||
<solid android:color="#FFF97297" />
|
||||
<!-- 设置按钮的四个角为弧形 -->
|
||||
<!-- android:radius 弧形的半径 -->
|
||||
<corners android:radius="10dip" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#FFFFFFFF" />
|
||||
</shape>
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<!-- 填充的颜色 -->
|
||||
<solid android:color="#B6F97297" />
|
||||
<!-- 设置按钮的四个角为弧形 -->
|
||||
<!-- android:radius 弧形的半径 -->
|
||||
<corners android:radius="10dip" />
|
||||
|
||||
<!-- padding:Button里面的文字与Button边界的间隔 -->
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#FFFFFFFF" />
|
||||
</shape>
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners
|
||||
android:topLeftRadius="5dp"
|
||||
android:topRightRadius="5dp"
|
||||
android:bottomLeftRadius="5dp"
|
||||
android:bottomRightRadius="5dp" />
|
||||
<solid android:color="#F5F5F5" />
|
||||
<size
|
||||
android:height="30dp"
|
||||
android:width="80dp" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:alpha="130"
|
||||
android:color="#BBBBBB" />
|
||||
</shape>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24"
|
||||
android:viewportWidth="24">
|
||||
<path
|
||||
android:fillColor="#ffffffff"
|
||||
android:pathData="M14,8.5A1.5,1.5 0,0 0,12.5 10A1.5,1.5 0,0 0,14 11.5A1.5,1.5 0,0 0,15.5 10A1.5,1.5 0,0 0,14 8.5M14,12.5A1.5,1.5 0,0 0,12.5 14A1.5,1.5 0,0 0,14 15.5A1.5,1.5 0,0 0,15.5 14A1.5,1.5 0,0 0,14 12.5M10,17A1,1 0,0 0,9 18A1,1 0,0 0,10 19A1,1 0,0 0,11 18A1,1 0,0 0,10 17M10,8.5A1.5,1.5 0,0 0,8.5 10A1.5,1.5 0,0 0,10 11.5A1.5,1.5 0,0 0,11.5 10A1.5,1.5 0,0 0,10 8.5M14,20.5A0.5,0.5 0,0 0,13.5 21A0.5,0.5 0,0 0,14 21.5A0.5,0.5 0,0 0,14.5 21A0.5,0.5 0,0 0,14 20.5M14,17A1,1 0,0 0,13 18A1,1 0,0 0,14 19A1,1 0,0 0,15 18A1,1 0,0 0,14 17M21,13.5A0.5,0.5 0,0 0,20.5 14A0.5,0.5 0,0 0,21 14.5A0.5,0.5 0,0 0,21.5 14A0.5,0.5 0,0 0,21 13.5M18,5A1,1 0,0 0,17 6A1,1 0,0 0,18 7A1,1 0,0 0,19 6A1,1 0,0 0,18 5M18,9A1,1 0,0 0,17 10A1,1 0,0 0,18 11A1,1 0,0 0,19 10A1,1 0,0 0,18 9M18,17A1,1 0,0 0,17 18A1,1 0,0 0,18 19A1,1 0,0 0,19 18A1,1 0,0 0,18 17M18,13A1,1 0,0 0,17 14A1,1 0,0 0,18 15A1,1 0,0 0,19 14A1,1 0,0 0,18 13M10,12.5A1.5,1.5 0,0 0,8.5 14A1.5,1.5 0,0 0,10 15.5A1.5,1.5 0,0 0,11.5 14A1.5,1.5 0,0 0,10 12.5M10,7A1,1 0,0 0,11 6A1,1 0,0 0,10 5A1,1 0,0 0,9 6A1,1 0,0 0,10 7M10,3.5A0.5,0.5 0,0 0,10.5 3A0.5,0.5 0,0 0,10 2.5A0.5,0.5 0,0 0,9.5 3A0.5,0.5 0,0 0,10 3.5M10,20.5A0.5,0.5 0,0 0,9.5 21A0.5,0.5 0,0 0,10 21.5A0.5,0.5 0,0 0,10.5 21A0.5,0.5 0,0 0,10 20.5M3,13.5A0.5,0.5 0,0 0,2.5 14A0.5,0.5 0,0 0,3 14.5A0.5,0.5 0,0 0,3.5 14A0.5,0.5 0,0 0,3 13.5M14,3.5A0.5,0.5 0,0 0,14.5 3A0.5,0.5 0,0 0,14 2.5A0.5,0.5 0,0 0,13.5 3A0.5,0.5 0,0 0,14 3.5M14,7A1,1 0,0 0,15 6A1,1 0,0 0,14 5A1,1 0,0 0,13 6A1,1 0,0 0,14 7M21,10.5A0.5,0.5 0,0 0,21.5 10A0.5,0.5 0,0 0,21 9.5A0.5,0.5 0,0 0,20.5 10A0.5,0.5 0,0 0,21 10.5M6,5A1,1 0,0 0,5 6A1,1 0,0 0,6 7A1,1 0,0 0,7 6A1,1 0,0 0,6 5M3,9.5A0.5,0.5 0,0 0,2.5 10A0.5,0.5 0,0 0,3 10.5A0.5,0.5 0,0 0,3.5 10A0.5,0.5 0,0 0,3 9.5M6,9A1,1 0,0 0,5 10A1,1 0,0 0,6 11A1,1 0,0 0,7 10A1,1 0,0 0,6 9M6,17A1,1 0,0 0,5 18A1,1 0,0 0,6 19A1,1 0,0 0,7 18A1,1 0,0 0,6 17M6,13A1,1 0,0 0,5 14A1,1 0,0 0,6 15A1,1 0,0 0,7 14A1,1 0,0 0,6 13Z"/>
|
||||
|
||||
</vector>
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24"
|
||||
android:viewportWidth="24">
|
||||
<path
|
||||
android:fillColor="#ffffffff"
|
||||
android:pathData="M10.07,14.27C10.57,14.03 11.16,14.25 11.4,14.75L13.7,19.74L15.5,18.89L13.19,13.91C12.95,13.41 13.17,12.81 13.67,12.58L13.95,12.5L16.25,12.05L8,5.12V15.9L9.82,14.43L10.07,14.27M13.64,21.97C13.14,22.21 12.54,22 12.31,21.5L10.13,16.76L7.62,18.78C7.45,18.92 7.24,19 7,19A1,1 0,0 1,6 18V3A1,1 0,0 1,7 2C7.24,2 7.47,2.09 7.64,2.23L7.65,2.22L19.14,11.86C19.57,12.22 19.62,12.85 19.27,13.27C19.12,13.45 18.91,13.57 18.7,13.61L15.54,14.23L17.74,18.96C18,19.46 17.76,20.05 17.26,20.28L13.64,21.97Z"/>
|
||||
|
||||
</vector>
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24"
|
||||
android:viewportWidth="24">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"/>
|
||||
|
||||
</vector>
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24"
|
||||
android:viewportWidth="24">
|
||||
<path
|
||||
android:fillColor="#ffffffff"
|
||||
android:pathData="M12,22C10.33,22 8.84,20.5 7.9,17.93C7.83,17.73 7.93,17.5 8.14,17.44C8.34,17.36 8.56,17.47 8.63,17.67C9.44,19.9 10.7,21.23 12,21.23C12.94,21.23 13.87,20.55 14.62,19.31C14.73,19.13 14.96,19.07 15.15,19.18C15.33,19.29 15.39,19.53 15.28,19.71C14.38,21.19 13.22,22 12,22M15.91,17.72C15.87,17.72 15.83,17.71 15.8,17.7C15.59,17.63 15.5,17.42 15.54,17.21C16,15.81 16.22,14.18 16.22,12.5C16.22,8.65 14.97,5.24 13.19,4.14C12.94,4.5 12.5,4.78 12,4.78C11.24,4.78 10.61,4.16 10.61,3.39C10.61,2.62 11.24,2 12,2C12.77,2 13.4,2.61 13.41,3.37C15.53,4.5 17,8.21 17,12.5C17,14.25 16.75,15.96 16.28,17.45C16.23,17.61 16.08,17.72 15.91,17.72M12,2.77C11.66,2.77 11.38,3.05 11.38,3.39C11.38,3.73 11.67,4 12,4C12.35,4 12.64,3.73 12.64,3.39C12.64,3.05 12.35,2.77 12,2.77M4.08,18.54C3.31,18.54 2.68,17.91 2.68,17.15C2.68,16.66 2.94,16.22 3.33,15.97C3.19,13.56 5.68,10.41 9.5,8.22C11.09,7.32 12.75,6.67 14.32,6.34C14.5,6.29 14.73,6.42 14.77,6.63C14.82,6.84 14.69,7.05 14.5,7.09C13,7.41 11.41,8.03 9.9,8.89C6.46,10.86 4.1,13.68 4.1,15.76C4.86,15.77 5.5,16.39 5.5,17.15C5.5,17.92 4.85,18.54 4.08,18.54M4.08,16.53C3.74,16.53 3.46,16.81 3.46,17.15C3.46,17.5 3.74,17.77 4.08,17.77S4.71,17.5 4.71,17.15C4.71,16.81 4.42,16.53 4.08,16.53M18.5,13.44C18.43,13.44 18.34,13.41 18.27,13.35C18.11,13.21 18.09,12.97 18.23,12.8C19.77,11 20.3,9.26 19.64,8.14C19.17,7.33 18.1,6.88 16.63,6.86C16.41,6.86 16.24,6.68 16.25,6.47C16.25,6.26 16.43,6.1 16.64,6.09C18.39,6.11 19.7,6.7 20.31,7.75C21.15,9.19 20.6,11.21 18.82,13.3C18.74,13.39 18.63,13.44 18.5,13.44M16.5,18.9C14.5,18.9 11.94,18.16 9.5,16.77C7.95,15.88 6.57,14.79 5.5,13.63C5.35,13.47 5.36,13.23 5.5,13.08C5.68,12.94 5.92,12.95 6.07,13.11C7.08,14.21 8.4,15.25 9.89,16.1C13.2,18 16.77,18.63 18.65,17.72C18.57,17.55 18.5,17.35 18.5,17.15C18.5,16.38 19.15,15.76 19.92,15.76C20.69,15.76 21.32,16.38 21.32,17.15C21.32,17.92 20.69,18.54 19.92,18.54C19.64,18.54 19.39,18.46 19.17,18.32C18.47,18.71 17.56,18.9 16.5,18.9M19.5,17.63C19.63,17.71 19.77,17.77 19.92,17.77C20.27,17.77 20.55,17.5 20.55,17.15C20.55,16.81 20.27,16.53 19.92,16.53S19.3,16.81 19.3,17.15C19.3,17.29 19.35,17.42 19.43,17.53C19.47,17.55 19.5,17.59 19.5,17.63M4.46,12C4.33,12 4.2,11.92 4.13,11.8C3.23,10.25 3.08,8.81 3.7,7.74C4.54,6.3 6.58,5.76 9.31,6.25C9.5,6.29 9.66,6.5 9.62,6.7C9.59,6.91 9.39,7.05 9.18,7C6.82,6.59 5,7 4.37,8.13C3.89,8.95 4.04,10.11 4.8,11.41C4.9,11.6 4.84,11.83 4.65,11.94C4.59,11.97 4.53,12 4.46,12M12.21,13.4C11.71,13.5 11.21,13.19 11.11,12.69C11,12.2 11.32,11.71 11.81,11.6C12.31,11.5 12.81,11.81 12.91,12.31C13,12.8 12.7,13.29 12.21,13.4Z"/>
|
||||
|
||||
</vector>
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24"
|
||||
android:viewportWidth="24">
|
||||
<path
|
||||
android:fillColor="#ffffffff"
|
||||
android:pathData="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z"/>
|
||||
|
||||
</vector>
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24"
|
||||
android:viewportWidth="24">
|
||||
<path
|
||||
android:fillColor="#ffffffff"
|
||||
android:pathData="M12,8A4,4 0,0 1,16 12A4,4 0,0 1,12 16A4,4 0,0 1,8 12A4,4 0,0 1,12 8M12,10A2,2 0,0 0,10 12A2,2 0,0 0,12 14A2,2 0,0 0,14 12A2,2 0,0 0,12 10M10,22C9.75,22 9.54,21.82 9.5,21.58L9.13,18.93C8.5,18.68 7.96,18.34 7.44,17.94L4.95,18.95C4.73,19.03 4.46,18.95 4.34,18.73L2.34,15.27C2.21,15.05 2.27,14.78 2.46,14.63L4.57,12.97L4.5,12L4.57,11L2.46,9.37C2.27,9.22 2.21,8.95 2.34,8.73L4.34,5.27C4.46,5.05 4.73,4.96 4.95,5.05L7.44,6.05C7.96,5.66 8.5,5.32 9.13,5.07L9.5,2.42C9.54,2.18 9.75,2 10,2H14C14.25,2 14.46,2.18 14.5,2.42L14.87,5.07C15.5,5.32 16.04,5.66 16.56,6.05L19.05,5.05C19.27,4.96 19.54,5.05 19.66,5.27L21.66,8.73C21.79,8.95 21.73,9.22 21.54,9.37L19.43,11L19.5,12L19.43,13L21.54,14.63C21.73,14.78 21.79,15.05 21.66,15.27L19.66,18.73C19.54,18.95 19.27,19.04 19.05,18.95L16.56,17.95C16.04,18.34 15.5,18.68 14.87,18.93L14.5,21.58C14.46,21.82 14.25,22 14,22H10M11.25,4L10.88,6.61C9.68,6.86 8.62,7.5 7.85,8.39L5.44,7.35L4.69,8.65L6.8,10.2C6.4,11.37 6.4,12.64 6.8,13.8L4.68,15.36L5.43,16.66L7.86,15.62C8.63,16.5 9.68,17.14 10.87,17.38L11.24,20H12.76L13.13,17.39C14.32,17.14 15.37,16.5 16.14,15.62L18.57,16.66L19.32,15.36L17.2,13.81C17.6,12.64 17.6,11.37 17.2,10.2L19.31,8.65L18.56,7.35L16.15,8.39C15.38,7.5 14.32,6.86 13.12,6.62L12.75,4H11.25Z"/>
|
||||
|
||||
</vector>
|
Binary file not shown.
After Width: | Height: | Size: 214 KiB |
|
@ -0,0 +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="@drawable/selecter_button_pressed" />
|
||||
<item android:drawable="@drawable/selecter_button_normal" />
|
||||
</selector>
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners
|
||||
android:topLeftRadius="2dp"
|
||||
android:topRightRadius="2dp"
|
||||
android:bottomLeftRadius="2dp"
|
||||
android:bottomRightRadius="2dp" />
|
||||
<solid android:color="#FFF97297" />
|
||||
<size
|
||||
android:height="50dp"
|
||||
android:width="50dp" />
|
||||
<stroke
|
||||
android:width="0.5dp"
|
||||
android:color="#FFFFFFFF" />
|
||||
</shape>
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners
|
||||
android:topLeftRadius="2dp"
|
||||
android:topRightRadius="2dp"
|
||||
android:bottomLeftRadius="2dp"
|
||||
android:bottomRightRadius="2dp" />
|
||||
<solid android:color="#B6F97297" />
|
||||
<size
|
||||
android:height="50dp"
|
||||
android:width="50dp" />
|
||||
<stroke
|
||||
android:width="0.5dp"
|
||||
android:color="#FFFFFFFF" />
|
||||
</shape>
|
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
|
@ -0,0 +1,509 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:padding="10dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/background_layout_item">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="通用属性"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"/>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="名称:"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/alert_miocustom_main_edit_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="高:"
|
||||
android:layout_centerVertical="true"/>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="20dp"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/alert_miocustom_main_tv_height_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="←"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:background="#FFF6F6F6"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/alert_miocustom_main_edit_height"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:inputType="number"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:gravity="center"
|
||||
android:text="50"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/alert_miocustom_main_tv_height_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="→"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="宽:"
|
||||
android:layout_centerVertical="true"/>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="20dp"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/alert_miocustom_main_tv_width_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="←"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/alert_miocustom_main_edit_width"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:inputType="number"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:gravity="center"
|
||||
android:text="50"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/alert_miocustom_main_tv_width_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="→"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="圆角:"
|
||||
android:layout_centerVertical="true"/>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="20dp"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/alert_miocustom_main_tv_round_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="←"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/alert_miocustom_main_edit_round"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:inputType="number"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:gravity="center"
|
||||
android:text="25"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/alert_miocustom_main_tv_round_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="→"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="文本大小:"
|
||||
android:layout_centerVertical="true"/>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="20dp"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/alert_miocustom_main_tv_textsize_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="←"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/alert_miocustom_main_edit_textsize"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:inputType="number"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:gravity="center"
|
||||
android:text="15"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/alert_miocustom_main_tv_textsize_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="→"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="边框颜色:"
|
||||
android:layout_centerVertical="true"
|
||||
android:id="@+id/alertmiocustommainTextView1"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/alert_miocustom_main_edit_strokecolor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@id/alertmiocustommainTextView1"
|
||||
android:layout_marginLeft="30dp"
|
||||
android:text="#FFFFFFFF"
|
||||
android:maxLines="1"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/alert_miocustom_main_view_strokecolor"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:background="#FFFFFFFF"
|
||||
android:layout_alignParentRight="true"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="文本颜色:"
|
||||
android:layout_centerVertical="true"
|
||||
android:id="@+id/alertmiocustommainTextView2"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/alert_miocustom_main_edit_textcolor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@id/alertmiocustommainTextView2"
|
||||
android:layout_marginLeft="30dp"
|
||||
android:text="#FFFFFFFF"
|
||||
android:maxLines="1"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/alert_miocustom_main_view_textcolor"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:background="#FFFFFFFF"
|
||||
android:layout_alignParentRight="true"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:background="?android:attr/dividerVertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="高级属性"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"/>
|
||||
|
||||
<RadioGroup
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<RadioButton
|
||||
android:checked="true"
|
||||
android:id="@+id/alert_miocustom_main_radio_normalbtn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="普通按键"/>
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/alert_miocustom_main_radio_cmdbtn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="命令按键"/>
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/alert_miocustom_main_radio_vsbbtn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="显隐控制按键"/>
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
<View
|
||||
android:background="?android:attr/dividerVertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/alert_miocustom_main_layout_normalbtn"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="普通按键"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"/>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="键值:"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
||||
|
||||
<EditText
|
||||
android:focusable="false"
|
||||
android:id="@+id/alert_miocustom_main_edit_key1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:textIsSelectable="false"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="+"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginRight="15dp"/>
|
||||
|
||||
<EditText
|
||||
android:focusable="false"
|
||||
android:id="@+id/alert_miocustom_main_edit_key2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:textIsSelectable="false"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="+"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginRight="15dp"/>
|
||||
|
||||
<EditText
|
||||
android:focusable="false"
|
||||
android:id="@+id/alert_miocustom_main_edit_key3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:textIsSelectable="false"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/alert_miocustom_main_check_autokeep"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="自动保持"/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/alert_miocustom_main_check_mousectrl"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="控制视角(指针)移动"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/alert_miocustom_main_layout_cmdbtn"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="命令按键"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"/>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="命令:"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/alert_miocustom_main_edit_cmd"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/alert_miocustom_main_layout_vsbbtn"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="显隐控制按键"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/alert_miocustom_main_btn_btnselect"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="选择按键"
|
||||
android:background="@drawable/background_button"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:layout_margin="5dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:padding="10dp">
|
||||
|
||||
<Button
|
||||
android:id="@+id/alert_miocustom_main_btn_ok"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="确定"
|
||||
android:background="@drawable/background_button"
|
||||
android:layout_marginRight="10dp"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:layout_weight="1.0"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/alert_miocustom_main_btn_cancle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="取消"
|
||||
android:background="@drawable/background_button"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:layout_weight="1.0"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center">
|
||||
|
||||
<com.larswerkman.holocolorpicker.ColorPicker
|
||||
android:id="@+id/picker"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="160dp"/>
|
||||
|
||||
<com.larswerkman.holocolorpicker.OpacityBar
|
||||
android:id="@+id/opacitybar"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<com.larswerkman.holocolorpicker.SVBar
|
||||
android:id="@+id/svbar"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#80D7D7D7"
|
||||
android:padding="15dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<Button
|
||||
android:id="@+id/dialog_selectkey_mouse_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="鼠标左"
|
||||
style="@style/selecterButtonStyle"
|
||||
android:textSize="15sp"/>
|
||||
|
||||
<Button
|
||||
android:layout_toRightOf="@id/dialog_selectkey_mouse_left"
|
||||
android:id="@+id/dialog_selectkey_mouse_center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="鼠标中"
|
||||
style="@style/selecterButtonStyle"
|
||||
android:textSize="15sp"/>
|
||||
|
||||
<Button
|
||||
android:layout_toRightOf="@id/dialog_selectkey_mouse_center"
|
||||
android:id="@+id/dialog_selectkey_mouse_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="鼠标右"
|
||||
style="@style/selecterButtonStyle"
|
||||
android:textSize="15sp"/>
|
||||
|
||||
<Button
|
||||
android:layout_toRightOf="@id/dialog_selectkey_mouse_right"
|
||||
android:id="@+id/dialog_selectkey_mouse_wheel_up"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="鼠滚轮上"
|
||||
style="@style/selecterButtonStyle"
|
||||
android:textSize="15sp"/>
|
||||
|
||||
<Button
|
||||
android:layout_toRightOf="@id/dialog_selectkey_mouse_wheel_up"
|
||||
android:id="@+id/dialog_selectkey_mouse_wheel_down"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="滚轮下"
|
||||
style="@style/selecterButtonStyle"
|
||||
android:textSize="15sp"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/dialog_selectkey_btn_cancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="取消"
|
||||
android:layout_alignParentRight="true"
|
||||
style="@style/selecterButtonStyle"
|
||||
android:textSize="18sp"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/dialog_selectkey_btn_ok"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="确定"
|
||||
android:layout_toLeftOf="@id/dialog_selectkey_btn_cancel"
|
||||
style="@style/selecterButtonStyle"
|
||||
android:textSize="18sp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dialog_selectkey_text_key"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toRightOf="@id/dialog_selectkey_mouse_wheel_down"
|
||||
android:layout_marginLeft="10dp"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<include
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
layout="@layout/selecter_keyboard"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -0,0 +1,991 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:custom="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/selecter_keyboard"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="ESC"
|
||||
custom:key="ESC" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="F1"
|
||||
custom:key="F1" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="F2"
|
||||
custom:key="F2" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="F3"
|
||||
custom:key="F3" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="F4"
|
||||
custom:key="F4" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.5" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="F5"
|
||||
custom:key="F5" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="F6"
|
||||
custom:key="F6" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="F7"
|
||||
custom:key="F7" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="F8"
|
||||
custom:key="F8" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.5" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="F9"
|
||||
custom:key="F9" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="F10"
|
||||
custom:key="F10" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="F11"
|
||||
custom:key="F11" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="F12"
|
||||
custom:key="F12" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.5" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="Prt"
|
||||
custom:key="PRINT" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="Scr"
|
||||
custom:key="SCROLL" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="Pau"
|
||||
custom:key="PAUSE" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="4.5" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- <View-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="0dp"-->
|
||||
<!-- android:layout_weight="0.5" />-->
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="`"
|
||||
custom:key="`"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="1"
|
||||
custom:key="1"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="2"
|
||||
custom:key="2"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="3"
|
||||
custom:key="3"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="4"
|
||||
custom:key="4"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="5"
|
||||
custom:key="5"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="6"
|
||||
custom:key="6"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="7"
|
||||
custom:key="7"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="8"
|
||||
custom:key="8"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="9"
|
||||
custom:key="9"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="0"
|
||||
custom:key="0"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="-"
|
||||
custom:key="-"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="="
|
||||
custom:key="="/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="\"
|
||||
custom:key="\"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="←--"
|
||||
custom:key="BACK" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.5" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="Ins"
|
||||
custom:key="INSERT" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="Hom"
|
||||
custom:key="HOME" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="Pau"
|
||||
custom:key="PGUP" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.5"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="Num"
|
||||
custom:key="NUMLOCK" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="/"
|
||||
custom:key="NUMPAD/" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="*"
|
||||
custom:key="NUMPAD*" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="-"
|
||||
custom:key="NUMPAD-" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.5"
|
||||
android:text="TAB"
|
||||
custom:key="TAB" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="Q"
|
||||
custom:key="Q"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="W"
|
||||
custom:key="W"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="E"
|
||||
custom:key="E"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="R"
|
||||
custom:key="R"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="T"
|
||||
custom:key="T"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="Y"
|
||||
custom:key="Y"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="U"
|
||||
custom:key="U"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="I"
|
||||
custom:key="I"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="O"
|
||||
custom:key="O"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="P"
|
||||
custom:key="P"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="["
|
||||
custom:key="["/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="]"
|
||||
custom:key="]"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.5"
|
||||
android:text="Enter"
|
||||
custom:key="ENTER" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.5"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="Del"
|
||||
custom:key="DELETE" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="End"
|
||||
custom:key="END" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="PaD"
|
||||
custom:key="PGDN" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.5"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="7"
|
||||
custom:key="NUMPAD7" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="8"
|
||||
custom:key="NUMPAD8" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="9"
|
||||
custom:key="NUMPAD9" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="+"
|
||||
custom:key="NUMPAD+" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.6"
|
||||
android:text="Caps L"
|
||||
custom:key="CAPITAL" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="A"
|
||||
custom:key="A"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="S"
|
||||
custom:key="S"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="D"
|
||||
custom:key="D"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="F"
|
||||
custom:key="F"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="G"
|
||||
custom:key="G"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="H"
|
||||
custom:key="H"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="J"
|
||||
custom:key="J"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="K"
|
||||
custom:key="K"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="L"
|
||||
custom:key="L"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text=";"
|
||||
custom:key=";"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="'"
|
||||
custom:key="'"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2.4"
|
||||
android:text=""
|
||||
custom:key="ENTER" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="4"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="4"
|
||||
custom:key="NUMPAD4" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="5"
|
||||
custom:key="NUMPAD5" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="6"
|
||||
custom:key="NUMPAD6" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text=""
|
||||
custom:key="NUMPAD+" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2.1"
|
||||
android:text="Shift"
|
||||
custom:key="LSHIFT" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="Z"
|
||||
custom:key="Z"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="X"
|
||||
custom:key="X"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="C"
|
||||
custom:key="C"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="V"
|
||||
custom:key="V"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="B"
|
||||
custom:key="B"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="N"
|
||||
custom:key="N"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="M"
|
||||
custom:key="M"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text=","
|
||||
custom:key=","/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="."
|
||||
custom:key="."/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="/"
|
||||
custom:key="/"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2.9"
|
||||
android:text="Shift"
|
||||
custom:key="RSHIFT" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.5"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="↑"
|
||||
custom:key="UP" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.5"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="1"
|
||||
custom:key="NUMPAD1" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="2"
|
||||
custom:key="NUMPAD2" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="3"
|
||||
custom:key="NUMPAD3" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="Ent"
|
||||
custom:key="NUMPADENTER" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.4"
|
||||
android:text="Ctrl"
|
||||
custom:key="LCTRL" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.4"
|
||||
android:text="Win"
|
||||
custom:key="LWIN" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.4"
|
||||
android:text="Alt"
|
||||
custom:key="LALT" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="5.2"
|
||||
android:text="Space"
|
||||
custom:key="SPACE"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.4"
|
||||
android:text="Alt"
|
||||
custom:key="RALT" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.4"
|
||||
android:text="Win"
|
||||
custom:key="RWIN" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.4"
|
||||
android:text="RightK"
|
||||
custom:key="RIGHTK" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.4"
|
||||
android:text="Ctrl"
|
||||
custom:key="RCTRL" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.5"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="←"
|
||||
custom:key="LEFT" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="↓"
|
||||
custom:key="DOWN" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="→"
|
||||
custom:key="RIGHT" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.5"/>
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:text="0"
|
||||
custom:key="NUMPAD0" />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="."
|
||||
custom:key="NUMPAD." />
|
||||
|
||||
<com.mio.customcontrol.MioSelectButton
|
||||
style="@style/selecterButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text=""
|
||||
custom:key="NUMPADENTER" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<declare-styleable name="MioSelectButton">
|
||||
<attr name="key" format="string"/>
|
||||
</declare-styleable>
|
||||
|
||||
</resources>
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#FFF97297</color>
|
||||
<color name="colorPrimaryDark">#FFFF5180</color>
|
||||
<color name="colorAccent">#FF4081</color>
|
||||
<color name="puredark">#FFFFFFFF</color>
|
||||
<color name="colorBottomButton">#FF8A8A8A</color>
|
||||
<color name="cardBG">#8CFF8D82</color>
|
||||
|
||||
</resources>
|
|
@ -0,0 +1,14 @@
|
|||
<resources>
|
||||
<string name="lfile_NotFoundBooks">Please select a file at least</string>
|
||||
<string name="lfile_NotFoundPath">The sd card is not available</string>
|
||||
<string name="lfile_UpOneLevel">Up</string>
|
||||
<string name="lfile_Selected">selected</string>
|
||||
<string name="lfile_LItem">item</string>
|
||||
<string name="lfile_Detail">detail</string>
|
||||
<string name="lfile_FileSize">size : </string>
|
||||
<string name="lfile_OutSize">Has reached the maximum number</string>
|
||||
<string name="lfile_SelectAll">SelectAll</string>
|
||||
<string name="lfile_Cancel">Cancel</string>
|
||||
<string name="lfile_OK">OK</string>
|
||||
<string name="lfile_ChooseTip">Please select folders path</string>
|
||||
</resources>
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="selecterButtonStyle">
|
||||
<item name="android:background">@drawable/selecter_button</item>
|
||||
<item name="android:textSize">8sp</item>
|
||||
<item name="android:textAllCaps">false</item>
|
||||
<item name="android:textColor">#FFFFFFFF</item>
|
||||
</style>
|
||||
<style name="FullDialog">
|
||||
<!-- 是否没有标题 -->
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowFullscreen">true</item>
|
||||
</style>
|
||||
</resources>
|
|
@ -20,3 +20,4 @@ include ':FCL'
|
|||
include ':FCLCore'
|
||||
include ':FCLauncher'
|
||||
include ':FCLLibrary'
|
||||
include ':MioCustom'
|
||||
|
|
Loading…
Reference in New Issue