Skip to content

Commit

Permalink
Merge branch 'hotfix/patch' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
wax911 committed May 30, 2019
2 parents 4e599f4 + 07be39d commit 56b4622
Show file tree
Hide file tree
Showing 43 changed files with 591 additions and 507 deletions.
8 changes: 8 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# These are supported funding model platforms

github: [wax911] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: wax911 # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
custom: # Replace with a single custom sponsorship URL
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# [ :biohazard: W.I.P v2.0 :biohazard: ] AniTrend v1.4.4   [![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)](https://github.com/AniTrend/anitrend-app/blob/master/LICENSE.md)
[![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)
# [ :biohazard: W.I.P v2.0 :biohazard: ] AniTrend v1.4.7   [![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)](https://github.com/AniTrend/anitrend-app/blob/master/LICENSE.md)
[![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)

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)

Big shout out to all the testers, translators and donators on the [AniTrend Discord Server](https://discord.gg/nMJzbEY) helping me keep this project alive!
Big shout out to all the testers, translators and donators on the [AniTrend Discord Server](https://discord.gg/2wzTqnF) helping me keep this project alive!

###### Feel free to donate the weeb cause with [Patreon](https://www.patreon.com/wax911) or [PayPal](https://www.paypal.me/mmax9)

Expand Down
4 changes: 2 additions & 2 deletions app/.meta/version.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"code": 108,
"code": 111,
"migration": false,
"releaseNotes": "",
"version": "1.4.4",
"version": "1.4.7",
"appId": "com.mxt.anitrend"
}
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"},"apkData":{"type":"MAIN","splits":[],"versionCode":108,"versionName":"1.4.4","enabled":true,"outputFile":"anitrend_v1.4.4_rc_108.apk","fullName":"release","baseName":"release"},"path":"anitrend_v1.4.4_rc_108.apk","properties":{}}]
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":111,"versionName":"1.4.7","enabled":true,"outputFile":"anitrend_v1.4.7_rc_111.apk","fullName":"release","baseName":"release"},"path":"anitrend_v1.4.7_rc_111.apk","properties":{}}]
17 changes: 6 additions & 11 deletions app/src/main/assets/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,22 @@ __N.B__ v2.0 will be dropping support for Jellybean - Kitkat, due to missing or
which can result in authentication errors [read more](https://github.com/square/okhttp/issues/2372)

#### Enhancements
- Reintroduced emoji support
- Spoiler tags in media pages (Mittens)
- New notification type for media the user may be interested in
- Minor UI tweaks, specifically view radius

#### Bug Fixes
- Multiple translations fixed
- Scores not matching sorted order
- Crashes on pre-lollipop with v1.4.2
- Missing related media notifications in v1.4.3
- Crashes on some device related to crunchyroll feeds
- Deep linking for user, anime, manga, staff, activities
- About page crashes
- Episode duration always displaying TBA (Swap)
- Missing notification type for subscribed activities (Mittens, Taichi)

#### Current Issues
- Clicking on @username shows mixed feed
- Sometimes image slide count doesn't change when you scroll slowly in feeds
- Sometimes image slide count doesn't change when you slowly scroll horizontally in feeds

#### Special Thanks
_Translators (minna arigato) & all of you lovely weebs <3_

__Admins, Devs & Cutie Pies:__
_Mittens, Senpai, Kuji, Moka, Flare, Silver, Mrspits4ever_
_Mittens, Switchums, Kuji, Moka, Flare, Silver, Mrspits4ever_

__Awesome Donators:__
_Bas, Golumpa, artemisthemp, Trivernis, PeakZer0, KorenTeam, keiggard_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ query UserNotifications($page: Int, $perPage: Int, $type: NotificationType, $typ
...userBase
}
}
... on ActivityReplySubscribedNotification {
id
type
createdAt
context
activityId
user {
...userBase
}
}
... on ActivityReplyLikeNotification {
id
type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
import android.widget.Filter;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.bumptech.glide.load.resource.bitmap.CenterInside;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
import com.bumptech.glide.request.RequestOptions;
import com.mxt.anitrend.R;
import com.mxt.anitrend.base.custom.recycler.RecyclerViewAdapter;
import com.mxt.anitrend.base.custom.recycler.RecyclerViewHolder;
import com.mxt.anitrend.databinding.AdapterFeedSlideBinding;
Expand Down Expand Up @@ -67,7 +71,7 @@ public PreviewHolder(AdapterFeedSlideBinding binding) {
@Override
public void onBindViewHolder(String model) {
String targetModel;
RequestOptions requestOptions = null;
boolean isCenterCrop = false;
switch (contentTypes.get(getAdapterPosition()).toLowerCase()) {
case RegexUtil.KEY_IMG:
targetModel = model;
Expand All @@ -77,22 +81,36 @@ public void onBindViewHolder(String model) {
case RegexUtil.KEY_YOU:
targetModel = RegexUtil.INSTANCE.getYoutubeThumb(model);
binding.feedPlayBack.setVisibility(View.VISIBLE);
requestOptions = RequestOptions.centerCropTransform();
isCenterCrop = true;
break;
default:
targetModel = RegexUtil.NO_THUMBNAIL;
binding.feedPlayBack.setVisibility(View.VISIBLE);
isCenterCrop = true;
break;
}

if(requestOptions == null)
if(!isCenterCrop)
Glide.with(getContext()).load(targetModel)
.transition(DrawableTransitionOptions.withCrossFade(250))
.transform(
new CenterInside(),
new RoundedCorners(
context.getResources().
getDimensionPixelSize(R.dimen.md_margin)
)
)
.into(binding.feedStatusImage);
else
Glide.with(getContext()).load(targetModel)
.transition(DrawableTransitionOptions.withCrossFade(250))
.apply(RequestOptions.centerCropTransform())
.transform(
new CenterCrop(),
new RoundedCorners(
context.getResources().
getDimensionPixelSize(R.dimen.md_margin)
)
)
.into(binding.feedStatusImage);
binding.executePendingBindings();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ public StatusFeedViewHolder(AdapterFeedStatusBinding binding) {
@Override
public void onBindViewHolder(FeedList model) {
binding.setModel(model);
// TODO: Temporarily disabled widget status to try out rich markdown rendering
binding.widgetStatus.setModel(model);

binding.widgetFavourite.setRequestParams(KeyUtil.ACTIVITY, model.getId());
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package com.mxt.anitrend.base.custom.glide

import android.content.Context
import com.bumptech.glide.GlideBuilder
import com.bumptech.glide.annotation.GlideModule
import com.bumptech.glide.load.DecodeFormat
import com.bumptech.glide.load.engine.DiskCacheStrategy
import com.bumptech.glide.load.engine.bitmap_recycle.LruBitmapPool
import com.bumptech.glide.load.engine.cache.ExternalPreferredCacheDiskCacheFactory
import com.bumptech.glide.load.engine.cache.LruResourceCache
import com.bumptech.glide.load.engine.cache.MemorySizeCalculator
import com.bumptech.glide.module.AppGlideModule
import com.bumptech.glide.request.RequestOptions
import com.mxt.anitrend.R
import com.mxt.anitrend.util.CompatUtil
import com.mxt.anitrend.util.KeyUtil

/**
* Created by max on 2017/06/10.
* Glide custom module
*/
@GlideModule
class GlideAppModule : AppGlideModule() {

/**
* If you’ve already migrated to the Glide v4 AppGlideModule and LibraryGlideModule, you can disable manifest parsing entirely.
* Doing so can improve the initial startup time of Glide and avoid some potential problems with trying to parse metadata.
* To disable manifest parsing, override the isManifestParsingEnabled() method in your AppGlideModule implementation:
*/
override fun isManifestParsingEnabled(): Boolean {
return false
}

override fun applyOptions(context: Context, builder: GlideBuilder) {
val isLowRamDevice = CompatUtil.isLowRamDevice(context)

val calculator = MemorySizeCalculator.Builder(context)
.setMemoryCacheScreens((if (isLowRamDevice) 1 else 2).toFloat()).build()

// Increasing cache & pool by 25% - default is 250MB
val memoryCacheSize = (1.25 * calculator.memoryCacheSize).toInt()
val bitmapPoolSize = (1.25 * calculator.bitmapPoolSize).toInt()
var storageCacheSize = 1024 * 1024 * 350
if (context.externalCacheDir != null) {
val total = context.externalCacheDir!!.totalSpace
storageCacheSize = (total * 0.2).toInt()
}

builder.setMemoryCache(LruResourceCache(memoryCacheSize.toLong()))
builder.setBitmapPool(LruBitmapPool(bitmapPoolSize.toLong()))
builder.setDiskCache(ExternalPreferredCacheDiskCacheFactory(context, storageCacheSize.toLong()))

// Setting default params for glide
val options = RequestOptions()
.format(if (isLowRamDevice) DecodeFormat.PREFER_RGB_565 else DecodeFormat.PREFER_ARGB_8888)
.timeout(KeyUtil.GLIDE_REQUEST_TIMEOUT)
.diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
.error(CompatUtil.getDrawable(context, R.drawable.ic_emoji_sweat))

builder.setDefaultRequestOptions(options)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void onInit() {
}

protected void applyStyle(int contentPadding) {
setRadius(getResources().getDimensionPixelSize(R.dimen.xl_margin));
setRadius(getResources().getDimensionPixelSize(R.dimen.lg_margin));
setUseCompatPadding(true);
setPreventCornerOverlap(false);
setContentPadding(contentPadding, contentPadding, contentPadding, contentPadding);
Expand Down
Loading

0 comments on commit 56b4622

Please sign in to comment.