Mobile Application Development BSCS-7 Lecture # 13

Slides:



Advertisements
Similar presentations
Samsung Smart TV is a web-based application running on an application engine installed on digital TVs connected to the Internet.
Advertisements

Cascading Style Sheets
Chapter 3: Engage! Android User Input, Variables, and Operations
Ch. 5 Web Page Design – Templates and Style Sheets Mr. Ursone.
Styles and Themes. Tell me about this XML snippet
Cascading Style Sheets Controlling the Display Of Web Content.
Cascading Style Sheets Controlling the Display Of Web Content.
Customizing Outlook. Forms Window in which you enter and view information in Outlook Outlook Form Designer The environment in which you create and customize.
4.01 Cascading Style Sheets
1 Chapter 20 — Creating Web Projects Microsoft Visual Basic.NET, Introduction to Programming.
Tutorial 3: Adding and Formatting Text. 2 Objectives Session 3.1 Type text into a page Copy text from a document and paste it into a page Check for spelling.
Introduction to Android Programming Content Basic environmental structure Building a simple app Debugging.
Working with Namespaces Combining XML Vocabularies in a Compound Document.
WORKING WITH NAMESPACES
Introducing the Sudoku Example
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
XP Tutorial 7New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks.
Chapter 3 Dreamweaver: Part I The Web Warrior Guide to Web Design Technologies.
Creating an Expression Web Site
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
INTRODUCTION TO HTML5 CSS Styles. Understanding Style Sheets  HTML5 enables you to define many different types of content on a web page, including headings,
Chapter 10: Move! Creating Animation
Cascading Style Sheets. Defines the presentation of one or more web pages Similar to a template Can control the appearance of an entire web site giving.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 4 1 Microsoft Office FrontPage 2003 Tutorial 4 – Using Shared Borders and Themes.
Basic Android Tutorial USF’s Association for Computing Machinery.
Intro to Dreamweaver Web Design Section 7-1 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I” Course.
XP Dreamweaver 8.0 Tutorial 3 1 Adding Text and Formatting Text with CSS Styles.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
 2004 Prentice Hall, Inc. All rights reserved. 1 Chapter 34 - Case Study: Active Server Pages and XML Outline 34.1 Introduction 34.2 Setup and Message.
Engage! Android User Input, Variables,
Css. Definition Cascading style sheet (CSS)  It is a simple mechanism for adding style (e.g. fonts, colors, spacing) to Web documents.
Creating an Example Android App in Android Studio Activity lifecycle & UI Resources.
XP New Perspectives on XML, 2nd Edition Tutorial 2 1 TUTORIAL 2 WORKING WITH NAMESPACES.
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.
Themes and Menus: The Sudoku Example Content taken from book: “Hello, Android” by Ed Burnette Third Edition.
1 Tutorial 12 Working with Namespaces Combining XML Vocabularies in a Compound Document.
First Venture into the Android World Chapter 1 Part 2.
CSE 409 – Advanced Internet Technology Today you will learn  Styles  Themes  Master Pages Themes and Master Pages.
Tutorial 3 Adding and Formatting Text with CSS Styles.
Cascading Style Sheets CSS. Source W3Schools
Working with Multiple Activities. Slide 2 Introduction Working with multiple activities Creating multiple views Introduction to intents Passing data to.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
1 Android Development Lean and mean introduction Based on a presentation by Mihail L. Sichitiu.
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.
NASRULLAHIBA.  It is time to take your web designing skills to the next level with Cascading Style Sheets (CSS). They are a way to control the look and.
More App Customizations. Overview  Application/ Activity Customizations: Themes  Menu Customizations  Custom Dialogs  Custom Toasts  Custom Buttons.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 10: Move! Creating Animation 1 Android.
What is CSS? A set of style rules that tell the web browser how to present a web page or document. – In earlier versions of HTML, style characteristics,
INTRODUCTION TO ANDROID. Slide 2 Introduction I take a top-down approach to describing an application’s anatomy.
CSS Introductions. Objectives To take control of the appearance of a Web site by creating style sheets. To use a style sheet to give all the pages of.
Working with Cascading Style Sheets
Android Application Development 1 6 May 2018
4.01 Cascading Style Sheets
WORKING WITH NAMESPACES
Intro to Dreamweaver Web Design Section 8-1
Cascading Style Sheets
ASP.NET Web Controls.
MAD.
Mobile Application Development Chapter 4 [Android Navigation and Interface Design] IT448-Fall 2017 IT448- Fall2017.
Politeknik Elektronika Negeri Surabaya
Building User Interfaces Basic Applications
Working with Text and Cascading Style Sheets
Using Cascading Style Sheets (CSS)
Microsoft PowerPoint 2007 – Unit 2
Using Templates and Library Items
4.01 Cascading Style Sheets
5.00 Apply procedures to organize content by using Dreamweaver. (22%)
CMPE212 – Reminders Assignment 5, a JavaFX GUI, due next Friday.
Microsoft Office Illustrated Fundamentals
Presentation transcript:

Mobile Application Development BSCS-7 Lecture # 13

QUIZ  For Solid 5 Marks Create an app in android (Java) which register the user account in xampp server having following fields: userID UserName Password PWHint

