Skip to content

Commit 067e8e1

Browse files
committed
fixed bugs
1 parent 97c1901 commit 067e8e1

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

alphabetsindexfastscrollrecycler/src/main/java/in/myinnos/alphabetsindexfastscrollrecycler/IndexFastScrollRecyclerSection.java

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,21 @@
44
* Created by MyInnos on 31-01-2017.
55
*/
66

7-
import android.annotation.SuppressLint;
87
import android.content.Context;
98
import android.graphics.Canvas;
109
import android.graphics.Color;
1110
import android.graphics.Paint;
1211
import android.graphics.RectF;
1312
import android.graphics.Typeface;
14-
15-
import androidx.annotation.ColorInt;
16-
import androidx.recyclerview.widget.LinearLayoutManager;
17-
import androidx.recyclerview.widget.RecyclerView;
18-
import android.os.Handler;
19-
import android.os.Message;
20-
import android.os.SystemClock;
2113
import android.util.AttributeSet;
2214
import android.util.Log;
2315
import android.view.MotionEvent;
2416
import android.widget.SectionIndexer;
2517

18+
import androidx.annotation.ColorInt;
19+
import androidx.recyclerview.widget.LinearLayoutManager;
20+
import androidx.recyclerview.widget.RecyclerView;
21+
2622
public class IndexFastScrollRecyclerSection extends RecyclerView.AdapterDataObserver {
2723

2824
private float mIndexbarWidth;
@@ -53,7 +49,7 @@ public class IndexFastScrollRecyclerSection extends RecyclerView.AdapterDataObse
5349
private @ColorInt
5450
int indexbarTextColor;
5551
private @ColorInt
56-
int indexbarHighLateTextColor;
52+
int indexbarHighLightTextColor;
5753

5854
private int setPreviewTextSize;
5955
private @ColorInt
@@ -80,7 +76,7 @@ public IndexFastScrollRecyclerSection(Context context, IndexFastScrollRecyclerVi
8076
setIndexBarCornerRadius = rv.mIndexBarCornerRadius;
8177
indexbarBackgroudColor = rv.mIndexbarBackgroudColor;
8278
indexbarTextColor = rv.mIndexbarTextColor;
83-
indexbarHighLateTextColor = rv.mIndexbarHighLateTextColor;
79+
indexbarHighLightTextColor = rv.indexbarHighLightTextColor;
8480

8581
indexbarBackgroudAlpha = convertTransparentValueToBackgroundAlpha(rv.mIndexBarTransparentValue);
8682

@@ -148,7 +144,7 @@ public void draw(Canvas canvas) {
148144
if (mCurrentSection > -1 && i == mCurrentSection) {
149145
indexPaint.setTypeface(Typeface.create(setTypeface, Typeface.BOLD));
150146
indexPaint.setTextSize((setIndexTextSize + 3) * mScaledDensity);
151-
indexPaint.setColor(indexbarHighLateTextColor);
147+
indexPaint.setColor(indexbarHighLightTextColor);
152148
} else {
153149
indexPaint.setTypeface(setTypeface);
154150
indexPaint.setTextSize(setIndexTextSize * mScaledDensity);
@@ -392,7 +388,7 @@ public void setIndexBarTextColor(@ColorInt int color) {
392388
* @param color The text color for the index bar
393389
*/
394390
public void setIndexBarHighlightTextColor(@ColorInt int color) {
395-
indexbarHighLateTextColor = color;
391+
indexbarHighLightTextColor = color;
396392
}
397393

398394
/**

alphabetsindexfastscrollrecycler/src/main/java/in/myinnos/alphabetsindexfastscrollrecycler/IndexFastScrollRecyclerView.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class IndexFastScrollRecyclerView extends RecyclerView {
3535
public @ColorInt
3636
int mIndexbarTextColor = Color.WHITE;
3737
public @ColorInt
38-
int mIndexbarHighLateTextColor = Color.BLACK;
38+
int indexbarHighLightTextColor = Color.BLACK;
3939

4040
public int mPreviewTextSize = 50;
4141
public @ColorInt
@@ -83,7 +83,7 @@ private void init(Context context, AttributeSet attrs) {
8383
}
8484

8585
if (typedArray.hasValue(R.styleable.IndexFastScrollRecyclerView_setIndexBarHighlightTextColor)) {
86-
mIndexbarHighLateTextColor = Color.parseColor(typedArray.getString(R.styleable.IndexFastScrollRecyclerView_setIndexBarHighlightTextColor));
86+
indexbarHighLightTextColor = Color.parseColor(typedArray.getString(R.styleable.IndexFastScrollRecyclerView_setIndexBarHighlightTextColor));
8787
}
8888

8989
if (typedArray.hasValue(R.styleable.IndexFastScrollRecyclerView_setIndexBarColorRes)) {
@@ -95,7 +95,7 @@ private void init(Context context, AttributeSet attrs) {
9595
}
9696

9797
if (typedArray.hasValue(R.styleable.IndexFastScrollRecyclerView_setIndexBarHighlightTextColorRes)) {
98-
mIndexbarHighLateTextColor = typedArray.getColor(R.styleable.IndexFastScrollRecyclerView_setIndexBarHighlightTextColor, mIndexbarHighLateTextColor);
98+
indexbarHighLightTextColor = typedArray.getColor(R.styleable.IndexFastScrollRecyclerView_setIndexBarHighlightTextColor, indexbarHighLightTextColor);
9999
}
100100

101101
mPreviewTextSize = typedArray.getInt(R.styleable.IndexFastScrollRecyclerView_setPreviewTextSize, mPreviewTextSize);

0 commit comments

Comments
 (0)