2015-11-23 15:07:41 -08:00
|
|
|
package org.thoughtcrime.securesms;
|
|
|
|
|
|
|
|
import android.annotation.TargetApi;
|
|
|
|
import android.content.Context;
|
|
|
|
import android.os.Build;
|
|
|
|
import android.support.annotation.NonNull;
|
|
|
|
import android.util.AttributeSet;
|
|
|
|
import android.widget.LinearLayout;
|
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
|
|
import org.thoughtcrime.securesms.database.model.ThreadRecord;
|
2017-10-16 13:11:42 -07:00
|
|
|
import org.thoughtcrime.securesms.mms.GlideRequests;
|
2015-11-23 15:07:41 -08:00
|
|
|
import org.thoughtcrime.securesms.util.ViewUtil;
|
|
|
|
|
|
|
|
import java.util.Locale;
|
|
|
|
import java.util.Set;
|
|
|
|
|
2019-07-24 12:30:23 +10:00
|
|
|
import network.loki.messenger.R;
|
|
|
|
|
2015-11-23 15:07:41 -08:00
|
|
|
public class ConversationListItemAction extends LinearLayout implements BindableConversationListItem {
|
|
|
|
|
|
|
|
private TextView description;
|
|
|
|
|
|
|
|
public ConversationListItemAction(Context context) {
|
|
|
|
super(context);
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConversationListItemAction(Context context, AttributeSet attrs) {
|
|
|
|
super(context, attrs);
|
|
|
|
}
|
|
|
|
|
|
|
|
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
|
|
|
public ConversationListItemAction(Context context, AttributeSet attrs, int defStyleAttr) {
|
|
|
|
super(context, attrs, defStyleAttr);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onFinishInflate() {
|
|
|
|
super.onFinishInflate();
|
|
|
|
this.description = ViewUtil.findById(this, R.id.description);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2018-10-29 15:14:31 -07:00
|
|
|
public void bind(@NonNull ThreadRecord thread,
|
|
|
|
@NonNull GlideRequests glideRequests,
|
|
|
|
@NonNull Locale locale,
|
|
|
|
@NonNull Set<Long> typingThreads,
|
|
|
|
@NonNull Set<Long> selectedThreads,
|
|
|
|
boolean batchMode)
|
|
|
|
{
|
2015-11-23 15:07:41 -08:00
|
|
|
this.description.setText(getContext().getString(R.string.ConversationListItemAction_archived_conversations_d, thread.getCount()));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void unbind() {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|