Assignment  For Solid 5 Marks Create an app in android which uses GridView and load 20 different countries maps and their names. Due date: coming Wednesday

Styles and Themes Style is a collection of properties that specify look and format for a View or window. Style can specify properties such as height, padding, font color, font size, background color, and much more. Style is defined in an XML resource that is separate from XML that specifies layout. Styles in Android share a similar philosophy to CSS in web design—they allow you to separate design from content. For example, by using a style, you can take this layout XML. will turn into this: Note: The style attribute does not use the android: namespace prefix. <TextView     android:layout_width="fill_parent"     android:layout_height="wrap_content"     android:textColor="#00FF00"     android:typeface="monospace"     android:text="@string/hello" /> <TextView     style="@style/CodeFont"     android:text="@string/hello" />

Styles and Themes  Defining Styles To create a set of styles, save an XML file in res/values/ directory of your project. Name of XML file is arbitrary, but it must use .xml extension and be saved in res/values/ folder. Root node of XML file must be <resources> For each style you want to create, add a <style> element to file with a name that uniquely identifies style (this attribute is required). Add <item> element for each property of that style, with a name that declares style property and a value to go with it (this attribute is required). Its value depends on style property. Each child of <resources> element is converted into an application resource object at compile-time, which can be referenced by the value in <style> element's name attribute. <?xml version="1.0" encoding="utf-8"?> <resources>     <style name="CodeFont" parent="@android:style/TextAppearance.Medium">         <item name="android:layout_width">fill_parent</item>         <item name="android:layout_height">wrap_content</item>         <item name="android:textColor">#00FF00</item>         <item name="android:typeface">monospace</item>     </style> </resources>

Styles and Themes  Inheritance Parent attribute in <style> element is optional and specifies resource ID of another style from which this style should inherit properties. You can then override inherited style properties if you want. Another way is, just prefix name of style you want to inherit to name of your new style, separated by a period. You can reference this new style as @style/CodeFont.Red. You can continue inheriting like this as many times as you'd like, by chaining names with periods. If you apply a style to a View that does not support all of style properties, the View will apply only those properties that are supported and simply ignore others. <style name="GreenText" parent="@android:style/TextAppearance">         <item name="android:textColor">#00FF00</item> </style> <style name="CodeFont.Red">         <item name="android:textColor">#FF0000</item> </style> <style name="CodeFont.Red.Big">         <item name="android:textSize">30sp</item> </style>

Styles and Themes  Applying to UI To an individual View, by adding style attribute to a View element in XML for your layout. Or, to an entire Activity or application, by adding android:theme attribute to <activity> or <application> element in Android manifest. However, you can apply a style so that it applies to all View elements—by applying style as a theme. Some style properties, however, are not supported by any View element and can only be applied as a theme. These style properties apply to entire window and not to any type of View. For example, style properties for a theme can hide application title, hide status bar, or change window's background. These kind of style properties do not belong to any View object. To discover these theme-only style properties, look at R.attr reference from internet for attributes that begin with window. Apply a theme to an Activity or application To set a theme for all activities of your application, open AndroidManifest.xml file and edit <application> tag to include android:theme attribute with style name. If you want a theme applied to just one Activity in your application, then add android:theme attribute to <activity> tag instead. <application android:theme="@style/CustomTheme">

Styles and Themes  Applying to UI Just as Android provides other built-in resources, there are many pre-defined themes that you can use, to avoid writing them yourself. For example, you can use the Dialog theme and make your Activity appear like a dialog box. Or if you want the background to be transparent, use the Translucent theme. If you like a theme, but want to tweak it, just add the theme as the parent of your custom theme. <activity android:theme="@android:style/Theme.Dialog"> <activity android:theme="@android:style/Theme.Translucent"> <color name="custom_theme_color">#b0b0ff</color> <style name="CustomTheme" parent="android:Theme.Light">     <item name="android:windowBackground">@color/custom_theme_color</item>     <item name="android:colorBackground">@color/custom_theme_color</item> </style> Styles and Themes  Using Platform Styles and Themes Android platform provides a large collection of styles and themes that you can use in your applications. You can find a reference of all available styles in the R.style class from internet. To use the styles listed here, replace all underscores in the style name with a period. For example, you can apply the Theme_NoTitleBar theme with "@android:style/Theme.NoTitleBar"

Styles and Themes  Select a theme based on platform version Newer versions of Android have additional themes available to applications, and you might want to use these while running on those platforms while still being compatible with older versions. You can accomplish this through a custom theme that uses resource selection to switch between different parent themes, based on the platform version. For example, here is declaration for a custom theme which is simply standard platforms default light theme. It would go in an XML file under res/values (typically res/values/styles.xml): To have this theme use newer holographic theme when application is running on Android 3.0 (API Level 11) or higher, you can place an alternative declaration for theme in an XML file in res/values- v11, but make parent theme holographic theme: Now use this theme like you would any other, and your application will automatically switch to holographic theme if running on Android 3.0 or higher. A list of standard attributes that you can use in themes can be found at R.styleable.Theme. <style name="LightThemeSelector" parent="android:Theme.Light">     ... </style> <style name="LightThemeSelector" parent="android:Theme.Holo.Light">     ... </style>