use of com.danielstone.materialaboutlibrary.adapters.MaterialAboutListAdapter in project material-about-library by daniel-stoneuk.
the class MaterialAboutActivity method initViews.
private void initViews() {
setSupportActionBar(toolbar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
}
adapter = new MaterialAboutListAdapter(getViewTypeManager());
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(adapter);
RecyclerView.ItemAnimator animator = recyclerView.getItemAnimator();
if (animator instanceof SimpleItemAnimator) {
((SimpleItemAnimator) animator).setSupportsChangeAnimations(false);
}
}
use of com.danielstone.materialaboutlibrary.adapters.MaterialAboutListAdapter in project material-about-library by daniel-stoneuk.
the class MaterialAboutFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
int style = getTheme();
// create ContextThemeWrapper from the original Activity Context with the custom theme
final Context contextThemeWrapper = new android.view.ContextThemeWrapper(getActivity(), style);
LayoutInflater localInflater = inflater.cloneInContext(contextThemeWrapper);
View rootView = localInflater.inflate(R.layout.mal_material_about_fragment, container, false);
recyclerView = (RecyclerView) rootView.findViewById(R.id.mal_recyclerview);
adapter = new MaterialAboutListAdapter(getViewTypeManager());
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
recyclerView.setAdapter(adapter);
RecyclerView.ItemAnimator animator = recyclerView.getItemAnimator();
if (animator instanceof SimpleItemAnimator) {
((SimpleItemAnimator) animator).setSupportsChangeAnimations(false);
}
recyclerView.setAlpha(0f);
recyclerView.setTranslationY(20);
ListTask task = new ListTask(getActivity());
task.execute();
return rootView;
}
Aggregations