use of androidx.appcompat.widget.AppCompatTextView in project J2ME-Loader by nikita36078.
the class StringItem method getItemContentView.
@Override
public View getItemContentView() {
if (textview == null) {
Context context = getOwnerForm().getParentActivity();
if (appearanceMode == BUTTON) {
textview = new AppCompatButton(context);
} else {
textview = new AppCompatTextView(context);
}
textview.setTextAppearance(context, android.R.style.TextAppearance_Small);
if (appearanceMode == HYPERLINK && text != null) {
SpannableStringBuilder s = new SpannableStringBuilder(text);
s.setSpan(new URLSpan(text), 0, s.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
textview.setText(s);
} else {
textview.setText(text);
}
textview.setOnClickListener(v -> fireDefaultCommandAction());
}
return textview;
}
use of androidx.appcompat.widget.AppCompatTextView in project J2ME-Loader by nikita36078.
the class Item method getItemView.
/**
* Get the whole item
*
* @return LinearLayout with a label in the first row and some content in the second row
*/
public View getItemView() {
if (layout == null) {
Context context = owner.getParentActivity();
layout = new LinearLayout(context);
layout.setOrientation(LinearLayout.VERTICAL);
labelview = new AppCompatTextView(context);
labelview.setTextAppearance(context, android.R.style.TextAppearance_Medium);
labelview.setText(label);
if (label != null) {
layout.addView(labelview, getLayoutParams());
}
contentview = getItemContentView();
layout.addView(contentview, getLayoutParams());
ViewHandler.postEvent(msgSetContextMenuListener);
}
return layout;
}
Aggregations