@@ -39,6 +39,7 @@ public class CandidateAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
39
39
private PositionType textPosition , commentPosition ;
40
40
private static int COMMENT_UNKNOW = 0 , COMMENT_TOP = 1 , COMMENT_DOWN = 2 , COMMENT_RIGHT = 3 ;
41
41
private static int comment_position ;
42
+ private static boolean hide_comment ;
42
43
43
44
public CandidateAdapter (Context context ) {
44
45
myContext = context ;
@@ -76,11 +77,15 @@ public void configStyle(int keyMarginX, int keyMarginTop) {
76
77
textColor = config .getLiquidColor ("long_text_color" );
77
78
if (textColor == null ) textColor = config .getLiquidColor ("key_text_color" );
78
79
79
- comment_position = config .getInt ("comment_position" );
80
- if (comment_position == COMMENT_UNKNOW ) {
81
- comment_position = config .getBoolean ("comment_on_top" ) ? COMMENT_TOP : COMMENT_RIGHT ;
80
+ hide_comment = Rime .getOption ("_hide_comment" );
81
+ if (hide_comment ) {
82
+ comment_position = COMMENT_RIGHT ;
83
+ } else {
84
+ comment_position = config .getInt ("comment_position" );
85
+ if (comment_position == COMMENT_UNKNOW ) {
86
+ comment_position = config .getBoolean ("comment_on_top" ) ? COMMENT_TOP : COMMENT_RIGHT ;
87
+ }
82
88
}
83
-
84
89
textSize = config .getFloat ("candidate_text_size" );
85
90
86
91
background =
@@ -132,8 +137,8 @@ public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int in
132
137
if (textFont != null ) itemViewHold .textView1 .setTypeface (textFont );
133
138
134
139
String text = candidates [index ].text ;
135
- String comment = candidates [ index ]. comment ;
136
- if (comment == null ) comment = "" ;
140
+ String comment = "" ;
141
+ if (! hide_comment && candidates [ index ]. comment != null ) comment = candidates [ index ]. comment ;
137
142
138
143
if (text .length () > 300 ) itemViewHold .textView1 .setText (text .substring (0 , 300 ));
139
144
else itemViewHold .textView1 .setText (text );
0 commit comments