SlideShare a Scribd company logo
1 of 50
Download to read offline
Supercharge

  Your UI
Dominik                                 Jonas
Helleberg                              Gehring
Mobile Development           Mobile Development
Android                                  Android
HTML5                                 JavaScript




dominik-helleberg.de/+   https://github.com/jjoe64
                            http://www.jjoe64.com
Design is
important




https://play.google.com/store/apps/details?id=com.outlook.Z7
This is what happens when you let developers create UI




http://www.codinghorror.com/blog/2006/11/this-is-what-happens-when-you-let-developers-create-ui.html
Stick with Holo

http://developer.android.com/design/index.html
Holo is designed by professional
designers and let you create
beautiful apps




https://play.google.com/store/apps/details?id=com.michaelpardo.quotes
Holo is designed by professional
designers and let you create
beautiful apps




https://play.google.com/store/apps/details?id=ch.teamtasks.tasks.paid
Don‘t customize it...
...unless you know what you‘re
doing




https://play.google.com/store/apps/details?id=sweesoft.prohome
How to use Holo




https://developer.android.com/design/building-blocks/index.html
Mind the Gap




https://developer.android.com/design/style/metrics-grids.html
How to use Holo - Grids

                          res/values/dimens.xml

<resources>

     <!-- Default screen margins,
           per the Android Design guidelines. -->

    <dimen name="activity_horizontal_margin">16dp</dimen>
    <dimen name="activity_vertical_margin">16dp</dimen>

    <dimen name=“ui_gap“>8dp</dimen>
    <dimen name=“element_height“>48dp</dimen>

</resources>



https://developer.android.com/design/style/metrics-grids.html
Theme.Holo

●   existiert seit API Level 11 (Honeycomb)
●   erst ab API Level 14 (ICS) garantiert unverändert durch OEM



Vorschlag
●   Ab Api Level 11 Theme.Holo verwenden (hell: Holo.Light)
●   Frühere Api Level verwenden Theme.Black. (hell: Theme)
Das richtige Theme zur Laufzeit automatisch auswählen


res/values/        res/values-v11/     res/values-v14/


     android:          android:           android:
   Theme.Black       Theme.Holo         Theme.Holo




                      android:
                   Theme.MyTheme
Das richtige Theme zur Laufzeit automatisch auswählen

                         res/values/themes.xml
<resources>
    <style name="Theme.MyTheme"
        parent="android:Theme.Black"></style>

   <style name="Theme.MyTheme.NoTitleBar"
       parent="android:Theme.Black.NoTitleBar"></style>

   <style name="Theme.MyTheme.Fullscreen"
       parent="android:Theme.Black.NoTitleBar.Fullscreen"></style>

   <style name="Theme.MyTheme.Light"
       parent="android:Theme"></style>

   <style name="Theme.MyTheme.Light.NoTitleBar"
       parent="android:Theme.NoTitleBar"></style>

    <style name="Theme.MyTheme.Light.NoTitleBar.Fullscreen"
        parent="android:Theme.NoTitleBar.Fullscreen"></style>
</resources>
Themes für Honeycomb                          res/values-v11/themes.xml


<resources>
    <style name="Theme.MyTheme"
        parent="android:Theme.Holo"></style>

    ...

   <!-- Bug: Theme.Holo.Light.NoActionBar is not public -->
   <style name="Theme.MyTheme.Light.NoTitleBar"
       parent="android:Theme.Holo.Light">
       <item name="android:windowActionBar">false</item>
       <item name="android:windowNoTitle">true</item>
   </style>

   <!-- Bug? Theme.Holo.Light.NoActionBar.Fullscreen has a titlebar -->
   <style name="Theme.MyTheme.Light.NoTitleBar.Fullscreen"
       parent="android:Theme.Holo.Light">
       <item name="android:windowActionBar">false</item>
       <item name="android:windowNoTitle">true</item>
       <item name="android:windowFullscreen">true</item>
       <item name="android:windowContentOverlay">@null</item>
   </style>
Themes für Ice Cream Sandwich

                        res/values-v14/themes.xml
