fixes a bug where the ProgressBar in NotificationsFragment would not show up
This commit is contained in:
parent
3628b8431d
commit
1af0b6fd48
1 changed files with 8 additions and 2 deletions
|
@ -20,6 +20,7 @@ import android.graphics.Color;
|
||||||
import android.graphics.PorterDuff;
|
import android.graphics.PorterDuff;
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
@ -75,8 +76,9 @@ public class NotificationsAdapter extends RecyclerView.Adapter {
|
||||||
mediaPreviewEnabled = true;
|
mediaPreviewEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
switch (viewType) {
|
switch (viewType) {
|
||||||
default:
|
default:
|
||||||
case VIEW_TYPE_MENTION: {
|
case VIEW_TYPE_MENTION: {
|
||||||
|
@ -108,7 +110,7 @@ public class NotificationsAdapter extends RecyclerView.Adapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) {
|
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int position) {
|
||||||
if (position < notifications.size()) {
|
if (position < notifications.size()) {
|
||||||
NotificationViewData notification = notifications.get(position);
|
NotificationViewData notification = notifications.get(position);
|
||||||
if (notification instanceof NotificationViewData.Placeholder) {
|
if (notification instanceof NotificationViewData.Placeholder) {
|
||||||
|
@ -226,7 +228,11 @@ public class NotificationsAdapter extends RecyclerView.Adapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFooterState(FooterViewHolder.State newFooterState) {
|
public void setFooterState(FooterViewHolder.State newFooterState) {
|
||||||
|
FooterViewHolder.State oldValue = footerState;
|
||||||
footerState = newFooterState;
|
footerState = newFooterState;
|
||||||
|
if (footerState != oldValue) {
|
||||||
|
notifyItemChanged(notifications.size());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMediaPreviewEnabled(boolean enabled) {
|
public void setMediaPreviewEnabled(boolean enabled) {
|
||||||
|
|
Loading…
Reference in a new issue