Skip to content

Commit

Permalink
Bug Fixes & Minor Improvements
Browse files Browse the repository at this point in the history
- Notifications cause the crash when binding a notification of thread type.
- Users profile progress page only returns anime, which is potentially a GraphQL query issue
- Every time the application checks for a notification it reports it as a new notification
- Create new account doesn't seem to be working because of text formatting
  • Loading branch information
wax911 committed May 1, 2018
1 parent 1b64f3f commit 966d76c
Show file tree
Hide file tree
Showing 27 changed files with 392 additions and 448 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
546 changes: 285 additions & 261 deletions .idea/workspace.xml

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AniTrend v1.0.5   [![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)](https://github.com/AniTrend/anitrend-app/blob/master/LICENSE)
# AniTrend v1.0.7   [![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)](https://github.com/AniTrend/anitrend-app/blob/master/LICENSE)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/30a8f983c55541cbb504671ecc32786c)](https://www.codacy.com/app/wax911/anitrend-app?utm_source=github.com&utm_medium=referral&utm_content=wax911/anitrend-app&utm_campaign=Badge_Grade)   [![Build Status](https://travis-ci.org/AniTrend/anitrend-app.svg?branch=master)](https://travis-ci.org/AniTrend/anitrend-app)   [![Waffle.io - Columns and their card count](https://badge.waffle.io/AniTrend/anitrend-app.svg?columns=all)](https://waffle.io/AniTrend/anitrend-app)

Discover anime or manga with AniTrend which is a free [AniList](https://anilist.co) android client written in java.(AniTrend does not offer streaming capabilities, but official website links such as Hulu, Chrunchyroll, Netflix will be provided if available)
Expand All @@ -10,6 +10,8 @@ Big shout out to all the testers, translators and donators on the [AniTrend Disc
# Known Issues

- Chrome based browsers are recommended when signing into AniTrend, other browsers may work but require one or two steps.
- Unresolved content on status feeds (results in an empty object appearing the response)
- Duplicated anime & manga entities on staff roles pages

# Screenshots

Expand Down
2 changes: 1 addition & 1 deletion app/release/output.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":76,"versionName":"1.0.7","enabled":true,"outputFile":"anitrend_v1.0.7_rc_76.apk","fullName":"release","baseName":"release"},"path":"anitrend_v1.0.7_rc_76.apk","properties":{}}]
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":77,"versionName":"1.0.8","enabled":true,"outputFile":"anitrend_v1.0.8_rc_77.apk","fullName":"release","baseName":"release"},"path":"anitrend_v1.0.8_rc_77.apk","properties":{}}]
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ query UserNotifications($page: Int, $perPage: Int, $type: NotificationType, $typ
type
createdAt
context
message {
...feedMessage
}
user {
...userBase
}
Expand All @@ -45,9 +42,7 @@ query UserNotifications($page: Int, $perPage: Int, $type: NotificationType, $typ
type
createdAt
context
activity {
...feedList
}
activityId
user {
...userBase
}
Expand All @@ -57,9 +52,7 @@ query UserNotifications($page: Int, $perPage: Int, $type: NotificationType, $typ
type
createdAt
context
activity {
...feedList
}
activityId
user {
...userBase
}
Expand All @@ -69,9 +62,7 @@ query UserNotifications($page: Int, $perPage: Int, $type: NotificationType, $typ
type
createdAt
context
activity {
...feedList
}
activityId
user {
...userBase
}
Expand All @@ -81,9 +72,7 @@ query UserNotifications($page: Int, $perPage: Int, $type: NotificationType, $typ
type
createdAt
context
activity {
...feedList
}
activityId
user {
...userBase
}
Expand All @@ -93,30 +82,45 @@ query UserNotifications($page: Int, $perPage: Int, $type: NotificationType, $typ
type
createdAt
context
user {
...userBase
}
}
... on ThreadCommentReplyNotification {
id
type
createdAt
context
user {
...userBase
}
}
... on ThreadCommentSubscribedNotification {
id
type
createdAt
context
user {
...userBase
}
}
... on ThreadCommentLikeNotification {
id
type
createdAt
context
user {
...userBase
}
}
... on ThreadLikeNotification {
id
type
createdAt
context
user {
...userBase
}
}
}
}
Expand Down Expand Up @@ -189,125 +193,3 @@ fragment userBase on User {
isFollowing
}
}

fragment feedList on ActivityUnion {
... on ListActivity {
id
status
progress
createdAt
type
user {
... on User {
id
name
avatar {
... on UserAvatar {
large
medium
}
}
isFollowing
}
}
replyCount
likes {
... on User {
id
name
avatar {
... on UserAvatar {
large
medium
}
}
isFollowing
}
}
media {
...mediaBase
}
}
... on TextActivity {
id
text(asHtml: false)
createdAt
type
user {
... on User {
id
name
avatar {
... on UserAvatar {
large
medium
}
}
isFollowing
}
}
replyCount
likes {
... on User {
id
name
avatar {
... on UserAvatar {
large
medium
}
}
isFollowing
}
}
}
}

fragment feedMessage on MessageActivity {
... on MessageActivity {
id
message(asHtml: false)
createdAt
type
messenger {
... on User {
id
name
avatar {
... on UserAvatar {
large
medium
}
}
isFollowing
}
}
recipient {
... on User {
id
name
avatar {
... on UserAvatar {
large
medium
}
}
isFollowing
}
}
replyCount
likes {
... on User {
id
name
avatar {
... on UserAvatar {
large
medium
}
}
isFollowing
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public Fragment getItem(int position) {
return UserOverviewFragment.newInstance(getParams());
case 1:
return UserFeedFragment.newInstance(getParams(), GraphUtil.getDefaultQuery(true)
.putVariable(KeyUtil.arg_type, KeyUtil.ANIME_LIST));
.putVariable(KeyUtil.arg_type, KeyUtil.MEDIA_LIST));
case 2:
return UserFeedFragment.newInstance(getParams(), GraphUtil.getDefaultQuery(true)
.putVariable(KeyUtil.arg_type, KeyUtil.TEXT));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ public void onBindViewHolder(Notification model) {
binding.notificationContent.setText(model.getContext());
break;
case KeyUtil.THREAD_COMMENT_MENTION:
binding.notificationSubject.setText(R.string.notification_user_activity_mention);
binding.notificationSubject.setText(R.string.notification_user_comment_forum);
binding.notificationHeader.setText(model.getUser().getName());
binding.notificationContent.setText(model.getContext());
break;
case KeyUtil.THREAD_SUBSCRIBED:
binding.notificationSubject.setText(R.string.notification_default);
binding.notificationSubject.setText(R.string.notification_user_comment_forum);
binding.notificationHeader.setText(model.getUser().getName());
binding.notificationContent.setText(model.getContext());
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,15 @@ public void onInit() {
private void checkLastSyncTime() {
if(presenter.getApplicationPref().isAuthenticated()) {
currentUser = presenter.getDatabase().getCurrentUser();
if (currentUser.getUnreadNotificationCount() > 0)
if (currentUser.getUnreadNotificationCount() > 0) {
binding.notificationCount.setText(String.valueOf(currentUser.getUnreadNotificationCount()));
showNotificationWidget();
else
}
else {
hideNotificationCountWidget();
}
AvatarImageView.setImage(binding.userAvatar, currentUser.getAvatar());
invalidate();
}
}

Expand All @@ -88,26 +92,24 @@ public void onModelChanged(BaseConsumer<User> consumer) {
}

private void showNotificationWidget() {
binding.notificationCount.setText(String.valueOf(currentUser.getUnreadNotificationCount()));
binding.notificationCount.setVisibility(VISIBLE);
binding.container.setVisibility(VISIBLE);
invalidate();
}

private void hideNotificationCountWidget() {
binding.notificationCount.setText(String.valueOf(currentUser.getUnreadNotificationCount()));
binding.notificationCount.setVisibility(GONE);
binding.container.setVisibility(GONE);
invalidate();
}

@Override
public void onClick(View view) {
if(presenter.getApplicationPref().isAuthenticated()) {
if (view.getId() == R.id.user_avatar) {
Intent intent;
if (currentUser.getUnreadNotificationCount() > 0)
if (currentUser.getUnreadNotificationCount() > 0) {
intent = new Intent(getContext(), NotificationActivity.class);
hideNotificationCountWidget();
}
else {
intent = new Intent(getContext(), ProfileActivity.class);
intent.putExtra(KeyUtil.arg_userName, currentUser.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.support.annotation.StringRes;
import android.support.v4.text.util.LinkifyCompat;
import android.support.v7.widget.AppCompatTextView;
import android.text.Html;
import android.text.Spanned;
import android.text.method.LinkMovementMethod;
import android.text.util.Linkify;
Expand Down Expand Up @@ -66,6 +67,12 @@ public static void htmlText(RichMarkdownTextView richMarkdownTextView, String ht
richMarkdownTextView.setText(markdownSpan, TextView.BufferType.SPANNABLE);
}

@BindingAdapter("basicHtml")
public static void basicText(RichMarkdownTextView richMarkdownTextView, String html) {
Spanned htmlSpan = Html.fromHtml(html);
richMarkdownTextView.setText(htmlSpan);
}

@BindingAdapter("textHtml")
public static void htmlText(RichMarkdownTextView richMarkdownTextView, @StringRes int resId) {
String text = richMarkdownTextView.getContext().getString(resId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
*/
public interface RepositoryModel {

String DOWNLOAD_LINK = "https://github.com/wax911/anitrend-resources/raw/%s/builds/app-release.apk";
String DOWNLOAD_LINK = "https://github.com/AniTrend/anitrend-resources/raw/%s/builds/app-release.apk";

@GET("/wax911/anitrend-resources/{branch}/builds/meta.json")
@GET("/AniTrend/anitrend-resources/{branch}/builds/meta.json")
Call<VersionBase> checkVersion(@Path("branch") String branch);
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

public class Notification extends NotificationBase {

// activity notifications
private FeedList activity;
// activity id
private long activityId;

// following or activity notification
private UserBase user;
Expand All @@ -28,7 +28,7 @@ public class Notification extends NotificationBase {

protected Notification(Parcel in) {
super(in);
activity = in.readParcelable(FeedList.class.getClassLoader());
activityId = in.readLong();
user = in.readParcelable(UserBase.class.getClassLoader());
episode = in.readInt();
contexts = in.createStringArrayList();
Expand All @@ -38,7 +38,7 @@ protected Notification(Parcel in) {
@Override
public void writeToParcel(Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeParcelable(activity, flags);
dest.writeLong(activityId);
dest.writeParcelable(user, flags);
dest.writeInt(episode);
dest.writeStringList(contexts);
Expand All @@ -50,9 +50,6 @@ public int describeContents() {
return super.describeContents();
}

public FeedList getActivity() {
return activity;
}

public UserBase getUser() {
return user;
Expand All @@ -69,4 +66,8 @@ public List<String> getContexts() {
public MediaBase getMedia() {
return media;
}

public long getActivityId() {
return activityId;
}
}
Loading

0 comments on commit 966d76c

Please sign in to comment.