Skip to content

Commit

Permalink
1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ORG00 authored and ORG00 committed Jul 14, 2022
1 parent cc7d734 commit 2a2aebc
Show file tree
Hide file tree
Showing 19 changed files with 615 additions and 219 deletions.
12 changes: 11 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/render.experimental.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {
minSdk 22
targetSdk 32
versionCode 1
versionName "1.2"
versionName "1.3"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -28,7 +28,6 @@ android {
}

dependencies {

implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
Expand All @@ -37,5 +36,5 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'org.apache.commons:commons-lang3:3.6'

implementation 'androidx.appcompat:appcompat'
}
373 changes: 291 additions & 82 deletions app/src/main/java/com/plawyue/wiimotedsu/MainActivity.java

Large diffs are not rendered by default.

15 changes: 5 additions & 10 deletions app/src/main/java/com/plawyue/wiimotedsu/Packet.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,11 @@ public byte[] answer(Controller mcontrol,int flag){
for(int i=0;i!=12;i++){
mout[40+i]=0;
}
long motion=System.currentTimeMillis();
long motion=System.currentTimeMillis()*1000;
for(int i=0;i!=8;i++){
mout[52+i]=LongToBytes(motion)[i];
// mout[52+i]=LongToBytes(motion)[i];
mout[52+i]= (byte) ((motion>>i*8)&0xFF);

}
float buffer = mcontrol.accelX;
ByteBuffer bbuf = ByteBuffer.allocate(4);
Expand Down Expand Up @@ -291,12 +293,5 @@ public int KeyToBitmask(Controller mcontrol){
}
return a;
}
public static byte[] LongToBytes(long values) {
byte[] buffer = new byte[8];
for (int i = 0; i < 8; i++) {
int offset = 64 - (i + 1) * 8;
buffer[i] = (byte) ((values >> offset) & 0xff);
}
return buffer;
}

}
12 changes: 12 additions & 0 deletions app/src/main/res/drawable/ic_editmode.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="96"
android:viewportHeight="96">
<path
android:fillColor="@color/spical"
android:pathData="M25,71.1C27,73.1 27,76.2 25,78.2L16.5,81 15,79.5 17.8,71C19.9,69.1 23,69.1 25,71.1ZM64.3,18.9 L14.3,69 8,88 27.1,81.7 77.1,31.7"/>
<path
android:fillColor="@color/spical"
android:pathData="M86.9,16.2 L79.8,9.1C78.2,7.5 75.7,7.5 74.1,9.1L67.1,16.1 79.8,28.8 86.8,21.8C88.5,20.3 88.5,17.8 86.9,16.2Z"/>
</vector>
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_senset.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="96dp"
android:height="96dp"
android:viewportWidth="96"
android:viewportHeight="96">
<path
android:fillColor="@color/spical"
android:pathData="M48,60C41.4,60 36,54.6 36,48 36,41.4 41.4,36 48,36 54.6,36 60,41.4 60,48 60,54.6 54.6,60 48,60ZM75,40.5C74.4,38.3 73.5,36.2 72.4,34.3L74.9,26.8 69.2,21.1 61.7,23.6C59.7,22.5 57.6,21.6 55.4,21L52,14 44,14 40.5,21C38.3,21.6 36.2,22.5 34.3,23.6L26.8,21.1 21.1,26.8 23.6,34.3C22.5,36.3 21.6,38.4 21,40.6L14,44 14,52 21,55.5C21.6,57.7 22.5,59.8 23.6,61.7L21.1,69.2 26.8,74.9 34.3,72.4C36.3,73.5 38.4,74.4 40.6,75L44.1,82 52.1,82 55.6,75C57.8,74.4 59.9,73.5 61.8,72.4L69.3,74.9 75,69.2 72.5,61.7C73.6,59.7 74.5,57.6 75.1,55.4L82.1,51.9 82.1,43.9 75,40.5Z"/>
</vector>
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/line.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<shape android:shape="rectangle"
xmlns:android="http://schemas.android.com/apk/res/android" >
<size android:height="20dp" android:width="20dp"/>
<size android:height="20dp" android:width="10dp"/>

</shape>
11 changes: 11 additions & 0 deletions app/src/main/res/drawable/pressed.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">

<!-- 圆角的半径 -->
<corners android:radius="90dp"/>
<!-- 填充颜色 -->
<solid android:color="@color/spical"/>

</shape>
13 changes: 13 additions & 0 deletions app/src/main/res/drawable/unpress.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
>

<!-- 圆角的半径 -->
<corners android:radius="90dp"/>

<!-- 填充颜色 -->
<solid android:color="@color/buttonx"/>

</shape>
Loading

0 comments on commit 2a2aebc

Please sign in to comment.