<resources>
    <style name="Theme.MyTheme"
        parent="android:Theme.Holo"></style>

    <style name="Theme.MyTheme.NoTitleBar"
        parent="android:Theme.Holo.NoActionBar"></style>

    <style name="Theme.MyTheme.Fullscreen"
        parent="android:Theme.Holo.NoActionBar.Fullscreen"></style>

    <style name="Theme.MyTheme.Light"
        parent="android:Theme.Holo.Light"></style>

    <style name="Theme.MyTheme.Light.NoTitleBar"
        parent="android:Theme.Holo.Light.NoActionBar"></style>

    <style name="Theme.MyTheme.Light.Fullscreen"
        parent="android:Theme.Holo.Light.NoActionBar.Fullscreen"></style>

</resources>
Verschiedene Themes sind nun unter einem gemeinsamen
                  Namen ansprechbar.


                    Verwendung in der AndroidManifest.xml

<activity
            android:theme="@style/Theme.MyTheme.Light.NoTitleBar“
...
Colors


#33B5E5   #AA66CC   #99CC00   #FFBB33   #FF4444




#0099CC   #9933CC   #669900   #FF8800   #CC0000
Colors
                res/colors.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="light_blue">#33B5E5</color>
    <color name="dark_blue">#0099CC</color>
    <color name="light_purple">#AA66CC</color>
    <color name="dark_purple">#9933CC</color>
    <color name="light_green">#99CC00</color>
    <color name="dark_green">#669900</color>
    <color name="light_orange">#FFBB33</color>
    <color name="dark_orange">#FF8800</color>
    <color name="light_red">#FF4444</color>
    <color name="dark_red">#CC0000</color>
</resources>
Build Responsive




  302 Redirect to Juhani Lehtimäki

http://developer.android.com/training/basics/fragments/fragment-ui.html
Build with Holo Components




http://developer.android.com/design/patterns/actionbar.html
Since we use Holo... Life is good....
OEMS und Themes
WAAAAAAAAA




http://www.flickr.com/photos/fspugna/4507352674/
OEMS und Themes
Zusammenfassung
Befolgen der Design-Guidlines
   ● Verwenden der Standard-Widgets

   ● Verwenden der Standard-Patterns

   ● Verwenden des Standard-Themes

   ● Verwenden der Standard-Farbpalette

   ● Verwenden von Responsive Design Techniques


Gefahr
   ● Gestaltung der App hebt sich womöglich kaum ab


Wie differenzieren?
   ● Qualität

   ● Wir sorgen dafür, dass sich die App gut anfühlt
Was heißt gut anfühlen?


●   klare logische UI Struktur
●   Die App ist responsive und snappy
●   Animationen
●   Grafische Effekte, eigene Widgets (wo es
    sinnvoll ist)
Android Custom Views




http://mindtherobot.com/blog/272/android-custom-ui-making-a-vintage-thermometer/
https://github.com/harism/android_page_curl
Most Simple Custom View

public class ExampleView extends View {

    public ExampleView(Context context, AttributeSet attrs) {
      super(context, attrs);
    }

    @Override
    protected void onDraw(Canvas canvas) {
       canvas.drawColor(Color.RED);
    }
}
Einige wichtige Methoden
Touch Events
@Override
public boolean onTouchEvent(MotionEvent event)

Größenabhängige Berechnungen
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh)


Spezielle Anforderungen an die Abmessungen

@Override
protected void onMeasure(int widthMeasureSpec, int
heightMeasureSpec)
View Drawing

Canvas API                      Paint API
●   Formen (Linien, Ellipsen,   ●   Gradienten (Kreis und
    Rechtecke etc)                  Linear)
●   Text                        ●   Effekte (Blur,...)
●   Bitmaps                     ●   Farbfilter
●   Zeichenmatrix (Position,    ●   Vermessen von Text
    Größe, Drehung)             ●   Texteigenschaften
                                ●   Farbe, Muster, Dicke
                                    von Formen
keines Paint Beispiel

SimplePaintExample
Gradients

Sinnvoll einsetzen

LinearGradient

RadialGradient

