Skip to content

Commit

Permalink
[GMNext] Clean up tab_ui theme overlay #5: remove divider
Browse files Browse the repository at this point in the history
This is a multiple step work of removing all theme overlap added for tab
switcher theme. The goal is to inline all the styles into
tab_grid_card_item.xml

Step #5: Remove the unused divider in the new tab grid card layout.

Bug: 1251194
Change-Id: Id832335da8da3714a6b77a8efa1d0558571730de
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3885309
Commit-Queue: Yue Zhang <[email protected]>
Reviewed-by: Yue Zhang <[email protected]>
Auto-Submit: Wenyu Fu <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1054879}
  • Loading branch information
fwy423 authored and Chromium LUCI CQ committed Oct 4, 2022
1 parent 5964ce8 commit 63c72e1
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,6 @@ found in the LICENSE file.
android:layout_width="match_parent"
android:layout_height="56dp"
android:visibility="gone"/>
<View
android:id="@+id/divider_view"
style="@style/HorizontalDivider"
android:layout_below="@id/tab_title"
android:visibility="gone"
android:background="@macro/divider_line_bg_color"/>
<org.chromium.ui.widget.ButtonCompat
android:id="@+id/create_group_button"
android:layout_width="wrap_content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import android.content.res.Configuration;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.GradientDrawable;
import android.util.AttributeSet;
import android.view.View;
Expand Down Expand Up @@ -720,10 +719,6 @@ private void updateAnimationCardView(View view) {
ApiCompatibilityUtils.setImageTintList(actionButton,
ImageViewCompat.getImageTintList((view.findViewById(R.id.action_button))));

View dividerView = mAnimationCardView.findViewById(R.id.divider_view);
dividerView.setBackgroundColor(
((ColorDrawable) view.findViewById(R.id.divider_view).getBackground()).getColor());

mAnimationCardView.findViewById(R.id.background_view).setBackground(null);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,6 @@ private static void updateFavicon(ViewLookupCachingFrameLayout rootView, Propert
private static void updateColor(
ViewLookupCachingFrameLayout rootView, boolean isIncognito, boolean isSelected) {
View cardView = rootView.fastFindViewById(R.id.card_view);
View dividerView = rootView.fastFindViewById(R.id.divider_view);
TextView titleView = (TextView) rootView.fastFindViewById(R.id.tab_title);
TabGridThumbnailView thumbnail =
(TabGridThumbnailView) rootView.fastFindViewById(R.id.tab_thumbnail);
Expand All @@ -468,9 +467,6 @@ private static void updateColor(
cardView.getContext(), isIncognito, isSelected);
ViewCompat.setBackgroundTintList(cardView, ColorStateList.valueOf(backgroundColor));

dividerView.setBackgroundColor(
TabUiThemeProvider.getDividerColor(dividerView.getContext(), isIncognito));

titleView.setTextColor(TabUiThemeProvider.getTitleTextColor(
titleView.getContext(), isIncognito, isSelected));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,19 +193,6 @@ public static ColorStateList getToggleActionButtonCheckedDrawableTintList(
return MaterialColors.getColor(context, org.chromium.chrome.R.attr.colorOnPrimary, TAG);
}

/**
* Returns the divider color for tab grid card based on the incognito mode.
*
* @param context {@link Context} used to retrieve color.
* @param isIncognito Whether the color is used for incognito mode.
* @return The divider color for tab grid card.
*/
@ColorInt
public static int getDividerColor(Context context, boolean isIncognito) {
return isIncognito ? context.getColor(R.color.tab_grid_card_divider_tint_color_incognito)
: SemanticColorUtils.getTabGridCardDividerTintColor(context);
}

/**
* Returns the thumbnail placeholder color resource id based on the incognito mode.
*
Expand Down

0 comments on commit 63c72e1

Please sign in to comment.