Example usage for android.widget ExpandableListView setOnChildClickListener

List of usage examples for android.widget ExpandableListView setOnChildClickListener

Introduction

In this page you can find the example usage for android.widget ExpandableListView setOnChildClickListener.

Prototype

public void setOnChildClickListener(OnChildClickListener onChildClickListener) 

Source Link

Usage

From source file:org.uab.deic.uabdroid.fragments.SessionMaterialsFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    setListAdapter(mExpandableListAdapter);

    ExpandableListView expandableListView = getExpandableListView();
    expandableListView.setTextFilterEnabled(true);
    expandableListView.setOnChildClickListener(this);
    // Trick to avoid the "flicker" effect
    expandableListView.setCacheColorHint(0);

    getLoaderManager().initLoader(0, null, new MaterialsCursorLoaderCallback());
}

From source file:android.hawkencompanionapp.activities.UserAccountMainActivity.java

private void setupNavDrawer() {
    final ExpandableListView lv = (ExpandableListView) findViewById(R.id.nav_drawer_expandable_list_view);
    lv.setAdapter(new NavBarExpandableListAdapter(this, mNavBarCategoryList));
    lv.setOnChildClickListener(this);
}

From source file:com.chatwing.whitelabel.fragments.BaseExpandableListFragment.java

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    mProgressView = view.findViewById(R.id.progress_container);
    mContentView = view.findViewById(R.id.content_container);
    TextView emptyView = (TextView) view.findViewById(android.R.id.empty);
    ExpandableListView listView = (ExpandableListView) view.findViewById(android.R.id.list);
    mAdapter = constructAdapter();//from w w  w  . j a v  a 2  s.  co m

    emptyView.setText(getEmptyTextId());
    listView.setEmptyView(emptyView);
    listView.setOnChildClickListener(this);
    listView.setAdapter(mAdapter);
}

From source file:org.mifos.androidclient.main.CustomerDetailsActivity.java

private void setupAccountsListListeners(View view) {
    ExpandableListView list = (ExpandableListView) view.findViewById(R.id.customerAccounts_list);
    list.setOnChildClickListener(this);
}

From source file:dev.drsoran.moloko.fragments.base.MolokoExpandableListFragment.java

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    loaderImpl.onViewCreated(view, savedInstanceState);
    editImpl.onViewCreated(view, savedInstanceState);

    final ExpandableListView expandableListView = getExpandableListView();

    expandableListView.setOnGroupClickListener(this);
    expandableListView.setOnChildClickListener(this);
    expandableListView.setOnGroupCollapseListener(this);
    expandableListView.setOnGroupExpandListener(this);
}

From source file:org.alfresco.mobile.android.application.fragments.workflow.task.TaskFilterFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    setRetainInstance(true);/*from ww w .j a  v a2s. c  o m*/

    View rootView = inflater.inflate(R.layout.app_task_filters, container, false);

    setSession(SessionUtils.getSession(getActivity()));
    SessionUtils.checkSession(getActivity(), getSession());

    ExpandableListView expandableList = (ExpandableListView) rootView.findViewById(R.id.filters_list);
    expandableList.setGroupIndicator(null);
    expListAdapter = new TaskFilterExpandableAdapter(getActivity(), selectedItems);
    expandableList.setAdapter(expListAdapter);

    expandableList.setOnChildClickListener(new OnChildClickListener() {
        @Override
        public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition,
                long id) {
            expListAdapter.select(v, groupPosition, childPosition);
            return false;
        }
    });

    Button validate = UIUtils.initValidation(rootView, R.string.task_filter_view, true);
    validate.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            ListingContext lc = new ListingContext();
            ListingFilter lf = TasksHelper.createFilter(selectedItems.values());
            lc.setFilter(lf);
            TasksFragment.with(getActivity()).setListingContext(lc).display();
        }
    });

    return rootView;
}

