CS 240 – Advanced Programming Concepts

Slides:



Advertisements
Similar presentations
Android UserInterfaces Nasrullah Niazi. overView All user interface elements in an Android app are built using View and ViewGroup objects. A View is an.
Advertisements

Intermediate Level Course. Text Format The text styles, bold, italics, underlining, superscript and subscript, can be easily added to selected text. Text.
Filip Debelić What is it? Android is a mobile operating system (OS) based on the Linux kernel and currently developed by Google Android,
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.
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.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Introduction to Android (Part.
PROG Mobile Java Application Development PROG Mobile Java Application Development Developing Android Apps: Components & Layout.
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.
Aligning the data in cells By default, Excel aligns text entries on the left margin of the cell (left justification) and aligns numeric entries on the.
Domain 3 Understanding the Adobe Dreamweaver CS5 Interface.
Programming with Android: Layouts, Widgets and Events Luca Bedogni Marco Di Felice Dipartimento di Scienze dell’Informazione Università di Bologna.
User Interfaces: Part 1 (View Groups and Layouts).
Application Development for mobile Devices
Presented By: Muhammad Tariq Software Engineer Android Training course.
Copyright© Jeffrey Jongko, Ateneo de Manila University Basic Views and Layouts.
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.
Android Development: Basic Widgets Richard S. Stansbury 2015.
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.
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.
Building User Interfaces and Basic Applications Chapter 2 1.
CHAPTER 4 Fragments ActionBar Menus. Explore how to build applications that use an ActionBar and Fragments Understand the Fragment lifecycle Learn to.
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.
Android Fundamentals. What is Android Software stack for mobile devices Software stack for mobile devices SDK provides tools and APIs to develop apps.
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
Open Handset Alliance.
Mobile Software Development for Android - I397
Android Basic XML Layouts
Android 9: Layouts Kirk Scott.
Creation of an Android App By Keith Lynn
Mobile Application Development Chapter 4 [Android Navigation and Interface Design] IT448-Fall 2017 IT448- Fall2017.
HNDIT2417 Mobile Application Development
Chap 7. Building Java Graphical User Interfaces
CS371m - Mobile Computing User Interface Basics.
CIS 470 Mobile App Development
Android Layout Basics Topics
CS371m - Mobile Computing User Interface Basics.
CS5103 Software Engineering
Lecture 2 b: Android Layout Basics Topics
CMPE419 Mobile Application Development
Mobile Computing With Android ACST 4550 Android Layouts
Android Studio Constraint Layout
Building User Interfaces Basic Applications
Android Developer Fundamentals V2
Android Developer Fundamentals V2
CIS 470 Mobile App Development
CMPE419 Mobile Application Development
Korea Software HRD Center
CMPE419 Mobile Application Development
Mobile Programmming Dr. Mohsin Ali Memon.
User Interface Screen Elements
CS 240 – Advanced Programming Concepts
User Interface Development
Android Sensor Programming
User Interface Development
Presentation transcript:

CS 240 – Advanced Programming Concepts Views and ViewGroups CS 240 – Advanced Programming Concepts

Views and ViewGroups View = Widget = Control ViewGroup = Container Examples: Button, Switch, Spinner, TextView, EditText ViewGroup = Container Views that contain other views Examples: LinearLayout, TableLayout, ScrollView Common Attributes id (i.e. android:id=“@+id/myViewId”) Layout_width, layout_height Values: match_parent, wrap_content, 16dp

Views (Attributes and Listeners) TextView (text labels) text, textAppearance .setClickable(boolean) – make clickable .setOnClickListener(View.OnClickListener) EditText (text fields) inputType .addTextChangedListener(TextWatcher) Button text ImageView (display image) .setImageDrawable(IconDrawable) – set icon to display

Views (Attributes and Listeners) Switch (on/off) .setChecked(boolean) – set check state .setOnCheckedChangeListener(CompoundButton.OnCheckedChangeListener) Spinner (dropdown list) entries or .setAdapter(ArrayAdapter) – specify list values .setSelection(int) – specify selected item onItemSelectedListener(AdapterView.OnItemSelectedListener) SearchView queryHint – Background text displayed when the field is empty iconifiedByDefault – Display the field or just an icon until clicked .setIconified(boolean) – make always visible .setOnQueryTextListener(SearchView.OnQueryTextListener) Space (blank space) set layout_width and layout_height to specific values (e.g., 30dp)

Advanced Views (covered later) RecyclerView Dynamic list of items ExpandableListView MapView

View Groups ScrollView LinearLayout FrameLayout Wraps around any one View to make it scrollable The one View can be a ViewGroup/layout Example: GridLayoutExampleWithScrollView LinearLayout orientation: vertical or horizontal Example: GeoQuiz/QuizActivity FrameLayout Used as a placeholder for dynamically created fragments Example: FragmentExample

View Groups: TableLayout Contains multiple TableRow objects and/or other layouts Columns determined by row with most views Useful Attributes: gravity Attribute of any widget Use to position the widget in it’s column Example: android:gravity=“end” will right justify the widget in it’s column stretchColumns Attribute of the TableLayout Specify which if any column should take up empty space Example: android:stretchColumns="3” (4th column will take space) layout_span Attribute of a widget inside a TableRow Specify that the widget should span multiple columns Example: android:layout_span="3” (declaring item will span 3 columns) Example: TableLayoutExample

View Groups: GridLayout Very similar to TableLayout No need to use TableRow or any other indicator of rows Specify columns with columnCount attribute Grid filled row-by-row from left to right Useful Attributes: columnCount Attribute of GridLayout layout_gravity (use layout_gravity, instead of gravity) Attribute of any widget Use to position the widget in it’s column(s) or row(s) Example: android:layout_gravity=“end” will right justify the widget in it’s column or columns Example: android:layout_gravity=“fill-horizontal” will fill the entire column or columns if using layout_columnSpan layout_columnSpan Use to span multiple columns Example: android:layout_columnSpan="3” (declaring item will span 3 columns) layout_rowSpan Attribute of and widget Use to span multiple rows Example: android:layout_rowSpan=”2” (declaring item will span 2 rows) Example: GridLayoutExample

View Groups: ConstraintLayout Allows you to connect views to their parents and to each other in design or text view Designed to allow visual layout in the design view Useful Attributes: layout_constraint*_to*Of (substitute Top, Bottom, Right or Left for *) Attribute of any widget Use to position the widget in it’s parent or relative to another View Example: app:layout_constraintTop_toTopOf="parent” Layout_margin* Use to put space between views or between a view and it’s parent Example: android:layout_marginBottom=“8dp” Example: ConstraintLayoutExample

View Groups: RelativeLayout Very similar to ConstraintLayout Not as easily manipulated visually in the design view, but takes fewer attributes to position the views Useful Attributes: layout_* (many substitutions for *) Attribute of any widget Use to position the widget in it’s parent or relative to another View Example: android:layout_centerInParent=”true” Example: android:layout_above=“@id/getVersionButton” Example: android:layout_centerHorizontal=“true” Layout_margin* Use to put space between Views or between a view and it’s parent Example: android:layout_marginBottom=“8dp” Example: RelativeLayoutExample

Family Map Client: Login Fragment How would you create this view? Does it need to scroll?

Family Map Client: Map Fragment How would you create this view? Does it need to scroll?

Family Map Client: Event Activity How would you create this view? Does it need to scroll?

Family Map Client: Person Activity How would you create this view? Does it need to scroll?

Family Map Client: Search Activity How would you create this view? Does it need to scroll?

Family Map Client: Filter Activity How would you create this view? Does it need to scroll?

Family Map Client: Settings Activity How would you create this view? Does it need to scroll?