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
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 {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
......
......@@ -78,9 +78,11 @@ public class MainActivity extends AppCompatActivity {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
enableInputView(false);
connectProxy();
} else {
disconnect();
enableInputView(true);
}
}
});
......@@ -108,4 +110,13 @@ public class MainActivity extends AppCompatActivity {
tvmServerWorker.disconnect();
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
UNSIGNED_APK=$APK_DIR/app-release-unsigned.apk
SIGNED_APK=$APK_DIR/tvmrpc-release.apk
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