Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Can I to Change Text Size in RemoteViews

Under RemoteViewsService.RemoteViewsFactory

public RemoteViews getViewAt(int position) {
    final int itemId = (position % 2 == 0 ? R.layout.light_widget_item
            : R.layout.dark_widget_item);
    RemoteViews rv = new RemoteViews(mContext.getPackageName(), itemId);
    rv.setTextViewText(R.id.widget_item, text);
    // rv.setTextSize(mPrefs.getTextsize().getValue());
    return rv;
}

How can I change the text size programmatically?

like image 956
fury Avatar asked Jul 17 '11 02:07

fury


1 Answers

How about the setFloat() method?

rv.setFloat(R.id.widget_item, "setTextSize", mPrefs.getTextsize().getValue());
like image 161
kvance Avatar answered Oct 06 '22 20:10

kvance