Search in sources :

Example 1 with SimpleAlbumHolder

use of us.koller.cameraroll.adapter.main.viewHolder.SimpleAlbumHolder in project Camera-Roll-Android-App by kollerlukas.

the class MainAdapter method onCreateViewHolder.

@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    RecyclerView.ViewHolder viewHolder;
    Resources res = parent.getContext().getResources();
    LayoutInflater inflater = LayoutInflater.from(parent.getContext());
    if (viewType == res.getInteger(R.integer.STYLE_PARALLAX_VALUE)) {
        View v = inflater.inflate(R.layout.album_cover_parallax, parent, false);
        viewHolder = new SimpleAlbumHolder(v);
    } else if (viewType == res.getInteger(R.integer.STYLE_CARDS_VALUE)) {
        View v = inflater.inflate(R.layout.album_cover_card, parent, false);
        viewHolder = new SimpleAlbumHolder(v);
    } else if (viewType == res.getInteger(R.integer.STYLE_CARDS_2_VALUE)) {
        View v = inflater.inflate(R.layout.album_cover_card_2, parent, false);
        viewHolder = new SimpleAlbumHolder(v);
    } else /*if (viewType == res.getInteger(R.integer.STYLE_NESTED_RECYCLER_VIEW_VALUE))*/
    {
        View v = inflater.inflate(R.layout.album_cover_nested_recyclerview, parent, false);
        viewHolder = new NestedRecyclerViewAlbumHolder(v).setSelectorModeManager(getSelectorManager());
    }
    Context context = viewHolder.itemView.getContext();
    Theme theme = Settings.getInstance(context).getThemeInstance(context);
    ThemeableActivity.checkTags((ViewGroup) viewHolder.itemView, theme);
    return viewHolder;
}
Also used : NestedRecyclerViewAlbumHolder(us.koller.cameraroll.adapter.main.viewHolder.NestedRecyclerViewAlbumHolder) Context(android.content.Context) LayoutInflater(android.view.LayoutInflater) Theme(us.koller.cameraroll.themes.Theme) RecyclerView(android.support.v7.widget.RecyclerView) Resources(android.content.res.Resources) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) SimpleAlbumHolder(us.koller.cameraroll.adapter.main.viewHolder.SimpleAlbumHolder)

Aggregations

Context (android.content.Context)1 Resources (android.content.res.Resources)1 RecyclerView (android.support.v7.widget.RecyclerView)1 LayoutInflater (android.view.LayoutInflater)1 View (android.view.View)1 NestedRecyclerViewAlbumHolder (us.koller.cameraroll.adapter.main.viewHolder.NestedRecyclerViewAlbumHolder)1 SimpleAlbumHolder (us.koller.cameraroll.adapter.main.viewHolder.SimpleAlbumHolder)1 Theme (us.koller.cameraroll.themes.Theme)1