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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/contextmenu/TabularContextMenuUi.java

Issue 2845303003: added rounded corners & created file for rounded corners (Closed)
Patch Set: Created 3 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 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.contextmenu; 5 package org.chromium.chrome.browser.contextmenu;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.app.Dialog; 8 import android.app.Dialog;
9 import android.content.DialogInterface; 9 import android.content.DialogInterface;
10 import android.content.res.Resources; 10 import android.content.res.Resources;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 public TabularContextMenuUi(Runnable onShareItemClicked) { 48 public TabularContextMenuUi(Runnable onShareItemClicked) {
49 mOnShareItemClicked = onShareItemClicked; 49 mOnShareItemClicked = onShareItemClicked;
50 } 50 }
51 51
52 @Override 52 @Override
53 public void displayMenu(Activity activity, ContextMenuParams params, 53 public void displayMenu(Activity activity, ContextMenuParams params,
54 List<Pair<Integer, List<ContextMenuItem>>> items, Callback<Integer> onItemClicked, 54 List<Pair<Integer, List<ContextMenuItem>>> items, Callback<Integer> onItemClicked,
55 final Runnable onMenuShown, final Runnable onMenuClosed) { 55 final Runnable onMenuShown, final Runnable onMenuClosed) {
56 mCallback = onItemClicked; 56 mCallback = onItemClicked;
57 mDialog = createDialog(activity, params, items); 57 mDialog = createDialog(activity, params, items);
58
58 mDialog.getWindow().setBackgroundDrawable(ApiCompatibilityUtils.getDrawa ble( 59 mDialog.getWindow().setBackgroundDrawable(ApiCompatibilityUtils.getDrawa ble(
59 activity.getResources(), R.drawable.bg_find_toolbar_popup)); 60 activity.getResources(), R.drawable.white_with_rounded_corners)) ;
60 61
61 mDialog.setOnShowListener(new DialogInterface.OnShowListener() { 62 mDialog.setOnShowListener(new DialogInterface.OnShowListener() {
62 @Override 63 @Override
63 public void onShow(DialogInterface dialogInterface) { 64 public void onShow(DialogInterface dialogInterface) {
64 onMenuShown.run(); 65 onMenuShown.run();
65 } 66 }
66 }); 67 });
67 68
68 mDialog.setOnDismissListener(new DialogInterface.OnDismissListener() { 69 mDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
69 @Override 70 @Override
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 activity, params, itemGroup.second, isImageTab, maxC ount))); 238 activity, params, itemGroup.second, isImageTab, maxC ount)));
238 } 239 }
239 TabularContextMenuViewPager pager = 240 TabularContextMenuViewPager pager =
240 (TabularContextMenuViewPager) view.findViewById(R.id.custom_page r); 241 (TabularContextMenuViewPager) view.findViewById(R.id.custom_page r);
241 pager.setAdapter(new TabularContextMenuPagerAdapter(viewGroups)); 242 pager.setAdapter(new TabularContextMenuPagerAdapter(viewGroups));
242 243
243 TabLayout tabLayout = (TabLayout) view.findViewById(R.id.tab_layout); 244 TabLayout tabLayout = (TabLayout) view.findViewById(R.id.tab_layout);
244 if (itemGroups.size() <= 1) { 245 if (itemGroups.size() <= 1) {
245 tabLayout.setVisibility(View.GONE); 246 tabLayout.setVisibility(View.GONE);
246 } 247 }
248
247 tabLayout.setupWithViewPager((ViewPager) view.findViewById(R.id.custom_p ager)); 249 tabLayout.setupWithViewPager((ViewPager) view.findViewById(R.id.custom_p ager));
248 250
249 return view; 251 return view;
250 } 252 }
251 253
252 /** 254 /**
253 * When an thumbnail is retrieved for the header of an image, this will set the header to 255 * When an thumbnail is retrieved for the header of an image, this will set the header to
254 * that particular bitmap. 256 * that particular bitmap.
255 */ 257 */
256 public void onImageThumbnailRetrieved(Bitmap bitmap) { 258 public void onImageThumbnailRetrieved(Bitmap bitmap) {
257 if (mHeaderImageView != null) { 259 if (mHeaderImageView != null) {
258 mHeaderImageView.setImageBitmap(bitmap); 260 mHeaderImageView.setImageBitmap(bitmap);
259 } 261 }
260 } 262 }
261 263
262 @Override 264 @Override
263 public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) { 265 public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
264 mDialog.dismiss(); 266 mDialog.dismiss();
265 mCallback.onResult((int) id); 267 mCallback.onResult((int) id);
266 } 268 }
267 } 269 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698