Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
justjanne committed Apr 2, 2019
1 parent be1e063 commit 6fe499e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package de.kuschku.ui.internal;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
Expand Down Expand Up @@ -133,18 +134,17 @@ public void setCollapsedTextGravity(int gravity) {

public void setCollapsedTextAppearance(int resId) {
Context context = view.getContext();
TypedArray a = context.obtainStyledAttributes(resId, R.styleable.TextAppearance);
ColorStateList textColor = MaterialResources.getColorStateList(context, a, R.styleable.TextAppearance_android_textColor);
TypedArray a = context.obtainStyledAttributes(resId, R.styleable.md_TextAppearance);
ColorStateList textColor = MaterialResources.getColorStateList(context, a, R.styleable.md_TextAppearance_android_textColor);
if (textColor != null) {
collapsedTextColor = textColor;
}
float textSize = a.getDimension(R.styleable.TextAppearance_android_textSize, 0f);
float textSize = a.getDimension(R.styleable.md_TextAppearance_android_textSize, 0f);
if (textSize != 0) {
collapsedTextSize = textSize;
}
a.recycle();


recalculate();
}

Expand Down Expand Up @@ -212,6 +212,7 @@ private int getCurrentColor(@Nullable ColorStateList colorStateList) {
return colorStateList.getDefaultColor();
}

@SuppressLint("RtlHardcoded")
private void calculateBaseOffsets() {
// We then calculate the collapsed text size, using the same logic
calculateUsingTextSize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,11 @@ private TextView getCaptionViewFromDisplayState(@CaptionDisplayState int caption
return errorView;
case CAPTION_STATE_HELPER_TEXT:
return helperTextView;
default: // No caption displayed, fall out and return null.
case CAPTION_STATE_NONE:
default:
// No caption displayed, fall out and return null.
return null;
}
return null;
}

void adjustIndicatorPadding() {
Expand Down

0 comments on commit 6fe499e

Please sign in to comment.