Question: There are a activity what I want to fill the screen in a phone
and pop up(dialog) for a tablet.

I thought I make a layout file like this, 

```
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="@dimen/main_layout_width"
  android:layout_height="match_parent">

```

and externalize the value of width as

in values/dimens.xml

```
<dimen name="tutorial_width">match_parent</dimen>

```

in values-xlarge/dimens.xml

```
<dimen name="tutorial_width">320dp</dimen>

```

But I can't representation 'match\_parent' as dimen element.
Any help? Thanks!

Answer: 
I used a style to fix this problem. Having separate xml style elements with android:layout\_width items for different screen sizes solved the problem without using the undocumented -1dp
As mentioned earlier in <https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#MATCH_PARENT> MATCH\_PARENT = -1 and WRAP\_CONTENT = -2.
Instead of declaring the values as Dimension resources I have successfully declared and used them as Integer resources.
So for the example to work you can use two Integer resource files:

values/integers.xml

```
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <integer name="tutorial_width">-1</integer>
</resources>

```

values-sw600dp/integers.xml

```
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <integer name="tutorial_width">-2</integer>
</resources>

```

And the layout file will be:

```
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="@integer/tutorial_width"
  android:layout_height="match_parent">

```