Responsive Android UI design
Learn step by step approach to creating, appealing fluid and responsive UI for Android.
Good offer at the end — read on!
The initial passion
If you are reading this article, chances are that you love building app that run on android, You started with great passion just like we all did, and most time, 80% of us are self thought, which on the highest percentage leaves us with no time to learn the basic secrets that makes up the complex.
Before you started building android apps, chances are also that you have tried other technologies like building for the web using html, css and javascript or desktop Apps using java. That leaves maybe 50% of us to be proud of our business logic, but it’s not always the same when it comes to designing user interface for our apps which is what this article is all about.
Building Android app is an exciting venture; there is this joy that comes with seeing your app run on your own very phone, you can be proud to show your friends and family, but not when it’s looking crappy right?.
Designing for android combines 3 powerful tools, layouts, typography and colors to give our app an appealing look, aside from the functionality of your app the next most important thing is the look and feel.
The Challenge
So let get even more deeper,
To build complex UI layouts, we use this Layouts more often to organise and arrange our ui components according to our design blueprint:
- Linear-layout
- Relative-layout
- Constraint-layout*
We have many other types of layout but, these three are common for most use cases, which might demand nesting of the same type of layout or even combining them, to achieve what we want. For instance in the screenshot below,
we have a spinner that a user can choose the number of items they want to purchase to generate a dynamic order items to be inflated in the layout with id “container”. *See code in Gist* We have a spinner and an ImageButton arranged in a horizontal Linearlayout, which we used layout_weight to distribute the space in the horizontal linearlayout in the ratio of 0.5/4.5 and 4/4.5 .
This horizontal Linearlayout is a siblings along side a TextView with the label of what the Spinner and Button stack on top of each other in a vertical LinearLayout.
This parent Linearlayout is also a child to a cardview wrapped around by another Linearlayout of vertical orientation, which we used because scrollview take a single child.
You can see the level of nesting tree in the code view below in Github
Gist
You can see the little UI in the screenshot above took 63 lines of xml code when pretty formatted, but the key takeaways here is that we can’t achieve that by just using drag and drop; to achieve a design that solves a key user problem, while saving space, you need to understand how this layouts work.
We just talked about using Linearlayouts, we can achieve the same UI using Relativelayout, which reduces the level of nesting, which consumes android computing and processing time to draw each individual view.
Get Phil Ucheolisah Nge’s stories in your inbox
Join Medium for free to get updates from this writer.
Let’s take a look at more fluid example the screenshot below
Was done using Constraint-layout. Constraint layout gives you more fluid and responsive power to effect UI that responds to all screen sizes like bootstrap for web.
Constraintlayout came as part of support library; you can take a look at the key intro from the android doc here
Constraint layout is a brother to Relativelayout, they behave mostly the same way, just that Constraint layout is now more advanced with more fluid features like guideline, barrier etc. To use Constraint layout you really need to understand the secrets to how these layouts works in positioning views to its siblings and parents, just like Relative-layout, but now uses Constraints.
To use ConstraintLayout in your project, proceed as follows
Ensure you have the
maven.google.com repository declared in your module-level build.gradle file:
repositories {
maven {
url ‘https://maven.google.com'
}
}
Add the library as a dependency in the same build.gradle file:
dependencies {
compile ‘com.android.support.constraint:constraint-layout:1.0.2’
}
The screenshot above was achieve in Constraintlayout, by nesting Constraint layout and guidelines.
Using the code below in Github
Gist
The way forward
This Udemy Course “Responsive Android UI design revealing the pro’s secret” which am going to share with you was design to solve all this design hitches from how to achieve such UI using Linear-layout nesting, Relative-layout and Constraint-layout just like the above example, which I am the Instructor @nge_one has agreed to offer to you at half the price [50%] discount with this coupon code UI-XTRA, or follow TAKE_ME_TO_THE_COURSE now as is limited to a number of people
So follow this link to enroll to this course almost free NOW and improve your Android UI app design skills since after functionality is your design. The user careless about million lines of code, rather its what they see.
The link above gives you 50% discount which is half price of a course priced at $30.kindly rate it leave an honest review to encourage and support him if you find it helpful, there is also 30 day money back, But i bet It will help you!







