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")
long id;
@JsonField(name = "indices")
@JsonField(name = "indices", typeConverter = IndicesConverter.class)
Indices indices;
@JsonField(name = "media_url")

View File

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

View File

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

View File

@ -102,6 +102,8 @@ public class HotMobiLogger {
return "battery";
} else if (event instanceof NotificationEvent) {
return "notification";
} else if (event instanceof ScreenEvent) {
return "screen";
}
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)
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() {
return action;
}
@ -42,11 +49,11 @@ public class ScreenEvent extends BaseEvent {
this.action = action;
}
public static ScreenEvent create(Context context, Action action) {
final ScreenEvent event = new ScreenEvent();
event.markStart(context);
event.setAction(action);
return event;
@Override
public String toString() {
return "ScreenEvent{" +
"action=" + action +
"} " + super.toString();
}
public enum Action {
@ -81,5 +88,4 @@ public class ScreenEvent extends BaseEvent {
}
}
}
}