Search in sources :

Example 6 with ListFragment

use of android.support.v4.app.ListFragment in project AndroidAutoLayout by hongyangAndroid.

the class MainActivity method initDatas.

private void initDatas() {
    ArrayList<Fragment> mList = new ArrayList<Fragment>();
    mList.add(new ListFragment());
    mList.add(new RegisterFragment());
    mList.add(new PayFragment());
    mList.add(new RecyclerViewFragment());
    mList.add(new RecyclerViewGridFragment());
    mList.add(new TestFragment());
    mViewPager.setAdapter(new MyAdapter(getSupportFragmentManager(), mList));
}
Also used : RecyclerViewGridFragment(com.zhy.sample.fragment.RecyclerViewGridFragment) TestFragment(com.zhy.sample.fragment.TestFragment) RegisterFragment(com.zhy.sample.fragment.RegisterFragment) ArrayList(java.util.ArrayList) ListFragment(com.zhy.sample.fragment.ListFragment) PayFragment(com.zhy.sample.fragment.PayFragment) RecyclerViewFragment(com.zhy.sample.fragment.RecyclerViewFragment) Fragment(android.support.v4.app.Fragment) RegisterFragment(com.zhy.sample.fragment.RegisterFragment) TestFragment(com.zhy.sample.fragment.TestFragment) RecyclerViewFragment(com.zhy.sample.fragment.RecyclerViewFragment) PayFragment(com.zhy.sample.fragment.PayFragment) ListFragment(com.zhy.sample.fragment.ListFragment) RecyclerViewGridFragment(com.zhy.sample.fragment.RecyclerViewGridFragment)

Example 7 with ListFragment

use of android.support.v4.app.ListFragment in project android_frameworks_base by DirtyUnicorns.

the class ShadowGridActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    FragmentManager fm = getSupportFragmentManager();
    if (fm.findFragmentById(android.R.id.content) == null) {
        ListFragment listFragment = new NoDividerListFragment();
        listFragment.setListAdapter(new ArrayAdapter<>(this, R.layout.card_row, R.id.card_text, TextUtils.buildSimpleStringList()));
        fm.beginTransaction().add(android.R.id.content, listFragment).commit();
    }
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) ListFragment(android.support.v4.app.ListFragment)

Example 8 with ListFragment

use of android.support.v4.app.ListFragment in project android_frameworks_base by DirtyUnicorns.

the class MainActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Intent intent = getIntent();
    String path = intent.getStringExtra(EXTRA_PATH);
    if (path == null) {
        path = "";
    } else {
        // not root level, display where we are in the hierarchy
        setTitle(path);
    }
    FragmentManager fm = getSupportFragmentManager();
    if (fm.findFragmentById(android.R.id.content) == null) {
        ListFragment listFragment = new TestListFragment();
        listFragment.setListAdapter(new SimpleAdapter(this, getData(path), android.R.layout.simple_list_item_1, new String[] { "title" }, new int[] { android.R.id.text1 }));
        fm.beginTransaction().add(android.R.id.content, listFragment).commit();
    }
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) ListFragment(android.support.v4.app.ListFragment) SimpleAdapter(android.widget.SimpleAdapter) Intent(android.content.Intent)

Example 9 with ListFragment

use of android.support.v4.app.ListFragment in project android_frameworks_base by ResurrectionRemix.

the class ShadowGridActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    FragmentManager fm = getSupportFragmentManager();
    if (fm.findFragmentById(android.R.id.content) == null) {
        ListFragment listFragment = new NoDividerListFragment();
        listFragment.setListAdapter(new ArrayAdapter<>(this, R.layout.card_row, R.id.card_text, TextUtils.buildSimpleStringList()));
        fm.beginTransaction().add(android.R.id.content, listFragment).commit();
    }
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) ListFragment(android.support.v4.app.ListFragment)

Example 10 with ListFragment

use of android.support.v4.app.ListFragment in project android_frameworks_base by ResurrectionRemix.

the class CompatListActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    FragmentManager fm = getSupportFragmentManager();
    if (fm.findFragmentById(android.R.id.content) == null) {
        ListFragment listFragment = new ListFragment();
        listFragment.setListAdapter(createListAdapter());
        fm.beginTransaction().add(android.R.id.content, listFragment).commit();
    }
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) ListFragment(android.support.v4.app.ListFragment)

Aggregations

ListFragment (android.support.v4.app.ListFragment)14 FragmentManager (android.support.v4.app.FragmentManager)13 Intent (android.content.Intent)4 Fragment (android.support.v4.app.Fragment)4 SimpleAdapter (android.widget.SimpleAdapter)4 FragmentPagerAdapter (android.support.v4.app.FragmentPagerAdapter)2 View (android.view.View)2 ArrayAdapter (android.widget.ArrayAdapter)2 TextView (android.widget.TextView)2 ArrayList (java.util.ArrayList)2 TabLayout (android.support.design.widget.TabLayout)1 FragmentTransaction (android.support.v4.app.FragmentTransaction)1 Adapter (android.widget.Adapter)1 GridView (android.widget.GridView)1 ListView (android.widget.ListView)1 SlidingMenu (com.jeremyfeinstein.slidingmenu.lib.SlidingMenu)1 ListFragment (com.zhy.sample.fragment.ListFragment)1 PayFragment (com.zhy.sample.fragment.PayFragment)1 RecyclerViewFragment (com.zhy.sample.fragment.RecyclerViewFragment)1 RecyclerViewGridFragment (com.zhy.sample.fragment.RecyclerViewGridFragment)1