Search in sources :

Example 46 with ExpandableListView

use of android.widget.ExpandableListView in project SmartAndroidSource by jaychou2012.

the class AbstractAQuery method expand.

public T expand(boolean expand) {
    if (view instanceof ExpandableListView) {
        ExpandableListView elv = (ExpandableListView) view;
        ExpandableListAdapter ela = elv.getExpandableListAdapter();
        if (ela != null) {
            int count = ela.getGroupCount();
            for (int i = 0; i < count; i++) {
                if (expand) {
                    elv.expandGroup(i);
                } else {
                    elv.collapseGroup(i);
                }
            }
        }
    }
    return self();
}
Also used : ExpandableListAdapter(android.widget.ExpandableListAdapter) ExpandableListView(android.widget.ExpandableListView) Paint(android.graphics.Paint)

Example 47 with ExpandableListView

use of android.widget.ExpandableListView in project SmartAndroidSource by jaychou2012.

the class AbstractAQuery method adapter.

/**
 * Set the adapter of an ExpandableListView.
 *
 * @param adapter adapter
 * @return self
 */
public T adapter(ExpandableListAdapter adapter) {
    if (view instanceof ExpandableListView) {
        ExpandableListView av = (ExpandableListView) view;
        av.setAdapter(adapter);
    }
    return self();
}
Also used : ExpandableListView(android.widget.ExpandableListView)

Example 48 with ExpandableListView

use of android.widget.ExpandableListView in project MVCHelper by LuckyJayce.

the class ListViewHandler method handleSetAdapter.

@Override
public boolean handleSetAdapter(View contentView, Object viewAdapter, ILoadMoreView loadMoreView, OnClickListener onClickLoadMoreListener) {
    final ListView listView = (ListView) contentView;
    boolean hasInit = false;
    if (loadMoreView != null) {
        loadMoreView.init(new ListViewFootViewAdder(listView), onClickLoadMoreListener);
        hasInit = true;
    }
    if (listView instanceof ExpandableListView) {
        ((ExpandableListView) listView).setAdapter((ExpandableListAdapter) viewAdapter);
    } else {
        listView.setAdapter((ListAdapter) viewAdapter);
    }
    return hasInit;
}
Also used : AbsListView(android.widget.AbsListView) ListView(android.widget.ListView) ExpandableListView(android.widget.ExpandableListView) ExpandableListView(android.widget.ExpandableListView)

Example 49 with ExpandableListView

use of android.widget.ExpandableListView in project AndroidDevMetrics by frogermcs.

the class ActivitiesMetricsFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.adm_fragment_activities_metrics, container, false);
    lvActivitiesMetrics = (ExpandableListView) view.findViewById(R.id.lvActivitiesMetrics);
    tvEmpty = (TextView) view.findViewById(R.id.tvEmpty);
    return view;
}
Also used : TextView(android.widget.TextView) View(android.view.View) ExpandableListView(android.widget.ExpandableListView) Nullable(android.support.annotation.Nullable)

Example 50 with ExpandableListView

use of android.widget.ExpandableListView in project cw-omnibus by commonsguy.

the class MainActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    InputStream raw = getResources().openRawResource(R.raw.sample);
    BufferedReader in = new BufferedReader(new InputStreamReader(raw));
    String str;
    StringBuffer buf = new StringBuffer();
    try {
        while ((str = in.readLine()) != null) {
            buf.append(str);
            buf.append('\n');
        }
        in.close();
        JSONObject model = new JSONObject(buf.toString());
        ExpandableListView elv = (ExpandableListView) findViewById(R.id.elv);
        adapter = new JSONExpandableListAdapter(getLayoutInflater(), model);
        elv.setAdapter(adapter);
        elv.setOnChildClickListener(this);
        elv.setOnGroupClickListener(this);
        elv.setOnGroupExpandListener(this);
        elv.setOnGroupCollapseListener(this);
    } catch (Exception e) {
        Log.e(getClass().getName(), "Exception reading JSON", e);
    }
}
Also used : InputStreamReader(java.io.InputStreamReader) JSONObject(org.json.JSONObject) InputStream(java.io.InputStream) BufferedReader(java.io.BufferedReader) ExpandableListView(android.widget.ExpandableListView)

Aggregations

ExpandableListView (android.widget.ExpandableListView)86 View (android.view.View)59 TextView (android.widget.TextView)30 AdapterView (android.widget.AdapterView)18 Intent (android.content.Intent)16 ListView (android.widget.ListView)16 ArrayList (java.util.ArrayList)16 AbsListView (android.widget.AbsListView)14 DialogInterface (android.content.DialogInterface)11 ImageView (android.widget.ImageView)11 List (java.util.List)11 Builder (android.app.AlertDialog.Builder)9 ViewGroup (android.view.ViewGroup)9 ExpandableListAdapter (android.widget.ExpandableListAdapter)7 AbsSpinner (android.widget.AbsSpinner)6 QuickContactBadge (android.widget.QuickContactBadge)6 TabHost (android.widget.TabHost)6 AdapterBinding (com.android.ide.common.rendering.api.AdapterBinding)6 ResourceReference (com.android.ide.common.rendering.api.ResourceReference)6 SessionParams (com.android.ide.common.rendering.api.SessionParams)6