Search in sources :

Example 16 with ListFragment

use of android.support.v4.app.ListFragment in project network-monitor by caarmen.

the class FilterColumnActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    Log.v(TAG, "onCreate");
    super.onCreate(savedInstanceState);
    setContentView(R.layout.filter_columns);
    ListFragment lvf = (ListFragment) getSupportFragmentManager().findFragmentById(R.id.listFragment);
    mListView = lvf.getListView();
    // Show a hint to the user, explaining what filtering this column does.
    TextView tvHint = findViewById(R.id.filter_columns_hint);
    String columnName = getIntent().getStringExtra(EXTRA_COLUMN_NAME);
    String columnLabel = NetMonColumns.getColumnLabel(this, columnName);
    String hintText = getString(R.string.filter_columns_hint, columnLabel);
    tvHint.setText(hintText);
}
Also used : ListFragment(android.support.v4.app.ListFragment) TextView(android.widget.TextView)

Example 17 with ListFragment

use of android.support.v4.app.ListFragment in project DragTopLayout by chenupt.

the class MainActivity method getFragments.

private List<Fragment> getFragments() {
    List<Fragment> list = new ArrayList<>();
    Fragment listFragment = new ListViewFragment();
    Fragment recyclerFragment = new RecyclerFragment();
    Fragment gridViewFragment = new GridViewFragment();
    Fragment scrollViewFragment = new ScrollViewFragment();
    Fragment webViewFragment = new WebViewFragment();
    list.add(listFragment);
    list.add(recyclerFragment);
    list.add(gridViewFragment);
    list.add(scrollViewFragment);
    list.add(webViewFragment);
    return list;
}
Also used : WebViewFragment(github.chenupt.dragtoplayout.demo.fragments.WebViewFragment) RecyclerFragment(github.chenupt.dragtoplayout.demo.fragments.RecyclerFragment) ArrayList(java.util.ArrayList) GridViewFragment(github.chenupt.dragtoplayout.demo.fragments.GridViewFragment) ScrollViewFragment(github.chenupt.dragtoplayout.demo.fragments.ScrollViewFragment) RecyclerFragment(github.chenupt.dragtoplayout.demo.fragments.RecyclerFragment) ScrollViewFragment(github.chenupt.dragtoplayout.demo.fragments.ScrollViewFragment) WebViewFragment(github.chenupt.dragtoplayout.demo.fragments.WebViewFragment) Fragment(android.support.v4.app.Fragment) GridViewFragment(github.chenupt.dragtoplayout.demo.fragments.GridViewFragment) ListViewFragment(github.chenupt.dragtoplayout.demo.fragments.ListViewFragment) ListViewFragment(github.chenupt.dragtoplayout.demo.fragments.ListViewFragment)

Example 18 with ListFragment

use of android.support.v4.app.ListFragment in project FolderLayout by kyze8439690.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    mFolderLayout = (FolderLayout) findViewById(R.id.folder_layout);
    text1 = (TextView) findViewById(R.id.item1);
    text2 = (TextView) findViewById(R.id.item2);
    text3 = (TextView) findViewById(R.id.item3);
    text4 = (TextView) findViewById(R.id.item4);
    text1.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            mFolderLayout.toggleItem(3);
        }
    });
    text2.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            mFolderLayout.toggleItem(2);
        }
    });
    text3.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            mFolderLayout.toggleItem(1);
        }
    });
    text4.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            mFolderLayout.toggleItem(0);
        }
    });
    mViewPager = (ViewPager) findViewById(R.id.pager);
    mViewPager.setAdapter(new FragmentPagerAdapter(getSupportFragmentManager()) {

        @Override
        public Fragment getItem(int position) {
            return new ListFragment();
        }

        @Override
        public int getCount() {
            return 3;
        }
    });
    ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, new String[] { "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item", "list item" });
    mListView = (ListView) findViewById(R.id.list);
    mListView.setAdapter(adapter);
    mGridView = (GridView) findViewById(R.id.grid);
    mGridView.setAdapter(adapter);
}
Also used : FragmentPagerAdapter(android.support.v4.app.FragmentPagerAdapter) ListFragment(android.support.v4.app.ListFragment) GridView(android.widget.GridView) TextView(android.widget.TextView) View(android.view.View) ListView(android.widget.ListView) ListFragment(android.support.v4.app.ListFragment) Fragment(android.support.v4.app.Fragment) ArrayAdapter(android.widget.ArrayAdapter)

Example 19 with ListFragment

use of android.support.v4.app.ListFragment in project material-design-data by Luosunce.

the class MainActivity method setupViewPager.

private void setupViewPager(ViewPager viewPager) {
    Adapter adapter = new Adapter(getSupportFragmentManager());
    adapter.addFragment(new ListFragment(), "Category 1");
    adapter.addFragment(new ListFragment(), "Category 2");
    adapter.addFragment(new ListFragment(), "Category 3");
    viewPager.setAdapter(adapter);
}
Also used : Adapter(android.widget.Adapter) FragmentPagerAdapter(android.support.v4.app.FragmentPagerAdapter) ArrayAdapter(android.widget.ArrayAdapter)

Example 20 with ListFragment

use of android.support.v4.app.ListFragment in project SlidingMenu by jfeinstein10.

the class BaseActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setTitle(mTitleRes);
    // set the Behind View
    setBehindContentView(R.layout.menu_frame);
    if (savedInstanceState == null) {
        FragmentTransaction t = this.getSupportFragmentManager().beginTransaction();
        mFrag = new SampleListFragment();
        t.replace(R.id.menu_frame, mFrag);
        t.commit();
    } else {
        mFrag = (ListFragment) this.getSupportFragmentManager().findFragmentById(R.id.menu_frame);
    }
    // customize the SlidingMenu
    SlidingMenu sm = getSlidingMenu();
    sm.setShadowWidthRes(R.dimen.shadow_width);
    sm.setShadowDrawable(R.drawable.shadow);
    sm.setBehindOffsetRes(R.dimen.slidingmenu_offset);
    sm.setFadeDegree(0.35f);
    sm.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
Also used : SlidingMenu(com.jeremyfeinstein.slidingmenu.lib.SlidingMenu) FragmentTransaction(android.support.v4.app.FragmentTransaction)

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