More App Customizations. Overview  Application/ Activity Customizations: Themes  Menu Customizations  Custom Dialogs  Custom Toasts  Custom Buttons.

Slides:



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

1 Web Site Design Overview of the Internet Cookie Setton.
Web Design with Cascading Style Sheet Lan Vu. Overview Introduction to CSS Designing CSS Using Visual Studio to create CSS Using template for web design.
Ch. 5 Web Page Design – Templates and Style Sheets Mr. Ursone.
Styles and Themes. Tell me about this XML snippet
 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.
Notifications & Alarms.  Notifications  Alarms.
Introducing Cascading Style Sheets  Cascading Style Sheet Basics  Creating Styles  Using Styles  Manipulating Styles  Text Formatting with CSS.
By: Jeremy Smith.  Introduction  Droid Draw  Add XML file  Layouts  LinearLayout  RelativeLayout  Objects  Notifications  Toast  Status Bar.
3.2 Presentation Software End Show Creating slide shows including audio,video and digital images End Show.
Cosc 4730 Android TabActivity and ListView. TabActivity A TabActivity allows for multiple “tabs”. – Each Tab is it’s own activity and the “root” activity.
User Interface Design using jQuery Mobile CIS 136 Building Mobile Apps 1.
Custom Views, Drawing, Styles, Themes, ViewProperties, Animations, oh my!
© 2010 Delmar, Cengage Learning Chapter 7 Using Styles and Style Sheets for Design.
Process Maps “101” An introduction to QAD.NET UI’s Process Maps Stacy Green, BravePoint MWUG Mar 2013.
Different ways to implement CSS. There are four different ways to use CSS in your web pages: – Inline CSS – Embedded CSS/Internal CSS – Linked CSS/External.
Chapter 3 Working with Text and Cascading Style Sheets.
Chapter 3 Dreamweaver: Part I The Web Warrior Guide to Web Design Technologies.
Cascading Style Sheets (CSS) 1.  What is CSS?  Why CSS?  How to write a CSS? 2.
Chapter 9: Customize! Navigating with Tabs on a Tablet App.
© Ms. Masihi.  The Dreamweaver Welcome Screen first opens when you start Dreamweaver.  This screen gives you quick access to previously opened files,
Favorite Twitter® Searches App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
XP Dreamweaver 8.0 Tutorial 3 1 Adding Text and Formatting Text with CSS Styles.
1 Announcements Homework #2 due Feb 7 at 1:30pm Submit the entire Eclipse project in Blackboard Please fill out the when2meets when your Project Manager.
Mobile Computing Lecture#11 Adapters and Dialogs.
1/29/ Android Programming: FrameLayout By Dr. Ramji M. Makwana Professor and Head, Computer Engineering Department A.D. Patel.
Android Dialog Boxes AlertDialog - Toast
Productivity Programs Common Features and Commands.
SpotOn Game App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
Android Boot Camp for Developers Using Java, 3E
Css. Definition Cascading style sheet (CSS)  It is a simple mechanism for adding style (e.g. fonts, colors, spacing) to Web documents.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Key Applications Module Lesson 20 — Enhancing Presentations with Multimedia Effects Computer Literacy BASICS.
Use CSS to Implement a Reusable Design Selecting a Dreamweaver CSS Starter Layout is the easiest way to create a page with a CSS layout You can access.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Introducing Cascading Style Sheets. Cascading Style Sheet Basics  Cascading Style Sheet Basics  Creating Styles  Using Styles  Manipulating Styles.
Copyright© Jeffrey Jongko, Ateneo de Manila University Custom ListAdapters.
So far, we have looked at CSS selectors that correlate with HTML tags Now, we’ll see how you can define your own selectors using class and ID selectors.
Welcome to PowerPoint for Beginners In-Tech Training Elementary School Teachers Day 2 January 13 and 14, 2003.
Tutorial 3 Adding and Formatting Text with CSS Styles.
Styles, Dialog Boxes, and Menus. Styles Allow creation of a common format – placed in res/values/styles.xml – file name is incidental Can be applied.
User Interface Design using jQuery Mobile CIS 136 Building Mobile Apps 1.
Copyright© Jeffrey Jongko, Ateneo de Manila University Deconstructing HelloWorld.
Word 2003 The Word Screen. Word 2003 Screen File Menu –Holds the options for creating a new document, opening a document, saving a document, printing.
CMPF114 Computer Literacy Chapter 3 The Visual Basic Environment 1.
CHAPTER 4 CREATING STYLES AND LAYOUTS WITH CSS. CHAPTER OBJECTIVES Create ID-based styles Position content with CSS Format text with CSS Identify CSS.
CS378 - Mobile Computing More UI - Part 2. Special Menus Two special application menus – options menu – context menu Options menu replaced by action bar.
Computer Literacy for IC 3 Unit 2: Using Productivity Software Chapter 9: Creating a Presentation © 2010 Pearson Education, Inc. | Publishing as Prentice.
Microsoft FrontPage 2003 Illustrated Complete Working on the Web Site’s Hyperlinks and Appearance.
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
HTML-I Basic HTML Elements. HTML (Hyper Text Markup Language) HTML is a document layout and hyperlink- specification language. i.e. a language used to.
Customizing Menus and Toolbars CHAPTER 12 Customizing Menus and Toolbars.
Flag Quiz Game App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
XP New Perspectives on Macromedia Dreamweaver MX 2004 Tutorial 5 1 Adding Shared Site Elements.
Lec 02 Activities Activity Lifecycle Multiple Activities Views Menus and Dialogs.
CHAPTER 4 Fragments ActionBar Menus. Explore how to build applications that use an ActionBar and Fragments Understand the Fragment lifecycle Learn to.
Creating Web Pages in Word. Sharing Office Files Online Many Web pages are created using the HTML programming language. Web page editors are software.
Menus. Menus are a common user interface component in many types of applications. The options menu is the primary collection of menu items for an activity.
Lab7 – Appendix.
CS499 – Mobile Application Development
Android Widgets 1 7 August 2018
Lists, Thumbnails, and Icons
Politeknik Elektronika Negeri Surabaya
Mobile Application Development BSCS-7 Lecture # 13
Android Programming Lecture 6
Using Cascading Style Sheets (CSS)
Presentation transcript:

