RemoteViews allow me to setTextSize TextView like this:
views.setFloat(R.id.appwidget_text, "setTextSize", fontSize);
but only with one argument. It will set font size in sp. I dont want the text in my widget to be measured in sp.
I need use setTextSize with 2 arguments (txtView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, fontSize);) using remote views. Is it possible to do this?
Yes! you can use this
viewId int: The id of the view whose text size should change
units int: The units of size (e.g. COMPLEX_UNIT_SP)
size float: The size of the text
This method is only available since API level 16 (android 4.1)
doc here: https://developer.android.com/reference/android/widget/RemoteViews.html#setTextViewTextSize(int,%20int,%20float)