Commit 28281c99 by Yizhi Liu Committed by Tianqi Chen

[APP] enhance android ui (#441)

parent a961b29c
...@@ -10,7 +10,7 @@ You will need JDK, [Android NDK](https://developer.android.com/ndk) and an Andro ...@@ -10,7 +10,7 @@ You will need JDK, [Android NDK](https://developer.android.com/ndk) and an Andro
Before you build the Android application, please refer to [TVM4J Installation Guide](https://github.com/dmlc/tvm/blob/master/jvm/README.md) and install tvm4j-core to your local maven repository. You can find tvm4j dependency declare in `app/build.gradle`. Modify it if it is necessary. Before you build the Android application, please refer to [TVM4J Installation Guide](https://github.com/dmlc/tvm/blob/master/jvm/README.md) and install tvm4j-core to your local maven repository. You can find tvm4j dependency declare in `app/build.gradle`. Modify it if it is necessary.
```json ```
dependencies { dependencies {
compile fileTree(dir: 'libs', include: ['*.jar']) compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
......
...@@ -78,9 +78,11 @@ public class MainActivity extends AppCompatActivity { ...@@ -78,9 +78,11 @@ public class MainActivity extends AppCompatActivity {
@Override @Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) { if (isChecked) {
enableInputView(false);
connectProxy(); connectProxy();
} else { } else {
disconnect(); disconnect();
enableInputView(true);
} }
} }
}); });
...@@ -108,4 +110,13 @@ public class MainActivity extends AppCompatActivity { ...@@ -108,4 +110,13 @@ public class MainActivity extends AppCompatActivity {
tvmServerWorker.disconnect(); tvmServerWorker.disconnect();
System.err.println("Disconnected."); System.err.println("Disconnected.");
} }
private void enableInputView(boolean enable) {
EditText edProxyAddress = findViewById(R.id.input_address);
EditText edProxyPort = findViewById(R.id.input_port);
EditText edAppKey = findViewById(R.id.input_key);
edProxyAddress.setEnabled(enable);
edProxyPort.setEnabled(enable);
edAppKey.setEnabled(enable);
}
} }
...@@ -4,3 +4,4 @@ APK_DIR=$CURR_DIR/../app/build/outputs/apk ...@@ -4,3 +4,4 @@ APK_DIR=$CURR_DIR/../app/build/outputs/apk
UNSIGNED_APK=$APK_DIR/app-release-unsigned.apk UNSIGNED_APK=$APK_DIR/app-release-unsigned.apk
SIGNED_APK=$APK_DIR/tvmrpc-release.apk SIGNED_APK=$APK_DIR/tvmrpc-release.apk
jarsigner -verbose -keystore $CURR_DIR/tvmrpc.keystore -signedjar $SIGNED_APK $UNSIGNED_APK 'tvmrpc' jarsigner -verbose -keystore $CURR_DIR/tvmrpc.keystore -signedjar $SIGNED_APK $UNSIGNED_APK 'tvmrpc'
echo $SIGNED_APK
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment