android - Implement NYTimes-like section "Up" navigation -
the new york times android app offers section navigation using spinner in action bar. user starts out on "top news", , if navigate section, content area replaced , left-pointing arrow "up" navigation added action bar logo. no matter how many sections switch between, if hit arrow-ed logo, go "top news". , if go "top news" using action bar spinner instead of arrow-ed logo, logo loses arrow appropriately. (standard functionality.)
my initial approach adapting put section content (a listview) in fragment, , replace fragment inside activity whenever user changes sections. content replacement works beautifully, haven't been able implement "up" navigation, , haven't found resources doing fragments.
i'm wondering how should design this. see 3 major approaches:
continue have sections part of 1 activity using fragments content replacement. implement "up" navigation using method (what?) haven't been able engineer or find.
give each section own activity, , launch new intent whenever user opens new 1 action bar's spinner. force new intent's action bar's spinner reflect activity's section on load.
same #2, give "top news" equivalent own activity rather variant of section activity. perhaps make more sense since app launches onto "top news", , want top level navigation.
or maybe there's better approach haven't thought of. design advice , links relevant resources (especially resources sample code or code advice, i'll take can get) appreciated.
the ny times app has functionality in 1 activity , uses view pages navigate between different views. in order conserve memory , allow support low performance devices, uses scroll view signal when element should loaded memory via custom mvc framework.
this in place 2011-2012.
how know? wrote it. :)
Comments
Post a Comment