use of android.widget.ExpandableListView in project AnExplorer by 1hakr.
the class RootsFragment method onCreateView.
@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;
}
use of android.widget.ExpandableListView in project ultrasonic by ultrasonic.
the class PullToRefreshExpandableListView method createRefreshableView.
@Override
protected ExpandableListView createRefreshableView(Context context, AttributeSet attrs) {
final ExpandableListView lv;
if (VERSION.SDK_INT >= VERSION_CODES.GINGERBREAD) {
lv = new InternalExpandableListViewSDK9(context, attrs);
} else {
lv = new InternalExpandableListView(context, attrs);
}
// Set it to this so it can be used in ListActivity/ListFragment
lv.setId(android.R.id.list);
return lv;
}
use of android.widget.ExpandableListView in project iNaturalistAndroid by inaturalist.
the class PullToRefreshExpandableListView method createRefreshableView.
@Override
protected ExpandableListView createRefreshableView(Context context, AttributeSet attrs) {
final ExpandableListView lv;
if (VERSION.SDK_INT >= VERSION_CODES.GINGERBREAD) {
lv = new InternalExpandableListViewSDK9(context, attrs);
} else {
lv = new InternalExpandableListView(context, attrs);
}
// Set it to this so it can be used in ListActivity/ListFragment
lv.setId(android.R.id.list);
return lv;
}
use of android.widget.ExpandableListView in project Osmand by osmandapp.
the class OsmandExpandableListFragment method onCreateView.
@Override
public View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, Bundle savedInstanceState) {
View v = createView(inflater, container);
listView = (ExpandableListView) v.findViewById(android.R.id.list);
listView.setOnChildClickListener(this);
if (this.adapter != null) {
listView.setAdapter(this.adapter);
}
return v;
}
use of android.widget.ExpandableListView in project BloodHub by kazijehangir.
the class FaqFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// Inflate the layout for this fragment
View rootView = (View) inflater.inflate(R.layout.fragment_faq, container, false);
expandableListView = (ExpandableListView) rootView.findViewById(R.id.expandableListView);
fillData();
listAdapter = new myExpListAdapter(getActivity(), faq, topics);
expandableListView.setAdapter(listAdapter);
final Activity activity = getActivity();
expandableListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
@Override
public boolean onChildClick(ExpandableListView expandableListView, View view, int i, int i1, long l) {
Toast.makeText(activity, faq.get(i) + ": " + topics.get(faq.get(i)).get(i1), Toast.LENGTH_LONG).show();
return false;
}
});
return rootView;
}
Aggregations