Skip to content

Commit

Permalink
fix(ime): symbol: invisible key text in LiquidKeyboard
Browse files Browse the repository at this point in the history
forgot to set the key text color, lol
  • Loading branch information
WhiredPlanck committed Oct 22, 2022
1 parent 6f6305a commit 054da09
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
17 changes: 11 additions & 6 deletions app/src/main/java/com/osfans/trime/ime/symbol/FlexibleAdapter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,20 @@ class FlexibleAdapter(
with(viewHolder) {
val bean = mBeans[position]
simpleKeyText.apply {
this.text = bean.text
this.typeface = theme.getFont("long_text_font")
text = bean.text
typeface = theme.getFont("long_text_font")
when (val textColor = theme.getLiquidColor("long_text_color")) {
null -> setTextColor(theme.getLiquidColor("key_text_color"))
else -> setTextColor(textColor)
}

val longTextSize = theme.getFloat("key_long_text_size")
val labelTextSize = theme.getFloat("label_text_size")
if (longTextSize > 0)
this.textSize = longTextSize
else if (labelTextSize > 0)
this.textSize = labelTextSize
textSize = when {
longTextSize > 0 -> longTextSize
labelTextSize > 0 -> labelTextSize
else -> textSize
}
}
simpleKeyPin.visibility = if (bean.pinned) View.VISIBLE else View.INVISIBLE

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
final SimpleKeyBean bean = mBeans.get(position);

holder.simpleKeyText.setText(bean.getLabel());
holder.simpleKeyText.setTextColor(theme.getLiquidColor("key_text_color"));
holder.simpleKeyText.setTypeface(theme.getFont("key_font"));
holder.simpleKeyText.setGravity(Gravity.CENTER);
holder.simpleKeyText.setEllipsize(TextUtils.TruncateAt.MARQUEE);
Expand Down

0 comments on commit 054da09

Please sign in to comment.