use of com.materiallib.devpaul.materiallibrary.list.MyAdapter in project MaterialLibrary by DeveloperPaul123.
the class BaseListActivity method init.
@Override
public void init() {
List<ListItem> items = new ArrayList<>();
for (int i = 0; i < 50; i++) {
items.add(new ListItem("Item " + i));
}
MyAdapter adapter = new MyAdapter(BaseListActivity.this, items);
getListView().setAdapter(adapter);
}
use of com.materiallib.devpaul.materiallibrary.list.MyAdapter in project MaterialLibrary by DeveloperPaul123.
the class FabListActivity method init.
@Override
public void init() {
List<ListItem> items = new ArrayList<>();
for (int i = 0; i < 50; i++) {
items.add(new ListItem("Item " + i));
}
MyAdapter adapter = new MyAdapter(this, items);
getListView().setAdapter(adapter);
getListView().setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Toast.makeText(FabListActivity.this, "Item " + position + " clicked", Toast.LENGTH_SHORT).show();
}
});
}
use of com.materiallib.devpaul.materiallibrary.list.MyAdapter in project MaterialLibrary by DeveloperPaul123.
the class MainActivity method init.
@Override
public void init() {
List<ListItem> items = new ArrayList<>();
for (int i = 0; i < titles.length; i++) {
ListItem item = new ListItem();
item.setText(titles[i]);
items.add(item);
}
MyAdapter adapter = new MyAdapter(MainActivity.this, items);
getListView().setAdapter(adapter);
getListView().setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
switch(position) {
case 0:
// menus
Intent menuActivityIntent = new Intent(MainActivity.this, MenuActivity.class);
startActivity(menuActivityIntent);
break;
case 1:
// buttons
Intent buttonActivity = new Intent(MainActivity.this, ButtonActivity.class);
startActivity(buttonActivity);
break;
case 2:
// base toolbar activity
Intent baseToolbar = new Intent(MainActivity.this, BaseToolbarExample.class);
startActivity(baseToolbar);
break;
case 3:
// base toolbar list activity
Intent baseList = new Intent(MainActivity.this, BaseListActivity.class);
startActivity(baseList);
break;
case 4:
// base fab list activity
Intent intent = new Intent(MainActivity.this, FabListActivity.class);
startActivity(intent);
break;
case 5:
Intent baseQuick = new Intent(MainActivity.this, QuickReturnActivity.class);
startActivity(baseQuick);
break;
case 6:
Intent baseCollapse = new Intent(MainActivity.this, CollapsingToolbarRecycler.class);
startActivity(baseCollapse);
break;
case 7:
Intent baseCollapseWithFab = new Intent(MainActivity.this, CollapsingToolbarFab.class);
startActivity(baseCollapseWithFab);
break;
case 8:
Intent baseRecylerFab = new Intent(MainActivity.this, ToolbarRecyclerActivity.class);
startActivity(baseRecylerFab);
}
}
});
}