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);
}
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;
}
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);
}
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);
}
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);
}
Aggregations