A Little Hack For Android Dimensions

May 26, 2016

If you write a lot of UI layouts for Android and your goal is making a responsive Android App, you surely faced the need of having something like “match_parent” or “wrap_content” in your Android Dimension Resources.

You might think of typing this:

But it doesn’t work like this. And the compiler will let you know that it doesn’t like what you’ve typed. 😡

We’ve to go a little bit deeper and see how the Android Source Code manages LayoutParams.