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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabBottomBarDelegate.java

Issue 2878403002: Support setting mouse cursor icon in Android N. (Closed)
Patch Set: Override onResolvePointerIcon Created 3 years, 5 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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.chrome.browser.customtabs; 5 package org.chromium.chrome.browser.customtabs;
6 6
7 import android.app.PendingIntent; 7 import android.app.PendingIntent;
8 import android.app.PendingIntent.CanceledException; 8 import android.app.PendingIntent.CanceledException;
9 import android.content.Intent; 9 import android.content.Intent;
10 import android.net.Uri; 10 import android.net.Uri;
11 import android.os.Build;
11 import android.support.customtabs.CustomTabsIntent; 12 import android.support.customtabs.CustomTabsIntent;
13 import android.view.PointerIcon;
12 import android.view.View; 14 import android.view.View;
13 import android.view.View.OnClickListener; 15 import android.view.View.OnClickListener;
14 import android.view.View.OnLayoutChangeListener; 16 import android.view.View.OnLayoutChangeListener;
15 import android.view.ViewGroup; 17 import android.view.ViewGroup;
16 import android.view.ViewStub; 18 import android.view.ViewStub;
17 import android.widget.ImageButton; 19 import android.widget.ImageButton;
18 import android.widget.LinearLayout; 20 import android.widget.LinearLayout;
19 import android.widget.RemoteViews; 21 import android.widget.RemoteViews;
20 22
21 import org.chromium.base.Log; 23 import org.chromium.base.Log;
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 return mBottomBarView.getChildAt(1).getHeight(); 150 return mBottomBarView.getChildAt(1).getHeight();
149 } 151 }
150 152
151 /** 153 /**
152 * Gets the {@link ViewGroup} of the bottom bar. If it has not been inflated , inflate it first. 154 * Gets the {@link ViewGroup} of the bottom bar. If it has not been inflated , inflate it first.
153 */ 155 */
154 private ViewGroup getBottomBarView() { 156 private ViewGroup getBottomBarView() {
155 if (mBottomBarView == null) { 157 if (mBottomBarView == null) {
156 ViewStub bottomBarStub = ((ViewStub) mActivity.findViewById(R.id.bot tombar_stub)); 158 ViewStub bottomBarStub = ((ViewStub) mActivity.findViewById(R.id.bot tombar_stub));
157 mBottomBarView = (ViewGroup) bottomBarStub.inflate(); 159 mBottomBarView = (ViewGroup) bottomBarStub.inflate();
160
161 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
162 PointerIcon icon = PointerIcon.getSystemIcon(
163 mBottomBarView.getContext(), PointerIcon.TYPE_ARROW);
164 mBottomBarView.setPointerIcon(icon);
165 }
158 } 166 }
159 return mBottomBarView; 167 return mBottomBarView;
160 } 168 }
161 169
162 private void hideBottomBar() { 170 private void hideBottomBar() {
163 if (mBottomBarView == null) return; 171 if (mBottomBarView == null) return;
164 mBottomBarView.animate().alpha(0f).translationY(mBottomBarView.getHeight ()) 172 mBottomBarView.animate().alpha(0f).translationY(mBottomBarView.getHeight ())
165 .setInterpolator(BakedBezierInterpolator.TRANSFORM_CURVE) 173 .setInterpolator(BakedBezierInterpolator.TRANSFORM_CURVE)
166 .setDuration(SLIDE_ANIMATION_DURATION_MS) 174 .setDuration(SLIDE_ANIMATION_DURATION_MS)
167 .withEndAction(new Runnable() { 175 .withEndAction(new Runnable() {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 public void onBottomControlsHeightChanged(int bottomControlsHeight) { 225 public void onBottomControlsHeightChanged(int bottomControlsHeight) {
218 getBottomBarView().setTranslationY(mFullscreenManager.getBottomControlOf fset()); 226 getBottomBarView().setTranslationY(mFullscreenManager.getBottomControlOf fset());
219 } 227 }
220 228
221 @Override 229 @Override
222 public void onContentOffsetChanged(float offset) { } 230 public void onContentOffsetChanged(float offset) { }
223 231
224 @Override 232 @Override
225 public void onToggleOverlayVideoMode(boolean enabled) { } 233 public void onToggleOverlayVideoMode(boolean enabled) { }
226 } 234 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698