Skip to content

Commit

Permalink
Update IndexFastScrollRecyclerView.java
Browse files Browse the repository at this point in the history
typedArray is never null, fixed value not updating from XML
  • Loading branch information
Hamza417 authored Sep 24, 2020
1 parent 2b9b4bd commit a605907
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,10 @@ public IndexFastScrollRecyclerView(Context context, AttributeSet attrs, int defS


private void init(Context context, AttributeSet attrs) {
mScroller = new IndexFastScrollRecyclerSection(context, this);


if (attrs != null) {
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.IndexFastScrollRecyclerView, 0, 0);

if (typedArray != null) {
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.IndexFastScrollRecyclerView);

try {
setIndexTextSize = typedArray.getInt(R.styleable.IndexFastScrollRecyclerView_setIndexTextSize, setIndexTextSize);
mIndexbarWidth = typedArray.getFloat(R.styleable.IndexFastScrollRecyclerView_setIndexbarWidth, mIndexbarWidth);
Expand Down Expand Up @@ -124,7 +122,9 @@ private void init(Context context, AttributeSet attrs) {
} finally {
typedArray.recycle();
}
}

// This line here is neccesary else the attributes won't be updated if a value is passed from XML
mScroller = new IndexFastScrollRecyclerSection(context, this);
}
}

Expand Down Expand Up @@ -369,4 +369,4 @@ public void setIndexBarHighLightTextVisibility(boolean shown) {
public void updateSections() {
mScroller.updateSections();
}
}
}

0 comments on commit a605907

Please sign in to comment.