Cosc 5/4730 Support design library. Support Design library Adds (API 9+) back support to a number of 5.0 lollipop widgets and material design pieces –

Slides:



Advertisements
Similar presentations
AGENT TRAINING PowerPoint Basics. Goals: After today, you will be able to: Add new slides Add new slides Apply design templates Apply design templates.
Advertisements

 User Interface - Raeha Sandalwala.  Introduction to UI  Layouts  UI Controls  Menus and ‘Toasts’  Notifications  Other interesting UIs ◦ ListView.
Cosc 5/4730 Android Navigation: Menus, ActionBar/ToolBar, and Navigation Drawer.
Hello world Follow steps under the sections “Create an AVD” and “Create a New Android Project” at
Cosc 5/4730 Material Design Spec’s and Toolbar.. Material Design First and for most, Material Design is a spec used by android to have app look similar.
Cosc 5/4730 Blackberry and Android: Menus. BLACKBERRY.
Android Form Elements. Views Provide common UI functionality Form elements: text area, button, radio button, checkbox, dropdown list, etc. Date and time.
Cosc 4730 Android TabActivity and ListView. TabActivity A TabActivity allows for multiple “tabs”. – Each Tab is it’s own activity and the “root” activity.
Android Development (Basics)
Presenting Lists of Data. Lists of Data Issues involved – unknown number of elements – allowing the user to scroll Data sources – most common ArrayList.
Android Application Development 2013 PClassic Chris Murphy 1.
Android development the first app. Andoid vs iOS which is better? Short answer: neither Proponents on both sides For an iOS side, see this article on.
1 Mobile Computing Monetizing An App Copyright 2014 by Janson Industries.
Hello world Follow steps under the sections “Create an AVD” and “Create a New Android Project” at
Chapter 5 Creating User Interfaces GOALS and OBJECTIVES Begin our application by creating our user interface. More than one way to create a user interface.
Microsoft Word 2007 Getting Started. Menus These features below contain many of the functions that were in the menu of previous versions of Word. –The.
CS378 - Mobile Computing More UI - Part 2. Special Menus Two special application menus – options menu – context menu Options menu replaced by action bar.
Cosc 5/4730 Android App Widgets. App Widgets App Widgets are miniature application views that can be embedded in other applications (such as the Home.
Create Navigation Drawer Team 2 Zhong Wang Jiaming Dong Philip Wu Lingduo Kong.
Programming Mobile Applications with Android September, Albacete, Spain Jesus Martínez-Gómez.
User Interfaces: Part 1 (View Groups and Layouts).
Cosc 5/4730 Dialogs and below 3.0 and above (fragment)
Cosc 4730 Android Fragments. Fragments You can think of a fragment as a modular section of an activity, which has its own lifecycle, receives its own.
ANDROID – DRAWING IMAGES – SIMPLE EXAMPLE IN INTERFACE AND EVENT HANDLING L. Grewe.
User Interface Android Club Agenda Button OnClickListener OnLongClickListener ToggleButton Checkbox RatingBar AutoCompleteTextView.
 Each tab is geared towards a certain activity area.
Copyright © Curt Hill More Components Varying the input of Dev-C++ Windows Programs.
Android Using Menus Notes are based on: The Busy Coder's Guide to Android Development by Mark L. Murphy Copyright © CommonsWare, LLC. ISBN:
Video Games list lab 6  At the end of this lab you will be expected to know:  What Views, View Groups, Layouts, and Widgets are and how they relate to.
Mobile Programming Lecture 7 Dialogs, Menus, and SharedPreferences.
HW#9 Clues CSCI 571 Fall, HW#9 Prototype
Copyright© Jeffrey Jongko, Ateneo de Manila University Deconstructing HelloWorld.
ListView and ExpandableListView
Pearson Webcast Series
CS378 - Mobile Computing More UI - Part 2. Special Menus Two special application menus – options menu – context menu Options menu replaced by action bar.
User Interface Layout Interaction. EventsEvent Handlers/Listeners Interacting with a user.
Android View Stuff. TextViews Display text Display images???
Cosc 5/4735 YouTube API. YouTube The YouTube Android Player API enables you to incorporate video playback functionality into your Android applications.
VB.NET and Databases. ADO.NET VB.Net allows you many ways to connect to a database. The technology used to interact with a database or data source is.
Cosc 4735 Collapsing Toolbar Support Pallette. Collapsing toolbar. Using a ScrollingView like listview, Recyclerview, or a NestedScrollView – Mostly done.
Cosc 4735 Activities, fragments, callbacks/listeners/interfaces.
PowerPoint Lesson 1. Viewing Presentations Projector on screen Television monitor Broadcasting live over Internet Publishing to web server for future.
ANDROID LAYOUTS AND WIDGETS. Slide 2 Introduction Parts of the Android screen Sizing widgets and fonts Layouts and their characteristics Buttons, checkboxes.
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
Resources. Android Resources We’ve already talked about the different types of Android Resources DirectoryResource Type anim/XML files that define tween.
Cosc 5/4730 RecyclerView And more..
CS240: Advanced Programming Concepts
GUI Programming Fundamentals
Android – Event Handling
Android Widgets 1 7 August 2018
Mobile Application Development Chapter 4 [Android Navigation and Interface Design] IT448-Fall 2017 IT448- Fall2017.
ITEC535 – Mobile Programming
Politeknik Elektronika Negeri Surabaya
Review 2: Material Design and key widgets.
CS323 Android Model-View-Controller Architecture
Depreciation App: Demo of tabs
CIS 470 Mobile App Development
Android Support Libraries A brief explanation.
BMI Android Application will take weight and height from the users to calculate Body Mass Index (BMI) with the information, whether user is underweight,
Android Developer Fundamentals V2
Android Developer Fundamentals V2 Lesson 4
CIS 470 Mobile App Development
Android Developer Fundamentals V2
Android Project Structure, App Resources and Event Handling
Adding Components to Activity
CMPE419 Mobile Application Development
Cosc 5/4730 EmojiCompat library..
Android Sensor Programming
Android Sensor Programming
Presentation transcript:

Cosc 5/4730 Support design library

Support Design library Adds (API 9+) back support to a number of 5.0 lollipop widgets and material design pieces – You’ll find a navigation drawer view, floating labels for editing text, a floating action button, snackbar, tabs, and a motion and scroll framework to tie them together. – A note, as of this writing, v broke somethings in Navigation drawer view which worked in The example code has comments to explain it.

Support Design library Using it – Add to the build.gradle (module file) – In the dependencies compile 'com.android.support:design:23.0.0‘ Sync/compile and now it ready to use in your app.

SnackBar Similar to a toast shown on the bottom of the screen and contain text with an optional single action. – Like a toast, they automatically time out after the given time length by animating off the screen. In addition, users can swipe them away before the timeout.

SnackBar code Simple version Snackbar.make(myView, "Hi there?", Snackbar.LENGTH_LONG) //or SHORT.show(); With the response button Snackbar.make(myView, "Hi there?", Snackbar.LENGTH_LONG) //or SHORT.setAction("Undo?", SBonClickListener) //this line is optional..show(); Where SBonClickListener is a standard OnClicklistener View.OnClickListener SBonClickListener = new View.OnClickListener(){ public void onClick (View v){ Toast.makeText(getActivity(),"You clicked undo", Toast.LENGTH_LONG).show(); } }; myView is first layout for the screen.

floating action button The FAB is a round button, instead of the traditional square button. – It’s normally colored with the accent color (from Material design) and a symbol – It also has an elevation (shadow) as well, so it doesn’t look flat on the app.

floating action button code Xml <android.support.design.widget.FloatingActio nButton android:layout_width="wrap_content" android:layout_height="wrap_content" app:fabSize="mini" /> Note app, needs xmlns:app=“ apk/res-auto” at the top. fabSize="normal" for bigger size. The java code is just like a normal widget: myView.findViewById( R.id.fab1).setOnClickListener (new View.OnClickListener() public void onClick(View v) { … } });

