Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(349)

Unified Diff: platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/ViewerApplication.java

Issue 2016343002: Revert of Add drawer with state information (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/ViewerApplication.java
diff --git a/platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/ViewerApplication.java b/platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/ViewerApplication.java
index ee1695afd1e9cd60fe25a0d44bd8a1ef271a023e..4b890bd5e1279cb2437a205d581b54aa04dffabc 100644
--- a/platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/ViewerApplication.java
+++ b/platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/ViewerApplication.java
@@ -12,7 +12,6 @@
public class ViewerApplication extends Application {
private long mNativeHandle = 0;
private ViewerActivity mViewerActivity;
- private String mStateJsonStr, mTitle;
static {
System.loadLibrary("skia_android");
@@ -42,40 +41,16 @@
}
public void setViewerActivity(ViewerActivity viewerActivity) {
- mViewerActivity = viewerActivity;
- // Note that viewerActivity might be null (called by onDestroy)
- if (mViewerActivity != null) {
- // A new ViewerActivity is created; initialize its state and title
- if (mStateJsonStr != null) {
- mViewerActivity.setState(mStateJsonStr);
- }
- if (mTitle != null) {
- mViewerActivity.setTitle(mTitle);
- }
- }
+ this.mViewerActivity = viewerActivity;
}
public void setTitle(String title) {
- mTitle = title; // Similar to mStateJsonStr, we have to store this.
+ final String finalTitle = title;
if (mViewerActivity != null) {
mViewerActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
- mViewerActivity.setTitle(mTitle);
- }
- });
- }
- }
-
- public void setState(String stateJsonStr) {
- // We have to store this state because ViewerActivity may be destroyed while the native app
- // is still running. When a new ViewerActivity is created, we'll pass the state to it.
- mStateJsonStr = stateJsonStr;
- if (mViewerActivity != null) {
- mViewerActivity.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- mViewerActivity.setState(mStateJsonStr);
+ mViewerActivity.setTitle(finalTitle);
}
});
}

Powered by Google App Engine
This is Rietveld 408576698