From fadd3923498b2830c49054f34fde349587cac7ad Mon Sep 17 00:00:00 2001 From: Daniel Abramowitz Date: Fri, 3 Aug 2018 08:18:22 -0700 Subject: [PATCH] Revert D8954095: [sonar] Add SonarDiagnosticActivity to android Differential Revision: D8954095 Original commit changeset: b4a638bc0ba2 fbshipit-source-id: 6165b7429477e80520fb0e149da1c2ef893e1d90 --- android/sample/AndroidManifest.xml | 3 +- .../diagnostics/SonarDiagnosticActivity.java | 64 ------------------- 2 files changed, 1 insertion(+), 66 deletions(-) delete mode 100644 android/src/main/java/com/facebook/sonar/android/diagnostics/SonarDiagnosticActivity.java diff --git a/android/sample/AndroidManifest.xml b/android/sample/AndroidManifest.xml index d053db33a..f25295f7f 100644 --- a/android/sample/AndroidManifest.xml +++ b/android/sample/AndroidManifest.xml @@ -24,8 +24,7 @@ - + diff --git a/android/src/main/java/com/facebook/sonar/android/diagnostics/SonarDiagnosticActivity.java b/android/src/main/java/com/facebook/sonar/android/diagnostics/SonarDiagnosticActivity.java deleted file mode 100644 index 69df20cfb..000000000 --- a/android/src/main/java/com/facebook/sonar/android/diagnostics/SonarDiagnosticActivity.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.facebook.sonar.android.diagnostics; - -import android.app.Activity; -import android.content.Context; -import android.os.Bundle; -import android.widget.Toast; -import com.facebook.sonar.android.AndroidSonarClient; -import com.facebook.sonar.core.SonarClient; -import com.facebook.sonar.core.SonarStateUpdateListener; -import android.widget.LinearLayout; -import android.view.View; -import android.widget.TextView; -import android.widget.ScrollView; - -public class SonarDiagnosticActivity extends Activity implements SonarStateUpdateListener { - - private TextView textView; - private ScrollView scrollView; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - LinearLayout root = new LinearLayout(this); - - textView = new TextView(this); - scrollView = new ScrollView(this); - scrollView.addView(textView); - root.addView(scrollView); - - setContentView(root); - } - - protected void onStart() { - super.onStart(); - SonarClient client = AndroidSonarClient.getInstance(this); - client.subscribeForUpdates(this); - textView.setText(client.getState()); - } - - protected void onResume() { - super.onResume(); - scrollView.fullScroll(View.FOCUS_DOWN); - } - -@Override - public void onUpdate() { - final Context context = this; - final String state = AndroidSonarClient.getInstance(context).getState(); - runOnUiThread(new Runnable() { - @Override - public void run() { - textView.setText(state); - scrollView.fullScroll(View.FOCUS_DOWN); - } - }); - } - - protected void onStop() { - super.onStop(); - SonarClient client = AndroidSonarClient.getInstance(this); - client.unsubscribe(); - } -}