Tłumaczenie i adaptacja materiałów: dr Tomasz Xięski. Na podstawie prezentacji udostępnionych przez Victor Matos, Cleveland State University.

Similar documents
Android. YÉÇàá. Victor Matos Cleveland State University

Text Properties Data Validation Styles/Themes Material Design

Android Data Storage

Android UI: Overview

Notification mechanism

Designing Apps Using The WebView Control

Produced by. Mobile Application Development. Eamonn de Leastar David Drohan

Android Using Menus. Victor Matos Cleveland State University

Let s take a display of HTC Desire smartphone as an example. Screen size = 3.7 inches, resolution = 800x480 pixels.

Simple Currency Converter

Android App Development. Mr. Michaud ICE Programs Georgia Institute of Technology

Saving application preferences

Android Using Menus. Victor Matos Cleveland State University

Android HelloWorld - Example. Tushar B. Kute,

Programming with Android: Introduction. Layouts. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna

Figure 2.10 demonstrates the creation of a new project named Chapter2 using the wizard.

Agenda. Overview of Xamarin and Xamarin.Android Xamarin.Android fundamentals Creating a detail screen

Adaptation of materials: dr Tomasz Xięski. Based on presentations made available by Victor Matos, Cleveland State University.

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Managing Screen Orientation

COMP4521 EMBEDDED SYSTEMS SOFTWARE

ANDROID USER INTERFACE

Mobile Programming Lecture 1. Getting Started

Android Workshop: Model View Controller ( MVC):

Basic GUI elements - exercises