Shader.TileMode
CLAMP, REPEAT,       MIRROR
Gradients
LinearGradient(float x0, float y0,
    float x1, float y1,
    int color0, int color1,
    Shader.TileMode tile)

LinearGradient(float x0, float y0,
   float x1, float y1, int[] colors,
   float[] positions, Shader.TileMode tile)
Custom ViewGroups




https://developer.android.com/design/patterns/index.html
Custom ViewGroups

einfache Möglichkeit um das Rendering von Child Views zu ändern:

setStaticTransformationsEnabled(true);

@Override
boolean getChildStaticTransformation(View child, Transformation t)


Statische Transformationen
     Alpha Wert
  ●
     Über das Matrix-Object
  ●
      ○ rotieren

      ○   positionieren
      ○   skalieren
      ○ "3D Blick"
 Beispiel: ExampleCustomViewGroup
ListView 3D

 ●   Custom ViewGroup
 ●   3D Effekt mit Canvas API
 ●   Bitmap Caching




MTCRichGraphics
Demo ViewPager3d
https://github.com/inovex/ViewPager3D




      ●   3D mit Canvas API
      ●   Animation
      ●   Multi Touch Handling
      ●   XML-Attribute
Animationen



 Animationen

                sollen

sinnvoll
                         sein
Animationen
Animation Framework:
                since 3.0

ObjectAnimator.ofFloat(myView, "alpha", 0f).start()

ValueAnimator anim = ValueAnimator.ofFloat(0f, 1f);
    anim.setDuration(500);
    anim.start();
Animation Framework:
                since 3.x
PropertyValuesHolder pvhX =
        PropertyValuesHolder.ofFloat("x", 50f);
PropertyValuesHolder pvhY =
        PropertyValuesHolder.ofFloat("y", 100f);
ObjectAnimator.ofPropertyValuesHolder(myView,
        pvhX, pvyY).start();

//since 3.1

myView.animate().x(50f).y(100f);
2.x ? NineOldAndroids

Usage


The API is exactly the same as the Honeycomb API, just change
your imports to use com.nineoldandroids.animation.*




http://nineoldandroids.com
ListViewAnimations



                 Mind the View-recycling!


            inspired by Chet Haase's Demo
http://graphics-geek.blogspot.de/2013/02/devbytes-listview-animations.html
ListViewAnimations
ab 4.1 -> view.setHasTransientState(true);

Alternative:
Custom Adapter
oder
ListViewAnimations-Lib von Niek Haarman
https://bitbucket.org/nhaarman/listviewanimations/
Demo

https://github.com/renard314/LEDView



         ●   Canvas API
         ●   Linear Gradients
         ●   Radial Gradients
         ●   BitmapShader
         ●   ColorFilter
         ●   Animation
         ●   XML-Attribute
         ●   Caching
Vermeide Canvas.drawText ()

   ●   Zeilenumbrüche
   ●   Zeilenabstände
   ●   Vermessen und Positionieren des Textes



Dafür gibt es Hilfsklassen!

   StaticLayout:              Mehrzeiliger Text der sich nicht ändert
   DynamicLayout: Mehrzeiliger Text der sich ändert
   BoringLayout:              Einzeiliger Text der sich nicht ändert

 Example: ExampleCanvasText
Tipps und Tricks

●   Bei beliebten Apps abgucken
●   onDraw leichtgewichtig lassen
●   invalide(Rect) statt invalide()
●   Bitmap Caching
●   nicht sinnlos malen
●   Advanced: Surface View
    ○   onDraw über eigenen Thread
Summary

Stick with Holo
Use defaults unless you're a designer
Use the techniques from design.android.com
OEM Themes DO suck
Add Custom Views / ViewGroups / Animations
 to differentiate, but do it right
DANKE!

More Related Content

Viewers also liked

Viewers also liked (11)

Why do we need more nerds?
Why do we need more nerds?Why do we need more nerds?
Why do we need more nerds?
 
Android Studio und gradle
Android Studio und gradleAndroid Studio und gradle
Android Studio und gradle
 
Android Development Tools
Android Development ToolsAndroid Development Tools
Android Development Tools
 