TextInputLayout it will display the hint even after the user starts typing and allows you to set an error message as well. The layout wraps around an editText. – Uses standard listener – In the onTextChanged Use setError(msg) – Display an for error setError(“”) – To clear the error.

TextInputLayout Xml <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="abc" android:singleLine="true" /> Java code mTextInputLayout = (TextInputLayout) findViewById(R.id.textinput02); et2 = (EditText) findViewById(R.id.edittext02); et2.addTextChangedListener(new TextWatcher() { public void onTextChanged(CharSequence s, int start, int before, int count) { if (!s.toString().equals("abc")) { set the error message that will display below the edittext mTextInputLayout.setError("Incorrect input."); } else { clear the error message. mTextInputLayout.setError(""); }

Motion with snackbars. The idea to move things out of the way, while a snackbar is displayed, so that it doesn’t obscure things. An example with the FAB – Which is to be placed at the buttom right. We wrap everything with a CoordinatorLayout

CoordinatorLayout Xml Normal layout stuff, that stays still … rest of the layout code. Stuff to move, in this case the FAB For the snackbar, where it wants the layout, we provide it the coorindatorlayout mCoordinatorLayout = (CoordinatorLayout) myView.findViewById(R.id.coordinatorlayout1); Now the layout uses the coordinatorlayout, so they coordinate the snackbar. Snackbar.make(mCoordinatorLayout, "Did the FAB move?", Snackbar.LENGTH_LONG).setAction("Yes?", SBonClickListener).show();

Support NavigationView For the DrawerLayout, you can use a “menu” to the drawer instead of creating a listview or fragment. <android.support.design.widget.NavigationView android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start"

NavigationView xml Xml <item android:checked="true" <item … Layout for the header is a linearlayout with a textview.

NavigationView Java code mNavigationView = (NavigationView) findViewById(R.id.navview); setup a listener, which acts very similar to how menus are handled. mNavigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() public boolean onNavigationItemSelected(MenuItem menuItem) { we could just as easily call onOptionsItemSelected and how it deal with it. use return onOptionsItemSelected(menuItem); int id = menuItem.getItemId(); if (id == R.id.navigation_item_1) { … return true; //we dealt with it. mDrawerlayout.closeDrawers(); //close the drawer layout } Return false; //we did not deal with it. });

Example code All the examples previous slides are in supportdesignDemo – In the Material design directory of the UI repo.

Support.TabLayout The support TabLayout will give you tabs (see left) – Uses a tab selected listener, you can change the information, fragment, page in a viewpager. can be used in place of a pageTabStrip on viewpager Examples below use viewpager – Left uses a pagetabstrip and right a tablayout.

Collapsing toolbar. Using a listview or Recyclerview – Mostly done with xml with a coordinatorlayout and a AppBarLayout. Plus more. supportDesign3 has the code – And dling-Scrolls-with-CoordinatorLayout maybe helpful as well. dling-Scrolls-with-CoordinatorLayout this will be left for advanced Mobile Apps

References was used to create the animated pictures (gif) developers.blogspot.com/2015/05/android- design-support-library.html developers.blogspot.com/2015/05/android- design-support-library.html

Q A &