Ahmad Aghazadeh
Ahmad Aghazadeh

Reputation: 17131

How to concatenate multiple dimen in android XML?

I have one dimen

 <dimen name="fab_margin">16dp</dimen>

I want plus fab_margin , android:attr/actionBarSize ?

like this

<dimen name="fab_margin_fragment">(@dimen/fab_margin)+(?android:attr/actionBarSize)</dimen>

Upvotes: 1

Views: 475

Answers (1)

IntelliJ Amiya
IntelliJ Amiya

Reputation: 75788

You can use programmatic way.

int getMargin= (int) getResources().getDimension(R.dimen.fab_margin)+(int) getResources().getDimension(R.dimen.fab_margin_fragment);

Upvotes: 2

Related Questions