Embedded Android
Embedded AndroidEmbedded Android
Embedded Android
 
Android ActionBar Navigation reloaded
Android ActionBar Navigation reloadedAndroid ActionBar Navigation reloaded
Android ActionBar Navigation reloaded
 
Android Studio vs. ADT
Android Studio vs. ADTAndroid Studio vs. ADT
Android Studio vs. ADT
 
Android Development Tools
Android Development ToolsAndroid Development Tools
Android Development Tools
 
Renderscript in Android 3.x
Renderscript in Android 3.xRenderscript in Android 3.x
Renderscript in Android 3.x
 
Android Enterprise Integration
Android Enterprise IntegrationAndroid Enterprise Integration
Android Enterprise Integration
 
Core Android
Core AndroidCore Android
Core Android
 
Rich Graphics & OpenGL mit Android
Rich Graphics & OpenGL mit AndroidRich Graphics & OpenGL mit Android
Rich Graphics & OpenGL mit Android
 

Similar to Supercharge your ui

Supercharge your Android UI
Supercharge your Android UISupercharge your Android UI
Supercharge your Android UIinovex GmbH
 
Top Tips for Android UIs - Getting the Magic on Tablets
Top Tips for Android UIs - Getting the Magic on TabletsTop Tips for Android UIs - Getting the Magic on Tablets
Top Tips for Android UIs - Getting the Magic on TabletsMotorola Mobility - MOTODEV
 
Google I/O 2011, Android Honeycomb Highlights
Google I/O 2011, Android Honeycomb HighlightsGoogle I/O 2011, Android Honeycomb Highlights
Google I/O 2011, Android Honeycomb HighlightsRomain Guy
 
Android design and Custom views
Android design and Custom views Android design and Custom views
Android design and Custom views Lars Vogel
 
Android 2D Drawing and Animation Framework
Android 2D Drawing and Animation FrameworkAndroid 2D Drawing and Animation Framework
Android 2D Drawing and Animation FrameworkJussi Pohjolainen
 
Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101Fernando Gallego
 
Html 5 mobile - nitty gritty
Html 5 mobile - nitty grittyHtml 5 mobile - nitty gritty
Html 5 mobile - nitty grittyMario Noble
 
The Role of Python in SPAs (Single-Page Applications)
The Role of Python in SPAs (Single-Page Applications)The Role of Python in SPAs (Single-Page Applications)
The Role of Python in SPAs (Single-Page Applications)David Gibbons
 
Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016Doris Chen
 
Responsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesResponsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesVitaly Friedman
 
MOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app developmentMOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app developmentanistar sung
 
Google Developer Day 2010 - Prague - Styles in Android
Google Developer Day 2010 - Prague - Styles in AndroidGoogle Developer Day 2010 - Prague - Styles in Android
Google Developer Day 2010 - Prague - Styles in Androidpavelpetrek
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Ryan Price
 
GDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App EngineGDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App EngineYared Ayalew
 
Advanced Android Design Implementation
Advanced Android Design ImplementationAdvanced Android Design Implementation
Advanced Android Design ImplementationTack Mobile
 
Android Material Design APIs/Tips
Android Material Design APIs/TipsAndroid Material Design APIs/Tips
Android Material Design APIs/TipsKen Yee
 
Intro to @viewport & other new Responsive Web Design CSS features
Intro to @viewport & other new Responsive Web Design CSS featuresIntro to @viewport & other new Responsive Web Design CSS features
Intro to @viewport & other new Responsive Web Design CSS featuresAndreas Bovens
 

Similar to Supercharge your ui (20)

Day seven
Day sevenDay seven
Day seven
 
Supercharge your Android UI
Supercharge your Android UISupercharge your Android UI
Supercharge your Android UI
 
Top Tips for Android UIs - Getting the Magic on Tablets
Top Tips for Android UIs - Getting the Magic on TabletsTop Tips for Android UIs - Getting the Magic on Tablets
Top Tips for Android UIs - Getting the Magic on Tablets
 
Google I/O 2011, Android Honeycomb Highlights
Google I/O 2011, Android Honeycomb HighlightsGoogle I/O 2011, Android Honeycomb Highlights
Google I/O 2011, Android Honeycomb Highlights
 
