Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Naming fixes to bottom bar color extra
Browse files Browse the repository at this point in the history
Change the extra name after API review.

BUG=579626

Review URL: https://codereview.chromium.org/1657853002 .

Cr-Commit-Position: refs/branch-heads/2623@{#217}
Cr-Branched-From: 92d7753-refs/heads/master@{#369907}
  • Loading branch information
Yusuf Ozuysal committed Feb 1, 2016
1 parent 351c3e6 commit f4040e4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@ public class CustomTabsIntent {
public static final int TOOLBAR_ACTION_BUTTON_ID = 0;

/**
* Extra that changes the background color for the custom action bar. The value should be an int
* that specifies a {@link Color}, not a resource id.
* Extra that changes the background color for the secondary action bar. The value should be an
* int that specifies a {@link Color}, not a resource id.
*/
public static final String EXTRA_CUSTOM_ACTION_BAR_COLOR =
"android.support.customtabs.extra.CUSTOM_ACTION_BAR_COLOR";
public static final String EXTRA_SECONDARY_ACTION_BAR_COLOR =
"android.support.customtabs.extra.SECONDARY_ACTION_BAR_COLOR";

/**
* Convenience method to create a VIEW intent without a session for the given package.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public CustomTabIntentDataProvider(Intent intent, Context context) {
mSession = IntentUtils.safeGetBinderExtra(intent, CustomTabsIntent.EXTRA_SESSION);
retrieveCustomButtons(intent, context);
retrieveToolbarColor(intent, context);
retrieveBottomBarColor(intent, context);
retrieveBottomBarColor(intent);
mEnableUrlBarHiding = IntentUtils.safeGetBooleanExtra(
intent, CustomTabsIntent.EXTRA_ENABLE_URLBAR_HIDING, true);
mKeepAliveServiceIntent = IntentUtils.safeGetParcelableExtra(intent, EXTRA_KEEP_ALIVE);
Expand Down Expand Up @@ -147,10 +147,10 @@ private void retrieveToolbarColor(Intent intent, Context context) {
/**
* Must be called after calling {@link #retrieveToolbarColor(Intent, Context)}.
*/
private void retrieveBottomBarColor(Intent intent, Context context) {
private void retrieveBottomBarColor(Intent intent) {
int defaultColor = mToolbarColor;
int color = IntentUtils.safeGetIntExtra(intent,
CustomTabsIntent.EXTRA_CUSTOM_ACTION_BAR_COLOR, defaultColor);
CustomTabsIntent.EXTRA_SECONDARY_ACTION_BAR_COLOR, defaultColor);
mBottomBarColor = removeTransparencyFromColor(color, defaultColor);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ public void testBottomBar() throws InterruptedException {
bundles.add(bundle);
}
intent.putExtra(CustomTabsIntent.EXTRA_ACTION_BAR_ITEMS, bundles);
intent.putExtra(CustomTabsIntent.EXTRA_CUSTOM_ACTION_BAR_COLOR, barColor);
intent.putExtra(CustomTabsIntent.EXTRA_SECONDARY_ACTION_BAR_COLOR, barColor);
startCustomTabActivityWithIntent(intent);

ViewGroup bottomBar = (ViewGroup) getActivity().findViewById(R.id.bottombar);
Expand Down

0 comments on commit f4040e4

Please sign in to comment.