190 likes | 317 Views
This guide by Dr. Razi Iqbal covers the essential steps for creating the graphical user interface (GUI) of the Manner Mode App. Focused on layout designs, it introduces Linear and Relative layouts to organize controls vertically and horizontally. It explains how to specify layout direction, add images through drag-and-drop, and incorporate widgets like ImageView and ToggleButton. Key functionalities include changing images and states on button clicks, ensuring an engaging user experience. Perfect for beginners and seasoned developers alike.
E N D
Designing user interface Dr. Razi Iqbal razi.iqbal@leads.edu.pk
Linear Layout • A View Group that arranges its children • Vertically • Horizontally • Layout Direction can be specified as • android:orientation • If orientation is vertical • Control will be one control per column • If orientation is Horizontal • Controls will be arranged in rows
Relative Layout • A View Group that arranges its children • Relative to each other • Child Views can specify their positions • Relative to their parents • Elements can be arranged to • Left of • Right of • Above • Below
Activity_Main.xml code Code after deleting the TextView from Activity_Main.xml
Adding Images to Project • Simply drag and Drop the images to res drawable-mdpi • Project will rebuild (Build Automatically) • It will include the resources in R.java file
The Final GUI • Widgets • An Image View • A Toggle Button • Desired Actions • Image should change on Button Click • State of Manner Mode should change on Button Click