Lecture 2 b: Android Layout Basics Topics

Slides:



Advertisements
Similar presentations
Spreadsheet Vocabulary
Advertisements

Chapter 3 – Web Design Tables & Page Layout
Rajab Davudov. What is a Layout ? A type of resource that defines what is drawn on the screen. A type of View class whose primary purpose is to organize.
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.
Cascading Style Sheets Basics. Why use Cascading Style Sheets? Allows you to set up a series of rules for all pages in a site. The series may be changed.
1 L48 Advanced GUI Component (3). 2 OBJECTIVES  To use additional layout managers.
By: Jeremy Smith.  Introduction  Droid Draw  Add XML file  Layouts  LinearLayout  RelativeLayout  Objects  Notifications  Toast  Status Bar.
Using HTML to Create Tables in Web pages Connie Lindsey November 2005.
Android: Layouts David Meredith
1 The Structure of a Web Table beginning of the table structure first row of three in the table end of the table structure table cells You do not need.
Creating Android user interfaces using layouts 1Android user interfaces using layouts.
Android Development: Application Layout Richard S. Stansbury 2015.
CHAPTER 11 Tables. How Are Tables Used Data Display  Very tidy and very useful Better Text Alignment  Putting text in tables allows you to format indents.
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.
Tutorial 5 Working with Web Tables. XP Objectives Explore the structure of a Web table Create headings and cells in a table Create cells that span multiple.
FRAMES. With frames, we can display more than one HTML document in the same browser window. Each HTML document is called the same browser window. Each.
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.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Using Android XML Resources.
INTRODUCTION TO ANDROID. Slide 2 Application Components An Android application is made of up one or more of the following components Activities We will.
Add and Subtract Decimals
Tutorial 5 Working with Tables and Columns
Tutorial 5 Working with Tables and Columns
UI Resources Layout Resources String Resources Image Resources.
User Interfaces: Part 1 (View Groups and Layouts).
Application Development for mobile Devices
Introducing Web Tables. Tables for tabulating items  Better looking  More flexibility  More efficient to explain information than plain text.
Copyright© Jeffrey Jongko, Ateneo de Manila University Basic Views and Layouts.
Tutorial 5 Working with Web Tables. XP Objectives Explore the structure of a Web table Create headings and cells in a table Create cells that span multiple.
CIS234A- Lecture 7 Instructor Greg D’Andrea. Tables A table can be displayed on a Web page either in a text or graphical format. A text table: – contains.
Lesson 3-1 Example Example 2 Find the sum of 311 and 452 using expanded form. 1.Write the first number in expanded form
FramesLayout & Image View Pages FrameLayout is a ViewGroup that divides the screen into blocks of area each of which is supposed to holds a single.
HW#9 Clues CSCI 571 Fall, HW#9 Prototype
1 Android Development Lean and mean introduction Based on a presentation by Mihail L. Sichitiu.
CS378 - Mobile Computing User Interface Basics. User Interface Elements View – Control – ViewGroup Layout Widget (Compound Control) Many pre built Views.
Building User Interfaces Basic Applications
BUILDING A SIMPLE USER INTERFACE. In this lesson, you create a layout in XML that includes a text field and a button. In the next lesson, your app responds.
Web111a_chapt04.ppt HTM: Section 4 Tables Table Types Text table elements Easy to use Use fixed-font text (font family monospace) Andale Mono Courier Monaco.
Chapter 2 Building User Interfaces and Basic Applications.
Tutorial 5 Working with Web Tables. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Learn and Apply the structure of.
ANDROID LAYOUTS AND WIDGETS. Slide 2 Introduction Parts of the Android screen Sizing widgets and fonts Layouts and their characteristics Buttons, checkboxes.
Introduction to HTML.
Open Handset Alliance.
Mobile Software Development for Android - I397
Tutorial 5 Working with Tables and Columns
Android Widget Tutorial
Mobile Application Development Chapter 4 [Android Navigation and Interface Design] IT448-Fall 2017 IT448- Fall2017.
HNDIT2417 Mobile Application Development
CIS 470 Mobile App Development
Android Programming Lecture 3
Android Layout Basics Topics
CS5103 Software Engineering
Addition of Whole Numbers
Mobile Computing With Android ACST 4550 Android Layouts
CSC 581: Mobile App Development
Cascading Style Sheets™ (CSS)
CIS 470 Mobile App Development
Korea Software HRD Center
Building a Simple User Interface
Bootstrap 4 December 17, 2018.
CSS Layout: Flexbox.
CS 240 – Advanced Programming Concepts
Android Sensor Programming
Presentation transcript:

Lecture 2 b: Android Layout Basics Topics Review View Groups Using Layout weight to give you more control in a layout Namespaces Using the full device screen Lab2 Exercise 2 - Coffee Ordering App

ViewGroup Review A ViewGroup is a container for Views. The most common ViewGroups are LinearLayout, RelativeLayout, and ConstraintLayout. A ViewGroup has rules on how its child Views are positioned within it.

LinearLayout A LinearLayout uses orientation to arrange child views in a vertical column or a horizontal column.

RelativeLayout RelativeLayout positions child views relative to the parent. It is useful for positioning children relative to other children.

ConstraintLayout ConstraintLayout is similar to RelativeLayout in that Views are positioned relative to siblings or parent. Constraint layouts were introduced to solve flexible alignment issues in responsive layouts.

Namespaces  xmlns:android=http://schemas.android.com/apk/res/an droid is a namespace. Namespaces are give you access all the defined Android attributes and tags. Since the attributes and tags are attached to this namespace, an autocomplete list will occur when you type android:. Namespaces serve as a convenience.

Using the full device screen In most cases, apps are designed to occupy the entire screen of a given device. To do this, add a no action bar attribute/value to the <application> section within the AndroidManifest.xml file. <application . . android:theme="@style/Theme.AppCompat.Light.NoActionBar"> . </application>

Using Layout Weight Adding a layout weight provides more control in a layout. Layout_weight is an attribute that can be applied to Views within a LinearLayout. By default, all views have a weight of 0. Android will divide the available space up amongst the Views proportionately, depending on their weight values.

Example 1: The default weight is zero. Each view occupies the minimum amount of space it needs.

Example 2: layout_weight is applied to the first view element. The larger weight allows the first element to expand to fill the “remaining space” in the parent view.

Example 3: A weight of 1 is applied to all elements. It is required that we set the layout_height to “0dp”. Space is divided by the weight sum.

Lab 2 Exercise 2: Create the app. See the next slide for structure.

Lab 2 Ex 2 Structure