• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Droidcon2013 android experience lahoda
 

Droidcon2013 android experience lahoda

on

  • 511 views

 

Statistics

Views

Total Views
511
Views on SlideShare
379
Embed Views
132

Actions

Likes
1
Downloads
9
Comments
0

1 Embed 132

http://de.droidcon.com 132

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Droidcon2013 android experience lahoda Droidcon2013 android experience lahoda Presentation Transcript

    • IMPROVING ANDROID EXPERIENCE FORBOTH USERS AND DEVELOPERSdroidcon Berlin 2013, Pavel Lahoda,Actiwerks Ltd.
    • LET’S HAVE A LITTLE WARMUP
    • ANDROID.UTIL.LOG
    • HOW MANYTIMESYOU’VETYPEDTHIS ?
    • prn.log("Index=" + i);HOW ABOUTTHIS ?
    • public static String cc(int depth) { if(skipCallStackCode == true) { return NA; // short-circuit for production } StackTraceElement[] ste = getStackTrace(null); int depthCount = 0; boolean shallowFlag = true; for(StackTraceElement element : ste) { if(prn.class.getName().equals(element.getClassName()) == true) { // always ignore elements that are above this class in the stack shallowFlag = false; } else { if(shallowFlag == false) { if(depthCount >= depth) { String name = element.getFileName(); if(name != null) { if(name.endsWith(".java")) { name = name.substring(0, name.length()-5); } } else { name ="[?]"; } return name; } else { depthCount++; } } } } return NA_BUG; }HOW DOES IT WORK ?
    • GITHUB LINK
    • WHERE ISTHE UX ?
    • HAVE TIME TO WORK ON AWESOMESTUFF !
    • IMPORTANCE OF HAVINGYOUR VIEW FLEXIBLE
    • ANDROID AND WEB COMMON STUFFUNLIMITED AMOUNT OF DISPLAY SIZES
    • WEBTRENDS: RESPONSIVE DESIGN
    • ANDROIDTRENDS: LOTS OF WORK
    • CURRENT ANDROID LAYOUTS ARENOT FLEXIBLE ENOUGH
    • ALTERNATIVE:USE PURE JAVAVIEWGROUP
    • @Overrideprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {int widthSpecSize = View.MeasureSpec.getSize(widthMeasureSpec); tinyGap = widthSpecSize/100; myComponent.measure(View.MeasureSpec.makeMeasureSpec(LayoutParams.WRAP_CONTENT, View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(LayoutParams.WRAP_CONTENT, View.MeasureSpec.EXACTLY));// more component’s measuring goes there setMeasuredDimension(widthSpecSize, newHeight);}@Overrideprotected void onLayout(boolean changed, int l, int t, int r, int b) {myComponent.layout(x, y, x+myComponent.getMeasuredWidth(), y+titleLabel.getMeasuredHeight());// more component’s layout goes there}
    • ONMEASURE() - PLACE FORYOUR LOGIC
    • NO NEEDTO REBIND COMPONENTS ORCALL SLOW LAYOUT INFLATE CODE
    • WORKS GREAT FOR ORIENTATIONCHANGES
    • BBC NEWS FORTABLETS EXAMPLE
    • INSPIRATION:WEB RESPONSIVE LAYOUT
    • DEAL WITH MANY DIFFERENT SCREENSIZES
    • STANDOUT - FLOATING WINDOWS
    • ACTION BAR
    • ONE OF WORST EXAMPLESOF API DESIGN
    • ACTIONBAR IS NOT A DESCENDANT OFAVIEW
    • BLOG.PERPETUMDESIGN.COM/2011/08/STRANGE-CASE-OF-DR-ACTION-AND-MR-BAR.HTML
    • ACTIONBARSHERLOCK
    • ACTION BAR PLUS
    • PROBLEM ?
    • AB OCCUPIES ~10% OF SCREEN SPACE
    • FUNCTIONALITY OFTEN REDUCEDTOBRANDING
    • FLY-OUT MENU:A FACEBOOK SOLUTION
    • NOT CONSISTENT WITHTHE REST OFACTIONBAR FUNCTIONALITY
    • ACTIONBAR PARTS
    • ACTIONBAR BEHAVIORTouch here showsa menu with optionsTouch here moves up in hierarchyTouch here performs actionTouch here show a menu with optionsAny extension should stay consistent with this
    • DON’T CONFUSEYOUR USERS
    • OWN APPS’D USE SOME UX FACELIFT
    • STILL WANT MORE FROMTHEACTIONBAR AREA ?
    • ACTION BAR PLUSCUSTOM ACTIONBAR IMPLEMENTATION
    • EMBRACE EXTRA DIMENSION
    • TWOTYPES OF NAVIGATION
    • MAKE SURETHERE IS DEAD AREATOSEPARATE FROM NOTIFICATION BARGESTURE
    • USE MIDDLE AS BONUS CONTENT
    • SUCH AS STUFF OUTSIDETHE APP
    • 2D JUST ON OVERFLOWACTIONS ARE EITHERTOUCHOR SWIPE DOWN
    • ACCESSTO HELP ON ACTIONS
    • EMBRACE MULTITOUCH
    • EASY SPLITVIEW FEATURE
    • BROADCASTTHE AVAILABLE SCREENactiwerks.intent.splitviewDESCRIPTION OFTHE INTENT APPEARS SOON ONTHE OPENINTENTS.ORG
    • BROADCAST DETAILSprivate Intent splitIntent;splitIntent = new Intent();splitIntent.setAction("actiwerks.intent.splitview");splitIntent.removeExtra("APP_SPLIT_SIZE");splitIntent.putExtra("APP_SPLIT_SIZE", windowVerticalOffset);getContext().sendBroadcast(splitIntent);
    • RECEIVETHE BROADCAST<receiver android:name="AppSplitViewReceiver" ><intent-filter><action android:name="actiwerks.intent.splitview" /></intent-filter></receiver>public class AppSplitViewReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if(intent.getAction() != null &&intent.getAction().equals("actiwerks.intent.splitview")) { int peekSize = intent.getIntExtra("APP_SPLIT_SIZE", -1); // Handle the intent in the app, resize the window/layout accordingly } }}
    • ACTIONBARPLUS INTHE GITHUB
    • FUN WITHTHE LISTVIEW
    • PROBLEM ?
    • ARRAYADAPTER API NOT DESIGNEDFOR GENERICVIEWGROUP
    • interface ViewAdapterBinder<T, V> {public void bindViewToData(V view, T data);}public class ArrayViewGroupAdapter<T, V extends ViewGroup> extends ArrayAdapter<T>BIND DATATOVIEW
    • public View getView(int position, View convertView, ViewGroup parent){ // assign the view we are converting to a local variable V v = null; try { v = (V) convertView; } catch(ClassCastException ccex) {}// safe to ignore, keep null to force new instance to be created // first check to see if the view is null. if so, we have to inflate it. // to inflate it basically means to render, or show, the view. if (v == null) { v = getInstanceOfV(); } T data = getItem(position); if (data != null && binder != null) { binder.bindViewToData(v, data); } else { // signal error here prn.log("Cant bind data to view " + position); } // the view must be returned to our activity return v;}
    • private V getInstanceOfV() {ParameterizedType superClass = (ParameterizedType)getClass().getGenericSuperclass(); Class<V> type = (Class<V>) superClass.getActualTypeArguments()[1];try {return type.getDeclaredConstructor(Context.class).newInstance(getContext());} catch (Exception ex) {// Oops, no default constructorthrow new RuntimeException(ex);}}
    • public class SampleArrayAdapter extends ArrayViewGroupAdapter<SampleData, SampleListItem> { public SampleArrayAdapter(Context context) { super(context, new ArrayViewGroupAdapter.ViewAdapterBinder<SampleData, SampleListItem>() { @Override public void bindViewToData(SampleListItem view, SampleData data) { view.setTitle(data.getTitle()); view.setDetails(data.getDetails()); } }); }}
    • ATYPE-SAFE, REFACTORING FRIENDLYSOLUTION
    • ADVANTAGES FORTHE DEVELOPER ANDTHE USER
    • INSTANT LISTS WITH INTROSPECTION
    • OBJECTFORMS.COM
    • FLEXIBLE LAYOUT ALLOWS RESIZING
    • PINCHTO ZOOM GESTURE IN LISTS
    • TIME AND DATE PICKER
    • PROBLEM ?
    • UNLIKE OTHER WIDGETS,TIME & DATE PICKER NEEDS DIALOG(OR PLENTY OF SPACE)
    • SOLUTION:SPLIT EDITING INTO SPECIALIZEDTIME & DATE KEYBOARD
    • DIRECT MANIPULATION GESTURE
    • “KEYBOARD” FOR DATE SELECTION
    • NOTOUCH AT ALL
    • KINETIC GESTURES
    • SHAKE GESTURE- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event{if (motion == UIEventSubtypeMotionShake) {[self showAlert];}}//When a gesture is detected (and ended) the showAlert method is called.-(IBAction)showAlert{UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"ShakeGesture Demo"message:@"Shake detected"delegate:nilcancelButtonTitle:@"OK"otherButtonTitles:nil];[alertView show];}
    • AREATHAT IS NOT GETTINGTHE LOVEIT DESERVERS
    • TIM BRAY : SENSPLORE
    • SENSOR FUSIONhttp://www.youtube.com/watch?v=C7JQ7Rpwn2k
    • SAMSUNG GESTURES
    • HELP US SHAPETHE FUTUREhttp://www.kineticgestures.org
    • TAKEWAY
    • Q & A
    • THANKYOU
    • PAVEL LAHODAPAVEL@ACTIWERKS.COM@PERPETUMDESIGN