mirror of
https://github.com/material-components/material-components-android.git
synced 2026-02-20 08:39:55 +08:00
fix
This commit is contained in:
parent
db0a58cd3f
commit
0f3e86dfdc
@ -70,13 +70,6 @@ public class MaterialToolbar extends Toolbar {
|
||||
|
||||
private static final int DEF_STYLE_RES = R.style.Widget_MaterialComponents_Toolbar;
|
||||
|
||||
@Nullable private Integer navigationIconTint;
|
||||
private boolean titleCentered;
|
||||
private boolean subtitleCentered;
|
||||
|
||||
private ImageView.ScaleType logoScaleType;
|
||||
private boolean logoAdjustViewBounds;
|
||||
|
||||
private static final ImageView.ScaleType[] sScaleTypeArray = {
|
||||
ImageView.ScaleType.MATRIX,
|
||||
ImageView.ScaleType.FIT_XY,
|
||||
@ -88,6 +81,13 @@ public class MaterialToolbar extends Toolbar {
|
||||
ImageView.ScaleType.CENTER_INSIDE
|
||||
};
|
||||
|
||||
@Nullable private Integer navigationIconTint;
|
||||
private boolean titleCentered;
|
||||
private boolean subtitleCentered;
|
||||
|
||||
private ImageView.ScaleType logoScaleType;
|
||||
private boolean logoAdjustViewBounds;
|
||||
|
||||
public MaterialToolbar(@NonNull Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
@ -113,9 +113,7 @@ public class MaterialToolbar extends Toolbar {
|
||||
subtitleCentered = a.getBoolean(R.styleable.MaterialToolbar_subtitleCentered, false);
|
||||
|
||||
final int index = a.getInt(R.styleable.MaterialToolbar_logoScaleType, 3);
|
||||
if (index >= 0) {
|
||||
logoScaleType = (sScaleTypeArray[index]);
|
||||
}
|
||||
logoScaleType = (sScaleTypeArray[index]);
|
||||
|
||||
logoAdjustViewBounds = a.getBoolean(R.styleable.MaterialToolbar_logoAdjustViewBounds, false);
|
||||
|
||||
@ -303,7 +301,7 @@ public class MaterialToolbar extends Toolbar {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set ImageView.ScaleType for logo's ImageView.
|
||||
* Sets ImageView.ScaleType for logo's ImageView.
|
||||
*/
|
||||
public void setLogoScaleType(ImageView.ScaleType logoScaleType) {
|
||||
if (this.logoScaleType != logoScaleType) {
|
||||
@ -323,7 +321,7 @@ public class MaterialToolbar extends Toolbar {
|
||||
|
||||
|
||||
/**
|
||||
* Set ImageView.adjustViewBounds for logo's ImageView.
|
||||
* Sets ImageView.adjustViewBounds for logo's ImageView.
|
||||
*/
|
||||
public void setLogoAdjustViewBounds(boolean logoAdjustViewBounds) {
|
||||
if (this.logoAdjustViewBounds != logoAdjustViewBounds) {
|
||||
|
||||
@ -82,5 +82,7 @@
|
||||
<public name="maxLines" type="attr"/>
|
||||
<public name="titleCentered" type="attr"/>
|
||||
<public name="subtitleCentered" type="attr"/>
|
||||
<public name="logoAdjustViewBounds" type="attr"/>
|
||||
<public name="logoScaleType" type="attr"/>
|
||||
</resources>
|
||||
|
||||
|
||||
@ -274,7 +274,6 @@
|
||||
<attr name="subtitleCentered" format="boolean" />
|
||||
<!-- adjust view bounds for logo's imageView. Default is false. -->
|
||||
<attr name="logoAdjustViewBounds" format="boolean" />
|
||||
|
||||
<!-- scale type for logo's imageView. Default is fitCenter. -->
|
||||
<attr name="logoScaleType">
|
||||
<!-- Scale using the image matrix when drawing. See
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user