Based on here on XML Attributes section I specify following in my dimens.xml:
-1dp
Depending on why you want to define match_parent in a @dimen, this use case could help you:
Instead of defining the width and height in dimen.xml, you can define it as a style in the styles.xml
I use
//res/values/styles.xml
and
//res/values-sw600dp/styles.xml
and use it like
which allows me to dynamically set the width and height attributes for different sized devices without having to write any code and you can use match_parent/wrap_content fine. you can use any @dimen that you have defined previously in the style as well if you want.
I use this because the layout for phone and tablet is the same, except i want to fix the width on tablet but fill the parent on phone, so it saves having to have 2 different layouts with basically the same xml