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

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

Issue 2050613003: Support resize in Android Viewer App (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Nits Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | tools/viewer/Viewer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 package org.skia.viewer; 8 package org.skia.viewer;
9 9
10 import android.app.Application; 10 import android.app.Application;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 mViewerActivity.setState(mStateJsonStr); 50 mViewerActivity.setState(mStateJsonStr);
51 } 51 }
52 if (mTitle != null) { 52 if (mTitle != null) {
53 mViewerActivity.setTitle(mTitle); 53 mViewerActivity.setTitle(mTitle);
54 } 54 }
55 } 55 }
56 } 56 }
57 57
58 public void setTitle(String title) { 58 public void setTitle(String title) {
59 mTitle = title; // Similar to mStateJsonStr, we have to store this. 59 mTitle = title; // Similar to mStateJsonStr, we have to store this.
60 if (mTitle.startsWith("Viewer: ")) { // Quick hack to shorten the title
61 mTitle = mTitle.replaceFirst("Viewer: ", "");
62 }
60 if (mViewerActivity != null) { 63 if (mViewerActivity != null) {
61 mViewerActivity.runOnUiThread(new Runnable() { 64 mViewerActivity.runOnUiThread(new Runnable() {
62 @Override 65 @Override
63 public void run() { 66 public void run() {
64 mViewerActivity.setTitle(mTitle); 67 mViewerActivity.setTitle(mTitle);
65 } 68 }
66 }); 69 });
67 } 70 }
68 } 71 }
69 72
70 public void setState(String stateJsonStr) { 73 public void setState(String stateJsonStr) {
71 // We have to store this state because ViewerActivity may be destroyed w hile the native app 74 // We have to store this state because ViewerActivity may be destroyed w hile the native app
72 // is still running. When a new ViewerActivity is created, we'll pass th e state to it. 75 // is still running. When a new ViewerActivity is created, we'll pass th e state to it.
73 mStateJsonStr = stateJsonStr; 76 mStateJsonStr = stateJsonStr;
74 if (mViewerActivity != null) { 77 if (mViewerActivity != null) {
75 mViewerActivity.runOnUiThread(new Runnable() { 78 mViewerActivity.runOnUiThread(new Runnable() {
76 @Override 79 @Override
77 public void run() { 80 public void run() {
78 mViewerActivity.setState(mStateJsonStr); 81 mViewerActivity.setState(mStateJsonStr);
79 } 82 }
80 }); 83 });
81 } 84 }
82 } 85 }
83 } 86 }
OLDNEW
« no previous file with comments | « no previous file | tools/viewer/Viewer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698