Android design and Custom views
Android design and Custom views Android design and Custom views
Android design and Custom views
 
Android 2D Drawing and Animation Framework
Android 2D Drawing and Animation FrameworkAndroid 2D Drawing and Animation Framework
Android 2D Drawing and Animation Framework
 
Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101
 
Html 5 mobile - nitty gritty
Html 5 mobile - nitty grittyHtml 5 mobile - nitty gritty
Html 5 mobile - nitty gritty
 
The Role of Python in SPAs (Single-Page Applications)
The Role of Python in SPAs (Single-Page Applications)The Role of Python in SPAs (Single-Page Applications)
The Role of Python in SPAs (Single-Page Applications)
 
Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016
 
Android layouts
Android layoutsAndroid layouts
Android layouts
 
Responsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesResponsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and Techniques
 
MOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app developmentMOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app development
 
Google Developer Day 2010 - Prague - Styles in Android
Google Developer Day 2010 - Prague - Styles in AndroidGoogle Developer Day 2010 - Prague - Styles in Android
Google Developer Day 2010 - Prague - Styles in Android
 
HTML CSS & Javascript
HTML CSS & JavascriptHTML CSS & Javascript
HTML CSS & Javascript
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011
 
GDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App EngineGDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App Engine
 
Advanced Android Design Implementation
Advanced Android Design ImplementationAdvanced Android Design Implementation
Advanced Android Design Implementation
 
Android Material Design APIs/Tips
Android Material Design APIs/TipsAndroid Material Design APIs/Tips
Android Material Design APIs/Tips
 
Intro to @viewport & other new Responsive Web Design CSS features
Intro to @viewport & other new Responsive Web Design CSS featuresIntro to @viewport & other new Responsive Web Design CSS features
Intro to @viewport & other new Responsive Web Design CSS features
 

Recently uploaded

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 