From source file:com.kaproduction.malibilgiler.MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    coordinatorLayoutMainActivity = (CoordinatorLayout) findViewById(R.id.coordinatorLayoutMainActivity);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);//from   w  w  w . j av a  2 s  .  co m
    getSupportActionBar().setIcon(R.mipmap.ic_launcher1);

    DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
    ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar,
            R.string.navigation_drawer_open, R.string.navigation_drawer_close);
    drawer.setDrawerListener(toggle);
    toggle.syncState();
    //Deneme Yourum Yazildi......
    NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
    navigationView.setNavigationItemSelectedListener(this);

    expandableListView = (ExpandableListView) findViewById(R.id.exp_list);
    mCategory = ExpandableListViewData.getInfo();
    mlist = new ArrayList<String>(mCategory.keySet());
    adapter = new ExpandableListViewAdapter(this, mCategory, mlist);
    expandableListView.setAdapter(adapter);
    expandableListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
        @Override
        public boolean onChildClick(ExpandableListView expandableListView, View view, int parent, int child,
                long l) {
            String heading = (String) adapter.getGroup(parent);
            String message = (String) adapter.getChild(parent, child);
            alertDialog(heading, message);
            // Toast.makeText(getApplicationContext(), result, Toast.LENGTH_LONG).show();
            return true;
        }
    });
    expandableListView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
        @Override
        public boolean onItemLongClick(AdapterView<?> adapterView, View view, int position, long id) {
            if (ExpandableListView.getPackedPositionType(id) == ExpandableListView.PACKED_POSITION_TYPE_CHILD) {
                int groupPosition = ExpandableListView.getPackedPositionGroup(id);
                int childPosition = ExpandableListView.getPackedPositionChild(id);
                String text = (String) adapter.getChild(groupPosition, childPosition);
                String heading = (String) adapter.getGroup(groupPosition);
                alertDialogForClipboard(heading, text);
            }

            return true;
        }
    });

}

From source file:can.yrt.onebusaway.RouteInfoListFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    // We have a menu item to show in action bar.
    setHasOptionsMenu(true);//from  w w  w.j  a va2 s . c o  m
    registerForContextMenu(getListView());

    // Start out with a progress indicator.
    setListShown(false);

    // Initialize the expandable list
    ExpandableListView list = (ExpandableListView) getListView();
    list.setOnChildClickListener(mChildClick);

    // Get the route ID from the "uri" argument
    Uri uri = (Uri) getArguments().getParcelable(FragmentUtils.URI);
    if (uri == null) {
        Log.e(TAG, "No URI in arguments");
        return;
    }
    mRouteId = uri.getLastPathSegment();

    getLoaderManager().initLoader(ROUTE_INFO_LOADER, null, mRouteCallback);
    getLoaderManager().initLoader(ROUTE_STOPS_LOADER, null, mStopsCallback);
}

From source file:com.github.michalbednarski.intentslab.AppComponentsFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    FragmentActivity activity = getActivity();
    FrameLayout frameLayout = new FrameLayout(activity);
    FrameLayout.LayoutParams stretch = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
            FrameLayout.LayoutParams.MATCH_PARENT);
    FrameLayout.LayoutParams center = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT,
            FrameLayout.LayoutParams.WRAP_CONTENT, Gravity.CENTER);

    final ExpandableListView expandableListView = new ExpandableListView(activity);
    expandableListView.setAdapter(this);
    expandableListView.setOnChildClickListener(this);
    expandableListView.setLayoutParams(stretch);
    frameLayout.addView(expandableListView);

    final TextView emptyView = new TextView(activity);
    emptyView.setText(activity.getString(R.string.no_components));
    emptyView.setLayoutParams(center);// w  ww  .j  a  v  a 2 s .c  om
    frameLayout.addView(emptyView);

    expandableListView.setEmptyView(emptyView);

    return frameLayout;
}

From source file:ivl.android.moneybalance.ExpenseListActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    supportRequestWindowFeature(WindowCompat.FEATURE_ACTION_BAR);

    setContentView(R.layout.expense_list);

    Intent intent = getIntent();//from w w  w . ja  va 2s.  c o  m
    calculationId = intent.getLongExtra(PARAM_CALCULATION_ID, -1);

    ExpandableListView listView = (ExpandableListView) findViewById(R.id.expense_list);
    adapter = new ExpenseAdapter(this);
    listView.setAdapter(adapter);
    listView.setOnChildClickListener(this);
    registerForContextMenu(listView);
    setContentView(listView);

    refresh();
}