Android ui part 2

26
Android Advance UI - Part 2

Transcript of Android ui part 2

Page 1: Android ui part 2

AndroidAdvance UI - Part 2

Page 2: Android ui part 2

Previous Sessions

ListView - more customization, GridView

More UI - CheckBox, RadioButton, ProgressBar, Pickers, WebView

Page 3: Android ui part 2

Today’s agenda

Dialogs

Importance of Good UI

Building UI - basics revisited

Building Beautiful UI

Animations

Hardwares and Sensors

Page 4: Android ui part 2

Dialogs

Page 5: Android ui part 2

Dialogs

Page 6: Android ui part 2

Dialogs

To show alert messages to user.

To ask for user confirmation before doing some critical task.

To ask user to select an option from given options.

***

Page 7: Android ui part 2

Why Good UI is Important

Smooth performance.

Attracts users and keeps them.

Does not irritate users.

Does what is expected.

Page 8: Android ui part 2
Page 9: Android ui part 2

Beauty is Important

“No matter how useful or how good your app is, if its UI is not awesome it will have very few chances of remaining there in your user’s device.”

Bad UI =

Page 10: Android ui part 2

Bad UI

Page 11: Android ui part 2

Building UI - revisiting basics

Page 12: Android ui part 2

Building UI - revisiting basics

A layout is combination of ‘ViewGroups’ and ‘Views’.

ViewGroup holds Views (and other ViewGroups) objects.

Every view component is either View or ViewGroup.

● Button, TextView, ImageView, EditText → View

● LinearLayout, RelativeLayout, ListView, RadioGroup → ViewGroup

Page 13: Android ui part 2

Building UI - revisiting basics

Page 14: Android ui part 2

Building UI - revisting basics

Page 15: Android ui part 2

Building UI - revisiting basics

Page 16: Android ui part 2

Building UI - revising basics

Page 17: Android ui part 2

Creating beautiful UI

Change view in Java

Create custom components

Styles and themes

Custom drawables

Page 18: Android ui part 2

Creating and changing UI in Java

Page 19: Android ui part 2

Styles and Themes

Style:

“Collection of properties that define the look and format of a View component like color, font size and background color.”

Page 20: Android ui part 2

Styles and Themes

Themes:

“A Theme is a ‘Style’ applied to whole Activity or Application.”

<application android:theme="@style/CustomTheme">

<style name="CustomTheme" parent="android:Theme.Light">

<item name="android:windowBackground">@color/custom_theme_color</item>

<item name="android:colorBackground">@color/custom_theme_color</item>

</style>

***

Page 21: Android ui part 2

Using Third Party Libraries

Page 22: Android ui part 2

Using Third Party Libraries

Create your own customized UI components and reuse them.

Use third party libraries created by expert developers.

● Github

● AndroidArsenal.com

● AndroidWeekly.net

● Jake Wharton

● ...and many more(Just Google it)

Page 23: Android ui part 2

Animations

View Animations - old and simple

Property Animations - New, useful, realistic, comlex

● The Object to animate, the property, the values

● Can change different properties: int, float, color

● Animation set - mix different animations

● Animation listener

● Interpolator - Accelerate, Bounce, Linear etc.

Page 24: Android ui part 2

Hardware

Camera

GPS

Speakers/ Audio Jack

Mic

Screen

Charging point/ usb port

Power Button

Wi-fi

Page 25: Android ui part 2

Hardware

Volume Button

Battery

Sensors

● Light sensor

● Proximity sensor

● Motion sensors - accelerometer, gravity sensors

● Orientation sensors

Finger scanner

Page 26: Android ui part 2

About Me

Paramvir Singh, Android Developer and Trainer

[email protected]

https://in.linkedin.com/in/paramvir-singh-android-developer-b45b5321