Recently uploaded (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

Supercharge your ui

  • 2. Dominik Jonas Helleberg Gehring Mobile Development Mobile Development Android Android HTML5 JavaScript dominik-helleberg.de/+ https://github.com/jjoe64 http://www.jjoe64.com
  • 4. This is what happens when you let developers create UI http://www.codinghorror.com/blog/2006/11/this-is-what-happens-when-you-let-developers-create-ui.html
  • 6. Holo is designed by professional designers and let you create beautiful apps https://play.google.com/store/apps/details?id=com.michaelpardo.quotes
  • 7. Holo is designed by professional designers and let you create beautiful apps https://play.google.com/store/apps/details?id=ch.teamtasks.tasks.paid
  • 8. Don‘t customize it... ...unless you know what you‘re doing https://play.google.com/store/apps/details?id=sweesoft.prohome
  • 9. How to use Holo https://developer.android.com/design/building-blocks/index.html
  • 11. How to use Holo - Grids res/values/dimens.xml <resources> <!-- Default screen margins, per the Android Design guidelines. --> <dimen name="activity_horizontal_margin">16dp</dimen> <dimen name="activity_vertical_margin">16dp</dimen> <dimen name=“ui_gap“>8dp</dimen> <dimen name=“element_height“>48dp</dimen> </resources> https://developer.android.com/design/style/metrics-grids.html
  • 12. Theme.Holo ● existiert seit API Level 11 (Honeycomb) ● erst ab API Level 14 (ICS) garantiert unverändert durch OEM Vorschlag ● Ab Api Level 11 Theme.Holo verwenden (hell: Holo.Light) ● Frühere Api Level verwenden Theme.Black. (hell: Theme)
  • 13. Das richtige Theme zur Laufzeit automatisch auswählen res/values/ res/values-v11/ res/values-v14/ android: android: android: Theme.Black Theme.Holo Theme.Holo android: Theme.MyTheme
  • 14. Das richtige Theme zur Laufzeit automatisch auswählen res/values/themes.xml <resources> <style name="Theme.MyTheme" parent="android:Theme.Black"></style> <style name="Theme.MyTheme.NoTitleBar" parent="android:Theme.Black.NoTitleBar"></style> <style name="Theme.MyTheme.Fullscreen" parent="android:Theme.Black.NoTitleBar.Fullscreen"></style> <style name="Theme.MyTheme.Light" parent="android:Theme"></style> <style name="Theme.MyTheme.Light.NoTitleBar" parent="android:Theme.NoTitleBar"></style> <style name="Theme.MyTheme.Light.NoTitleBar.Fullscreen" parent="android:Theme.NoTitleBar.Fullscreen"></style> </resources>
  • 15. Themes für Honeycomb res/values-v11/themes.xml <resources> <style name="Theme.MyTheme" parent="android:Theme.Holo"></style> ... <!-- Bug: Theme.Holo.Light.NoActionBar is not public --> <style name="Theme.MyTheme.Light.NoTitleBar" parent="android:Theme.Holo.Light"> <item name="android:windowActionBar">false</item> <item name="android:windowNoTitle">true</item> </style> <!-- Bug? Theme.Holo.Light.NoActionBar.Fullscreen has a titlebar --> <style name="Theme.MyTheme.Light.NoTitleBar.Fullscreen" parent="android:Theme.Holo.Light"> <item name="android:windowActionBar">false</item> <item name="android:windowNoTitle">true</item> <item name="android:windowFullscreen">true</item> <item name="android:windowContentOverlay">@null</item> </style>
  • 16. Themes für Ice Cream Sandwich res/values-v14/themes.xml <resources> <style name="Theme.MyTheme" parent="android:Theme.Holo"></style> <style name="Theme.MyTheme.NoTitleBar" parent="android:Theme.Holo.NoActionBar"></style> <style name="Theme.MyTheme.Fullscreen" parent="android:Theme.Holo.NoActionBar.Fullscreen"></style> <style name="Theme.MyTheme.Light" parent="android:Theme.Holo.Light"></style> <style name="Theme.MyTheme.Light.NoTitleBar" parent="android:Theme.Holo.Light.NoActionBar"></style> <style name="Theme.MyTheme.Light.Fullscreen" parent="android:Theme.Holo.Light.NoActionBar.Fullscreen"></style> </resources>
  • 17. Verschiedene Themes sind nun unter einem gemeinsamen Namen ansprechbar. Verwendung in der AndroidManifest.xml <activity android:theme="@style/Theme.MyTheme.Light.NoTitleBar“ ...
  • 18. Colors #33B5E5 #AA66CC #99CC00 #FFBB33 #FF4444 #0099CC #9933CC #669900 #FF8800 #CC0000
  • 19. Colors res/colors.xml <?xml version="1.0" encoding="utf-8"?> <resources> <color name="light_blue">#33B5E5</color> <color name="dark_blue">#0099CC</color> <color name="light_purple">#AA66CC</color> <color name="dark_purple">#9933CC</color> <color name="light_green">#99CC00</color> <color name="dark_green">#669900</color> <color name="light_orange">#FFBB33</color> <color name="dark_orange">#FF8800</color> <color name="light_red">#FF4444</color> <color name="dark_red">#CC0000</color> </resources>
  • 20. Build Responsive 302 Redirect to Juhani Lehtimäki http://developer.android.com/training/basics/fragments/fragment-ui.html
  • 21. Build with Holo Components http://developer.android.com/design/patterns/actionbar.html
  • 22. Since we use Holo... Life is good....
  • 26. Zusammenfassung Befolgen der Design-Guidlines ● Verwenden der Standard-Widgets ● Verwenden der Standard-Patterns ● Verwenden des Standard-Themes ● Verwenden der Standard-Farbpalette ● Verwenden von Responsive Design Techniques Gefahr ● Gestaltung der App hebt sich womöglich kaum ab Wie differenzieren? ● Qualität ● Wir sorgen dafür, dass sich die App gut anfühlt
  • 27. Was heißt gut anfühlen? ● klare logische UI Struktur ● Die App ist responsive und snappy ● Animationen ● Grafische Effekte, eigene Widgets (wo es sinnvoll ist)
  • 29. Most Simple Custom View public class ExampleView extends View { public ExampleView(Context context, AttributeSet attrs) { super(context, attrs); } @Override protected void onDraw(Canvas canvas) { canvas.drawColor(Color.RED); } }
  • 30. Einige wichtige Methoden Touch Events @Override public boolean onTouchEvent(MotionEvent event) Größenabhängige Berechnungen @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) Spezielle Anforderungen an die Abmessungen @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
  • 31. View Drawing Canvas API Paint API ● Formen (Linien, Ellipsen, ● Gradienten (Kreis und Rechtecke etc) Linear) ● Text ● Effekte (Blur,...) ● Bitmaps ● Farbfilter ● Zeichenmatrix (Position, ● Vermessen von Text Größe, Drehung) ● Texteigenschaften ● Farbe, Muster, Dicke von Formen
  • 34. Gradients LinearGradient(float x0, float y0, float x1, float y1, int color0, int color1, Shader.TileMode tile) LinearGradient(float x0, float y0, float x1, float y1, int[] colors, float[] positions, Shader.TileMode tile)
  • 36. Custom ViewGroups einfache Möglichkeit um das Rendering von Child Views zu ändern: setStaticTransformationsEnabled(true); @Override boolean getChildStaticTransformation(View child, Transformation t) Statische Transformationen Alpha Wert ● Über das Matrix-Object ● ○ rotieren ○ positionieren ○ skalieren ○ "3D Blick" Beispiel: ExampleCustomViewGroup
  • 37. ListView 3D ● Custom ViewGroup ● 3D Effekt mit Canvas API ● Bitmap Caching MTCRichGraphics
  • 38. Demo ViewPager3d https://github.com/inovex/ViewPager3D ● 3D mit Canvas API ● Animation ● Multi Touch Handling ● XML-Attribute
  • 39. Animationen Animationen sollen sinnvoll sein
  • 41. Animation Framework: since 3.0 ObjectAnimator.ofFloat(myView, "alpha", 0f).start() ValueAnimator anim = ValueAnimator.ofFloat(0f, 1f); anim.setDuration(500); anim.start();
  • 42. Animation Framework: since 3.x PropertyValuesHolder pvhX = PropertyValuesHolder.ofFloat("x", 50f); PropertyValuesHolder pvhY = PropertyValuesHolder.ofFloat("y", 100f); ObjectAnimator.ofPropertyValuesHolder(myView, pvhX, pvyY).start(); //since 3.1 myView.animate().x(50f).y(100f);
  • 43. 2.x ? NineOldAndroids Usage The API is exactly the same as the Honeycomb API, just change your imports to use com.nineoldandroids.animation.* http://nineoldandroids.com
  • 44. ListViewAnimations Mind the View-recycling! inspired by Chet Haase's Demo http://graphics-geek.blogspot.de/2013/02/devbytes-listview-animations.html
  • 45. ListViewAnimations ab 4.1 -> view.setHasTransientState(true); Alternative: Custom Adapter oder ListViewAnimations-Lib von Niek Haarman https://bitbucket.org/nhaarman/listviewanimations/
  • 46. Demo https://github.com/renard314/LEDView ● Canvas API ● Linear Gradients ● Radial Gradients ● BitmapShader ● ColorFilter ● Animation ● XML-Attribute ● Caching
  • 47. Vermeide Canvas.drawText () ● Zeilenumbrüche ● Zeilenabstände ● Vermessen und Positionieren des Textes Dafür gibt es Hilfsklassen! StaticLayout: Mehrzeiliger Text der sich nicht ändert DynamicLayout: Mehrzeiliger Text der sich ändert BoringLayout: Einzeiliger Text der sich nicht ändert Example: ExampleCanvasText
  • 48. Tipps und Tricks ● Bei beliebten Apps abgucken ● onDraw leichtgewichtig lassen ● invalide(Rect) statt invalide() ● Bitmap Caching ● nicht sinnlos malen ● Advanced: Surface View ○ onDraw über eigenen Thread
  • 49. Summary Stick with Holo Use defaults unless you're a designer Use the techniques from design.android.com OEM Themes DO suck Add Custom Views / ViewGroups / Animations to differentiate, but do it right