Skip to content

Commit

Permalink
set deprecated ViewHolder constructor. Update sample.
Browse files Browse the repository at this point in the history
  • Loading branch information
bevzaanton committed Aug 16, 2018
1 parent 123f9ac commit 5d213ca
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -655,12 +655,13 @@ public static abstract class BaseMessageViewHolder<MESSAGE extends IMessage> ext
*/
protected ImageLoader imageLoader;

@Deprecated
public BaseMessageViewHolder(View itemView) {
super(itemView);
}

public BaseMessageViewHolder(View itemView, Object payload) {
this(itemView);
super(itemView);
this.payload = payload;
}

Expand Down Expand Up @@ -717,6 +718,7 @@ public static class IncomingTextMessageViewHolder<MESSAGE extends IMessage>
protected ViewGroup bubble;
protected TextView text;

@Deprecated
public IncomingTextMessageViewHolder(View itemView) {
super(itemView);
init(itemView);
Expand Down Expand Up @@ -775,6 +777,7 @@ public static class OutcomingTextMessageViewHolder<MESSAGE extends IMessage>
protected ViewGroup bubble;
protected TextView text;

@Deprecated
public OutcomingTextMessageViewHolder(View itemView) {
super(itemView);
init(itemView);
Expand Down Expand Up @@ -833,6 +836,7 @@ public static class IncomingImageMessageViewHolder<MESSAGE extends MessageConten
protected ImageView image;
protected View imageOverlay;

@Deprecated
public IncomingImageMessageViewHolder(View itemView) {
super(itemView);
init(itemView);
Expand Down Expand Up @@ -893,6 +897,7 @@ public static class OutcomingImageMessageViewHolder<MESSAGE extends MessageConte
protected ImageView image;
protected View imageOverlay;

@Deprecated
public OutcomingImageMessageViewHolder(View itemView) {
super(itemView);
init(itemView);
Expand Down Expand Up @@ -991,6 +996,7 @@ public abstract static class BaseIncomingMessageViewHolder<MESSAGE extends IMess
protected TextView time;
protected ImageView userAvatar;

@Deprecated
public BaseIncomingMessageViewHolder(View itemView) {
super(itemView);
init(itemView);
Expand Down Expand Up @@ -1048,6 +1054,7 @@ public abstract static class BaseOutcomingMessageViewHolder<MESSAGE extends IMes

protected TextView time;

@Deprecated
public BaseOutcomingMessageViewHolder(View itemView) {
super(itemView);
init(itemView);
Expand Down Expand Up @@ -1091,31 +1098,31 @@ private static class DefaultIncomingTextMessageViewHolder
extends IncomingTextMessageViewHolder<IMessage> {

public DefaultIncomingTextMessageViewHolder(View itemView) {
super(itemView);
super(itemView, null);
}
}

private static class DefaultOutcomingTextMessageViewHolder
extends OutcomingTextMessageViewHolder<IMessage> {

public DefaultOutcomingTextMessageViewHolder(View itemView) {
super(itemView);
super(itemView, null);
}
}

private static class DefaultIncomingImageMessageViewHolder
extends IncomingImageMessageViewHolder<MessageContentType.Image> {

public DefaultIncomingImageMessageViewHolder(View itemView) {
super(itemView);
super(itemView, null);
}
}

private static class DefaultOutcomingImageMessageViewHolder
extends OutcomingImageMessageViewHolder<MessageContentType.Image> {

public DefaultOutcomingImageMessageViewHolder(View itemView) {
super(itemView);
super(itemView, null);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public class CustomIncomingImageMessageViewHolder

private View onlineIndicator;

public CustomIncomingImageMessageViewHolder(View itemView) {
super(itemView);
public CustomIncomingImageMessageViewHolder(View itemView, Object payload) {
super(itemView, payload);
onlineIndicator = itemView.findViewById(R.id.onlineIndicator);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
public class CustomOutcomingImageMessageViewHolder
extends MessageHolders.OutcomingImageMessageViewHolder<Message> {

public CustomOutcomingImageMessageViewHolder(View itemView) {
super(itemView);
public CustomOutcomingImageMessageViewHolder(View itemView, Object payload) {
super(itemView, payload);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
public class CustomOutcomingTextMessageViewHolder
extends MessageHolders.OutcomingTextMessageViewHolder<Message> {

public CustomOutcomingTextMessageViewHolder(View itemView) {
super(itemView);
public CustomOutcomingTextMessageViewHolder(View itemView, Object payload) {
super(itemView, payload);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public class IncomingVoiceMessageViewHolder
private TextView tvDuration;
private TextView tvTime;

public IncomingVoiceMessageViewHolder(View itemView) {
super(itemView);
public IncomingVoiceMessageViewHolder(View itemView, Object payload) {
super(itemView, payload);
tvDuration = (TextView) itemView.findViewById(R.id.duration);
tvTime = (TextView) itemView.findViewById(R.id.time);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public class OutcomingVoiceMessageViewHolder
private TextView tvDuration;
private TextView tvTime;

public OutcomingVoiceMessageViewHolder(View itemView) {
super(itemView);
public OutcomingVoiceMessageViewHolder(View itemView, Object payload) {
super(itemView, payload);
tvDuration = (TextView) itemView.findViewById(R.id.duration);
tvTime = (TextView) itemView.findViewById(R.id.time);
}
Expand Down

0 comments on commit 5d213ca

Please sign in to comment.