Skip to content
This repository has been archived by the owner on Sep 30, 2021. It is now read-only.

Commit

Permalink
this commit revamped feeds text in general as per #174 and #166
Browse files Browse the repository at this point in the history
  • Loading branch information
Kosh committed Jun 11, 2017
1 parent b345bf7 commit bed9a48
Show file tree
Hide file tree
Showing 6 changed files with 506 additions and 104 deletions.
2 changes: 1 addition & 1 deletion app/src/main/assets/highlight/js/scrollto.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var smoothScroll = function (elementId) {

var stepFunc = function () {
scrollContainer.scrollTop =
Math.min(targetY, pixelsPerStep + scrollContainer.scrollTop);
Math.min(targetY, pixelsPerStep + scrollContainer.scrollTop) - 80;

if (scrollContainer.scrollTop >= targetY) {
return;
Expand Down
54 changes: 50 additions & 4 deletions app/src/main/java/com/fastaccess/data/dao/PayloadModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@
import android.os.Parcelable;

import com.fastaccess.data.dao.model.Comment;
import com.fastaccess.data.dao.model.Commit;
import com.fastaccess.data.dao.model.Gist;
import com.fastaccess.data.dao.model.Issue;
import com.fastaccess.data.dao.model.PullRequest;
import com.fastaccess.data.dao.model.Release;
import com.fastaccess.data.dao.model.Repo;
import com.fastaccess.data.dao.model.User;

import java.util.List;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
Expand All @@ -26,13 +31,26 @@ public class PayloadModel implements Parcelable {
public Repo forkee;
public Issue issue;
public PullRequest pullRequest;
public String ref;
public String refType;
public Comment comment;
public User target;
public User member;
public String head;
public TeamsModel team;
public Comment commitComment;
public String description;
public ReleasesAssetsModel download;
public Gist gist;
public List<WikiModel> pages;
public String before;
public String head;
public String ref;
public int size;
public List<Commit> commits;
public User user;
public Release release;
public User blockedUser;
public User organization;
public User invitation;

@Override public int describeContents() { return 0; }

Expand All @@ -41,25 +59,53 @@ public class PayloadModel implements Parcelable {
dest.writeParcelable(this.forkee, flags);
dest.writeParcelable(this.issue, flags);
dest.writeParcelable(this.pullRequest, flags);
dest.writeString(this.ref);
dest.writeString(this.refType);
dest.writeParcelable(this.comment, flags);
dest.writeParcelable(this.target, flags);
dest.writeParcelable(this.member, flags);
dest.writeParcelable(this.team, flags);
dest.writeParcelable(this.commitComment, flags);
dest.writeString(this.description);
dest.writeParcelable(this.download, flags);
dest.writeParcelable(this.gist, flags);
dest.writeTypedList(this.pages);
dest.writeString(this.before);
dest.writeString(this.head);
dest.writeString(this.ref);
dest.writeInt(this.size);
dest.writeTypedList(this.commits);
dest.writeParcelable(this.user, flags);
dest.writeParcelable(this.release, flags);
dest.writeParcelable(this.blockedUser, flags);
dest.writeParcelable(this.organization, flags);
dest.writeParcelable(this.invitation, flags);
}

protected PayloadModel(Parcel in) {
this.action = in.readString();
this.forkee = in.readParcelable(Repo.class.getClassLoader());
this.issue = in.readParcelable(Issue.class.getClassLoader());
this.pullRequest = in.readParcelable(PullRequest.class.getClassLoader());
this.ref = in.readString();
this.refType = in.readString();
this.comment = in.readParcelable(Comment.class.getClassLoader());
this.target = in.readParcelable(User.class.getClassLoader());
this.member = in.readParcelable(User.class.getClassLoader());
this.team = in.readParcelable(TeamsModel.class.getClassLoader());
this.commitComment = in.readParcelable(Comment.class.getClassLoader());
this.description = in.readString();
this.download = in.readParcelable(ReleasesAssetsModel.class.getClassLoader());
this.gist = in.readParcelable(Gist.class.getClassLoader());
this.pages = in.createTypedArrayList(WikiModel.CREATOR);
this.before = in.readString();
this.head = in.readString();
this.ref = in.readString();
this.size = in.readInt();
this.commits = in.createTypedArrayList(Commit.CREATOR);
this.user = in.readParcelable(User.class.getClassLoader());
this.release = in.readParcelable(Release.class.getClassLoader());
this.blockedUser = in.readParcelable(User.class.getClassLoader());
this.organization = in.readParcelable(User.class.getClassLoader());
this.invitation = in.readParcelable(User.class.getClassLoader());
}

public static final Creator<PayloadModel> CREATOR = new Creator<PayloadModel>() {
Expand Down
49 changes: 49 additions & 0 deletions app/src/main/java/com/fastaccess/data/dao/WikiModel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package com.fastaccess.data.dao;

import android.os.Parcel;
import android.os.Parcelable;

import lombok.Getter;
import lombok.Setter;

/**
* Created by Kosh on 11 Jun 2017, 7:13 PM
*/

@Getter @Setter public class WikiModel implements Parcelable {
public String pageName;
public String title;
public String summary;
public String action;
public String sha;

public String htmlUrl;

public WikiModel() {}

@Override public int describeContents() { return 0; }

@Override public void writeToParcel(Parcel dest, int flags) {
dest.writeString(this.pageName);
dest.writeString(this.title);
dest.writeString(this.summary);
dest.writeString(this.action);
dest.writeString(this.sha);
dest.writeString(this.htmlUrl);
}

protected WikiModel(Parcel in) {
this.pageName = in.readString();
this.title = in.readString();
this.summary = in.readString();
this.action = in.readString();
this.sha = in.readString();
this.htmlUrl = in.readString();
}

public static final Creator<WikiModel> CREATOR = new Creator<WikiModel>() {
@Override public WikiModel createFromParcel(Parcel source) {return new WikiModel(source);}

@Override public WikiModel[] newArray(int size) {return new WikiModel[size];}
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@ public enum EventsType {
PullRequestReviewEvent(R.string.pr_review_event, R.drawable.ic_eye),
RepositoryEvent(R.string.repo_event, R.drawable.ic_repo),
PushEvent(R.string.pushed, R.drawable.ic_push),
StatusEvent(R.string.status, R.drawable.ic_info_outline),
TeamAddEvent(R.string.team_event, R.drawable.ic_profile),
DeleteEvent(R.string.deleted, R.drawable.ic_trash),
ReleaseEvent(R.string.released, R.drawable.ic_download),
Unhandled(R.string.unknown, R.drawable.ic_info_outline),
ForkApplyEvent(R.string.forked, R.drawable.ic_fork),
OrgBlockEvent(R.string.organization_event, R.drawable.ic_profile),
ProjectCardEvent(R.string.card_event, R.drawable.ic_info_outline),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

public class TimelineProvider {


@NonNull public static SpannableBuilder getStyledEvents(@NonNull IssueEvent issueEventModel, @NonNull Context context, boolean isMerged) {
IssueEventType event = issueEventModel.getEvent();
SpannableBuilder spannableBuilder = SpannableBuilder.builder();
Expand Down Expand Up @@ -74,6 +73,7 @@ public class TimelineProvider {
.append(from)
.append(" ")
.bold(issueEventModel.getRename().getFromValue())
.append(" ")
.append(to)
.append(" ")
.bold(issueEventModel.getRename().getToValue());
Expand Down

0 comments on commit bed9a48

Please sign in to comment.