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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetContentController.java

Issue 2754313002: [Home] Record some user actions for the Chrome Home BottomSheet (Closed)
Patch Set: [Home] Record some user actions for the Chrome Home BottomSheet Created 3 years, 9 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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.widget.bottomsheet; 5 package org.chromium.chrome.browser.widget.bottomsheet;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.content.res.Resources; 8 import android.content.res.Resources;
9 import android.support.design.internal.BottomNavigationItemView; 9 import android.support.design.internal.BottomNavigationItemView;
10 import android.support.design.internal.BottomNavigationMenuView; 10 import android.support.design.internal.BottomNavigationMenuView;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 showBottomSheetContent(R.id.action_home); 117 showBottomSheetContent(R.id.action_home);
118 } 118 }
119 119
120 @Override 120 @Override
121 public void onLoadUrl(String url) {} 121 public void onLoadUrl(String url) {}
122 122
123 @Override 123 @Override
124 public void onSheetOffsetChanged(float heightFraction) {} 124 public void onSheetOffsetChanged(float heightFraction) {}
125 125
126 @Override
127 public void onSheetStateChanged(int newState) {}
128
129 @Override
130 public void onSheetContentChanged(BottomSheetContent newContent) {}
Theresa 2017/03/17 16:07:12 I'm considering making a new class variable for th
mdjones 2017/03/17 18:17:26 Yeah, I think that interface is sufficiently large
131
126 // TODO(twellington): remove this once the support library is updated to all ow disabling 132 // TODO(twellington): remove this once the support library is updated to all ow disabling
127 // shifting mode or determines shifting mode based on the width of the 133 // shifting mode or determines shifting mode based on the width of the
128 // child views. 134 // child views.
129 private void disableShiftingMode() { 135 private void disableShiftingMode() {
130 BottomNavigationMenuView menuView = (BottomNavigationMenuView) getChildA t(0); 136 BottomNavigationMenuView menuView = (BottomNavigationMenuView) getChildA t(0);
131 try { 137 try {
132 Field shiftingMode = menuView.getClass().getDeclaredField("mShifting Mode"); 138 Field shiftingMode = menuView.getClass().getDeclaredField("mShifting Mode");
133 shiftingMode.setAccessible(true); 139 shiftingMode.setAccessible(true);
134 shiftingMode.setBoolean(menuView, false); 140 shiftingMode.setBoolean(menuView, false);
135 shiftingMode.setAccessible(false); 141 shiftingMode.setAccessible(false);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 // There are some bugs related to programatically selecting menu items t hat are fixed in 174 // There are some bugs related to programatically selecting menu items t hat are fixed in
169 // newer support library versions. 175 // newer support library versions.
170 // TODO(twellington): remove this after the support library is rolled. 176 // TODO(twellington): remove this after the support library is rolled.
171 if (mSelectedItemId != 0) getMenu().findItem(mSelectedItemId).setChecked (false); 177 if (mSelectedItemId != 0) getMenu().findItem(mSelectedItemId).setChecked (false);
172 mSelectedItemId = navItemId; 178 mSelectedItemId = navItemId;
173 getMenu().findItem(mSelectedItemId).setChecked(true); 179 getMenu().findItem(mSelectedItemId).setChecked(true);
174 180
175 mBottomSheet.showContent(getSheetContentForId(mSelectedItemId)); 181 mBottomSheet.showContent(getSheetContentForId(mSelectedItemId));
176 } 182 }
177 } 183 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698