fixed crashes on refresh

This commit is contained in:
Mariotaku Lee 2015-11-11 17:49:05 +08:00
parent 0e1ee9d999
commit d854cf180d
5 changed files with 17 additions and 9 deletions

View File

@ -36,7 +36,7 @@ public class MediaEntityImpl implements MediaEntity {
@JsonField(name = "id") @JsonField(name = "id")
long id; long id;
@JsonField(name = "indices") @JsonField(name = "indices", typeConverter = IndicesConverter.class)
Indices indices; Indices indices;
@JsonField(name = "media_url") @JsonField(name = "media_url")

View File

@ -29,7 +29,7 @@ import org.mariotaku.twidere.api.twitter.model.UrlEntity;
*/ */
@JsonObject @JsonObject
public class UrlEntityImpl implements UrlEntity { public class UrlEntityImpl implements UrlEntity {
@JsonField(name = "indices") @JsonField(name = "indices", typeConverter = IndicesConverter.class)
Indices indices; Indices indices;
@JsonField(name = "display_url") @JsonField(name = "display_url")
String displayUrl; String displayUrl;

View File

@ -29,7 +29,7 @@ import org.mariotaku.twidere.api.twitter.model.UserMentionEntity;
*/ */
@JsonObject @JsonObject
public class UserMentionEntityImpl implements UserMentionEntity { public class UserMentionEntityImpl implements UserMentionEntity {
@JsonField(name = "indices") @JsonField(name = "indices", typeConverter = IndicesConverter.class)
Indices indices; Indices indices;
@JsonField(name = "id") @JsonField(name = "id")
long id; long id;

View File

@ -102,6 +102,8 @@ public class HotMobiLogger {
return "battery"; return "battery";
} else if (event instanceof NotificationEvent) { } else if (event instanceof NotificationEvent) {
return "notification"; return "notification";
} else if (event instanceof ScreenEvent) {
return "screen";
} }
throw new UnsupportedOperationException("Unknown event type " + event); throw new UnsupportedOperationException("Unknown event type " + event);
} }

View File

@ -34,6 +34,13 @@ public class ScreenEvent extends BaseEvent {
@JsonField(name = "action", typeConverter = Action.ScreenActionConverter.class) @JsonField(name = "action", typeConverter = Action.ScreenActionConverter.class)
Action action; Action action;
public static ScreenEvent create(Context context, Action action) {
final ScreenEvent event = new ScreenEvent();
event.markStart(context);
event.setAction(action);
return event;
}
public Action getAction() { public Action getAction() {
return action; return action;
} }
@ -42,11 +49,11 @@ public class ScreenEvent extends BaseEvent {
this.action = action; this.action = action;
} }
public static ScreenEvent create(Context context, Action action) { @Override
final ScreenEvent event = new ScreenEvent(); public String toString() {
event.markStart(context); return "ScreenEvent{" +
event.setAction(action); "action=" + action +
return event; "} " + super.toString();
} }
public enum Action { public enum Action {
@ -81,5 +88,4 @@ public class ScreenEvent extends BaseEvent {
} }
} }
} }
} }