CS378 - Mobile Computing User Interface Basics. User Interface Elements View – Control – ViewGroup Layout Widget (Compound Control) Many pre built Views.

Slides:



Advertisements
Similar presentations
Chapter 3 – Web Design Tables & Page Layout
Advertisements

Android UserInterfaces Nasrullah Niazi. overView All user interface elements in an Android app are built using View and ViewGroup objects. A View is an.
CE881: Mobile and Social Application Programming Simon M. Lucas Layouts.
Android User Interface
Tutorial 6 Creating Fixed-Width Layouts
Intermediate Level Course. Text Format The text styles, bold, italics, underlining, superscript and subscript, can be easily added to selected text. Text.
 User Interface - Raeha Sandalwala.  Introduction to UI  Layouts  UI Controls  Menus and ‘Toasts’  Notifications  Other interesting UIs ◦ ListView.
User Interface Classes.  Design Principles  Views & Layouts  Event Handling  Menus  Dialogs.
Filip Debelić What is it? Android is a mobile operating system (OS) based on the Linux kernel and currently developed by Google Android,
More on User Interface Android Applications. Layouts Linear Layout Relative Layout Table Layout Grid View Tab Layout List View.
By: Jeremy Smith.  Introduction  Droid Draw  Add XML file  Layouts  LinearLayout  RelativeLayout  Objects  Notifications  Toast  Status Bar.
Layout and Control in UI The user interface (UI) is the graphical interface user can see and interact with your app comprising UI controls like textbox,
CS378 - Mobile Computing User Interface Basics MIKE!! LOOK HERE FOR intercepting the ListView items:
Android: Layouts David Meredith
Creating Android user interfaces using layouts 1Android user interfaces using layouts.
® IBM Software Group © 2006 IBM Corporation Creating JSF/EGL Template Pages This section describes how to create.JTPL (Java Template Pages) using the Page.
Android Development: Application Layout Richard S. Stansbury 2015.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Modify Android Objects Using.
Android: versions Note that: Honeycomb (Android v3.0) A tablet-only release Jelly Bean (Android v4.1) Released on July 09, 2012.
CS5103 Software Engineering Lecture 08 Android Development II.
PROG Mobile Java Application Development PROG Mobile Java Application Development Developing Android Apps: Components & Layout.
Chapter 9: Customize! Navigating with Tabs on a Tablet App.
Favorite Twitter® Searches App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
Tip Calculator App Building an Android App with Java © by Pearson Education, Inc. All Rights Reserved.
Android Layouts. Layouts Define the user interface for an activity Layouts are defined in.xml files – within /res/layout folder – different layout can.
ANDROID – INTERFACE AND LAYOUT L. Grewe. Interfaces: Two Alternatives Code or XML  You have two ways you can create the interface(s) of your Application.
Understanding Hello Android 1 CS300. Activity  Similar to a form  Base class for the visual, interactive components of your application  Android API.
Frank Xu Gannon University.  Linear Layout  Relative Layout  Table Layout.
1/29/ Android Programming: FrameLayout By Dr. Ramji M. Makwana Professor and Head, Computer Engineering Department A.D. Patel.
Domain 3 Understanding the Adobe Dreamweaver CS5 Interface.
INTRODUCTION TO ANDROID. Slide 2 Application Components An Android application is made of up one or more of the following components Activities We will.
LAYOUT CONTROLS. XAML Overview XAML : eXtensible Application Markup Language pronounced (ZAMEL) is a markup language used to design user interfaces XML-based.
User Interfaces: Part 1 (View Groups and Layouts).
Application Development for mobile Devices
Chapter 5 Quick Links Slide 2 Performance Objectives Understanding Framesets and Frames Creating Framesets and Frames Selecting Framesets and Frames Using.
5-1 More UI CSNB544 Mobile Application Development Thanks to Utexas Austin.
WaveMaker Visual AJAX Studio 4.0 Training Basics: Building Your First Application Designer Basics.
Computer Science 101 Lists and Tables. Lists Unordered lists - use a bullet Ordered lists - use a number, Roman numeral, or letter.
MOBILE COMPUTING D10K-7D02 MC04: Layouts Dr. Setiawan Hadi, M.Sc.CS. Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran.
HW#9 Clues CSCI 571 Fall, HW#9 Prototype
MOBILE COMPUTING D10K-7D02 MC05: Android UI Design Dr. Setiawan Hadi, M.Sc.CS. Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran.
1 Android Development Lean and mean introduction Based on a presentation by Mihail L. Sichitiu.
20-753: Fundamentals of Web Programming 1 Lecture 6: Advanced HTML Fundamentals of Web Programming Lecture 6: Advanced HTML.
Building User Interfaces Basic Applications
CS378 - Mobile Computing More UI. UI Review Containers – more formally ViewGroups – store widgets and other containers – examples: LinearLayout, RelativeLayout,
Chapter 2 Building User Interfaces and Basic Applications.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
CS371m - Mobile Computing User Interface Basics. UI Programming with Widgets Widget is an element in a Graphical User Interface (GUI) – not to be confused.
ANDROID LAYOUTS AND WIDGETS. Slide 2 Introduction Parts of the Android screen Sizing widgets and fonts Layouts and their characteristics Buttons, checkboxes.
You have to remember that  To create an AVD(Android Virtual Device)  The Structure of Android Project  XML Layout  The advantage of XML Layout  Android.
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
Java FX: Scene Builder.
Open Handset Alliance.
Mobile Application Development BSCS-7 Lecture # 8
Mobile Application Development Chapter 4 [Android Navigation and Interface Design] IT448-Fall 2017 IT448- Fall2017.
HNDIT2417 Mobile Application Development
CS371m - Mobile Computing User Interface Basics.
First text statement positioned here at guide intersection
CIS 470 Mobile App Development
CS371m - Mobile Computing User Interface Basics.
CS5103 Software Engineering
Mobile Computing With Android ACST 4550 Android Layouts
DREAMWEAVER MX 2004 Chapter 3 Working with Tables
Building User Interfaces Basic Applications
Android Developer Fundamentals V2
CIS 470 Mobile App Development
Korea Software HRD Center
CS 240 – Advanced Programming Concepts
Android Sensor Programming
Presentation transcript:

CS378 - Mobile Computing User Interface Basics

User Interface Elements View – Control – ViewGroup Layout Widget (Compound Control) Many pre built Views – Button, CheckBox, RadioButton – TextView, EditText, ListView – Can be customized by extending and overriding onDraw()

XML UI Configuration Layouts can specify UI elements (provided and custom) res/layout "Design by Declaration"

Layouts Layouts are subclasses of ViewGroup FrameLayout – simplest type of layout object – fill with a single object (such as a picture) that can be switched in and out – child elements pinned to top left corner of screen and cannot be move – adding a new element / child draws over the last one

LinearLayout aligns child elements (such as buttons, edit text boxes, pictures, etc.) in a single direction orientation attribute defines direction: – android:orientation= "vertical"

Gravity Child element's gravity attribute – where to position in the outer container right center

Weight layout_weight attribute – "importance" of a view – default = 0 – if set > 0 takes up more of parent space BTW, scale emulator Run -> Run Configurations -> target -> command line options "-scale 0.7

Another Weight Examples button and bottom edit text weight of 2 button weight 1 and bottom edit text weight of 2

LinearLayout - Horizontal Orientation padding background color margins

TableLayout rows and columns rows normally TableRows TableRows contain other elements such as buttons, text, etc.

RelativeLayout children specify position relative to parent or to each other (specified by ID) First element listed is placed in "center" other elements placed based on position to other elements

RelativeLayout XML

Other Layouts - GridView Two Dimensional Scrollable Grid Items inserted into layout via a ListAdapter

Other Layouts - TabLayout Uses a TabHost and TabWidget Swap between views in same activity or switch between different activities

Other Layouts - ListView Creates a list of scrollable items Items added via a ListAdapter as in GridView

Other Views - Layouts Gallery – horizontal scrolling display of images from a list SurfaceView – provide access to a "drawing" surface. Intended to draw pixels, not display other views / widgets

Concrete Example Tip Calculator What kind of layout to use? Widgets: – TextView – EditText – SeekBar

TextViews

EditText All but top EditText are uneditable Alternative? TextViews?

SeekBar

Layout TableLayout row 0 row 1 row 2 row 3 row 4 row 5

Layout Attributes android:background – #RGB, #ARGB, #RRGGBB, #AARRGGBB – can place colors in res/values/colors.xml

Color Resources Good Resource / W3C colors –

StretchColumns columns 0 indexed columns 1, 2, 3 stretch to fill layout width column 0 wide as widest element, plus any padding for that element

Initial UI Done via some Drag and Drop, Outline view, and editing XML Demo outline view – properties

Changes to UI Outline multiple select properties – all TextViews' textColor set to black # change column for %DD labels use center gravity for components

Changes to UI change bill total and seekbar to span more columns gravity and padding for text in column 0 align text with seekBar set seekBar progress to 18 set seekBar focusable to false - keep keyboard on screen

Changes to UI Prevent Editing in EditText – focusable, long clickable, and cursor visible properties to false Set text in EditText to 0.00 Change weights to 1 to spread out

Functionality onCreate instance variables assigned to components found via ids update standard percents:

Functionality - Saving State onSaveInstance – save BillTotal and CustomPercent to the Bundle – check for these in onCreate

Functionality Responding to SeekBar customSeekBarListener instance variable Of type OnSeekBarChangeListener

Create an Anonymous Inner Class Class notified when seek bar changed and program updates custom tip and total amount must register with the seekBar instance variable in onCreate!

Functionality - Total EditText Another anonymous inner class implement onTextChanged to convert s to double and call update methods register with EditText for total in onCreate()!