Question: I want to be able to to be able to set padding values if a boolean is true. The problem is that Android studio cannot parse the layout because it thinks 2dp is a decimal with a value of 2 and then doesn't know what to do with the p. how do I format this so that it understands i mean 2 density pixels.

Data layout:

```
<data class=".ItemBinding">
    <variable name="isGroupType" type="Boolean"/>
</data>

```

View layout(whats important):

```
<android.support.v7.widget.AppCompatImageView
            android:layout_width="64dp"
            android:layout_height="64dp"
            android:paddingBottom='@{isGroupType ? 2dp : 0dp}'
            android:paddingTop='@{isGroupType ? 8dp : 0dp}'
            android:paddingRight='@{isGroupType ? 2dp : 0dp}'
            android:paddingLeft='@{isGroupType ? 2dp : 0dp}'/>

```

Answer: 
@Ravi's answer is correct. 

But for more flexibility you can also try this:

```
@BindingAdapter({"padding", "shouldAdd"})
public static void setPadding(AppCompatImageView imageView, boolean shouldAdd, int padding){
    if (shouldAdd){
        imageView.setPadding(padding, padding, padding, padding);
    }
}

```

Then:

```
<android.support.v7.widget.AppCompatImageView
        android:layout_width="64dp"
        android:layout_height="64dp"
        shouldAdd="@{isGroupType}"
        padding="@{10}"/>

```
Use a blank view

```
<View
android:layout_width = "8dp"
android:layout_height = "8dp"
>

```

Now constraint this view to the layout you want to control the visibility of .
Now disappear this view depending on the condition. would work the same as a margin