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

The following are Jave code examples for showing how to use setChoiceMode() 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.
Example 1
Project: easyfilemanager   File: RootsFragment.java   Source Code and License Vote up 5 votes
@Override
public View onCreateView(
        LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    final View view = inflater.inflate(R.layout.fragment_roots, container, false);
    mList = (ExpandableListView) view.findViewById(android.R.id.list);
    mList.setOnChildClickListener(mItemListener);
    mList.setChoiceMode(ListView.CHOICE_MODE_SINGLE);

    DisplayMetrics metrics = new DisplayMetrics();
    getActivity().getWindowManager().getDefaultDisplay().getMetrics(metrics);
    int width = Utils.dpToPx(302);

    boolean rtl = Utils.isRTL();
    int leftPadding = rtl ? 10 : 50;
    int rightPadding = rtl ? 50 : 10;
    int leftWidth = width - Utils.dpToPx(leftPadding);
    int rightWidth = width - Utils.dpToPx(rightPadding);

    if(Utils.hasJellyBeanMR2()){
        mList.setIndicatorBoundsRelative(leftWidth, rightWidth);

    } else {
        mList.setIndicatorBounds(leftWidth, rightWidth);
    }
    return view;
}
 
Example 2
Project: FireFiles   File: RootsFragment.java   Source Code and License Vote up 5 votes
@Override
public View onCreateView(
        LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    final View view = inflater.inflate(R.layout.fragment_roots, container, false);
    mList = (ExpandableListView) view.findViewById(android.R.id.list);
    mList.setOnChildClickListener(mItemListener);
    mList.setChoiceMode(ListView.CHOICE_MODE_SINGLE);

    DisplayMetrics metrics = new DisplayMetrics();
    getActivity().getWindowManager().getDefaultDisplay().getMetrics(metrics);
    int width = Utils.dpToPx(302);

    boolean rtl = Utils.isRTL();
    int leftPadding = rtl ? 10 : 50;
    int rightPadding = rtl ? 50 : 10;
    int leftWidth = width - Utils.dpToPx(leftPadding);
    int rightWidth = width - Utils.dpToPx(rightPadding);

    if(Utils.hasJellyBeanMR2()){
        mList.setIndicatorBoundsRelative(leftWidth, rightWidth);

    } else {
        mList.setIndicatorBounds(leftWidth, rightWidth);
    }
    return view;
}
 
Example 3
Project: simple-share-android   File: RootsFragment.java   Source Code and License Vote up 5 votes
@Override
public View onCreateView(
        LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    final View view = inflater.inflate(R.layout.fragment_roots, container, false);
    mList = (ExpandableListView) view.findViewById(android.R.id.list);
    mList.setOnChildClickListener(mItemListener);
    mList.setChoiceMode(ListView.CHOICE_MODE_SINGLE);

    DisplayMetrics metrics = new DisplayMetrics();
    getActivity().getWindowManager().getDefaultDisplay().getMetrics(metrics);
    int width = Utils.dpToPx(302);

    boolean rtl = Utils.isRTL();
    int leftPadding = rtl ? 10 : 50;
    int rightPadding = rtl ? 50 : 10;
    int leftWidth = width - Utils.dpToPx(leftPadding);
    int rightWidth = width - Utils.dpToPx(rightPadding);

    if(Utils.hasJellyBeanMR2()){
        mList.setIndicatorBoundsRelative(leftWidth, rightWidth);

    } else {
        mList.setIndicatorBounds(leftWidth, rightWidth);
    }
    return view;
}