How to cleanly superpose ScrollableViews in Android

In order to implement a navigation bar ala Facebook I have the following layout configuration:

<FrameLayout
  android:layout_width="match_parent"
  android:layout_height="match_parent"
>
   <!-- This is the Lower Layer hosting the navbar -->
   <LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
   >
      <!-- ListView representing the navbar -->
      <ListView 
       />
   </LinearLayout>

   <!-- This is the Top Layer hosting the Content -->
   <FrameLayout 
      android:layout_width="match_parent"
      android:layout_height="match_parent"
   > 
      <!-- This is where the View of the Content will be injected -->
   </FrameLayout>
</FrameLayout>

So the basic idea is that when I want to open the navbar I just shift the TopLayer to the right and the navbar will be revealed. Now this works well and I can interact with the navbar's ListView in order to navigate through the application, as far as the view that gets injected inside the TopLayerisn't a ScrollableView(like another ListView, a ScrollViewor a WebView).

For instance, when the TopLayeris a WebViewinstance, I can't scroll and interact with the navbar's ListViewbecause it is the WebViewthat gets scrolled (althoough I shifted it to the right).

I guess it's not trivial to superpose many ScrollableView's but I hope there are hacks to overcome these issues.

Thanks for your help!

EDIT

By the way, this is how I am shifting the TopLayerview (using TranslateAnimation):

TranslateAnimation translateAnim = new TranslateAnimation(0.0F, mListView.getWidth(), 0.0F, 0.0F);
translateAnim.setDuration(..);
translateAnim.setFillAfter(true);
mTopLayerView.startAnimation(translateAnim);

Answers


According to my app - Android UI Patterns (https://play.google.com/store/apps/details?id=com.groidify.uipatterns), there are 2 sample implementations of Facebook navigation and animation, this is:

Can you take a try if it works.


Turns out the problem was not due to superposing ScrollableViews or anything but to the fact that when using TranslateAnimation the logical position (ie: not visual) of the animated view is still bound to its original position. Thus when I thought I was clicking on the navigation's item, I was in fact interacting with the ContentView that I thought has moved.

Now I am using ObjectAnimator which fixes this issue and it works very well. I only have to assure the compatibility with Pre-Honeycomb devices (I am thinking of using NineOldAndroids for this matter. If someones knows any other alternative to fix this properly using the old animation API, feel free to answer this question).


Need Your Help

CDH 4.1.1. Hive JDBC connection

jdbc hadoop hive cloudera

I have pretty strange problem. I do have an CDH 4.1.1 cluster with Cloudera manager free installed.

Advanced custom fields filtering with taxonomies

wordpress wordpress-plugin

I'm working with AdvancedCustomFields and Taxonomies, and I don't find, in the documentation, something that allows me to filter the Taxonomies by the values stored on the wp_options table.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.