More App Customizations

Overview  Application/ Activity Customizations: Themes  Menu Customizations  Custom Dialogs  Custom Toasts  Custom Buttons  Custom ListView

Themes

Recap: Styles  Styles are collections of properties used in Views  Styles, however, are targetted.  They only affect the View specified even a Layout which could have multiple Views inside it will not pass the style values to these

Theme  Styles can be applied globally across a whole application by styling an Application or Activity  Used in this way a style is called a theme  Styling an Activity will affect all Views in the activity  Styling an Application will affect all Activities and Views in those activities  Themes can also contain properties that are not usable by Views

Theme-specific properties  Some style properties, however, are not supported by any View elements and can only be applied as part of a theme.  These style properties apply to the entire window and not to any type of View.  For example, style properties for a theme can hide the application title, hide the status bar, or change the window's background.  android:windowNoTitle  android:windowFullscreen  android:windowBackground

Example  more windowXXX attributes can be found in file:///C:/android-sdk- windows/docs/reference/android/R.attr fill_parent wrap_content #00FF00 monospace

Example  If you want the theme applied only to a specific activity add the android:theme attribute to the tag instead <application <activity android:name=".AppCustomizationActivity"

Menu Customization

Custom Menus  Options menus options can have icons associated to them  Context menus cannot take icons

Custom Menu via XML  Adding icons to options menus is easy simply add an android:icon attribute with the image id

Custom Toasts

 Toasts do not have to look like plain text on black  They can be fully customized like an Activity  Simply define a layout using the GraphicalEditor or XML  Attach this to the Toast

Example  Save this as toast_layout.xml

Example LayoutInflater inflater = getLayoutInflater(); View layout = inflater.inflate(R.layout.toast_layout, (ViewGroup) findViewById(R.id.toast_layout_root)); ImageView image = (ImageView) layout.findViewById(R.id.image); image.setImageResource(R.drawable.android); TextView text = (TextView) layout.findViewById(R.id.text); text.setText("Hello! This is a custom toast!"); Toast toast = new Toast(getApplicationContext()); toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0); toast.setDuration(Toast.LENGTH_LONG); toast.setView(layout); toast.show();  Load the layout and initialize the views  Create a Toast  Attach the layout to a Toast and provide other initializations  show()

Note  Do not use the public constructor for a Toast unless you are going to define the layout with setView(View).setView(View)  If you do not have a custom layout to use, you must use makeText(Context, int, int) to create the Toast as beforemakeText(Context, int, int)

Custom Dialogs

 Generally AlertDialog is all you will need for most Dialog requirements  If you can get away with AlertDialog use it  If AlertDialog does not provide what you need, it is possible to define your own Dialog layout  The process is similar to defining an Activity layout

Example

Example  Create the Dialog object manually and initialize using the layout specified  Note: this code would be part of showDialog(int i) as one of the cases Context mContext = getApplicationContext(); Dialog dialog = new Dialog(mContext); dialog.setContentView(R.layout.custom_dialog); dialog.setTitle("Custom Dialog"); TextView text = (TextView) dialog.findViewById(R.id.text); text.setText("Hello, this is a custom dialog!"); ImageView image = (ImageView) dialog.findViewById(R.id.image); image.setImageResource(R.drawable.android);

Special widget customization

Specific widget customization  Many widgets have specific customization options  E.g. Buttons  Icons  Animated (hover image change)  Background image

Button customization  To change the look of a button is done via XML and supplying replacement images for the button  Requires defining a selector resource and passing this as the button’s background  The selector defines the different button states and how it will look in each state

Example <item android:state_enabled="false" /> <item android:state_pressed="true" android:state_enabled="true" /> <item android:state_focused="true" android:state_enabled="true" /> <item android:state_enabled="true" />

Example <Button android:text="Button" android:layout_width="wrap_content" android:layout_height="wrap_content">

ListView customization  ListView customization works similar to Button customization  Define a selector with the different selection states  For more information:  iew-item-background-via-custom-selector iew-item-background-via-custom-selector