45 lines
1.7 KiB
Java
45 lines
1.7 KiB
Java
package org.schabi.newpipe.local.holder;
|
|
|
|
import android.support.annotation.Nullable;
|
|
import android.support.v7.widget.RecyclerView;
|
|
import android.view.LayoutInflater;
|
|
import android.view.ViewGroup;
|
|
|
|
import org.schabi.newpipe.database.LocalItem;
|
|
import org.schabi.newpipe.database.stream.model.StreamStateEntity;
|
|
import org.schabi.newpipe.local.LocalItemBuilder;
|
|
|
|
import java.text.DateFormat;
|
|
|
|
/*
|
|
* Created by Christian Schabesberger on 12.02.17.
|
|
*
|
|
* Copyright (C) Christian Schabesberger 2016 <chris.schabesberger@mailbox.org>
|
|
* InfoItemHolder.java is part of NewPipe.
|
|
*
|
|
* NewPipe is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* NewPipe is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
public abstract class LocalItemHolder extends RecyclerView.ViewHolder {
|
|
protected final LocalItemBuilder itemBuilder;
|
|
|
|
public LocalItemHolder(LocalItemBuilder itemBuilder, int layoutId, ViewGroup parent) {
|
|
super(LayoutInflater.from(itemBuilder.getContext())
|
|
.inflate(layoutId, parent, false));
|
|
this.itemBuilder = itemBuilder;
|
|
}
|
|
|
|
public abstract void updateFromItem(final LocalItem item, @Nullable final StreamStateEntity state, final DateFormat dateFormat);
|
|
}
|