Java Code Examples for android.widget.ExpandableListView.getFlatListPosition()

The following are Jave code examples for showing how to use getFlatListPosition() of the android.widget.ExpandableListView class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: easyfilemanager   File: RootsFragment.java   View Source Code Vote up 6 votes
@Override
public boolean onChildClick(ExpandableListView parent, View v, int groupPosition,
                            int childPosition, long id) {
    final BaseActivity activity = BaseActivity.get(RootsFragment.this);
    final Item item = (Item) mAdapter.getChild(groupPosition, childPosition);
    if (item instanceof RootItem) {
            int index = parent.getFlatListPosition(ExpandableListView.getPackedPositionForChild(groupPosition, childPosition));
        parent.setItemChecked(index, true);
        activity.onRootPicked(((RootItem) item).root, true);
        Bundle params = new Bundle();
        params.putString("type", ((RootItem) item).root.title);
        AnalyticsManager.logEvent("navigate", ((RootItem) item).root, params);
    } else if (item instanceof AppItem) {
        activity.onAppPicked(((AppItem) item).info);
    } else {
        throw new IllegalStateException("Unknown root: " + item);
    }
    return false;
}
 
Example 2
Project: FireFiles   File: RootsFragment.java   View Source Code Vote up 6 votes
@Override
public boolean onChildClick(ExpandableListView parent, View v, int groupPosition,
                            int childPosition, long id) {
    final BaseActivity activity = BaseActivity.get(RootsFragment.this);
    final Item item = (Item) mAdapter.getChild(groupPosition, childPosition);
    if (item instanceof RootItem) {
            int index = parent.getFlatListPosition(ExpandableListView.getPackedPositionForChild(groupPosition, childPosition));
        parent.setItemChecked(index, true);
        activity.onRootPicked(((RootItem) item).root, true);
        Bundle params = new Bundle();
        params.putString("type", ((RootItem) item).root.title);
        AnalyticsManager.logEvent("navigate", ((RootItem) item).root, params);
    } else if (item instanceof AppItem) {
        activity.onAppPicked(((AppItem) item).info);
    } else {
        throw new IllegalStateException("Unknown root: " + item);
    }
    return false;
}
 
Example 3
Project: simple-share-android   File: RootsFragment.java   View Source Code Vote up 6 votes
@Override
public boolean onChildClick(ExpandableListView parent, View v, int groupPosition,
                            int childPosition, long id) {
    final BaseActivity activity = BaseActivity.get(RootsFragment.this);
    final Item item = (Item) mAdapter.getChild(groupPosition, childPosition);
    if (item instanceof RootItem) {
            int index = parent.getFlatListPosition(ExpandableListView.getPackedPositionForChild(groupPosition, childPosition));
        parent.setItemChecked(index, true);
        activity.onRootPicked(((RootItem) item).root, true);
        Bundle params = new Bundle();
        params.putString("type", ((RootItem) item).root.title);
        AnalyticsManager.logEvent("navigate", ((RootItem) item).root, params);
    } else if (item instanceof AppItem) {
        activity.onAppPicked(((AppItem) item).info);
    } else {
        throw new IllegalStateException("Unknown root: " + item);
    }
    return false;
}