mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1076260 - Adjust new tablet divider size and color. r=lucasr
This commit is contained in:
parent
dfee244955
commit
3c4b4b5713
@ -6,12 +6,13 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<gradient
|
||||
android:startColor="#D1D5DA"
|
||||
android:endColor="@android:color/transparent"
|
||||
android:angle="90"/>
|
||||
<solid android:color="#555555"/>
|
||||
|
||||
<size android:width="1dp"
|
||||
android:height="32dp"/>
|
||||
android:height="30dp"/>
|
||||
|
||||
<!-- We draw this ourselves in TabStripView.draw() and to avoid implementing more
|
||||
than we have to, only bottom padding is taken into account. -->
|
||||
<padding android:bottom="6dp"/>
|
||||
|
||||
</shape>
|
||||
|
@ -8,6 +8,7 @@ package org.mozilla.gecko.tabs;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
@ -27,6 +28,10 @@ public class TabStripView extends TwoWayView {
|
||||
private final TabStripAdapter adapter;
|
||||
private final Drawable divider;
|
||||
|
||||
// Filled by calls to ShapeDrawable.getPadding();
|
||||
// saved to prevent allocation in draw().
|
||||
private final Rect dividerPadding = new Rect();
|
||||
|
||||
private boolean isPrivate;
|
||||
|
||||
public TabStripView(Context context, AttributeSet attrs) {
|
||||
@ -41,6 +46,7 @@ public class TabStripView extends TwoWayView {
|
||||
final Resources resources = getResources();
|
||||
|
||||
divider = resources.getDrawable(R.drawable.new_tablet_tab_strip_divider);
|
||||
divider.getPadding(dividerPadding);
|
||||
|
||||
final int itemMargin =
|
||||
resources.getDimensionPixelSize(R.dimen.new_tablet_tab_strip_item_margin);
|
||||
@ -141,7 +147,7 @@ public class TabStripView extends TwoWayView {
|
||||
public void draw(Canvas canvas) {
|
||||
super.draw(canvas);
|
||||
|
||||
final int bottom = getHeight() - getPaddingBottom();
|
||||
final int bottom = getHeight() - getPaddingBottom() - dividerPadding.bottom;
|
||||
final int top = bottom - divider.getIntrinsicHeight();
|
||||
|
||||
final int dividerWidth = divider.getIntrinsicWidth();
|
||||
|
Loading…
Reference in New Issue
Block a user