diff --git a/README.md b/README.md index 69b2dd3..7470fe4 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,6 @@ For TicWear OS: ![pic](http://7xi6qz.com1.z0.glb.clouddn.com/partyshakingticwear2.jpg) -![pic](http://7xi6qz.com1.z0.glb.clouddn.com/partyshakingticwear3.jpg) - ![pic](http://7xi6qz.com1.z0.glb.clouddn.com/partyshakingticwear4.jpg) ![pic](http://7xi6qz.com1.z0.glb.clouddn.com/partyshakingticwear5.jpg) diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.gitignore" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.gitignore" new file mode 100644 index 0000000..afbdab3 --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.gitignore" @@ -0,0 +1,6 @@ +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/.name" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/.name" new file mode 100644 index 0000000..a4a3e2a --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/.name" @@ -0,0 +1 @@ +PartySharking \ No newline at end of file diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/compiler.xml" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/compiler.xml" new file mode 100644 index 0000000..217af47 --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/compiler.xml" @@ -0,0 +1,23 @@ + + + + + + diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/copyright/profiles_settings.xml" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/copyright/profiles_settings.xml" new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/copyright/profiles_settings.xml" @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/encodings.xml" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/encodings.xml" new file mode 100644 index 0000000..e206d70 --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/encodings.xml" @@ -0,0 +1,5 @@ + + + + + diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/gradle.xml" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/gradle.xml" new file mode 100644 index 0000000..fe865d3 --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/gradle.xml" @@ -0,0 +1,19 @@ + + + + + + + diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/misc.xml" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/misc.xml" new file mode 100644 index 0000000..9076de5 --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/misc.xml" @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/modules.xml" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/modules.xml" new file mode 100644 index 0000000..8156f5d --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/modules.xml" @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/runConfigurations.xml" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/runConfigurations.xml" new file mode 100644 index 0000000..7f68460 --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/runConfigurations.xml" @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/scopes/scope_settings.xml" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/scopes/scope_settings.xml" new file mode 100644 index 0000000..922003b --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/scopes/scope_settings.xml" @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/vcs.xml" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/vcs.xml" new file mode 100644 index 0000000..def6a6a --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/.idea/vcs.xml" @@ -0,0 +1,7 @@ + + + + + + + diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/PartySharking.iml" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/PartySharking.iml" new file mode 100644 index 0000000..dd5cab9 --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/PartySharking.iml" @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/.gitignore" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/.gitignore" new file mode 100644 index 0000000..796b96d --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/.gitignore" @@ -0,0 +1 @@ +/build diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/app-release.apk" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/app-release.apk" new file mode 100644 index 0000000..f32357b Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/app-release.apk" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/app.iml" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/app.iml" new file mode 100644 index 0000000..7402242 --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/app.iml" @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/build.gradle" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/build.gradle" new file mode 100644 index 0000000..d7a1bf3 --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/build.gradle" @@ -0,0 +1,28 @@ +apply plugin: 'com.android.application' + + +android { + compileSdkVersion 22 + buildToolsVersion "22.0.1" + defaultConfig { + applicationId 'com.daijiale.wear.partyshaking' + minSdkVersion 21 + targetSdkVersion 22 + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } + productFlavors { + } +} + +dependencies { + compile fileTree(include: ['*.jar'], dir: 'libs') + compile 'com.google.android.support:wearable:1.1.0' + compile 'com.google.android.gms:play-services-wearable:7.3.0' +} diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/libs/mobvoi-api.jar" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/libs/mobvoi-api.jar" new file mode 100644 index 0000000..28d0491 Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/libs/mobvoi-api.jar" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/manifest-merger-release-report.txt" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/manifest-merger-release-report.txt" new file mode 100644 index 0000000..53000b1 --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/manifest-merger-release-report.txt" @@ -0,0 +1,97 @@ +-- Merging decision tree log --- +manifest +ADDED from AndroidManifest.xml:2:1 + package + ADDED from AndroidManifest.xml:3:5 + INJECTED from AndroidManifest.xml:0:0 + INJECTED from AndroidManifest.xml:0:0 + android:versionName + ADDED from AndroidManifest.xml:5:5 + INJECTED from AndroidManifest.xml:0:0 + INJECTED from AndroidManifest.xml:0:0 + android:versionCode + ADDED from AndroidManifest.xml:4:5 + INJECTED from AndroidManifest.xml:0:0 + INJECTED from AndroidManifest.xml:0:0 + xmlns:android + ADDED from AndroidManifest.xml:2:11 +uses-feature#android.hardware.type.watch +ADDED from AndroidManifest.xml:7:5 + android:name + ADDED from AndroidManifest.xml:7:19 +uses-permission#android.permission.VIBRATE +ADDED from AndroidManifest.xml:8:5 + android:name + ADDED from AndroidManifest.xml:8:22 +application +ADDED from AndroidManifest.xml:9:5 +MERGED from com.google.android.support:wearable:1.1.0:10:5 +MERGED from com.android.support:support-v4:22.0.0:22:5 +MERGED from com.android.support:recyclerview-v7:21.0.0:17:5 +MERGED from com.android.support:support-v4:22.0.0:22:5 +MERGED from com.google.android.gms:play-services-wearable:7.3.0:19:5 +MERGED from com.google.android.gms:play-services-base:7.3.0:20:5 +MERGED from com.android.support:support-v4:22.0.0:22:5 + android:label + ADDED from AndroidManifest.xml:12:9 + android:allowBackup + ADDED from AndroidManifest.xml:10:9 + android:icon + ADDED from AndroidManifest.xml:11:9 + android:theme + ADDED from AndroidManifest.xml:13:9 +activity#com.daijiale.wear.partyshaking.ActivityToActivity +ADDED from AndroidManifest.xml:15:9 + android:label + ADDED from AndroidManifest.xml:17:13 + android:name + ADDED from AndroidManifest.xml:16:13 +intent-filter#android.intent.action.MAIN+android.intent.category.LAUNCHER +ADDED from AndroidManifest.xml:18:13 +action#android.intent.action.MAIN +ADDED from AndroidManifest.xml:19:17 + android:name + ADDED from AndroidManifest.xml:19:25 +category#android.intent.category.LAUNCHER +ADDED from AndroidManifest.xml:21:17 + android:name + ADDED from AndroidManifest.xml:21:27 +activity#com.daijiale.wear.partyshaking.FirstActivity +ADDED from AndroidManifest.xml:26:9 + android:label + ADDED from AndroidManifest.xml:28:13 + android:name + ADDED from AndroidManifest.xml:27:13 +activity#com.daijiale.wear.partyshaking.SecondActivity +ADDED from AndroidManifest.xml:32:9 + android:label + ADDED from AndroidManifest.xml:34:13 + android:name + ADDED from AndroidManifest.xml:33:13 +uses-sdk +INJECTED from AndroidManifest.xml:0:0 reason: use-sdk injection requested +MERGED from com.google.android.support:wearable:1.1.0:6:5 +MERGED from com.android.support:support-v4:22.0.0:20:5 +MERGED from com.android.support:recyclerview-v7:21.0.0:15:5 +MERGED from com.android.support:support-v4:22.0.0:20:5 +MERGED from com.google.android.gms:play-services-wearable:7.3.0:18:5 +MERGED from com.google.android.gms:play-services-base:7.3.0:18:5 +MERGED from com.android.support:support-v4:22.0.0:20:5 + android:targetSdkVersion + INJECTED from AndroidManifest.xml:0:0 + INJECTED from AndroidManifest.xml:0:0 + android:minSdkVersion + INJECTED from AndroidManifest.xml:0:0 + INJECTED from AndroidManifest.xml:0:0 +activity#android.support.v7.widget.TestActivity +ADDED from com.android.support:recyclerview-v7:21.0.0:18:9 + android:label + ADDED from com.android.support:recyclerview-v7:21.0.0:18:19 + android:name + ADDED from com.android.support:recyclerview-v7:21.0.0:18:60 +meta-data#com.google.android.gms.version +ADDED from com.google.android.gms:play-services-base:7.3.0:21:9 + android:value + ADDED from com.google.android.gms:play-services-base:7.3.0:23:13 + android:name + ADDED from com.google.android.gms:play-services-base:7.3.0:22:13 diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/proguard-rules.pro" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/proguard-rules.pro" new file mode 100644 index 0000000..710bb1a --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/proguard-rules.pro" @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /Users/JialeDai/Library/Android/sdk/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 *; +#} diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/AndroidManifest.xml" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/AndroidManifest.xml" new file mode 100644 index 0000000..4e8f46b --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/AndroidManifest.xml" @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/java/com/daijiale/wear/partyshaking/ActivityToActivity.java" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/java/com/daijiale/wear/partyshaking/ActivityToActivity.java" new file mode 100644 index 0000000..3a99038 --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/java/com/daijiale/wear/partyshaking/ActivityToActivity.java" @@ -0,0 +1,72 @@ +package com.daijiale.wear.partyshaking; + +import android.app.Activity; +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.view.View; +import android.view.View.OnClickListener; +import android.widget.ImageButton; +import android.widget.TextView; + +/** + * Created by JialeDai on 15/5/17. + */ + +public class ActivityToActivity extends Activity { + private static final int MainActivity = 1; + private static final int SecondActivity = 2; + + TextView textView; + + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); +// final WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub); +// stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() { +// @Override +// public void onLayoutInflated(WatchViewStub stub) { +// +// } +// }); + setContentView(R.layout.round_activity_main); + + + final ImageButton btn1 = (ImageButton)findViewById(R.id.imageButton1); + final ImageButton btn2 = (ImageButton)findViewById(R.id.imageButton2); + + btn1.setOnClickListener(new OnClickListener(){ + public void onClick(View view){ + Intent intent = new Intent(ActivityToActivity.this, FirstActivity.class); + startActivityForResult(intent, MainActivity); + } + }); + + btn2.setOnClickListener(new OnClickListener(){ + public void onClick(View view){ + Intent intent = new Intent(ActivityToActivity.this, SecondActivity.class); + startActivityForResult(intent, SecondActivity); + } + }); + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + + switch (requestCode) { + case MainActivity: + if (resultCode == RESULT_OK) { + Uri uriData = data.getData(); + textView.setText(uriData.toString()); + } + break; + case SecondActivity: + break; + } + + } +} + + diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/java/com/daijiale/wear/partyshaking/FirstActivity.java" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/java/com/daijiale/wear/partyshaking/FirstActivity.java" new file mode 100644 index 0000000..7ac4800 --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/java/com/daijiale/wear/partyshaking/FirstActivity.java" @@ -0,0 +1,153 @@ +package com.daijiale.wear.partyshaking; + +import android.app.Activity; +import android.content.Context; +import android.os.Bundle; +import android.os.Handler; +import android.os.Message; +import android.os.Vibrator; +import android.util.Log; +import android.view.View; +import android.view.Window; +import android.widget.ImageView; +import android.widget.TextView; + +import com.daijiale.wear.partyshaking.ShakeListener.OnShakeListener; + +import java.util.Random; + +/** +Created by JialeDai on 15/5/17. + **/ + +public class FirstActivity extends Activity { + + private TextView mTextView; + private Vibrator vibrator; + + private ImageView imView, imcount, imgnot; + + private ShakeListener shakeListener; + + private int ico[] = { R.drawable.image_left, R.drawable.image_middle,R.drawable.image_right }; + + private int icoSotp[] = { R.drawable.lottery_result,R.drawable.game1,R.drawable.game2, + R.drawable.game3,R.drawable.game4,R.drawable.game5}; + + private int index = 0; + + private int randomC=0; + + private Random random; + + + + @Override + protected void onCreate(Bundle savedInstanceState) { + + +// final WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub); +// stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() { +// @Override +// public void onLayoutInflated(WatchViewStub stub) { +// mTextView = (TextView) stub.findViewById(R.id.text); +// } +// }); + this.requestWindowFeature(Window.FEATURE_NO_TITLE); + super.onCreate(savedInstanceState); + setContentView(R.layout.shakingstatus1); + init(); + + + } + + public void init(){ + vibrator = (Vibrator) this.getSystemService(Context.VIBRATOR_SERVICE); + shakeListener = new ShakeListener(this); + shakeListener.setOnShake(onShake); + + imView = (ImageView) this.findViewById(R.id.imgmiddle); + imcount = (ImageView) this.findViewById(R.id.imgtit); + imgnot = (ImageView) this.findViewById(R.id.imgnoth); + random=new Random(); + } + + + + private OnShakeListener onShake = new OnShakeListener() { + + @Override + public void onShake() { + imgnot.setVisibility(View.GONE); + startVibrator(); + shakeListener.stop(); + + handler.sendEmptyMessageDelayed(1, 200); + handler.sendEmptyMessageDelayed(2, 2000); + + randomC=random.nextInt(6); + Log.e("--", "---" + randomC); + + } + }; + + private Handler handler = new Handler() { + @Override + public void handleMessage(Message msg) { + super.handleMessage(msg); + if (msg.what == 1) { + if (index < ico.length - 1) { + index++; + } else { + index = 0; + } + imView.setBackgroundResource(ico[index]); + handler.sendEmptyMessageDelayed(1, 200); + } else { + imView.setBackgroundResource(icoSotp[0]); + handler.removeMessages(1); + shakeListener.start(); + + + + if(randomC==5){ + imgnot.setBackgroundResource(icoSotp[3]); + imgnot.setVisibility(View.VISIBLE); + }else if(randomC==4) + { + imgnot.setBackgroundResource(icoSotp[4]); + imgnot.setVisibility(View.VISIBLE); + }else if(randomC==3) + { + imgnot.setBackgroundResource(icoSotp[5]); + imgnot.setVisibility(View.VISIBLE); + + } + else if(randomC==2) + { + imgnot.setBackgroundResource(icoSotp[1]); + imgnot.setVisibility(View.VISIBLE); + } + else + { + imgnot.setBackgroundResource(icoSotp[2]); + imgnot.setVisibility(View.VISIBLE); + } + + } + } + + }; + + + public void startVibrator() { + vibrator.vibrate(new long[] { 500, 300, 500, 300 }, -1); + } + + @Override + protected void onDestroy() { + // TODO Auto-generated method stub + super.onDestroy(); + } + +} diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/java/com/daijiale/wear/partyshaking/SecondActivity.java" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/java/com/daijiale/wear/partyshaking/SecondActivity.java" new file mode 100644 index 0000000..5d9c0ec --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/java/com/daijiale/wear/partyshaking/SecondActivity.java" @@ -0,0 +1,169 @@ +package com.daijiale.wear.partyshaking; + +import android.app.Activity; +import android.content.Context; +import android.os.Bundle; +import android.os.Handler; +import android.os.Message; +import android.os.Vibrator; +import android.util.Log; +import android.view.View; +import android.widget.ImageView; + +import com.daijiale.wear.partyshaking.ShakeListener.OnShakeListener; + +import java.util.Random; + + +public class SecondActivity extends Activity { + + private Vibrator vibrator; + + private ImageView imView, imcount, imgnot; + + private ShakeListener shakeListener; + + private int ico[] = { R.drawable.image_left, R.drawable.image_middle,R.drawable.image_right }; + + private int icoSotp[] = { R.drawable.lottery_result,R.drawable.lottery_nothing,R.drawable.chengfa1, + R.drawable.chengfa2,R.drawable.chengfa3,R.drawable.chengfa4,R.drawable.chengfa5, + R.drawable.chengfa6,R.drawable.chengfa7,R.drawable.chengfa8,R.drawable.chengfa9, + R.drawable.chengfa10,R.drawable.chengfa11,R.drawable.chengfa12,R.drawable.chengfa13}; + + private int index = 0; + + private int randomC=0; + + private Random random; + + @Override + protected void onCreate(Bundle savedInstanceState) { +// this.requestWindowFeature(Window.FEATURE_NO_TITLE); + super.onCreate(savedInstanceState); + + setContentView(R.layout.shakingstatus1); + init(); + } + + public void init(){ + vibrator = (Vibrator) this.getSystemService(Context.VIBRATOR_SERVICE); + shakeListener = new ShakeListener(this); + shakeListener.setOnShake(onShake); + + imView = (ImageView) this.findViewById(R.id.imgmiddle); + imcount = (ImageView) this.findViewById(R.id.imgtit); + imgnot = (ImageView) this.findViewById(R.id.imgnoth); + random=new Random(); + } + + + private OnShakeListener onShake = new OnShakeListener() { + public void onShake() { + imgnot.setVisibility(View.GONE); + + startVibrator(); + shakeListener.stop(); + + handler.sendEmptyMessageDelayed(1, 200); + handler.sendEmptyMessageDelayed(2, 2000); + + randomC=random.nextInt(15); + Log.e("--", "---" + randomC); + + } + }; + + private Handler handler = new Handler() { + @Override + public void handleMessage(Message msg) { + super.handleMessage(msg); + if (msg.what == 1) { + if (index < ico.length - 1) { + index++; + } else { + index = 0; + } + imView.setBackgroundResource(ico[index]); + handler.sendEmptyMessageDelayed(1, 200); + } else { + imView.setBackgroundResource(icoSotp[0]); + //imcount.setBackgroundResource(icoSotp[1]); + handler.removeMessages(1); + shakeListener.start(); + + + + if(randomC==1){ + imgnot.setBackgroundResource(icoSotp[3]); + imgnot.setVisibility(View.VISIBLE); + } + else if(randomC==2){ + imgnot.setBackgroundResource(icoSotp[4]); + imgnot.setVisibility(View.VISIBLE); + } + else if(randomC==3){ + imgnot.setBackgroundResource(icoSotp[5]); + imgnot.setVisibility(View.VISIBLE); + } + else if(randomC==4){ + imgnot.setBackgroundResource(icoSotp[6]); + imgnot.setVisibility(View.VISIBLE); + } + else if(randomC==5){ + imgnot.setBackgroundResource(icoSotp[7]); + imgnot.setVisibility(View.VISIBLE); + } + else if(randomC==6){ + imgnot.setBackgroundResource(icoSotp[8]); + imgnot.setVisibility(View.VISIBLE); + } + else if(randomC==7){ + imgnot.setBackgroundResource(icoSotp[9]); + imgnot.setVisibility(View.VISIBLE); + } + else if(randomC==8){ + imgnot.setBackgroundResource(icoSotp[10]); + imgnot.setVisibility(View.VISIBLE); + } + else if(randomC==9){ + imgnot.setBackgroundResource(icoSotp[11]); + imgnot.setVisibility(View.VISIBLE); + } + else if(randomC==10){ + imgnot.setBackgroundResource(icoSotp[12]); + imgnot.setVisibility(View.VISIBLE); + } + else if(randomC==11){ + imgnot.setBackgroundResource(icoSotp[13]); + imgnot.setVisibility(View.VISIBLE); + } + else if(randomC==12){ + imgnot.setBackgroundResource(icoSotp[14]); + imgnot.setVisibility(View.VISIBLE); + } + else if(randomC==13){ + imgnot.setBackgroundResource(icoSotp[1]); + imgnot.setVisibility(View.VISIBLE); + } + else{ + imgnot.setBackgroundResource(icoSotp[2]); + imgnot.setVisibility(View.VISIBLE); + } + + } + } + + }; + + public void startVibrator() { + vibrator.vibrate(new long[] { 500, 300, 500, 300 }, -1); + } + + @Override + protected void onDestroy() { + // TODO Auto-generated method stub + super.onDestroy(); + } + + +} diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/java/com/daijiale/wear/partyshaking/ShakeListener.java" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/java/com/daijiale/wear/partyshaking/ShakeListener.java" new file mode 100644 index 0000000..56f7506 --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/java/com/daijiale/wear/partyshaking/ShakeListener.java" @@ -0,0 +1,117 @@ +package com.daijiale.wear.partyshaking; + +import android.app.Activity; +import android.content.Context; +import android.hardware.Sensor; +import android.hardware.SensorEvent; +import android.hardware.SensorEventListener; +import android.hardware.SensorManager; + +/** + Created by JialeDai on 15/5/17. + **/ + +public class ShakeListener extends Activity implements SensorEventListener { + + private Context context; + + private Sensor sensor; + + private SensorManager senmanager; + + private float last_x; + + private float last_y; + + private float last_z; + + private long lastUpDatetime; + + public OnShakeListener onShake; + + public ShakeListener(Context context) { + this.context = context; + start(); + } + + public ShakeListener() { + senmanager = (SensorManager)getSystemService(SENSOR_SERVICE); + sensor = senmanager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); + } + protected void onResume() { + super.onResume(); + senmanager.registerListener(this, sensor, + SensorManager.SENSOR_DELAY_NORMAL); + } + protected void onPause() { + super.onPause(); + senmanager.unregisterListener(this); + } + + //重写onResume + public void start() { + senmanager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE); + if (senmanager != null) { + sensor = senmanager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); + } + if (sensor != null) { + senmanager.registerListener(this, sensor, SensorManager.SENSOR_DELAY_GAME); + } + } + + //重写onPause方法 + public void stop() { + senmanager.unregisterListener(this, sensor); + } + + public void setOnShake(OnShakeListener onShake) { + this.onShake = onShake; + } + + @Override + public void onAccuracyChanged(Sensor sensor, int accuracy) { + // TODO Auto-generated method stub + } + + @Override + public void onSensorChanged(SensorEvent event) { + + long currentUpDatetime = System.currentTimeMillis(); + + long timeInterval = currentUpDatetime - lastUpDatetime; + + if (timeInterval < UPTATE_INTERVAL_TIME) { + return; + } + + lastUpDatetime = currentUpDatetime; + + float x = event.values[0]; + float y = event.values[1]; + float z = event.values[2]; + + float deltaX = x - last_x; + float deltaY = y - last_y; + float deltaZ = z - last_z; + + last_x = x; + last_y = y; + last_z = z; + + double speed = Math.sqrt(deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ) / timeInterval * 10000; + + if (speed >= SPEED_SHRESHOLD) { + onShake.onShake(); + } + + } + + public interface OnShakeListener { + public void onShake(); + } + + private static final int SPEED_SHRESHOLD = 3500; + + private static final int UPTATE_INTERVAL_TIME = 70; + +} \ No newline at end of file diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa1.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa1.png" new file mode 100644 index 0000000..0d07b7e Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa1.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa10.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa10.png" new file mode 100644 index 0000000..8f09820 Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa10.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa11.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa11.png" new file mode 100644 index 0000000..866f095 Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa11.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa12.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa12.png" new file mode 100644 index 0000000..a71f71a Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa12.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa13.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa13.png" new file mode 100644 index 0000000..8286421 Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa13.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa2.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa2.png" new file mode 100644 index 0000000..5b18723 Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa2.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa3.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa3.png" new file mode 100644 index 0000000..5c78554 Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa3.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa4.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa4.png" new file mode 100644 index 0000000..f11df2f Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa4.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa5.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa5.png" new file mode 100644 index 0000000..ebe71c9 Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa5.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa6.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa6.png" new file mode 100644 index 0000000..bad969a Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa6.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa7.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa7.png" new file mode 100644 index 0000000..aed1195 Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa7.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa8.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa8.png" new file mode 100644 index 0000000..e7efeab Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa8.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa9.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa9.png" new file mode 100644 index 0000000..19a4af0 Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/chengfa9.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/game1.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/game1.png" new file mode 100644 index 0000000..006563e Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/game1.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/game2.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/game2.png" new file mode 100644 index 0000000..d970bc2 Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/game2.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/game3.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/game3.png" new file mode 100644 index 0000000..844e89a Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/game3.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/game4.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/game4.png" new file mode 100644 index 0000000..17e2e9c Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/game4.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/game5.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/game5.png" new file mode 100644 index 0000000..f3d57ae Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/game5.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/ic_launcher.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/ic_launcher.png" new file mode 100644 index 0000000..e4c0e97 Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/ic_launcher.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/image_left.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/image_left.png" new file mode 100644 index 0000000..e6e287b Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/image_left.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/image_middle.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/image_middle.png" new file mode 100644 index 0000000..5ac86e3 Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/image_middle.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/image_right.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/image_right.png" new file mode 100644 index 0000000..37be72f Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/image_right.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/lottery_bg.jpg" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/lottery_bg.jpg" new file mode 100644 index 0000000..0598c83 Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/lottery_bg.jpg" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/lottery_head_1.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/lottery_head_1.png" new file mode 100644 index 0000000..966da96 Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/lottery_head_1.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/lottery_nothing.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/lottery_nothing.png" new file mode 100644 index 0000000..375bfd5 Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/lottery_nothing.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/lottery_result.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/lottery_result.png" new file mode 100644 index 0000000..ff14558 Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/lottery_result.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/main_line.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/main_line.png" new file mode 100644 index 0000000..8356e1b Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/main_line.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/mbutton1.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/mbutton1.png" new file mode 100644 index 0000000..09d7267 Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/mbutton1.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/mbutton2.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/mbutton2.png" new file mode 100644 index 0000000..8ba1a34 Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/mbutton2.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/menue.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/menue.png" new file mode 100644 index 0000000..8088d4c Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-hdpi/menue.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-mdpi/ic_launcher.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-mdpi/ic_launcher.png" new file mode 100644 index 0000000..11ec206 Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-mdpi/ic_launcher.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-xhdpi/ic_launcher.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-xhdpi/ic_launcher.png" new file mode 100644 index 0000000..7c02b78 Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-xhdpi/ic_launcher.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-xxhdpi/ic_launcher.png" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-xxhdpi/ic_launcher.png" new file mode 100644 index 0000000..915d914 Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/drawable-xxhdpi/ic_launcher.png" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/layout/activity_main.xml" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/layout/activity_main.xml" new file mode 100644 index 0000000..a24884f --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/layout/activity_main.xml" @@ -0,0 +1,9 @@ + + diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/layout/rect_activity_main.xml" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/layout/rect_activity_main.xml" new file mode 100644 index 0000000..203071b --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/layout/rect_activity_main.xml" @@ -0,0 +1,9 @@ + + + + + diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/layout/round_activity_main.xml" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/layout/round_activity_main.xml" new file mode 100644 index 0000000..d8e6d12 --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/layout/round_activity_main.xml" @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/layout/shakingstatus1.xml" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/layout/shakingstatus1.xml" new file mode 100644 index 0000000..b646f68 --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/layout/shakingstatus1.xml" @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/layout/shakingstatus2.xml" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/layout/shakingstatus2.xml" new file mode 100644 index 0000000..0dbe567 --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/layout/shakingstatus2.xml" @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/menu/menu_second.xml" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/menu/menu_second.xml" new file mode 100644 index 0000000..6cecfd2 --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/menu/menu_second.xml" @@ -0,0 +1,6 @@ + + + diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/values-w820dp/dimens.xml" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/values-w820dp/dimens.xml" new file mode 100644 index 0000000..63fc816 --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/values-w820dp/dimens.xml" @@ -0,0 +1,6 @@ + + + 64dp + diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/values/dimens.xml" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/values/dimens.xml" new file mode 100644 index 0000000..47c8224 --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/values/dimens.xml" @@ -0,0 +1,5 @@ + + + 16dp + 16dp + diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/values/strings.xml" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/values/strings.xml" new file mode 100644 index 0000000..70b96ef --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/app/src/main/res/values/strings.xml" @@ -0,0 +1,11 @@ + + + + 聚会摇摇蛋 + Hello let us shaking the party! + Hi let us shaking the party! + SecondActivity + Hello world! + Settings + + diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/build.gradle" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/build.gradle" new file mode 100644 index 0000000..6356aab --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/build.gradle" @@ -0,0 +1,19 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.0.0' + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + jcenter() + } +} diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/gradle.properties" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/gradle.properties" new file mode 100644 index 0000000..1d3591c --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/gradle.properties" @@ -0,0 +1,18 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx10248m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true \ No newline at end of file diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/gradle/wrapper/gradle-wrapper.jar" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/gradle/wrapper/gradle-wrapper.jar" new file mode 100644 index 0000000..8c0fb64 Binary files /dev/null and "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/gradle/wrapper/gradle-wrapper.jar" differ diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/gradle/wrapper/gradle-wrapper.properties" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/gradle/wrapper/gradle-wrapper.properties" new file mode 100644 index 0000000..0c71e76 --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/gradle/wrapper/gradle-wrapper.properties" @@ -0,0 +1,6 @@ +#Wed Apr 10 15:27:10 PDT 2013 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/gradlew" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/gradlew" new file mode 100755 index 0000000..91a7e26 --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/gradlew" @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/gradlew.bat" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/gradlew.bat" new file mode 100644 index 0000000..8a0b282 --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/gradlew.bat" @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git "a/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/settings.gradle" "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/settings.gradle" new file mode 100644 index 0000000..e7b4def --- /dev/null +++ "b/WearableAPP/TicWear\347\211\210\346\234\254/code/PartySharking/settings.gradle" @@ -0,0 +1 @@ +include ':app'