SATURN  RING  STATION

At a distant space view post, we chat about codes.

Android: programmatically adjust ConstraintLayout’s layout constraint tip.

As great as Android’s dp unit and ConstraintLayout are, sometimes adjusting View objects placement dynamically just offer more flexibility.


Check screen density: getting the screen density programmatically in android?

For complex UI, I have seem people use two xml for one activity. One xml for smaller screens, and one for bigger screens. Pro is you don’t have to programmatically adjust size, constraints and margins. Con is you end up maintaining two xml, where you can use xml include tag to cut repetition. Not too bad at all.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Android: programmatically adjust ConstraintLayout’s layout constraint tip.