Skip to content

Commit fd06923

Browse files
committed
fix a bug
1 parent 50a844f commit fd06923

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

app/src/main/java/cn/hadcn/keyboard_example/MainApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class MainApplication extends Application {
1818
public void onCreate() {
1919
super.onCreate();
2020

21-
if ( !ChatKeyboardLayout.isEmoticonsDBInitSuccess(this) ) {
21+
if (!ChatKeyboardLayout.isEmoticonsDBInitSuccess(this)) {
2222
List<EmoticonEntity> entities = new ArrayList<>();
2323
entities.add(new EmoticonEntity("emoticons/xhs", EmoticonBase.Scheme.ASSETS));
2424
entities.add(new EmoticonEntity("emoticons/tusiji", EmoticonBase.Scheme.ASSETS));

keyboard/src/main/java/cn/hadcn/keyboard/ChatKeyboardLayout.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,14 @@ public ChatKeyboardLayout(Context context, AttributeSet attrs) {
100100
String btnSendText = typedArray.getString(R.styleable.ChatKeyboardLayout_sendButtonText);
101101
ColorStateList btnSendTextColor = typedArray.getColorStateList(R.styleable
102102
.ChatKeyboardLayout_sendButtonTextColor);
103-
isShowRightIcon = typedArray.getBoolean(R.styleable
104-
.ChatKeyboardLayout_showRightIcon, false);
103+
isShowRightIcon = typedArray.getBoolean(R.styleable.ChatKeyboardLayout_showRightIcon,
104+
false);
105105
@KeyboardStyle int keyboardStyle = typedArray.getInt(R.styleable
106106
.ChatKeyboardLayout_keyboardStyle, Style.TEXT_ONLY);
107107
setKeyboardStyle(keyboardStyle);
108-
mLeftDefaultIcon = typedArray.getDrawable(R.styleable
109-
.ChatKeyboardLayout_leftDefaultIcon);
110-
mLeftSecondIcon = typedArray.getDrawable(R.styleable
111-
.ChatKeyboardLayout_leftSecondIcon);
112-
Drawable rightIcon = typedArray.getDrawable(R.styleable
113-
.ChatKeyboardLayout_rightIcon);
108+
mLeftDefaultIcon = typedArray.getDrawable(R.styleable.ChatKeyboardLayout_leftDefaultIcon);
109+
mLeftSecondIcon = typedArray.getDrawable(R.styleable.ChatKeyboardLayout_leftSecondIcon);
110+
Drawable rightIcon = typedArray.getDrawable(R.styleable.ChatKeyboardLayout_rightIcon);
114111
Drawable faceIcon = typedArray.getDrawable(R.styleable.ChatKeyboardLayout_faceIcon);
115112
if (faceIcon != null) {
116113
btnEmoticon.setImageDrawable(faceIcon);

keyboard/src/main/java/cn/hadcn/keyboard/emoticon/view/EmoticonsPageView.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ private void updateView() {
6262
List<View> emoticonPageViews = new ArrayList<>();
6363
clearOnPageChangeListeners();
6464
addOnPageChangeListener(new PageChangeListener());
65+
// init to show indicators
66+
mOnEmoticonsPageViewListener.emoticonsPageViewCountChanged(getPageCount
67+
(mEmoticonSetBeanList.get(0)));
6568

6669
for (EmoticonSetBean bean : mEmoticonSetBeanList) {
6770
List<EmoticonBean> emoticonList = bean.getEmoticonList();
@@ -153,6 +156,7 @@ public void setPageSelect(int position) {
153156
private class PageChangeListener implements OnPageChangeListener {
154157
@Override
155158
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
159+
// unused for now
156160
}
157161

158162
@Override
@@ -197,6 +201,7 @@ public void onPageSelected(int position) {
197201

198202
@Override
199203
public void onPageScrollStateChanged(int state) {
204+
// unused for now
200205
}
201206
}
202207

0 commit comments

Comments
 (0)