Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Incorrect value of app module dimen/color when using in dynamic-delivery module

I have app module and one dynamic module named - "chat". I have a layout and fragment resides in chat module, in layout there is a android:textSize="@dimen/sp20" written. Dimen is defined in app module due to that it is showing incorrect text size when I run it. I debugged it, it is equal to 12sp (36 for xxhdpi device).

I tried to use dimen programtically but same result. (landing_page_toolbar_title.setTextSize(TypedValue.COMPLEX_UNIT_PX, resources.getDimension(com.sendbird.R.dimen.sp20))) . Carefully used "R" from app module package.

When I define the same value in chat module, it works perfectly. But it is not feasible for our scenario. I have tons of string, dimens, color resources with multiple configurations written in app module. Please share feasible solution.

Attaching screenshot for better understanding.Reflection based result comparison

like image 976
Harish Gyanani Avatar asked Nov 07 '22 05:11

Harish Gyanani


1 Answers

Can you try by updating your app module resources with the "app_sp20" prefix, it will be resolved mostly.

Common names are mostly overridden by SDKs/modules

Still, you face the problem then use reflection as the last option.

like image 180
Kishan Maurya Avatar answered Nov 15 '22 05:11

Kishan Maurya