else if(rb2.ischecked()) {

Learn about Android Content Providers and SQLite

Mobile Application Development Lab [] Simple Android Application for Native Calculator. To develop a Simple Android Application for Native Calculator.

Thread. A Thread is a concurrent unit of execution. The thread has its own call stack for methods being invoked, their arguments and local variables.

Mobile Software Development for Android - I397

Introductory Android Development

CS 403X Mobile and Ubiquitous Computing Lecture 3: Introduction to Android Programming Emmanuel Agu

Introduction To Android

android:orientation="horizontal" android:layout_margintop="30dp"> <Button android:text="button2"

User Interface Development. CSE 5236: Mobile Application Development Instructor: Adam C. Champion Course Coordinator: Dr.

Action Bar. (c) 2010 Haim Michael. All Rights Reserv ed.

Android Basics. - Bhaumik Shukla Android Application STEALTH FLASH

Embedded Systems Programming - PA8001

Interaction with Android

CSE 660 Lab 3 Khoi Pham Thanh Ho April 19 th, 2015

Vienos veiklos būsena. Theory

Computer Science E-76 Building Mobile Applications

CS 528 Mobile and Ubiquitous Computing Lecture 2: Intro to Android Programming Emmanuel Agu

Topics of Discussion

Android Specifics. Jonathan Diehl (Informatik 10) Hendrik Thüs (Informatik 9)

CS 4330/5390: Mobile Application Development Exam 1

Android Beginners Workshop

Mobile Programming Lecture 2. Layouts, Widgets, Toasts, and Event Handling

Lecture 14. Android Application Development

Android UI Development

ITU- FAO- DOA- TRCSL. Training on. Innovation & Application Development for E- Agriculture. Shared Preferences

Programming Android UI. J. Serrat Software Design December 2017

Tutorials. Android. Programming. Version 2.9. Mark L. Murphy. for Android 2.2 COMMONSWARE

M.A.D ASSIGNMENT # 2 REHAN ASGHAR BSSE 15126

UI (User Interface) overview Supporting Multiple Screens Touch events and listeners

Intents. Your first app assignment

A Quick Intro to Coding Applications for Android Beginners, stop searching Google and start here.

App Development for Smart Devices. Lec #7: Audio, Video & Telephony Try It Out

EECS 4443 Mobile User Interfaces. More About Layouts. Scott MacKenzie. York University. Overview (Review)

Meniu. Create a project:

CS 528 Mobile and Ubiquitous Computing Lecture 2a: Android UI Design in XML + Examples. Emmanuel Agu

Adapter.

Agenda. The Android GUI Framework Introduction Anatomy A real word example Life cycle Findings

Embedded Systems Programming - PA8001

Diving into Android. By Jeroen Tietema. Jeroen Tietema,

Programming with Android: Layouts, Widgets and Events. Dipartimento di Scienze dell Informazione Università di Bologna

University of Stirling Computing Science Telecommunications Systems and Services CSCU9YH: Android Practical 1 Hello World

Android Services. Victor Matos Cleveland State University. Services

Programming with Android: Android for Tablets. Dipartimento di Scienze dell Informazione Università di Bologna

Android Application Model I

8/30/15 MOBILE COMPUTING. CSE 40814/60814 Fall How many of you. have implemented a command-line user interface?

TextView. A label is called a TextView. TextViews are typically used to display a caption TextViews are not editable, therefore they take no input

Mobile Programming Lecture 5. Composite Views, Activities, Intents and Filters

Android for Java Developers Dr. Markus Schmall, Jochen Hiller

EECS 4443 Mobile User Interfaces. More About Layouts. Scott MacKenzie. York University

Overview. What are layouts Creating and using layouts Common layouts and examples Layout parameters Types of views Event listeners

CS 4518 Mobile and Ubiquitous Computing Lecture 2: Introduction to Android Programming. Emmanuel Agu

Graphical User Interfaces

Arrays of Buttons. Inside Android

Getting Started. Dr. Miguel A. Labrador Department of Computer Science & Engineering

Real-Time Embedded Systems

Android Application Model I. CSE 5236: Mobile Application Development Instructor: Adam C. Champion, Ph.D. Course Coordinator: Dr.

Manifest.xml. Activity.java

Hybrid Apps Combining HTML5 + JAVASCRIPT + ANDROID

App Development for Smart Devices. Lec #18: Advanced Topics

Mobile Computing Practice # 2c Android Applications - Interface

Programming with Android: Introduction. Layouts. Luca Bedogni. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna

Applications. Marco Ronchetti Università degli Studi di Trento

Getting started: Installing IDE and SDK. Marco Ronchetti Università degli Studi di Trento

Preview from Notesale.co.uk Page 6 of 337

Our First Android Application

Xin Pan. CSCI Fall

Solving an Android Threading Problem

Creating a Custom ListView

Security model. Marco Ronchetti Università degli Studi di Trento

Basic UI elements: Android Buttons (Basics) Marco Ronchetti Università degli Studi di Trento

IPN-ESCOM Application Development for Mobile Devices. Extraordinary. A Web service, invoking the SOAP protocol, in an Android application.

Android UI DateBasics

Mobile Programming Lecture 3. Resources, Selection, Activities, Intents

Database Development In Android Applications

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Saving State

Transcription:

Czcionki

Tłumaczenie i adaptacja materiałów: dr Tomasz Xięski. Na podstawie prezentacji udostępnionych przez Victor Matos, Cleveland State University. Portions of this page are reproduced from work created and shared by Google and used according to terms

Ice Cream Sandwich introduced a new font type family named Roboto. The new font intents to provide a uniform touch to Android apps and display well on high-resolution screens. The current TextView framework supports regular, bold, italic, and bold italic weights by default. (this page is written with the Roboto Font) Reference: http://developer.android.com/design/style/typography.html 2

Default type colors The Android UI uses the following default text color styles: textcolorprimary and textcolorsecondary. For light themes use textcolorprimaryinverse and textcolorsecondaryinverse. Reference: http://developer.android.com/design/style/typography.html 3

Typographic Scale The Android framework a limited set of type sizes. Users can also select specific textsize in scale-independent pixels (sp). Reference: http://developer.android.com/design/style/typography.html 4

Android s typeface follows: attribute can be set using XML or code as 1. 2. XML clause Method android:typeface=.settypeface( ) clause, or Options are: sans: serif: monospaced: An m is wider than i, mmm iiii An m is wider than i, mmm iiii An mmm is not wider than iii 5

Also know as: Grotesque or Gothic Roman Type Source: http://en.wikipedia.org/wiki/serif 6

Developers may add any font to their application by following the next steps: 1. Create the /fonts folder in the /assets directory. 2. Copy any fonts you plan to use into the new folder (Look at c:\windows\font for your basic local collection). 3. Use Java code to bind the font with the UI widget wanting to display the custom typeface (see example). 7

Example: Getting ready to use the Jokerman.TTF font. Original font taken from c:\windows\fonts Example based on: The Busy Coder's Guide to Android Development by Mark L. Murphy Copyright 2008-2009 CommonsWare, LLC. ISBN: 978-0-9816780-0-9 8

Example: Display the Hello World! message using different fonts. Using the Roboto font Using the font: Jokerman.TTF Note: If you are using Windows look into the folder: c:\windows\fonts for fonts installed in your machine. 9

Example Application: Showing different FONT types. XML Layout: main.xml (1 of 5) Fonts <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:stretchcolumns="1" > <TableRow android:layout_width="fill_parent" android:orientation="horizontal" > 10

Example Application: Showing different FONT types. XML Layout: main.xml (2 of 5) Fonts <TextView android:layout_width="wrap_content" android:layout_marginright="24dp" android:background="#ff006666" android:text=" sans:" android:textcolor="@android:color/primary_text_dark" android:textsize="20sp" > </TextView> <TextView android:layout_width="wrap_content" android:text="hello, world!" android:textsize="20sp" android:typeface="sans" > </TextView> </TableRow> 11

Example Application: Showing different FONT types. XML Layout: main.xml (3 of 5) <TableRow android:layout_width="fill_parent" android:orientation="horizontal" > Fonts <TextView android:layout_width="wrap_content" android:layout_marginright="24dp" android:background="#ff006666" android:text=" serif:" android:textcolor="@android:color/primary_text_dark" android:textsize="20sp" > </TextView> <TextView android:layout_width="wrap_content" android:text="hello, world!" android:textsize="20sp" android:typeface="serif" > </TextView> </TableRow> 1212

Example Application: Showing different FONT types. XML Layout: main.xml (4 of 5) <TableRow android:layout_width="fill_parent" android:orientation="horizontal" > Fonts <TextView android:layout_width="wrap_content" android:layout_marginright="24dp" android:background="#ff006666" android:text=" monospace: " android:textcolor="@android:color/primary_text_dark" android:textsize="20sp" > </TextView> <TextView android:layout_width="wrap_content" android:text="hello, world!" android:textsize="20sp" android:typeface="monospace" > </TextView> </TableRow> 1313

Example Application: Showing different FONT types. XML Layout: main.xml (5 of 5) <TableRow android:layout_width="fill_parent" android:orientation="horizontal" > Fonts <TextView android:layout_width="wrap_content" android:layout_marginright="24dp" android:background="#ff006666" android:text=" custom:" android:textcolor="@android:color/primary_text_dark" android:textsize="20sp" > </TextView> <TextView android:id="@+id/custom" android:layout_width="wrap_content" android:text="hello, world!" android:textsize="20sp" > </TextView> </TableRow> </TableLayout> 1414

Example Application: Showing different FONT types. XML Layout: main.xml (5 of 5) Fonts public class AndroFontDemo extends Activity { @Override public void oncreate(bundle icicle) { super.oncreate(icicle); setcontentview(r.layout.main); // bind the "custom" TextView with chosen font TextView txtcustom=(textview)findviewbyid(r.id.custom); txtcustom.settypeface(typeface.sans_serif); }//class Typeface mynewface=typeface.createfromasset(getassets(), "fonts/jokerman.ttf"); txtcustom.settypeface(mynewface); }//oncreate 15

Questions? 16