Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chromoting; | 5 package org.chromium.chromoting; |
| 6 | 6 |
| 7 import android.graphics.Matrix; | 7 import android.graphics.Matrix; |
| 8 import android.graphics.PointF; | 8 import android.graphics.PointF; |
| 9 import android.graphics.Rect; | 9 import android.graphics.Rect; |
| 10 import android.graphics.RectF; | 10 import android.graphics.RectF; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 123 setCursorPosition(mCursorPosition.x + deltaX, mCursorPosition.y + deltaY ); | 123 setCursorPosition(mCursorPosition.x + deltaX, mCursorPosition.y + deltaY ); |
| 124 return new PointF(mCursorPosition.x, mCursorPosition.y); | 124 return new PointF(mCursorPosition.x, mCursorPosition.y); |
| 125 } | 125 } |
| 126 | 126 |
| 127 /** | 127 /** |
| 128 * Handles System UI size and visibility changes. | 128 * Handles System UI size and visibility changes. |
| 129 * | 129 * |
| 130 * @param parameter The set of values defining the current System UI state. | 130 * @param parameter The set of values defining the current System UI state. |
| 131 */ | 131 */ |
| 132 public void onSystemUiVisibilityChanged(SystemUiVisibilityChangedEventParame ter parameter) { | 132 public void onSystemUiVisibilityChanged(SystemUiVisibilityChangedEventParame ter parameter) { |
| 133 if (parameter.systemUiVisible) { | 133 if (parameter.softInputMethodVisible) { |
|
Yuwei
2016/10/11 18:57:37
I think you also mentioned that you want to make o
Yuwei
2016/10/11 18:57:37
IIUC change of soft keyboard's visibility will alw
joedow
2016/10/11 19:00:44
Definitely later, we cannot compile against the N
joedow
2016/10/11 19:00:44
Yes it will.
| |
| 134 mSystemUiScreenSize.set(parameter.left, parameter.top, | 134 mSystemUiScreenSize.set(parameter.left, parameter.top, |
| 135 mRenderData.screenWidth - parameter.right, | 135 mRenderData.screenWidth - parameter.right, |
| 136 mRenderData.screenHeight - parameter.bottom); | 136 mRenderData.screenHeight - parameter.bottom); |
| 137 | 137 |
| 138 if (mAdjustViewportForSystemUi) { | 138 if (mAdjustViewportForSystemUi) { |
| 139 // Adjust the cursor position to ensure it's visible when large System UI (1/3 or | 139 // Adjust the cursor position to ensure it's visible when large System UI (1/3 or |
| 140 // more of the total screen size) is displayed (typically the So ft Keyboard). | 140 // more of the total screen size) is displayed (typically the So ft Keyboard). |
| 141 // Without this change, it is difficult for users to enter text into edit controls | 141 // Without this change, it is difficult for users to enter text into edit controls |
| 142 // which are located bottom of the screen and may not see the cu rsor at all. | 142 // which are located bottom of the screen and may not see the cu rsor at all. |
| 143 if (mSystemUiScreenSize.bottom > (mRenderData.screenHeight / 3)) { | 143 if (mSystemUiScreenSize.bottom > (mRenderData.screenHeight / 3)) { |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 371 PointF letterboxPadding = getLetterboxPadding(); | 371 PointF letterboxPadding = getLetterboxPadding(); |
| 372 float[] imagePoints = {0.0f, 0.0f, mRenderData.imageWidth, mRenderData.i mageHeight}; | 372 float[] imagePoints = {0.0f, 0.0f, mRenderData.imageWidth, mRenderData.i mageHeight}; |
| 373 mRenderData.transform.mapPoints(imagePoints); | 373 mRenderData.transform.mapPoints(imagePoints); |
| 374 | 374 |
| 375 mVisibleImagePadding.set(Math.max(imagePoints[0] - letterboxPadding.x, 0 .0f), | 375 mVisibleImagePadding.set(Math.max(imagePoints[0] - letterboxPadding.x, 0 .0f), |
| 376 Math.max(imagePoints[1] - letterboxPadding.y, 0.0f), | 376 Math.max(imagePoints[1] - letterboxPadding.y, 0.0f), |
| 377 Math.max(mRenderData.screenWidth - imagePoints[2] - letterboxPad ding.x, 0.0f), | 377 Math.max(mRenderData.screenWidth - imagePoints[2] - letterboxPad ding.x, 0.0f), |
| 378 Math.max(mRenderData.screenHeight - imagePoints[3] - letterboxPa dding.y, 0.0f)); | 378 Math.max(mRenderData.screenHeight - imagePoints[3] - letterboxPa dding.y, 0.0f)); |
| 379 } | 379 } |
| 380 } | 380 } |
| OLD | NEW |