diff options
Diffstat (limited to 'app/src')
54 files changed, 380 insertions, 701 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchGfycatOrRedgifsVideoLinks.java b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchGfycatOrRedgifsVideoLinks.java deleted file mode 100644 index 1f55fb7f..00000000 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchGfycatOrRedgifsVideoLinks.java +++ /dev/null @@ -1,135 +0,0 @@ -package ml.docilealligator.infinityforreddit; - -import android.content.Context; -import android.content.SharedPreferences; -import android.os.Handler; - -import org.json.JSONException; -import org.json.JSONObject; - -import java.io.IOException; -import java.util.concurrent.Executor; - -import ml.docilealligator.infinityforreddit.apis.GfycatAPI; -import ml.docilealligator.infinityforreddit.apis.RedgifsAPI; -import ml.docilealligator.infinityforreddit.utils.APIUtils; -import ml.docilealligator.infinityforreddit.utils.JSONUtils; -import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; -import retrofit2.Call; -import retrofit2.Response; -import retrofit2.Retrofit; - -public class FetchGfycatOrRedgifsVideoLinks { - - public interface FetchGfycatOrRedgifsVideoLinksListener { - void success(String webm, String mp4); - void failed(int errorCode); - } - - public static void fetchGfycatVideoLinks(Executor executor, Handler handler, Retrofit gfycatRetrofit, - String gfycatId, - FetchGfycatOrRedgifsVideoLinksListener fetchGfycatOrRedgifsVideoLinksListener) { - executor.execute(() -> { - try { - Response<String> response = gfycatRetrofit.create(GfycatAPI.class).getGfycatData(gfycatId).execute(); - if (response.isSuccessful()) { - parseGfycatVideoLinks(handler, response.body(), fetchGfycatOrRedgifsVideoLinksListener); - } else { - handler.post(() -> fetchGfycatOrRedgifsVideoLinksListener.failed(response.code())); - } - } catch (IOException e) { - e.printStackTrace(); - handler.post(() -> fetchGfycatOrRedgifsVideoLinksListener.failed(-1)); - } - }); - } - - public static void fetchRedgifsVideoLinks(Context context, Executor executor, Handler handler, Retrofit redgifsRetrofit, - SharedPreferences currentAccountSharedPreferences, - String gfycatId, - FetchGfycatOrRedgifsVideoLinksListener fetchGfycatOrRedgifsVideoLinksListener) { - executor.execute(() -> { - try { - Response<String> response = redgifsRetrofit.create(RedgifsAPI.class).getRedgifsData(APIUtils.getRedgifsOAuthHeader(currentAccountSharedPreferences.getString(SharedPreferencesUtils.REDGIFS_ACCESS_TOKEN, "")), - gfycatId, APIUtils.USER_AGENT).execute(); - if (response.isSuccessful()) { - parseRedgifsVideoLinks(handler, response.body(), fetchGfycatOrRedgifsVideoLinksListener); - } else { - handler.post(() -> fetchGfycatOrRedgifsVideoLinksListener.failed(response.code())); - } - } catch (IOException e) { - e.printStackTrace(); - handler.post(() -> fetchGfycatOrRedgifsVideoLinksListener.failed(-1)); - } - }); - } - - public static void fetchGfycatOrRedgifsVideoLinksInRecyclerViewAdapter(Executor executor, Handler handler, - Call<String> gfycatCall, - boolean isGfycatVideo, - boolean automaticallyTryRedgifs, - FetchGfycatOrRedgifsVideoLinksListener fetchGfycatOrRedgifsVideoLinksListener) { - executor.execute(() -> { - try { - Response<String> response = gfycatCall.execute(); - if (response.isSuccessful()) { - if (isGfycatVideo) { - parseGfycatVideoLinks(handler, response.body(), fetchGfycatOrRedgifsVideoLinksListener); - } else { - parseRedgifsVideoLinks(handler, response.body(), fetchGfycatOrRedgifsVideoLinksListener); - } - } else { - if (response.code() == 404 && isGfycatVideo && automaticallyTryRedgifs) { - fetchGfycatOrRedgifsVideoLinksInRecyclerViewAdapter(executor, handler, gfycatCall.clone(), - false, false, fetchGfycatOrRedgifsVideoLinksListener); - } else { - handler.post(() -> fetchGfycatOrRedgifsVideoLinksListener.failed(response.code())); - } - } - } catch (IOException e) { - e.printStackTrace(); - handler.post(() -> fetchGfycatOrRedgifsVideoLinksListener.failed(-1)); - } - }); - } - - private static void parseGfycatVideoLinks(Handler handler, String response, - FetchGfycatOrRedgifsVideoLinksListener fetchGfycatOrRedgifsVideoLinksListener) { - try { - JSONObject jsonObject = new JSONObject(response); - String mp4 = jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY).has(JSONUtils.MP4_URL_KEY) ? - jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY).getString(JSONUtils.MP4_URL_KEY) - : jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY) - .getJSONObject(JSONUtils.CONTENT_URLS_KEY) - .getJSONObject(JSONUtils.MP4_KEY) - .getString(JSONUtils.URL_KEY); - String webm; - if (jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY).has(JSONUtils.WEBM_URL_KEY)) { - webm = jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY).getString(JSONUtils.WEBM_URL_KEY); - } else if (jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY).getJSONObject(JSONUtils.CONTENT_URLS_KEY).has(JSONUtils.WEBM_KEY)) { - webm = jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY) - .getJSONObject(JSONUtils.CONTENT_URLS_KEY) - .getJSONObject(JSONUtils.WEBM_KEY) - .getString(JSONUtils.URL_KEY); - } else { - webm = mp4; - } - handler.post(() -> fetchGfycatOrRedgifsVideoLinksListener.success(webm, mp4)); - } catch (JSONException e) { - e.printStackTrace(); - handler.post(() -> fetchGfycatOrRedgifsVideoLinksListener.failed(-1)); - } - } - - private static void parseRedgifsVideoLinks(Handler handler, String response, - FetchGfycatOrRedgifsVideoLinksListener fetchGfycatOrRedgifsVideoLinksListener) { - try { - String mp4 = new JSONObject(response).getJSONObject(JSONUtils.GIF_KEY).getJSONObject(JSONUtils.URLS_KEY) - .getString(JSONUtils.HD_KEY); - handler.post(() -> fetchGfycatOrRedgifsVideoLinksListener.success(mp4, mp4)); - } catch (JSONException e) { - e.printStackTrace(); - handler.post(() -> fetchGfycatOrRedgifsVideoLinksListener.failed(-1)); - } - } -} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchRedgifsVideoLinks.java b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchRedgifsVideoLinks.java new file mode 100644 index 00000000..8435f3ea --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchRedgifsVideoLinks.java @@ -0,0 +1,76 @@ +package ml.docilealligator.infinityforreddit; + +import android.content.SharedPreferences; +import android.os.Handler; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.io.IOException; +import java.util.concurrent.Executor; + +import ml.docilealligator.infinityforreddit.apis.RedgifsAPI; +import ml.docilealligator.infinityforreddit.utils.APIUtils; +import ml.docilealligator.infinityforreddit.utils.JSONUtils; +import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; +import retrofit2.Call; +import retrofit2.Response; +import retrofit2.Retrofit; + +public class FetchRedgifsVideoLinks { + + public interface FetchRedgifsVideoLinksListener { + void success(String webm, String mp4); + void failed(int errorCode); + } + + public static void fetchRedgifsVideoLinks(Executor executor, Handler handler, Retrofit redgifsRetrofit, + SharedPreferences currentAccountSharedPreferences, + String redgifsId, + FetchRedgifsVideoLinksListener fetchRedgifsVideoLinksListener) { + executor.execute(() -> { + try { + Response<String> response = redgifsRetrofit.create(RedgifsAPI.class).getRedgifsData(APIUtils.getRedgifsOAuthHeader(currentAccountSharedPreferences.getString(SharedPreferencesUtils.REDGIFS_ACCESS_TOKEN, "")), + redgifsId, APIUtils.USER_AGENT).execute(); + if (response.isSuccessful()) { + parseRedgifsVideoLinks(handler, response.body(), fetchRedgifsVideoLinksListener); + } else { + handler.post(() -> fetchRedgifsVideoLinksListener.failed(response.code())); + } + } catch (IOException e) { + e.printStackTrace(); + handler.post(() -> fetchRedgifsVideoLinksListener.failed(-1)); + } + }); + } + + public static void fetchRedgifsVideoLinksInRecyclerViewAdapter(Executor executor, Handler handler, + Call<String> redgifsCall, + FetchRedgifsVideoLinksListener fetchRedgifsVideoLinksListener) { + executor.execute(() -> { + try { + Response<String> response = redgifsCall.execute(); + if (response.isSuccessful()) { + parseRedgifsVideoLinks(handler, response.body(), fetchRedgifsVideoLinksListener); + } else { + handler.post(() -> fetchRedgifsVideoLinksListener.failed(response.code())); + } + } catch (IOException e) { + e.printStackTrace(); + handler.post(() -> fetchRedgifsVideoLinksListener.failed(-1)); + } + }); + } + + private static void parseRedgifsVideoLinks(Handler handler, String response, + FetchRedgifsVideoLinksListener fetchRedgifsVideoLinksListener) { + try { + String mp4 = new JSONObject(response).getJSONObject(JSONUtils.GIF_KEY).getJSONObject(JSONUtils.URLS_KEY) + .getString(JSONUtils.HD_KEY); + handler.post(() -> fetchRedgifsVideoLinksListener.success(mp4, mp4)); + } catch (JSONException e) { + e.printStackTrace(); + handler.post(() -> fetchRedgifsVideoLinksListener.failed(-1)); + } + } +} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/NetworkModule.java b/app/src/main/java/ml/docilealligator/infinityforreddit/NetworkModule.java index 5aff6fc1..ffd4dcb6 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/NetworkModule.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/NetworkModule.java @@ -148,15 +148,6 @@ abstract class NetworkModule { } @Provides - @Named("gfycat") - @Singleton - static Retrofit provideGfycatRetrofit(@Named("base") Retrofit retrofit) { - return retrofit.newBuilder() - .baseUrl(APIUtils.GFYCAT_API_BASE_URI) - .build(); - } - - @Provides @Named("RedgifsAccessTokenAuthenticator") static Interceptor redgifsAccessTokenAuthenticator(@Named("current_account") SharedPreferences currentAccountSharedPreferences) { return new RedgifsAccessTokenAuthenticator(currentAccountSharedPreferences); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java index 7b535685..e5346178 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java @@ -44,7 +44,6 @@ public class LinkResolverActivity extends AppCompatActivity { private static final String MULTIREDDIT_PATTERN = "/user/[\\w-]+/m/\\w+/?"; private static final String MULTIREDDIT_PATTERN_2 = "/[rR]/(\\w+\\+?)+/?"; private static final String REDD_IT_POST_PATTERN = "/\\w+/?"; - private static final String GFYCAT_PATTERN = "(/i?fr)?/[\\w-]+$"; private static final String REDGIFS_PATTERN = "/watch/[\\w-]+$"; private static final String IMGUR_GALLERY_PATTERN = "/gallery/\\w+/?"; private static final String IMGUR_ALBUM_PATTERN = "/(album|a)/\\w+/?"; @@ -258,20 +257,10 @@ public class LinkResolverActivity extends AppCompatActivity { if (path.startsWith("/CL0/")) { handleUri(Uri.parse(path.substring("/CL0/".length()))); } - } else if (authority.contains("gfycat.com")) { - if (path.matches(GFYCAT_PATTERN)) { - Intent intent = new Intent(this, ViewVideoActivity.class); - intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, path.substring(path.lastIndexOf("/") + 1)); - intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_GFYCAT); - intent.putExtra(ViewVideoActivity.EXTRA_IS_NSFW, getIntent().getBooleanExtra(EXTRA_IS_NSFW, false)); - startActivity(intent); - } else { - deepLinkError(uri); - } } else if (authority.contains("redgifs.com")) { if (path.matches(REDGIFS_PATTERN)) { Intent intent = new Intent(this, ViewVideoActivity.class); - intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, path.substring(path.lastIndexOf("/") + 1)); + intent.putExtra(ViewVideoActivity.EXTRA_REDGIFS_ID, path.substring(path.lastIndexOf("/") + 1)); intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_REDGIFS); intent.putExtra(ViewVideoActivity.EXTRA_IS_NSFW, true); startActivity(intent); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LoginActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LoginActivity.java index 11a11fa7..fb39c4e2 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LoginActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LoginActivity.java @@ -203,6 +203,7 @@ public class LoginActivity extends BaseActivity { mCurrentAccountSharedPreferences.edit().putString(SharedPreferencesUtils.ACCESS_TOKEN, accessToken) .putString(SharedPreferencesUtils.ACCOUNT_NAME, name) .putString(SharedPreferencesUtils.ACCOUNT_IMAGE_URL, profileImageUrl).apply(); + mCurrentAccountSharedPreferences.edit().remove(SharedPreferencesUtils.SUBSCRIBED_THINGS_SYNC_TIME).apply(); ParseAndInsertNewAccount.parseAndInsertNewAccount(mExecutor, new Handler(), name, accessToken, refreshToken, profileImageUrl, bannerImageUrl, karma, authCode, mRedditDataRoomDatabase.accountDao(), () -> { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java index 0748fb33..270694b4 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java @@ -1003,6 +1003,10 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb } private void loadSubscriptions() { + if (System.currentTimeMillis() - mCurrentAccountSharedPreferences.getLong(SharedPreferencesUtils.SUBSCRIBED_THINGS_SYNC_TIME, 0L) < 24 * 60 * 60 * 1000) { + return; + } + if (!mAccountName.equals(Account.ANONYMOUS_ACCOUNT) && !mFetchSubscriptionsSuccess) { FetchSubscribedThing.fetchSubscribedThing(mOauthRetrofit, mAccessToken, mAccountName, null, new ArrayList<>(), new ArrayList<>(), @@ -1012,6 +1016,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb public void onFetchSubscribedThingSuccess(ArrayList<SubscribedSubredditData> subscribedSubredditData, ArrayList<SubscribedUserData> subscribedUserData, ArrayList<SubredditData> subredditData) { + mCurrentAccountSharedPreferences.edit().putLong(SharedPreferencesUtils.SUBSCRIBED_THINGS_SYNC_TIME, System.currentTimeMillis()).apply(); InsertSubscribedThings.insertSubscribedThings( mExecutor, new Handler(), diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubscribedThingListingActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubscribedThingListingActivity.java index def20919..d3eca700 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubscribedThingListingActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubscribedThingListingActivity.java @@ -107,9 +107,6 @@ public class SubscribedThingListingActivity extends BaseActivity implements Acti @Named("current_account") SharedPreferences mCurrentAccountSharedPreferences; @Inject - @Named("internal") - SharedPreferences mInternalSharedPreferences; - @Inject CustomThemeWrapper mCustomThemeWrapper; @Inject Executor mExecutor; @@ -318,7 +315,7 @@ public class SubscribedThingListingActivity extends BaseActivity implements Acti } public void loadSubscriptions(boolean forceLoad) { - if (!forceLoad && System.currentTimeMillis() - mInternalSharedPreferences.getLong(SharedPreferencesUtils.SUBSCRIBED_THINGS_SYNC_TIME, 0L) < 24 * 60 * 60 * 1000) { + if (!forceLoad && System.currentTimeMillis() - mCurrentAccountSharedPreferences.getLong(SharedPreferencesUtils.SUBSCRIBED_THINGS_SYNC_TIME, 0L) < 24 * 60 * 60 * 1000) { return; } @@ -331,7 +328,7 @@ public class SubscribedThingListingActivity extends BaseActivity implements Acti public void onFetchSubscribedThingSuccess(ArrayList<SubscribedSubredditData> subscribedSubredditData, ArrayList<SubscribedUserData> subscribedUserData, ArrayList<SubredditData> subredditData) { - mInternalSharedPreferences.edit().putLong(SharedPreferencesUtils.SUBSCRIBED_THINGS_SYNC_TIME, System.currentTimeMillis()).apply(); + mCurrentAccountSharedPreferences.edit().putLong(SharedPreferencesUtils.SUBSCRIBED_THINGS_SYNC_TIME, System.currentTimeMillis()).apply(); InsertSubscribedThings.insertSubscribedThings( mExecutor, new Handler(), diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java index 69fd01e4..38ca2f2f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java @@ -68,7 +68,6 @@ import com.google.android.exoplayer2.util.MimeTypes; import com.google.android.exoplayer2.video.VideoSize; import com.google.android.material.bottomappbar.BottomAppBar; import com.google.android.material.button.MaterialButton; -import com.google.android.material.snackbar.Snackbar; import com.google.common.collect.ImmutableList; import com.otaliastudios.zoom.ZoomEngine; import com.otaliastudios.zoom.ZoomSurfaceView; @@ -88,7 +87,7 @@ import app.futured.hauler.LockableNestedScrollView; import butterknife.BindView; import butterknife.ButterKnife; import ml.docilealligator.infinityforreddit.CustomFontReceiver; -import ml.docilealligator.infinityforreddit.FetchGfycatOrRedgifsVideoLinks; +import ml.docilealligator.infinityforreddit.FetchRedgifsVideoLinks; import ml.docilealligator.infinityforreddit.FetchStreamableVideo; import ml.docilealligator.infinityforreddit.Infinity; import ml.docilealligator.infinityforreddit.R; @@ -131,7 +130,7 @@ public class ViewVideoActivity extends AppCompatActivity implements CustomFontRe public static final String EXTRA_POST = "EP"; public static final String EXTRA_PROGRESS_SECONDS = "EPS"; public static final String EXTRA_VIDEO_TYPE = "EVT"; - public static final String EXTRA_GFYCAT_ID = "EGI"; + public static final String EXTRA_REDGIFS_ID = "EGI"; public static final String EXTRA_V_REDD_IT_URL = "EVRIU"; public static final String EXTRA_STREAMABLE_SHORT_CODE = "ESSC"; public static final String EXTRA_IS_NSFW = "EIN"; @@ -140,7 +139,6 @@ public class ViewVideoActivity extends AppCompatActivity implements CustomFontRe public static final int VIDEO_TYPE_V_REDD_IT = 4; public static final int VIDEO_TYPE_DIRECT = 3; public static final int VIDEO_TYPE_REDGIFS = 2; - public static final int VIDEO_TYPE_GFYCAT = 1; private static final int VIDEO_TYPE_NORMAL = 0; private static final int PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE = 0; @@ -203,10 +201,6 @@ public class ViewVideoActivity extends AppCompatActivity implements CustomFontRe Retrofit applicationOnlyOauthRetrofit; @Inject - @Named("gfycat") - Retrofit gfycatRetrofit; - - @Inject @Named("redgifs") Retrofit redgifsRetrofit; @@ -546,29 +540,21 @@ public class ViewVideoActivity extends AppCompatActivity implements CustomFontRe } } else if (videoType == VIDEO_TYPE_V_REDD_IT) { loadVReddItVideo(savedInstanceState); - } else if (videoType == VIDEO_TYPE_GFYCAT || videoType == VIDEO_TYPE_REDGIFS) { + } else if (videoType == VIDEO_TYPE_REDGIFS) { if (savedInstanceState != null) { videoDownloadUrl = savedInstanceState.getString(VIDEO_DOWNLOAD_URL_STATE); } else { videoDownloadUrl = intent.getStringExtra(EXTRA_VIDEO_DOWNLOAD_URL); } - String gfycatId = intent.getStringExtra(EXTRA_GFYCAT_ID); - if (gfycatId != null && gfycatId.contains("-")) { - gfycatId = gfycatId.substring(0, gfycatId.indexOf('-')); - } - if (videoType == VIDEO_TYPE_GFYCAT) { - videoFileName = "Gfycat-" + gfycatId + ".mp4"; - } else { - videoFileName = "Redgifs-" + gfycatId + ".mp4"; + String redgifsId = intent.getStringExtra(EXTRA_REDGIFS_ID); + if (redgifsId != null && redgifsId.contains("-")) { + redgifsId = redgifsId.substring(0, redgifsId.indexOf('-')); } + videoFileName = "Redgifs-" + redgifsId + ".mp4"; if (mVideoUri == null) { - if (videoType == VIDEO_TYPE_GFYCAT) { - loadGfycatOrRedgifsVideo(gfycatRetrofit, gfycatId, true, savedInstanceState, true); - } else { - loadGfycatOrRedgifsVideo(redgifsRetrofit, gfycatId, false, savedInstanceState, false); - } + loadRedgifsVideo(redgifsId, savedInstanceState); } else { dataSourceFactory = new CacheDataSource.Factory().setCache(mSimpleCache) .setUpstreamDataSourceFactory(new DefaultHttpDataSource.Factory().setAllowCrossProtocolRedirects(true).setUserAgent(APIUtils.USER_AGENT)); @@ -723,61 +709,28 @@ public class ViewVideoActivity extends AppCompatActivity implements CustomFontRe return C.TRACK_TYPE_UNKNOWN; } - private void loadGfycatOrRedgifsVideo(Retrofit retrofit, String gfycatId, boolean isGfycatVideo, - Bundle savedInstanceState, boolean needErrorHandling) { + private void loadRedgifsVideo(String redgifsId, Bundle savedInstanceState) { progressBar.setVisibility(View.VISIBLE); - if (isGfycatVideo) { - FetchGfycatOrRedgifsVideoLinks.fetchGfycatVideoLinks(mExecutor, new Handler(), retrofit, gfycatId, - new FetchGfycatOrRedgifsVideoLinks.FetchGfycatOrRedgifsVideoLinksListener() { - @Override - public void success(String webm, String mp4) { - progressBar.setVisibility(View.GONE); - mVideoUri = Uri.parse(webm); - videoDownloadUrl = mp4; - dataSourceFactory = new CacheDataSource.Factory().setCache(mSimpleCache) - .setUpstreamDataSourceFactory(new DefaultHttpDataSource.Factory().setAllowCrossProtocolRedirects(true).setUserAgent(APIUtils.USER_AGENT)); - preparePlayer(savedInstanceState); - player.prepare(); - player.setMediaSource(new ProgressiveMediaSource.Factory(dataSourceFactory).createMediaSource(MediaItem.fromUri(mVideoUri))); - } - - @Override - public void failed(int errorCode) { - if (errorCode == 404 && needErrorHandling) { - if (mSharedPreferences.getBoolean(SharedPreferencesUtils.AUTOMATICALLY_TRY_REDGIFS, true)) { - loadGfycatOrRedgifsVideo(redgifsRetrofit, gfycatId, false, savedInstanceState, false); - } else { - Snackbar.make(coordinatorLayout, R.string.load_video_in_redgifs, Snackbar.LENGTH_INDEFINITE).setAction(R.string.yes, - view -> loadGfycatOrRedgifsVideo(redgifsRetrofit, gfycatId, false, savedInstanceState, false)).show(); - } - } else { - progressBar.setVisibility(View.GONE); - Toast.makeText(ViewVideoActivity.this, R.string.fetch_gfycat_video_failed, Toast.LENGTH_SHORT).show(); - } - } - }); - } else { - FetchGfycatOrRedgifsVideoLinks.fetchRedgifsVideoLinks(this, mExecutor, new Handler(), redgifsRetrofit, - mCurrentAccountSharedPreferences, gfycatId, new FetchGfycatOrRedgifsVideoLinks.FetchGfycatOrRedgifsVideoLinksListener() { - @Override - public void success(String webm, String mp4) { - progressBar.setVisibility(View.GONE); - mVideoUri = Uri.parse(webm); - videoDownloadUrl = mp4; - dataSourceFactory = new CacheDataSource.Factory().setCache(mSimpleCache) - .setUpstreamDataSourceFactory(new DefaultHttpDataSource.Factory().setAllowCrossProtocolRedirects(true).setUserAgent(APIUtils.USER_AGENT)); - preparePlayer(savedInstanceState); - player.prepare(); - player.setMediaSource(new ProgressiveMediaSource.Factory(dataSourceFactory).createMediaSource(MediaItem.fromUri(mVideoUri))); - } + FetchRedgifsVideoLinks.fetchRedgifsVideoLinks(mExecutor, new Handler(), redgifsRetrofit, + mCurrentAccountSharedPreferences, redgifsId, new FetchRedgifsVideoLinks.FetchRedgifsVideoLinksListener() { + @Override + public void success(String webm, String mp4) { + progressBar.setVisibility(View.GONE); + mVideoUri = Uri.parse(webm); + videoDownloadUrl = mp4; + dataSourceFactory = new CacheDataSource.Factory().setCache(mSimpleCache) + .setUpstreamDataSourceFactory(new DefaultHttpDataSource.Factory().setAllowCrossProtocolRedirects(true).setUserAgent(APIUtils.USER_AGENT)); + preparePlayer(savedInstanceState); + player.prepare(); + player.setMediaSource(new ProgressiveMediaSource.Factory(dataSourceFactory).createMediaSource(MediaItem.fromUri(mVideoUri))); + } - @Override - public void failed(int errorCode) { - progressBar.setVisibility(View.GONE); - Toast.makeText(ViewVideoActivity.this, R.string.fetch_redgifs_video_failed, Toast.LENGTH_SHORT).show(); - } - }); - } + @Override + public void failed(int errorCode) { + progressBar.setVisibility(View.GONE); + Toast.makeText(ViewVideoActivity.this, R.string.fetch_redgifs_video_failed, Toast.LENGTH_SHORT).show(); + } + }); } private void loadVReddItVideo(Bundle savedInstanceState) { @@ -795,30 +748,14 @@ public class ViewVideoActivity extends AppCompatActivity implements CustomFontRe new FetchPost.FetchPostListener() { @Override public void fetchPostSuccess(Post post) { - if (post.isGfycat()) { - videoType = VIDEO_TYPE_GFYCAT; - String gfycatId = post.getGfycatId(); - if (gfycatId != null && gfycatId.contains("-")) { - gfycatId = gfycatId.substring(0, gfycatId.indexOf('-')); - } - if (videoType == VIDEO_TYPE_GFYCAT) { - videoFileName = "Gfycat-" + gfycatId + ".mp4"; - } else { - videoFileName = "Redgifs-" + gfycatId + ".mp4"; - } - loadGfycatOrRedgifsVideo(gfycatRetrofit, gfycatId, true, savedInstanceState, true); - } else if (post.isRedgifs()) { + if (post.isRedgifs()) { videoType = VIDEO_TYPE_REDGIFS; - String gfycatId = post.getGfycatId(); - if (gfycatId != null && gfycatId.contains("-")) { - gfycatId = gfycatId.substring(0, gfycatId.indexOf('-')); - } - if (videoType == VIDEO_TYPE_GFYCAT) { - videoFileName = "Gfycat-" + gfycatId + ".mp4"; - } else { - videoFileName = "Redgifs-" + gfycatId + ".mp4"; + String redgifsId = post.getRedgifsId(); + if (redgifsId != null && redgifsId.contains("-")) { + redgifsId = redgifsId.substring(0, redgifsId.indexOf('-')); } - loadGfycatOrRedgifsVideo(redgifsRetrofit, gfycatId, false, savedInstanceState, false); + videoFileName = "Redgifs-" + redgifsId + ".mp4"; + loadRedgifsVideo(redgifsId, savedInstanceState); } else if (post.isStreamable()) { videoType = VIDEO_TYPE_STREAMABLE; String shortCode = post.getStreamableShortCode(); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/HistoryPostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/HistoryPostRecyclerViewAdapter.java index b5b9d1e5..da1078b2 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/HistoryPostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/HistoryPostRecyclerViewAdapter.java @@ -65,7 +65,7 @@ import butterknife.BindView; import butterknife.ButterKnife; import jp.wasabeef.glide.transformations.BlurTransformation; import jp.wasabeef.glide.transformations.RoundedCornersTransformation; -import ml.docilealligator.infinityforreddit.FetchGfycatOrRedgifsVideoLinks; +import ml.docilealligator.infinityforreddit.FetchRedgifsVideoLinks; import ml.docilealligator.infinityforreddit.FetchStreamableVideo; import ml.docilealligator.infinityforreddit.R; import ml.docilealligator.infinityforreddit.SaveMemoryCenterInisdeDownsampleStrategy; @@ -82,7 +82,6 @@ import ml.docilealligator.infinityforreddit.activities.ViewRedditGalleryActivity import ml.docilealligator.infinityforreddit.activities.ViewSubredditDetailActivity; import ml.docilealligator.infinityforreddit.activities.ViewUserDetailActivity; import ml.docilealligator.infinityforreddit.activities.ViewVideoActivity; -import ml.docilealligator.infinityforreddit.apis.GfycatAPI; import ml.docilealligator.infinityforreddit.apis.RedgifsAPI; import ml.docilealligator.infinityforreddit.apis.StreamableAPI; import ml.docilealligator.infinityforreddit.bottomsheetfragments.ShareLinkBottomSheetFragment; @@ -161,7 +160,6 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy private SharedPreferences mCurrentAccountSharedPreferences; private Executor mExecutor; private Retrofit mOauthRetrofit; - private Retrofit mGfycatRetrofit; private Retrofit mRedgifsRetrofit; private Provider<StreamableAPI> mStreamableApiProvider; private String mAccessToken; @@ -220,7 +218,6 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy private boolean mShowThumbnailOnTheRightInCompactLayout; private double mStartAutoplayVisibleAreaOffset; private boolean mMuteNSFWVideo; - private boolean mAutomaticallyTryRedgifs; private boolean mLongPressToHideToolbarInCompactLayout; private boolean mCompactLayoutToolbarHiddenByDefault; private boolean mDataSavingMode = false; @@ -242,7 +239,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy private RecyclerView.RecycledViewPool mGalleryRecycledViewPool; public HistoryPostRecyclerViewAdapter(BaseActivity activity, HistoryPostFragment fragment, Executor executor, Retrofit oauthRetrofit, - Retrofit gfycatRetrofit, Retrofit redgifsRetrofit, Provider<StreamableAPI> streambleApiProvider, + Retrofit redgifsRetrofit, Provider<StreamableAPI> streambleApiProvider, CustomThemeWrapper customThemeWrapper, Locale locale, @Nullable String accessToken, @NonNull String accountName, int postType, int postLayout, boolean displaySubredditName, SharedPreferences sharedPreferences, SharedPreferences currentAccountSharedPreferences, @@ -256,7 +253,6 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy mCurrentAccountSharedPreferences = currentAccountSharedPreferences; mExecutor = executor; mOauthRetrofit = oauthRetrofit; - mGfycatRetrofit = gfycatRetrofit; mRedgifsRetrofit = redgifsRetrofit; mStreamableApiProvider = streambleApiProvider; mAccessToken = accessToken; @@ -288,7 +284,6 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy sharedPreferences.getInt(SharedPreferencesUtils.START_AUTOPLAY_VISIBLE_AREA_OFFSET_LANDSCAPE, 50) / 100.0; mMuteNSFWVideo = sharedPreferences.getBoolean(SharedPreferencesUtils.MUTE_NSFW_VIDEO, false); - mAutomaticallyTryRedgifs = sharedPreferences.getBoolean(SharedPreferencesUtils.AUTOMATICALLY_TRY_REDGIFS, true); mLongPressToHideToolbarInCompactLayout = sharedPreferences.getBoolean(SharedPreferencesUtils.LONG_PRESS_TO_HIDE_TOOLBAR_IN_COMPACT_LAYOUT, false); mCompactLayoutToolbarHiddenByDefault = sharedPreferences.getBoolean(SharedPreferencesUtils.POST_COMPACT_LAYOUT_TOOLBAR_HIDDEN_BY_DEFAULT, false); @@ -785,19 +780,17 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy } } - if ((post.isGfycat() || post.isRedgifs()) && !post.isLoadGfycatOrStreamableVideoSuccess()) { - ((PostBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = - post.isGfycat() ? mGfycatRetrofit.create(GfycatAPI.class).getGfycatData(post.getGfycatId()) : - mRedgifsRetrofit.create(RedgifsAPI.class).getRedgifsData(APIUtils.getRedgifsOAuthHeader(mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.REDGIFS_ACCESS_TOKEN, "")), post.getGfycatId(), APIUtils.USER_AGENT); - FetchGfycatOrRedgifsVideoLinks.fetchGfycatOrRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(), - ((PostBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall, - post.isGfycat(), mAutomaticallyTryRedgifs, - new FetchGfycatOrRedgifsVideoLinks.FetchGfycatOrRedgifsVideoLinksListener() { + if (post.isRedgifs() && !post.isLoadRedgifsOrStreamableVideoSuccess()) { + ((PostBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall = + mRedgifsRetrofit.create(RedgifsAPI.class).getRedgifsData(APIUtils.getRedgifsOAuthHeader(mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.REDGIFS_ACCESS_TOKEN, "")), post.getRedgifsId(), APIUtils.USER_AGENT); + FetchRedgifsVideoLinks.fetchRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(), + ((PostBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall, + new FetchRedgifsVideoLinks.FetchRedgifsVideoLinksListener() { @Override public void success(String webm, String mp4) { post.setVideoDownloadUrl(mp4); post.setVideoUrl(mp4); - post.setLoadGfyOrStreamableVideoSuccess(true); + post.setLoadRedgifsOrStreamableVideoSuccess(true); if (position == holder.getBindingAdapterPosition()) { ((PostBaseVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl())); } @@ -806,22 +799,22 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy @Override public void failed(int errorCode) { if (position == holder.getBindingAdapterPosition()) { - ((PostBaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.VISIBLE); + ((PostBaseVideoAutoplayViewHolder) holder).errorLoadingVideoImageView.setVisibility(View.VISIBLE); } } }); - } else if(post.isStreamable() && !post.isLoadGfycatOrStreamableVideoSuccess()) { - ((PostBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = + } else if(post.isStreamable() && !post.isLoadRedgifsOrStreamableVideoSuccess()) { + ((PostBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall = mStreamableApiProvider.get().getStreamableData(post.getStreamableShortCode()); FetchStreamableVideo.fetchStreamableVideoInRecyclerViewAdapter(mExecutor, new Handler(), - ((PostBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall, + ((PostBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall, new FetchStreamableVideo.FetchStreamableVideoListener() { @Override public void success(StreamableVideo streamableVideo) { StreamableVideo.Media media = streamableVideo.mp4 == null ? streamableVideo.mp4Mobile : streamableVideo.mp4; post.setVideoDownloadUrl(media.url); post.setVideoUrl(media.url); - post.setLoadGfyOrStreamableVideoSuccess(true); + post.setLoadRedgifsOrStreamableVideoSuccess(true); if (position == holder.getBindingAdapterPosition()) { ((PostBaseVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl())); } @@ -830,7 +823,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy @Override public void failed() { if (position == holder.getBindingAdapterPosition()) { - ((PostBaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.VISIBLE); + ((PostBaseVideoAutoplayViewHolder) holder).errorLoadingVideoImageView.setVisibility(View.VISIBLE); } } }); @@ -965,19 +958,20 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy } } - if ((post.isGfycat() || post.isRedgifs()) && !post.isLoadGfycatOrStreamableVideoSuccess()) { - ((PostCard2BaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = - post.isGfycat() ? mGfycatRetrofit.create(GfycatAPI.class).getGfycatData(post.getGfycatId()) : - mRedgifsRetrofit.create(RedgifsAPI.class).getRedgifsData(APIUtils.getRedgifsOAuthHeader(mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.REDGIFS_ACCESS_TOKEN, "")), post.getGfycatId(), APIUtils.USER_AGENT); - FetchGfycatOrRedgifsVideoLinks.fetchGfycatOrRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(), - ((PostCard2BaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall, - post.isGfycat(), mAutomaticallyTryRedgifs, - new FetchGfycatOrRedgifsVideoLinks.FetchGfycatOrRedgifsVideoLinksListener() { + if (post.isRedgifs() && !post.isLoadRedgifsOrStreamableVideoSuccess()) { + ((PostCard2BaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall = + mRedgifsRetrofit.create(RedgifsAPI.class).getRedgifsData( + APIUtils.getRedgifsOAuthHeader( + mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.REDGIFS_ACCESS_TOKEN, "")), + post.getRedgifsId(), APIUtils.USER_AGENT); + FetchRedgifsVideoLinks.fetchRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(), + ((PostCard2BaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall, + new FetchRedgifsVideoLinks.FetchRedgifsVideoLinksListener() { @Override public void success(String webm, String mp4) { post.setVideoDownloadUrl(mp4); post.setVideoUrl(mp4); - post.setLoadGfyOrStreamableVideoSuccess(true); + post.setLoadRedgifsOrStreamableVideoSuccess(true); if (position == holder.getBindingAdapterPosition()) { ((PostCard2BaseVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl())); } @@ -986,22 +980,22 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy @Override public void failed(int errorCode) { if (position == holder.getBindingAdapterPosition()) { - ((PostCard2BaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.VISIBLE); + ((PostCard2BaseVideoAutoplayViewHolder) holder).errorLoadingRedgifsImageView.setVisibility(View.VISIBLE); } } }); - } else if(post.isStreamable() && !post.isLoadGfycatOrStreamableVideoSuccess()) { - ((PostCard2BaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = + } else if(post.isStreamable() && !post.isLoadRedgifsOrStreamableVideoSuccess()) { + ((PostCard2BaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall = mStreamableApiProvider.get().getStreamableData(post.getStreamableShortCode()); FetchStreamableVideo.fetchStreamableVideoInRecyclerViewAdapter(mExecutor, new Handler(), - ((PostCard2BaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall, + ((PostCard2BaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall, new FetchStreamableVideo.FetchStreamableVideoListener() { @Override public void success(StreamableVideo streamableVideo) { StreamableVideo.Media media = streamableVideo.mp4 == null ? streamableVideo.mp4Mobile : streamableVideo.mp4; post.setVideoDownloadUrl(media.url); post.setVideoUrl(media.url); - post.setLoadGfyOrStreamableVideoSuccess(true); + post.setLoadRedgifsOrStreamableVideoSuccess(true); if (position == holder.getBindingAdapterPosition()) { ((PostCard2BaseVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl())); } @@ -1010,7 +1004,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy @Override public void failed() { if (position == holder.getBindingAdapterPosition()) { - ((PostCard2BaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.VISIBLE); + ((PostCard2BaseVideoAutoplayViewHolder) holder).errorLoadingRedgifsImageView.setVisibility(View.VISIBLE); } } }); @@ -1787,19 +1781,20 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy } } - if ((post.isGfycat() || post.isRedgifs()) && !post.isLoadGfycatOrStreamableVideoSuccess()) { - ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = - post.isGfycat() ? mGfycatRetrofit.create(GfycatAPI.class).getGfycatData(post.getGfycatId()) : - mRedgifsRetrofit.create(RedgifsAPI.class).getRedgifsData(APIUtils.getRedgifsOAuthHeader(mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.REDGIFS_ACCESS_TOKEN, "")), post.getGfycatId(), APIUtils.USER_AGENT); - FetchGfycatOrRedgifsVideoLinks.fetchGfycatOrRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(), - ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall, - post.isGfycat(), mAutomaticallyTryRedgifs, - new FetchGfycatOrRedgifsVideoLinks.FetchGfycatOrRedgifsVideoLinksListener() { + if (post.isRedgifs() && !post.isLoadRedgifsOrStreamableVideoSuccess()) { + ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall = + mRedgifsRetrofit.create(RedgifsAPI.class).getRedgifsData( + APIUtils.getRedgifsOAuthHeader(mCurrentAccountSharedPreferences + .getString(SharedPreferencesUtils.REDGIFS_ACCESS_TOKEN, "")), + post.getRedgifsId(), APIUtils.USER_AGENT); + FetchRedgifsVideoLinks.fetchRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(), + ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall, + new FetchRedgifsVideoLinks.FetchRedgifsVideoLinksListener() { @Override public void success(String webm, String mp4) { post.setVideoDownloadUrl(mp4); post.setVideoUrl(mp4); - post.setLoadGfyOrStreamableVideoSuccess(true); + post.setLoadRedgifsOrStreamableVideoSuccess(true); if (position == holder.getBindingAdapterPosition()) { ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl())); } @@ -1808,22 +1803,22 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy @Override public void failed(int errorCode) { if (position == holder.getBindingAdapterPosition()) { - ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.VISIBLE); + ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).errorLoadingRedgifsImageView.setVisibility(View.VISIBLE); } } }); - } else if(post.isStreamable() && !post.isLoadGfycatOrStreamableVideoSuccess()) { - ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = + } else if(post.isStreamable() && !post.isLoadRedgifsOrStreamableVideoSuccess()) { + ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall = mStreamableApiProvider.get().getStreamableData(post.getStreamableShortCode()); FetchStreamableVideo.fetchStreamableVideoInRecyclerViewAdapter(mExecutor, new Handler(), - ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall, + ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall, new FetchStreamableVideo.FetchStreamableVideoListener() { @Override public void success(StreamableVideo streamableVideo) { StreamableVideo.Media media = streamableVideo.mp4 == null ? streamableVideo.mp4Mobile : streamableVideo.mp4; post.setVideoDownloadUrl(media.url); post.setVideoUrl(media.url); - post.setLoadGfyOrStreamableVideoSuccess(true); + post.setLoadRedgifsOrStreamableVideoSuccess(true); if (position == holder.getBindingAdapterPosition()) { ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl())); } @@ -1832,7 +1827,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy @Override public void failed() { if (position == holder.getBindingAdapterPosition()) { - ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.VISIBLE); + ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).errorLoadingRedgifsImageView.setVisibility(View.VISIBLE); } } }); @@ -2245,11 +2240,11 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy ((PostBaseViewHolder) holder).titleTextView.setTextColor(mPostTitleColor); if (holder instanceof PostBaseVideoAutoplayViewHolder) { ((PostBaseVideoAutoplayViewHolder) holder).mediaUri = null; - if (((PostBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall != null && !((PostBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.isCanceled()) { - ((PostBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.cancel(); - ((PostBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = null; + if (((PostBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall != null && !((PostBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall.isCanceled()) { + ((PostBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall.cancel(); + ((PostBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall = null; } - ((PostBaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.GONE); + ((PostBaseVideoAutoplayViewHolder) holder).errorLoadingVideoImageView.setVisibility(View.GONE); ((PostBaseVideoAutoplayViewHolder) holder).muteButton.setVisibility(View.GONE); if (!((PostBaseVideoAutoplayViewHolder) holder).isManuallyPaused) { ((PostBaseVideoAutoplayViewHolder) holder).resetVolume(); @@ -2275,11 +2270,11 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy ((PostTextTypeViewHolder) holder).binding.contentTextViewItemPostTextType.setVisibility(View.GONE); } else if (holder instanceof PostCard2BaseVideoAutoplayViewHolder) { ((PostCard2BaseVideoAutoplayViewHolder) holder).mediaUri = null; - if (((PostCard2BaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall != null && !((PostCard2BaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.isCanceled()) { - ((PostCard2BaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.cancel(); - ((PostCard2BaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = null; + if (((PostCard2BaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall != null && !((PostCard2BaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall.isCanceled()) { + ((PostCard2BaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall.cancel(); + ((PostCard2BaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall = null; } - ((PostCard2BaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.GONE); + ((PostCard2BaseVideoAutoplayViewHolder) holder).errorLoadingRedgifsImageView.setVisibility(View.GONE); ((PostCard2BaseVideoAutoplayViewHolder) holder).muteButton.setVisibility(View.GONE); ((PostCard2BaseVideoAutoplayViewHolder) holder).resetVolume(); mGlide.clear(((PostCard2BaseVideoAutoplayViewHolder) holder).previewImageView); @@ -2357,11 +2352,11 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy ((PostMaterial3CardBaseViewHolder) holder).titleTextView.setTextColor(mPostTitleColor); if (holder instanceof PostMaterial3CardBaseVideoAutoplayViewHolder) { ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).mediaUri = null; - if (((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall != null && !((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.isCanceled()) { - ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.cancel(); - ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = null; + if (((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall != null && !((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall.isCanceled()) { + ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall.cancel(); + ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall = null; } - ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.GONE); + ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).errorLoadingRedgifsImageView.setVisibility(View.GONE); ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).muteButton.setVisibility(View.GONE); if (!((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).isManuallyPaused) { ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).resetVolume(); @@ -2483,12 +2478,9 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy if (post.isImgur()) { intent.setData(Uri.parse(post.getVideoUrl())); intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_IMGUR); - } else if (post.isGfycat()) { - intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_GFYCAT); - intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId()); } else if (post.isRedgifs()) { intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_REDGIFS); - intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId()); + intent.putExtra(ViewVideoActivity.EXTRA_REDGIFS_ID, post.getRedgifsId()); } else if (post.isStreamable()) { intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_STREAMABLE); intent.putExtra(ViewVideoActivity.EXTRA_STREAMABLE_SHORT_CODE, post.getStreamableShortCode()); @@ -3120,7 +3112,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy class PostBaseVideoAutoplayViewHolder extends PostBaseViewHolder implements ToroPlayer { AspectRatioFrameLayout aspectRatioFrameLayout; GifImageView previewImageView; - ImageView errorLoadingGfycatImageView; + ImageView errorLoadingVideoImageView; PlayerView videoPlayer; ImageView muteButton; ImageView fullscreenButton; @@ -3133,7 +3125,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy ExoPlayerViewHelper helper; private Uri mediaUri; private float volume; - public Call<String> fetchGfycatOrStreamableVideoCall; + public Call<String> fetchRedgifsOrStreamableVideoCall; private boolean isManuallyPaused; PostBaseVideoAutoplayViewHolder(View rootView, @@ -3152,7 +3144,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy CustomTextView flairTextView, AspectRatioFrameLayout aspectRatioFrameLayout, GifImageView previewImageView, - ImageView errorLoadingGfycatImageView, + ImageView errorLoadingVideoImageView, PlayerView videoPlayer, ImageView muteButton, ImageView fullscreenButton, @@ -3191,7 +3183,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy this.aspectRatioFrameLayout = aspectRatioFrameLayout; this.previewImageView = previewImageView; - this.errorLoadingGfycatImageView = errorLoadingGfycatImageView; + this.errorLoadingVideoImageView = errorLoadingVideoImageView; this.videoPlayer = videoPlayer; this.muteButton = muteButton; this.fullscreenButton = fullscreenButton; @@ -3230,17 +3222,10 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy if (post.isImgur()) { intent.setData(Uri.parse(post.getVideoUrl())); intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_IMGUR); - } else if (post.isGfycat()) { - intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_GFYCAT); - intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId()); - if (post.isLoadGfycatOrStreamableVideoSuccess()) { - intent.setData(Uri.parse(post.getVideoUrl())); - intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, post.getVideoDownloadUrl()); - } } else if (post.isRedgifs()) { intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_REDGIFS); - intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId()); - if (post.isLoadGfycatOrStreamableVideoSuccess()) { + intent.putExtra(ViewVideoActivity.EXTRA_REDGIFS_ID, post.getRedgifsId()); + if (post.isLoadRedgifsOrStreamableVideoSuccess()) { intent.setData(Uri.parse(post.getVideoUrl())); intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, post.getVideoDownloadUrl()); } @@ -3438,7 +3423,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy binding.flairCustomTextViewItemPostVideoTypeAutoplay, binding.aspectRatioFrameLayoutItemPostVideoTypeAutoplay, binding.previewImageViewItemPostVideoTypeAutoplay, - binding.errorLoadingGfycatImageViewItemPostVideoTypeAutoplay, + binding.errorLoadingVideoImageViewItemPostVideoTypeAutoplay, binding.playerViewItemPostVideoTypeAutoplay, binding.getRoot().findViewById(R.id.mute_exo_playback_control_view), binding.getRoot().findViewById(R.id.fullscreen_exo_playback_control_view), @@ -3473,7 +3458,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy binding.flairCustomTextViewItemPostVideoTypeAutoplay, binding.aspectRatioFrameLayoutItemPostVideoTypeAutoplay, binding.previewImageViewItemPostVideoTypeAutoplay, - binding.errorLoadingGfycatImageViewItemPostVideoTypeAutoplay, + binding.errorLoadingVideoImageViewItemPostVideoTypeAutoplay, binding.playerViewItemPostVideoTypeAutoplay, binding.getRoot().findViewById(R.id.mute_exo_playback_control_view), binding.getRoot().findViewById(R.id.fullscreen_exo_playback_control_view), @@ -4755,7 +4740,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy class PostCard2BaseVideoAutoplayViewHolder extends PostBaseViewHolder implements ToroPlayer { AspectRatioFrameLayout aspectRatioFrameLayout; GifImageView previewImageView; - ImageView errorLoadingGfycatImageView; + ImageView errorLoadingRedgifsImageView; PlayerView videoPlayer; ImageView muteButton; ImageView fullscreenButton; @@ -4770,7 +4755,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy ExoPlayerViewHelper helper; private Uri mediaUri; private float volume; - public Call<String> fetchGfycatOrStreamableVideoCall; + public Call<String> fetchRedgifsOrStreamableVideoCall; private boolean isManuallyPaused; PostCard2BaseVideoAutoplayViewHolder(View itemView, @@ -4789,7 +4774,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy CustomTextView flairTextView, AspectRatioFrameLayout aspectRatioFrameLayout, GifImageView previewImageView, - ImageView errorLoadingGfycatImageView, + ImageView errorLoadingRedgifsImageView, PlayerView videoPlayer, ImageView muteButton, ImageView fullscreenButton, @@ -4830,7 +4815,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy this.aspectRatioFrameLayout = aspectRatioFrameLayout; this.previewImageView = previewImageView; - this.errorLoadingGfycatImageView = errorLoadingGfycatImageView; + this.errorLoadingRedgifsImageView = errorLoadingRedgifsImageView; this.videoPlayer = videoPlayer; this.muteButton = muteButton; this.fullscreenButton = fullscreenButton; @@ -4900,17 +4885,10 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy if (post.isImgur()) { intent.setData(Uri.parse(post.getVideoUrl())); intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_IMGUR); - } else if (post.isGfycat()) { - intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_GFYCAT); - intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId()); - if (post.isLoadGfycatOrStreamableVideoSuccess()) { - intent.setData(Uri.parse(post.getVideoUrl())); - intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, post.getVideoDownloadUrl()); - } } else if (post.isRedgifs()) { intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_REDGIFS); - intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId()); - if (post.isLoadGfycatOrStreamableVideoSuccess()) { + intent.putExtra(ViewVideoActivity.EXTRA_REDGIFS_ID, post.getRedgifsId()); + if (post.isLoadRedgifsOrStreamableVideoSuccess()) { intent.setData(Uri.parse(post.getVideoUrl())); intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, post.getVideoDownloadUrl()); } @@ -5077,7 +5055,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy binding.flairCustomTextViewItemPostCard2VideoAutoplay, binding.aspectRatioFrameLayoutItemPostCard2VideoAutoplay, binding.previewImageViewItemPostCard2VideoAutoplay, - binding.errorLoadingGfycatImageViewItemPostCard2VideoAutoplay, + binding.errorLoadingVideoImageViewItemPostCard2VideoAutoplay, binding.playerViewItemPostCard2VideoAutoplay, binding.getRoot().findViewById(R.id.mute_exo_playback_control_view), binding.getRoot().findViewById(R.id.fullscreen_exo_playback_control_view), @@ -5113,7 +5091,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy binding.flairCustomTextViewItemPostCard2VideoAutoplay, binding.aspectRatioFrameLayoutItemPostCard2VideoAutoplay, binding.previewImageViewItemPostCard2VideoAutoplay, - binding.errorLoadingGfycatImageViewItemPostCard2VideoAutoplay, + binding.errorLoadingVideoImageViewItemPostCard2VideoAutoplay, binding.playerViewItemPostCard2VideoAutoplay, binding.getRoot().findViewById(R.id.mute_exo_playback_control_view), binding.getRoot().findViewById(R.id.fullscreen_exo_playback_control_view), @@ -5754,7 +5732,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy class PostMaterial3CardBaseVideoAutoplayViewHolder extends PostMaterial3CardBaseViewHolder implements ToroPlayer { AspectRatioFrameLayout aspectRatioFrameLayout; GifImageView previewImageView; - ImageView errorLoadingGfycatImageView; + ImageView errorLoadingRedgifsImageView; PlayerView videoPlayer; ImageView muteButton; ImageView fullscreenButton; @@ -5767,7 +5745,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy ExoPlayerViewHelper helper; private Uri mediaUri; private float volume; - public Call<String> fetchGfycatOrStreamableVideoCall; + public Call<String> fetchRedgifsOrStreamableVideoCall; private boolean isManuallyPaused; PostMaterial3CardBaseVideoAutoplayViewHolder(View rootView, @@ -5779,7 +5757,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy TextView titleTextView, AspectRatioFrameLayout aspectRatioFrameLayout, GifImageView previewImageView, - ImageView errorLoadingGfycatImageView, + ImageView errorLoadingRedgifsImageView, PlayerView videoPlayer, ImageView muteButton, ImageView fullscreenButton, @@ -5811,7 +5789,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy this.aspectRatioFrameLayout = aspectRatioFrameLayout; this.previewImageView = previewImageView; - this.errorLoadingGfycatImageView = errorLoadingGfycatImageView; + this.errorLoadingRedgifsImageView = errorLoadingRedgifsImageView; this.videoPlayer = videoPlayer; this.muteButton = muteButton; this.fullscreenButton = fullscreenButton; @@ -5878,17 +5856,10 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy if (post.isImgur()) { intent.setData(Uri.parse(post.getVideoUrl())); intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_IMGUR); - } else if (post.isGfycat()) { - intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_GFYCAT); - intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId()); - if (post.isLoadGfycatOrStreamableVideoSuccess()) { - intent.setData(Uri.parse(post.getVideoUrl())); - intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, post.getVideoDownloadUrl()); - } } else if (post.isRedgifs()) { intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_REDGIFS); - intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId()); - if (post.isLoadGfycatOrStreamableVideoSuccess()) { + intent.putExtra(ViewVideoActivity.EXTRA_REDGIFS_ID, post.getRedgifsId()); + if (post.isLoadRedgifsOrStreamableVideoSuccess()) { intent.setData(Uri.parse(post.getVideoUrl())); intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, post.getVideoDownloadUrl()); } @@ -6048,7 +6019,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy binding.titleTextViewItemPostCard3VideoTypeAutoplay, binding.aspectRatioFrameLayoutItemPostCard3VideoTypeAutoplay, binding.previewImageViewItemPostCard3VideoTypeAutoplay, - binding.errorLoadingGfycatImageViewItemPostCard3VideoTypeAutoplay, + binding.errorLoadingVideoImageViewItemPostCard3VideoTypeAutoplay, binding.playerViewItemPostCard3VideoTypeAutoplay, binding.getRoot().findViewById(R.id.mute_exo_playback_control_view), binding.getRoot().findViewById(R.id.fullscreen_exo_playback_control_view), @@ -6076,7 +6047,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy binding.titleTextViewItemPostCard3VideoTypeAutoplay, binding.aspectRatioFrameLayoutItemPostCard3VideoTypeAutoplay, binding.previewImageViewItemPostCard3VideoTypeAutoplay, - binding.errorLoadingGfycatImageViewItemPostCard3VideoTypeAutoplay, + binding.errorLoadingVideoImageViewItemPostCard3VideoTypeAutoplay, binding.playerViewItemPostCard3VideoTypeAutoplay, binding.getRoot().findViewById(R.id.mute_exo_playback_control_view), binding.getRoot().findViewById(R.id.fullscreen_exo_playback_control_view), diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java index a8148722..39ac232a 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java @@ -61,7 +61,7 @@ import io.noties.markwon.MarkwonPlugin; import io.noties.markwon.core.MarkwonTheme; import jp.wasabeef.glide.transformations.BlurTransformation; import jp.wasabeef.glide.transformations.RoundedCornersTransformation; -import ml.docilealligator.infinityforreddit.FetchGfycatOrRedgifsVideoLinks; +import ml.docilealligator.infinityforreddit.FetchRedgifsVideoLinks; import ml.docilealligator.infinityforreddit.FetchStreamableVideo; import ml.docilealligator.infinityforreddit.R; import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase; @@ -80,7 +80,6 @@ import ml.docilealligator.infinityforreddit.activities.ViewRedditGalleryActivity import ml.docilealligator.infinityforreddit.activities.ViewSubredditDetailActivity; import ml.docilealligator.infinityforreddit.activities.ViewUserDetailActivity; import ml.docilealligator.infinityforreddit.activities.ViewVideoActivity; -import ml.docilealligator.infinityforreddit.apis.GfycatAPI; import ml.docilealligator.infinityforreddit.apis.RedgifsAPI; import ml.docilealligator.infinityforreddit.apis.StreamableAPI; import ml.docilealligator.infinityforreddit.asynctasks.LoadSubredditIcon; @@ -140,7 +139,6 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler private final Executor mExecutor; private final Retrofit mOauthRetrofit; private final Retrofit mApplicationOnlyRetrofit; - private final Retrofit mGfycatRetrofit; private final Retrofit mRedgifsRetrofit; private final Provider<StreamableAPI> mStreamableApiProvider; private final RedditDataRoomDatabase mRedditDataRoomDatabase; @@ -170,7 +168,6 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler private final boolean mMuteAutoplayingVideos; private final double mStartAutoplayVisibleAreaOffset; private final boolean mMuteNSFWVideo; - private final boolean mAutomaticallyTryRedgifs; private boolean mDataSavingMode; private final boolean mDisableImagePreview; private final boolean mOnlyDisablePreviewInVideoAndGifPosts; @@ -224,7 +221,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler public PostDetailRecyclerViewAdapter(@NonNull BaseActivity activity, ViewPostDetailFragment fragment, Executor executor, CustomThemeWrapper customThemeWrapper, - Retrofit oauthRetrofit, Retrofit applicationOnlyRetrofit, Retrofit gfycatRetrofit, + Retrofit oauthRetrofit, Retrofit applicationOnlyRetrofit, Retrofit redgifsRetrofit, Provider<StreamableAPI> streamableApiProvider, RedditDataRoomDatabase redditDataRoomDatabase, RequestManager glide, boolean separatePostAndComments, @Nullable String accessToken, @@ -240,7 +237,6 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler mExecutor = executor; mOauthRetrofit = oauthRetrofit; mApplicationOnlyRetrofit = applicationOnlyRetrofit; - mGfycatRetrofit = gfycatRetrofit; mRedgifsRetrofit = redgifsRetrofit; mStreamableApiProvider = streamableApiProvider; mRedditDataRoomDatabase = redditDataRoomDatabase; @@ -285,7 +281,6 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler sharedPreferences.getInt(SharedPreferencesUtils.START_AUTOPLAY_VISIBLE_AREA_OFFSET_LANDSCAPE, 50) / 100.0; mMuteNSFWVideo = sharedPreferences.getBoolean(SharedPreferencesUtils.MUTE_NSFW_VIDEO, false); - mAutomaticallyTryRedgifs = sharedPreferences.getBoolean(SharedPreferencesUtils.AUTOMATICALLY_TRY_REDGIFS, true); String dataSavingModeString = sharedPreferences.getString(SharedPreferencesUtils.DATA_SAVING_MODE, SharedPreferencesUtils.DATA_SAVING_MODE_OFF); if (dataSavingModeString.equals(SharedPreferencesUtils.DATA_SAVING_MODE_ALWAYS)) { @@ -714,45 +709,46 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler ((PostDetailBaseVideoAutoplayViewHolder) holder).setVolume((mMuteAutoplayingVideos || (mPost.isNSFW() && mMuteNSFWVideo)) ? 0f : 1f); } - if (mPost.isGfycat() || mPost.isRedgifs() && !mPost.isLoadGfycatOrStreamableVideoSuccess()) { - ((PostDetailBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = - mPost.isGfycat() ? mGfycatRetrofit.create(GfycatAPI.class).getGfycatData(mPost.getGfycatId()) : - mRedgifsRetrofit.create(RedgifsAPI.class).getRedgifsData(APIUtils.getRedgifsOAuthHeader(mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.REDGIFS_ACCESS_TOKEN, "")), mPost.getGfycatId(), APIUtils.USER_AGENT); - FetchGfycatOrRedgifsVideoLinks.fetchGfycatOrRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(), - ((PostDetailBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall, - mPost.isGfycat(), mAutomaticallyTryRedgifs, - new FetchGfycatOrRedgifsVideoLinks.FetchGfycatOrRedgifsVideoLinksListener() { + if (mPost.isRedgifs() && !mPost.isLoadRedgifsOrStreamableVideoSuccess()) { + ((PostDetailBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall = + mRedgifsRetrofit.create(RedgifsAPI.class) + .getRedgifsData(APIUtils.getRedgifsOAuthHeader( + mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.REDGIFS_ACCESS_TOKEN, "")), + mPost.getRedgifsId(), APIUtils.USER_AGENT); + FetchRedgifsVideoLinks.fetchRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(), + ((PostDetailBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall, + new FetchRedgifsVideoLinks.FetchRedgifsVideoLinksListener() { @Override public void success(String webm, String mp4) { mPost.setVideoDownloadUrl(mp4); mPost.setVideoUrl(mp4); - mPost.setLoadGfyOrStreamableVideoSuccess(true); + mPost.setLoadRedgifsOrStreamableVideoSuccess(true); ((PostDetailBaseVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(mPost.getVideoUrl())); } @Override public void failed(int errorCode) { - ((PostDetailBaseVideoAutoplayViewHolder) holder).mErrorLoadingGfycatImageView.setVisibility(View.VISIBLE); + ((PostDetailBaseVideoAutoplayViewHolder) holder).mErrorLoadingRedgifsImageView.setVisibility(View.VISIBLE); } }); - } else if(mPost.isStreamable() && !mPost.isLoadGfycatOrStreamableVideoSuccess()) { - ((PostDetailBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = + } else if(mPost.isStreamable() && !mPost.isLoadRedgifsOrStreamableVideoSuccess()) { + ((PostDetailBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall = mStreamableApiProvider.get().getStreamableData(mPost.getStreamableShortCode()); FetchStreamableVideo.fetchStreamableVideoInRecyclerViewAdapter(mExecutor, new Handler(), - ((PostDetailBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall, + ((PostDetailBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall, new FetchStreamableVideo.FetchStreamableVideoListener() { @Override public void success(StreamableVideo streamableVideo) { StreamableVideo.Media media = streamableVideo.mp4 == null ? streamableVideo.mp4Mobile : streamableVideo.mp4; mPost.setVideoDownloadUrl(media.url); mPost.setVideoUrl(media.url); - mPost.setLoadGfyOrStreamableVideoSuccess(true); + mPost.setLoadRedgifsOrStreamableVideoSuccess(true); ((PostDetailBaseVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(mPost.getVideoUrl())); } @Override public void failed() { - ((PostDetailBaseVideoAutoplayViewHolder) holder).mErrorLoadingGfycatImageView.setVisibility(View.VISIBLE); + ((PostDetailBaseVideoAutoplayViewHolder) holder).mErrorLoadingRedgifsImageView.setVisibility(View.VISIBLE); } }); } else { @@ -1040,11 +1036,11 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler ((PostDetailBaseViewHolder) holder).contentMarkdownView.setVisibility(View.GONE); if (holder instanceof PostDetailBaseVideoAutoplayViewHolder) { - if (((PostDetailBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall != null && !((PostDetailBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.isCanceled()) { - ((PostDetailBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.cancel(); - ((PostDetailBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = null; + if (((PostDetailBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall != null && !((PostDetailBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall.isCanceled()) { + ((PostDetailBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall.cancel(); + ((PostDetailBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall = null; } - ((PostDetailBaseVideoAutoplayViewHolder) holder).mErrorLoadingGfycatImageView.setVisibility(View.GONE); + ((PostDetailBaseVideoAutoplayViewHolder) holder).mErrorLoadingRedgifsImageView.setVisibility(View.GONE); ((PostDetailBaseVideoAutoplayViewHolder) holder).muteButton.setVisibility(View.GONE); if (!((PostDetailBaseVideoAutoplayViewHolder) holder).isManuallyPaused) { ((PostDetailBaseVideoAutoplayViewHolder) holder).resetVolume(); @@ -1603,11 +1599,11 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler } class PostDetailBaseVideoAutoplayViewHolder extends PostDetailBaseViewHolder implements ToroPlayer { - public Call<String> fetchGfycatOrStreamableVideoCall; + public Call<String> fetchRedgifsOrStreamableVideoCall; AspectRatioFrameLayout aspectRatioFrameLayout; PlayerView playerView; GifImageView previewImageView; - ImageView mErrorLoadingGfycatImageView; + ImageView mErrorLoadingRedgifsImageView; ImageView muteButton; ImageView fullscreenButton; ImageView pauseButton; @@ -1639,7 +1635,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler AspectRatioFrameLayout aspectRatioFrameLayout, PlayerView playerView, GifImageView previewImageView, - ImageView errorLoadingGfycatImageView, + ImageView errorLoadingRedgifsImageView, ImageView muteButton, ImageView fullscreenButton, ImageView pauseButton, @@ -1679,7 +1675,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler this.aspectRatioFrameLayout = aspectRatioFrameLayout; this.previewImageView = previewImageView; - this.mErrorLoadingGfycatImageView = errorLoadingGfycatImageView; + this.mErrorLoadingRedgifsImageView = errorLoadingRedgifsImageView; this.playerView = playerView; this.muteButton = muteButton; this.fullscreenButton = fullscreenButton; @@ -1710,17 +1706,10 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler if (mPost.isImgur()) { intent.setData(Uri.parse(mPost.getVideoUrl())); intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_IMGUR); - } else if (mPost.isGfycat()) { - intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_GFYCAT); - intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, mPost.getGfycatId()); - if (mPost.isLoadGfycatOrStreamableVideoSuccess()) { - intent.setData(Uri.parse(mPost.getVideoUrl())); - intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, mPost.getVideoDownloadUrl()); - } } else if (mPost.isRedgifs()) { intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_REDGIFS); - intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, mPost.getGfycatId()); - if (mPost.isLoadGfycatOrStreamableVideoSuccess()) { + intent.putExtra(ViewVideoActivity.EXTRA_REDGIFS_ID, mPost.getRedgifsId()); + if (mPost.isLoadRedgifsOrStreamableVideoSuccess()) { intent.setData(Uri.parse(mPost.getVideoUrl())); intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, mPost.getVideoDownloadUrl()); } @@ -1914,7 +1903,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler binding.aspectRatioFrameLayoutItemPostDetailVideoAutoplay, binding.playerViewItemPostDetailVideoAutoplay, binding.previewImageViewItemPostDetailVideoAutoplay, - binding.errorLoadingGfycatImageViewItemPostDetailVideoAutoplay, + binding.errorLoadingVideoImageViewItemPostDetailVideoAutoplay, binding.getRoot().findViewById(R.id.mute_exo_playback_control_view), binding.getRoot().findViewById(R.id.fullscreen_exo_playback_control_view), binding.getRoot().findViewById(R.id.exo_pause), @@ -1951,7 +1940,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler binding.aspectRatioFrameLayoutItemPostDetailVideoAutoplay, binding.playerViewItemPostDetailVideoAutoplay, binding.previewImageViewItemPostDetailVideoAutoplay, - binding.errorLoadingGfycatImageViewItemPostDetailVideoAutoplay, + binding.errorLoadingVideoImageViewItemPostDetailVideoAutoplay, binding.getRoot().findViewById(R.id.mute_exo_playback_control_view), binding.getRoot().findViewById(R.id.fullscreen_exo_playback_control_view), binding.getRoot().findViewById(R.id.exo_pause), @@ -2010,12 +1999,9 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler if (mPost.isImgur()) { intent.setData(Uri.parse(mPost.getVideoUrl())); intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_IMGUR); - } else if (mPost.isGfycat()) { - intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_GFYCAT); - intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, mPost.getGfycatId()); } else if (mPost.isRedgifs()) { intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_REDGIFS); - intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, mPost.getGfycatId()); + intent.putExtra(ViewVideoActivity.EXTRA_REDGIFS_ID, mPost.getRedgifsId()); } else if (mPost.isStreamable()) { intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_STREAMABLE); intent.putExtra(ViewVideoActivity.EXTRA_STREAMABLE_SHORT_CODE, mPost.getStreamableShortCode()); @@ -2185,12 +2171,9 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler if (mPost != null) { if (mPost.getPostType() == Post.VIDEO_TYPE) { Intent intent = new Intent(mActivity, ViewVideoActivity.class); - if (mPost.isGfycat()) { - intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_GFYCAT); - intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, mPost.getGfycatId()); - } else if (mPost.isRedgifs()) { + if (mPost.isRedgifs()) { intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_REDGIFS); - intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, mPost.getGfycatId()); + intent.putExtra(ViewVideoActivity.EXTRA_REDGIFS_ID, mPost.getRedgifsId()); } else if (mPost.isStreamable()) { intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_STREAMABLE); intent.putExtra(ViewVideoActivity.EXTRA_STREAMABLE_SHORT_CODE, mPost.getStreamableShortCode()); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java index 520a4496..5f8ff0d5 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java @@ -65,7 +65,7 @@ import butterknife.BindView; import butterknife.ButterKnife; import jp.wasabeef.glide.transformations.BlurTransformation; import jp.wasabeef.glide.transformations.RoundedCornersTransformation; -import ml.docilealligator.infinityforreddit.FetchGfycatOrRedgifsVideoLinks; +import ml.docilealligator.infinityforreddit.FetchRedgifsVideoLinks; import ml.docilealligator.infinityforreddit.FetchStreamableVideo; import ml.docilealligator.infinityforreddit.MarkPostAsReadInterface; import ml.docilealligator.infinityforreddit.R; @@ -83,7 +83,6 @@ import ml.docilealligator.infinityforreddit.activities.ViewRedditGalleryActivity import ml.docilealligator.infinityforreddit.activities.ViewSubredditDetailActivity; import ml.docilealligator.infinityforreddit.activities.ViewUserDetailActivity; import ml.docilealligator.infinityforreddit.activities.ViewVideoActivity; -import ml.docilealligator.infinityforreddit.apis.GfycatAPI; import ml.docilealligator.infinityforreddit.apis.RedgifsAPI; import ml.docilealligator.infinityforreddit.apis.StreamableAPI; import ml.docilealligator.infinityforreddit.bottomsheetfragments.ShareLinkBottomSheetFragment; @@ -166,7 +165,6 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie private SharedPreferences mCurrentAccountSharedPreferences; private Executor mExecutor; private Retrofit mOauthRetrofit; - private Retrofit mGfycatRetrofit; private Retrofit mRedgifsRetrofit; private Provider<StreamableAPI> mStreamableApiProvider; private String mAccessToken; @@ -230,7 +228,6 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie private boolean mShowThumbnailOnTheRightInCompactLayout; private double mStartAutoplayVisibleAreaOffset; private boolean mMuteNSFWVideo; - private boolean mAutomaticallyTryRedgifs; private boolean mLongPressToHideToolbarInCompactLayout; private boolean mCompactLayoutToolbarHiddenByDefault; private boolean mDataSavingMode = false; @@ -255,7 +252,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie private RecyclerView.RecycledViewPool mGalleryRecycledViewPool; public PostRecyclerViewAdapter(BaseActivity activity, PostFragment fragment, Executor executor, Retrofit oauthRetrofit, - Retrofit gfycatRetrofit, Retrofit redgifsRetrofit, Provider<StreamableAPI> streamableApiProvider, + Retrofit redgifsRetrofit, Provider<StreamableAPI> streamableApiProvider, CustomThemeWrapper customThemeWrapper, Locale locale, @Nullable String accessToken, @NonNull String accountName, int postType, int postLayout, boolean displaySubredditName, SharedPreferences sharedPreferences, SharedPreferences currentAccountSharedPreferences, @@ -270,7 +267,6 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie mCurrentAccountSharedPreferences = currentAccountSharedPreferences; mExecutor = executor; mOauthRetrofit = oauthRetrofit; - mGfycatRetrofit = gfycatRetrofit; mRedgifsRetrofit = redgifsRetrofit; mStreamableApiProvider = streamableApiProvider; mAccessToken = accessToken; @@ -303,7 +299,6 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie sharedPreferences.getInt(SharedPreferencesUtils.START_AUTOPLAY_VISIBLE_AREA_OFFSET_LANDSCAPE, 50) / 100.0; mMuteNSFWVideo = sharedPreferences.getBoolean(SharedPreferencesUtils.MUTE_NSFW_VIDEO, false); - mAutomaticallyTryRedgifs = sharedPreferences.getBoolean(SharedPreferencesUtils.AUTOMATICALLY_TRY_REDGIFS, true); mLongPressToHideToolbarInCompactLayout = sharedPreferences.getBoolean(SharedPreferencesUtils.LONG_PRESS_TO_HIDE_TOOLBAR_IN_COMPACT_LAYOUT, false); mCompactLayoutToolbarHiddenByDefault = sharedPreferences.getBoolean(SharedPreferencesUtils.POST_COMPACT_LAYOUT_TOOLBAR_HIDDEN_BY_DEFAULT, false); @@ -827,19 +822,20 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie } } - if ((post.isGfycat() || post.isRedgifs()) && !post.isLoadGfycatOrStreamableVideoSuccess()) { - ((PostBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = - post.isGfycat() ? mGfycatRetrofit.create(GfycatAPI.class).getGfycatData(post.getGfycatId()) : - mRedgifsRetrofit.create(RedgifsAPI.class).getRedgifsData(APIUtils.getRedgifsOAuthHeader(mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.REDGIFS_ACCESS_TOKEN, "")), post.getGfycatId(), APIUtils.USER_AGENT); - FetchGfycatOrRedgifsVideoLinks.fetchGfycatOrRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(), - ((PostBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall, - post.isGfycat(), mAutomaticallyTryRedgifs, - new FetchGfycatOrRedgifsVideoLinks.FetchGfycatOrRedgifsVideoLinksListener() { + if (post.isRedgifs() && !post.isLoadRedgifsOrStreamableVideoSuccess()) { + ((PostBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall = + mRedgifsRetrofit.create(RedgifsAPI.class) + .getRedgifsData(APIUtils.getRedgifsOAuthHeader( + mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.REDGIFS_ACCESS_TOKEN, "")), + post.getRedgifsId(), APIUtils.USER_AGENT); + FetchRedgifsVideoLinks.fetchRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(), + ((PostBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall, + new FetchRedgifsVideoLinks.FetchRedgifsVideoLinksListener() { @Override public void success(String webm, String mp4) { post.setVideoDownloadUrl(mp4); post.setVideoUrl(mp4); - post.setLoadGfyOrStreamableVideoSuccess(true); + post.setLoadRedgifsOrStreamableVideoSuccess(true); if (position == holder.getBindingAdapterPosition()) { ((PostBaseVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl())); } @@ -848,22 +844,22 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie @Override public void failed(int errorCode) { if (position == holder.getBindingAdapterPosition()) { - ((PostBaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.VISIBLE); + ((PostBaseVideoAutoplayViewHolder) holder).errorLoadingRedgifsImageView.setVisibility(View.VISIBLE); } } }); - } else if(post.isStreamable() && !post.isLoadGfycatOrStreamableVideoSuccess()) { - ((PostBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = + } else if(post.isStreamable() && !post.isLoadRedgifsOrStreamableVideoSuccess()) { + ((PostBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall = mStreamableApiProvider.get().getStreamableData(post.getStreamableShortCode()); FetchStreamableVideo.fetchStreamableVideoInRecyclerViewAdapter(mExecutor, new Handler(), - ((PostBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall, + ((PostBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall, new FetchStreamableVideo.FetchStreamableVideoListener() { @Override public void success(StreamableVideo streamableVideo) { StreamableVideo.Media media = streamableVideo.mp4 == null ? streamableVideo.mp4Mobile : streamableVideo.mp4; post.setVideoDownloadUrl(media.url); post.setVideoUrl(media.url); - post.setLoadGfyOrStreamableVideoSuccess(true); + post.setLoadRedgifsOrStreamableVideoSuccess(true); if (position == holder.getBindingAdapterPosition()) { ((PostBaseVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl())); } @@ -872,7 +868,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie @Override public void failed() { if (position == holder.getBindingAdapterPosition()) { - ((PostBaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.VISIBLE); + ((PostBaseVideoAutoplayViewHolder) holder).errorLoadingRedgifsImageView.setVisibility(View.VISIBLE); } } }); @@ -1010,19 +1006,20 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie } } - if ((post.isGfycat() || post.isRedgifs()) && !post.isLoadGfycatOrStreamableVideoSuccess()) { - ((PostCard2BaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = - post.isGfycat() ? mGfycatRetrofit.create(GfycatAPI.class).getGfycatData(post.getGfycatId()) : - mRedgifsRetrofit.create(RedgifsAPI.class).getRedgifsData(APIUtils.getRedgifsOAuthHeader(mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.REDGIFS_ACCESS_TOKEN, "")), post.getGfycatId(), APIUtils.USER_AGENT); - FetchGfycatOrRedgifsVideoLinks.fetchGfycatOrRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(), - ((PostCard2BaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall, - post.isGfycat(), mAutomaticallyTryRedgifs, - new FetchGfycatOrRedgifsVideoLinks.FetchGfycatOrRedgifsVideoLinksListener() { + if (post.isRedgifs() && !post.isLoadRedgifsOrStreamableVideoSuccess()) { + ((PostCard2BaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall = + mRedgifsRetrofit.create(RedgifsAPI.class).getRedgifsData( + APIUtils.getRedgifsOAuthHeader(mCurrentAccountSharedPreferences + .getString(SharedPreferencesUtils.REDGIFS_ACCESS_TOKEN, "")), + post.getRedgifsId(), APIUtils.USER_AGENT); + FetchRedgifsVideoLinks.fetchRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(), + ((PostCard2BaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall, + new FetchRedgifsVideoLinks.FetchRedgifsVideoLinksListener() { @Override public void success(String webm, String mp4) { post.setVideoDownloadUrl(mp4); post.setVideoUrl(mp4); - post.setLoadGfyOrStreamableVideoSuccess(true); + post.setLoadRedgifsOrStreamableVideoSuccess(true); if (position == holder.getBindingAdapterPosition()) { ((PostCard2BaseVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl())); } @@ -1031,22 +1028,22 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie @Override public void failed(int errorCode) { if (position == holder.getBindingAdapterPosition()) { - ((PostCard2BaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.VISIBLE); + ((PostCard2BaseVideoAutoplayViewHolder) holder).errorLoadingRedgifsImageView.setVisibility(View.VISIBLE); } } }); - } else if(post.isStreamable() && !post.isLoadGfycatOrStreamableVideoSuccess()) { - ((PostCard2BaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = + } else if(post.isStreamable() && !post.isLoadRedgifsOrStreamableVideoSuccess()) { + ((PostCard2BaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall = mStreamableApiProvider.get().getStreamableData(post.getStreamableShortCode()); FetchStreamableVideo.fetchStreamableVideoInRecyclerViewAdapter(mExecutor, new Handler(), - ((PostCard2BaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall, + ((PostCard2BaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall, new FetchStreamableVideo.FetchStreamableVideoListener() { @Override public void success(StreamableVideo streamableVideo) { StreamableVideo.Media media = streamableVideo.mp4 == null ? streamableVideo.mp4Mobile : streamableVideo.mp4; post.setVideoDownloadUrl(media.url); post.setVideoUrl(media.url); - post.setLoadGfyOrStreamableVideoSuccess(true); + post.setLoadRedgifsOrStreamableVideoSuccess(true); if (position == holder.getBindingAdapterPosition()) { ((PostCard2BaseVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl())); } @@ -1055,7 +1052,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie @Override public void failed() { if (position == holder.getBindingAdapterPosition()) { - ((PostCard2BaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.VISIBLE); + ((PostCard2BaseVideoAutoplayViewHolder) holder).errorLoadingRedgifsImageView.setVisibility(View.VISIBLE); } } }); @@ -1871,19 +1868,20 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie } } - if ((post.isGfycat() || post.isRedgifs()) && !post.isLoadGfycatOrStreamableVideoSuccess()) { - ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = - post.isGfycat() ? mGfycatRetrofit.create(GfycatAPI.class).getGfycatData(post.getGfycatId()) : - mRedgifsRetrofit.create(RedgifsAPI.class).getRedgifsData(APIUtils.getRedgifsOAuthHeader(mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.REDGIFS_ACCESS_TOKEN, "")), post.getGfycatId(), APIUtils.USER_AGENT); - FetchGfycatOrRedgifsVideoLinks.fetchGfycatOrRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(), - ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall, - post.isGfycat(), mAutomaticallyTryRedgifs, - new FetchGfycatOrRedgifsVideoLinks.FetchGfycatOrRedgifsVideoLinksListener() { + if (post.isRedgifs() && !post.isLoadRedgifsOrStreamableVideoSuccess()) { + ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall = + mRedgifsRetrofit.create(RedgifsAPI.class).getRedgifsData( + APIUtils.getRedgifsOAuthHeader(mCurrentAccountSharedPreferences + .getString(SharedPreferencesUtils.REDGIFS_ACCESS_TOKEN, "")), + post.getRedgifsId(), APIUtils.USER_AGENT); + FetchRedgifsVideoLinks.fetchRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(), + ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall, + new FetchRedgifsVideoLinks.FetchRedgifsVideoLinksListener() { @Override public void success(String webm, String mp4) { post.setVideoDownloadUrl(mp4); post.setVideoUrl(mp4); - post.setLoadGfyOrStreamableVideoSuccess(true); + post.setLoadRedgifsOrStreamableVideoSuccess(true); if (position == holder.getBindingAdapterPosition()) { ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl())); } @@ -1892,22 +1890,22 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie @Override public void failed(int errorCode) { if (position == holder.getBindingAdapterPosition()) { - ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.VISIBLE); + ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).errorLoadingRedgifsImageView.setVisibility(View.VISIBLE); } } }); - } else if(post.isStreamable() && !post.isLoadGfycatOrStreamableVideoSuccess()) { - ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = + } else if(post.isStreamable() && !post.isLoadRedgifsOrStreamableVideoSuccess()) { + ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall = mStreamableApiProvider.get().getStreamableData(post.getStreamableShortCode()); FetchStreamableVideo.fetchStreamableVideoInRecyclerViewAdapter(mExecutor, new Handler(), - ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall, + ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall, new FetchStreamableVideo.FetchStreamableVideoListener() { @Override public void success(StreamableVideo streamableVideo) { StreamableVideo.Media media = streamableVideo.mp4 == null ? streamableVideo.mp4Mobile : streamableVideo.mp4; post.setVideoDownloadUrl(media.url); post.setVideoUrl(media.url); - post.setLoadGfyOrStreamableVideoSuccess(true); + post.setLoadRedgifsOrStreamableVideoSuccess(true); if (position == holder.getBindingAdapterPosition()) { ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl())); } @@ -1916,7 +1914,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie @Override public void failed() { if (position == holder.getBindingAdapterPosition()) { - ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.VISIBLE); + ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).errorLoadingRedgifsImageView.setVisibility(View.VISIBLE); } } }); @@ -2340,11 +2338,11 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie ((PostBaseViewHolder) holder).titleTextView.setTextColor(mPostTitleColor); if (holder instanceof PostBaseVideoAutoplayViewHolder) { ((PostBaseVideoAutoplayViewHolder) holder).mediaUri = null; - if (((PostBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall != null && !((PostBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.isCanceled()) { - ((PostBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.cancel(); - ((PostBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = null; + if (((PostBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall != null && !((PostBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall.isCanceled()) { + ((PostBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall.cancel(); + ((PostBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall = null; } - ((PostBaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.GONE); + ((PostBaseVideoAutoplayViewHolder) holder).errorLoadingRedgifsImageView.setVisibility(View.GONE); ((PostBaseVideoAutoplayViewHolder) holder).muteButton.setVisibility(View.GONE); if (!((PostBaseVideoAutoplayViewHolder) holder).isManuallyPaused) { ((PostBaseVideoAutoplayViewHolder) holder).resetVolume(); @@ -2370,11 +2368,11 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie ((PostTextTypeViewHolder) holder).binding.contentTextViewItemPostTextType.setVisibility(View.GONE); } else if (holder instanceof PostCard2BaseVideoAutoplayViewHolder) { ((PostCard2BaseVideoAutoplayViewHolder) holder).mediaUri = null; - if (((PostCard2BaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall != null && !((PostCard2BaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.isCanceled()) { - ((PostCard2BaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.cancel(); - ((PostCard2BaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = null; + if (((PostCard2BaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall != null && !((PostCard2BaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall.isCanceled()) { + ((PostCard2BaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall.cancel(); + ((PostCard2BaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall = null; } - ((PostCard2BaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.GONE); + ((PostCard2BaseVideoAutoplayViewHolder) holder).errorLoadingRedgifsImageView.setVisibility(View.GONE); ((PostCard2BaseVideoAutoplayViewHolder) holder).muteButton.setVisibility(View.GONE); ((PostCard2BaseVideoAutoplayViewHolder) holder).resetVolume(); mGlide.clear(((PostCard2BaseVideoAutoplayViewHolder) holder).previewImageView); @@ -2480,11 +2478,11 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie ((PostMaterial3CardBaseViewHolder) holder).titleTextView.setTextColor(mPostTitleColor); if (holder instanceof PostMaterial3CardBaseVideoAutoplayViewHolder) { ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).mediaUri = null; - if (((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall != null && !((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.isCanceled()) { - ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.cancel(); - ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = null; + if (((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall != null && !((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall.isCanceled()) { + ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall.cancel(); + ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchRedgifsOrStreamableVideoCall = null; } - ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.GONE); + ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).errorLoadingRedgifsImageView.setVisibility(View.GONE); ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).muteButton.setVisibility(View.GONE); if (!((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).isManuallyPaused) { ((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).resetVolume(); @@ -2607,12 +2605,9 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie if (post.isImgur()) { intent.setData(Uri.parse(post.getVideoUrl())); intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_IMGUR); - } else if (post.isGfycat()) { - intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_GFYCAT); - intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId()); } else if (post.isRedgifs()) { intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_REDGIFS); - intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId()); + intent.putExtra(ViewVideoActivity.EXTRA_REDGIFS_ID, post.getRedgifsId()); } else if (post.isStreamable()) { intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_STREAMABLE); intent.putExtra(ViewVideoActivity.EXTRA_STREAMABLE_SHORT_CODE, post.getStreamableShortCode()); @@ -3279,7 +3274,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie class PostBaseVideoAutoplayViewHolder extends PostBaseViewHolder implements ToroPlayer { AspectRatioFrameLayout aspectRatioFrameLayout; GifImageView previewImageView; - ImageView errorLoadingGfycatImageView; + ImageView errorLoadingRedgifsImageView; PlayerView videoPlayer; ImageView muteButton; ImageView fullscreenButton; @@ -3292,7 +3287,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie ExoPlayerViewHelper helper; private Uri mediaUri; private float volume; - public Call<String> fetchGfycatOrStreamableVideoCall; + public Call<String> fetchRedgifsOrStreamableVideoCall; private boolean isManuallyPaused; PostBaseVideoAutoplayViewHolder(View rootView, @@ -3311,7 +3306,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie CustomTextView flairTextView, AspectRatioFrameLayout aspectRatioFrameLayout, GifImageView previewImageView, - ImageView errorLoadingGfycatImageView, + ImageView errorLoadingRedgifsImageView, PlayerView videoPlayer, ImageView muteButton, ImageView fullscreenButton, @@ -3350,7 +3345,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie this.aspectRatioFrameLayout = aspectRatioFrameLayout; this.previewImageView = previewImageView; - this.errorLoadingGfycatImageView = errorLoadingGfycatImageView; + this.errorLoadingRedgifsImageView = errorLoadingRedgifsImageView; this.videoPlayer = videoPlayer; this.muteButton = muteButton; this.fullscreenButton = fullscreenButton; @@ -3390,17 +3385,10 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie if (post.isImgur()) { intent.setData(Uri.parse(post.getVideoUrl())); intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_IMGUR); - } else if (post.isGfycat()) { - intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_GFYCAT); - intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId()); - if (post.isLoadGfycatOrStreamableVideoSuccess()) { - intent.setData(Uri.parse(post.getVideoUrl())); - intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, post.getVideoDownloadUrl()); - } } else if (post.isRedgifs()) { intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_REDGIFS); - intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId()); - if (post.isLoadGfycatOrStreamableVideoSuccess()) { + intent.putExtra(ViewVideoActivity.EXTRA_REDGIFS_ID, post.getRedgifsId()); + if (post.isLoadRedgifsOrStreamableVideoSuccess()) { intent.setData(Uri.parse(post.getVideoUrl())); intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, post.getVideoDownloadUrl()); } @@ -3598,7 +3586,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie binding.flairCustomTextViewItemPostVideoTypeAutoplay, binding.aspectRatioFrameLayoutItemPostVideoTypeAutoplay, binding.previewImageViewItemPostVideoTypeAutoplay, - binding.errorLoadingGfycatImageViewItemPostVideoTypeAutoplay, + binding.errorLoadingVideoImageViewItemPostVideoTypeAutoplay, binding.playerViewItemPostVideoTypeAutoplay, binding.getRoot().findViewById(R.id.mute_exo_playback_control_view), binding.getRoot().findViewById(R.id.fullscreen_exo_playback_control_view), @@ -3633,7 +3621,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie binding.flairCustomTextViewItemPostVideoTypeAutoplay, binding.aspectRatioFrameLayoutItemPostVideoTypeAutoplay, binding.previewImageViewItemPostVideoTypeAutoplay, - binding.errorLoadingGfycatImageViewItemPostVideoTypeAutoplay, + binding.errorLoadingVideoImageViewItemPostVideoTypeAutoplay, binding.playerViewItemPostVideoTypeAutoplay, binding.getRoot().findViewById(R.id.mute_exo_playback_control_view), binding.getRoot().findViewById(R.id.fullscreen_exo_playback_control_view), @@ -4983,7 +4971,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie class PostCard2BaseVideoAutoplayViewHolder extends PostBaseViewHolder implements ToroPlayer { AspectRatioFrameLayout aspectRatioFrameLayout; GifImageView previewImageView; - ImageView errorLoadingGfycatImageView; + ImageView errorLoadingRedgifsImageView; PlayerView videoPlayer; ImageView muteButton; ImageView fullscreenButton; @@ -4997,7 +4985,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie ExoPlayerViewHelper helper; private Uri mediaUri; private float volume; - public Call<String> fetchGfycatOrStreamableVideoCall; + public Call<String> fetchRedgifsOrStreamableVideoCall; private boolean isManuallyPaused; PostCard2BaseVideoAutoplayViewHolder(View itemView, @@ -5016,7 +5004,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie CustomTextView flairTextView, AspectRatioFrameLayout aspectRatioFrameLayout, GifImageView previewImageView, - ImageView errorLoadingGfycatImageView, + ImageView errorLoadingRedgifsImageView, PlayerView videoPlayer, ImageView muteButton, ImageView fullscreenButton, @@ -5057,7 +5045,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie this.aspectRatioFrameLayout = aspectRatioFrameLayout; this.previewImageView = previewImageView; - this.errorLoadingGfycatImageView = errorLoadingGfycatImageView; + this.errorLoadingRedgifsImageView = errorLoadingRedgifsImageView; this.videoPlayer = videoPlayer; this.muteButton = muteButton; this.fullscreenButton = fullscreenButton; @@ -5098,17 +5086,10 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie if (post.isImgur()) { intent.setData(Uri.parse(post.getVideoUrl())); intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_IMGUR); - } else if (post.isGfycat()) { - intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_GFYCAT); - intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId()); - if (post.isLoadGfycatOrStreamableVideoSuccess()) { - intent.setData(Uri.parse(post.getVideoUrl())); - intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, post.getVideoDownloadUrl()); - } } else if (post.isRedgifs()) { intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_REDGIFS); - intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId()); - if (post.isLoadGfycatOrStreamableVideoSuccess()) { + intent.putExtra(ViewVideoActivity.EXTRA_REDGIFS_ID, post.getRedgifsId()); + if (post.isLoadRedgifsOrStreamableVideoSuccess()) { intent.setData(Uri.parse(post.getVideoUrl())); intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, post.getVideoDownloadUrl()); } @@ -5305,7 +5286,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie binding.flairCustomTextViewItemPostCard2VideoAutoplay, binding.aspectRatioFrameLayoutItemPostCard2VideoAutoplay, binding.previewImageViewItemPostCard2VideoAutoplay, - binding.errorLoadingGfycatImageViewItemPostCard2VideoAutoplay, + binding.errorLoadingVideoImageViewItemPostCard2VideoAutoplay, binding.playerViewItemPostCard2VideoAutoplay, binding.getRoot().findViewById(R.id.mute_exo_playback_control_view), binding.getRoot().findViewById(R.id.fullscreen_exo_playback_control_view), @@ -5341,7 +5322,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie binding.flairCustomTextViewItemPostCard2VideoAutoplay, binding.aspectRatioFrameLayoutItemPostCard2VideoAutoplay, binding.previewImageViewItemPostCard2VideoAutoplay, - binding.errorLoadingGfycatImageViewItemPostCard2VideoAutoplay, + binding.errorLoadingVideoImageViewItemPostCard2VideoAutoplay, binding.playerViewItemPostCard2VideoAutoplay, binding.getRoot().findViewById(R.id.mute_exo_playback_control_view), binding.getRoot().findViewById(R.id.fullscreen_exo_playback_control_view), @@ -6014,7 +5995,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie class PostMaterial3CardBaseVideoAutoplayViewHolder extends PostMaterial3CardBaseViewHolder implements ToroPlayer { AspectRatioFrameLayout aspectRatioFrameLayout; GifImageView previewImageView; - ImageView errorLoadingGfycatImageView; + ImageView errorLoadingRedgifsImageView; PlayerView videoPlayer; ImageView muteButton; ImageView fullscreenButton; @@ -6027,7 +6008,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie ExoPlayerViewHelper helper; private Uri mediaUri; private float volume; - public Call<String> fetchGfycatOrStreamableVideoCall; + public Call<String> fetchRedgifsOrStreamableVideoCall; private boolean isManuallyPaused; PostMaterial3CardBaseVideoAutoplayViewHolder(View rootView, @@ -6039,7 +6020,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie TextView titleTextView, AspectRatioFrameLayout aspectRatioFrameLayout, GifImageView previewImageView, - ImageView errorLoadingGfycatImageView, + ImageView errorLoadingRedgifsImageView, PlayerView videoPlayer, ImageView muteButton, ImageView fullscreenButton, @@ -6071,7 +6052,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie this.aspectRatioFrameLayout = aspectRatioFrameLayout; this.previewImageView = previewImageView; - this.errorLoadingGfycatImageView = errorLoadingGfycatImageView; + this.errorLoadingRedgifsImageView = errorLoadingRedgifsImageView; this.videoPlayer = videoPlayer; this.muteButton = muteButton; this.fullscreenButton = fullscreenButton; @@ -6111,17 +6092,10 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie if (post.isImgur()) { intent.setData(Uri.parse(post.getVideoUrl())); intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_IMGUR); - } else if (post.isGfycat()) { - intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_GFYCAT); - intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId()); - if (post.isLoadGfycatOrStreamableVideoSuccess()) { - intent.setData(Uri.parse(post.getVideoUrl())); - intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, post.getVideoDownloadUrl()); - } } else if (post.isRedgifs()) { intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_REDGIFS); - intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId()); - if (post.isLoadGfycatOrStreamableVideoSuccess()) { + intent.putExtra(ViewVideoActivity.EXTRA_REDGIFS_ID, post.getRedgifsId()); + if (post.isLoadRedgifsOrStreamableVideoSuccess()) { intent.setData(Uri.parse(post.getVideoUrl())); intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, post.getVideoDownloadUrl()); } @@ -6312,7 +6286,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie binding.titleTextViewItemPostCard3VideoTypeAutoplay, binding.aspectRatioFrameLayoutItemPostCard3VideoTypeAutoplay, binding.previewImageViewItemPostCard3VideoTypeAutoplay, - binding.errorLoadingGfycatImageViewItemPostCard3VideoTypeAutoplay, + binding.errorLoadingVideoImageViewItemPostCard3VideoTypeAutoplay, binding.playerViewItemPostCard3VideoTypeAutoplay, binding.getRoot().findViewById(R.id.mute_exo_playback_control_view), binding.getRoot().findViewById(R.id.fullscreen_exo_playback_control_view), @@ -6340,7 +6314,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie binding.titleTextViewItemPostCard3VideoTypeAutoplay, binding.aspectRatioFrameLayoutItemPostCard3VideoTypeAutoplay, binding.previewImageViewItemPostCard3VideoTypeAutoplay, - binding.errorLoadingGfycatImageViewItemPostCard3VideoTypeAutoplay, + binding.errorLoadingVideoImageViewItemPostCard3VideoTypeAutoplay, binding.playerViewItemPostCard3VideoTypeAutoplay, binding.getRoot().findViewById(R.id.mute_exo_playback_control_view), binding.getRoot().findViewById(R.id.fullscreen_exo_playback_control_view), diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/apis/GfycatAPI.java b/app/src/main/java/ml/docilealligator/infinityforreddit/apis/GfycatAPI.java deleted file mode 100644 index 14028182..00000000 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/apis/GfycatAPI.java +++ /dev/null @@ -1,10 +0,0 @@ -package ml.docilealligator.infinityforreddit.apis; - -import retrofit2.Call; -import retrofit2.http.GET; -import retrofit2.http.Path; - -public interface GfycatAPI { - @GET("{gfyid}") - Call<String> getGfycatData(@Path("gfyid") String gfyId); -} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/apis/RedditAPI.java b/app/src/main/java/ml/docilealligator/infinityforreddit/apis/RedditAPI.java index 44ba63b6..32948ff7 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/apis/RedditAPI.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/apis/RedditAPI.java @@ -237,10 +237,6 @@ public interface RedditAPI { @GET("/api/trending_searches_v1.json?withAds=0&raw_json=1&gilding_detail=1") Call<String> getTrendingSearchesOauth(@HeaderMap Map<String, String> headers); - default Call<String> getWiki(@Path("subredditName") String subredditName) { - return getWikiPage(subredditName, "index"); - } - @GET("/r/{subredditName}/wiki/{wikiPage}.json?raw_json=1") Call<String> getWikiPage(@Path("subredditName") String subredditName, @Path("wikiPage") String wikiPage); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/asynctasks/SwitchAccount.java b/app/src/main/java/ml/docilealligator/infinityforreddit/asynctasks/SwitchAccount.java index f5443973..bb49824b 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/asynctasks/SwitchAccount.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/asynctasks/SwitchAccount.java @@ -22,6 +22,7 @@ public class SwitchAccount { .putString(SharedPreferencesUtils.ACCESS_TOKEN, account.getAccessToken()) .putString(SharedPreferencesUtils.ACCOUNT_NAME, account.getAccountName()) .putString(SharedPreferencesUtils.ACCOUNT_IMAGE_URL, account.getProfileImageUrl()).apply(); + currentAccountSharedPreferences.edit().remove(SharedPreferencesUtils.SUBSCRIBED_THINGS_SYNC_TIME).apply(); handler.post(() -> switchAccountListener.switched(account)); }); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/HistoryPostFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/HistoryPostFragment.java index 752fe396..988c9b8f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/HistoryPostFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/HistoryPostFragment.java @@ -163,9 +163,6 @@ public class HistoryPostFragment extends Fragment implements FragmentCommunicato @Named("application_only_oauth") Retrofit mApplicationOnlyRetrofit; @Inject - @Named("gfycat") - Retrofit mGfycatRetrofit; - @Inject @Named("redgifs") Retrofit mRedgifsRetrofit; @Inject @@ -378,7 +375,7 @@ public class HistoryPostFragment extends Fragment implements FragmentCommunicato if (historyType == HISTORY_TYPE_READ_POSTS) { postLayout = mPostLayoutSharedPreferences.getInt(SharedPreferencesUtils.HISTORY_POST_LAYOUT_READ_POST, defaultPostLayout); - mAdapter = new HistoryPostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mGfycatRetrofit, + mAdapter = new HistoryPostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mRedgifsRetrofit, mStreamableApiProvider, mCustomThemeWrapper, locale, accessToken, accountName, postType, postLayout, true, mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java index e49ff234..e1949175 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java @@ -185,9 +185,6 @@ public class PostFragment extends Fragment implements FragmentCommunicator { @Named("application_only_oauth") Retrofit mApplicationOnlyRetrofit; @Inject - @Named("gfycat") - Retrofit mGfycatRetrofit; - @Inject @Named("redgifs") Retrofit mRedgifsRetrofit; @Inject @@ -462,7 +459,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { sortType = new SortType(SortType.Type.valueOf(sort), SortType.Time.valueOf(sortTime)); postLayout = mPostLayoutSharedPreferences.getInt(SharedPreferencesUtils.POST_LAYOUT_SEARCH_POST, defaultPostLayout); - mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mGfycatRetrofit, + mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mRedgifsRetrofit, mStreamableApiProvider, mCustomThemeWrapper, locale, accessToken, accountName, postType, postLayout, true, mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences, @@ -539,7 +536,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { sortType = new SortType(SortType.Type.valueOf(sort)); } - mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mGfycatRetrofit, + mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mRedgifsRetrofit, mStreamableApiProvider, mCustomThemeWrapper, locale, accessToken, accountName, postType, postLayout, displaySubredditName, mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences, @@ -610,7 +607,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { sortType = new SortType(SortType.Type.valueOf(sort)); } - mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mGfycatRetrofit, + mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mRedgifsRetrofit, mStreamableApiProvider, mCustomThemeWrapper, locale, accessToken, accountName, postType, postLayout, true, mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences, @@ -675,7 +672,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { } postLayout = mPostLayoutSharedPreferences.getInt(SharedPreferencesUtils.POST_LAYOUT_USER_POST_BASE + username, defaultPostLayout); - mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mGfycatRetrofit, + mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mRedgifsRetrofit, mStreamableApiProvider, mCustomThemeWrapper, locale, accessToken, accountName, postType, postLayout, true, mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences, @@ -736,7 +733,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { postLayout = mPostLayoutSharedPreferences.getInt(SharedPreferencesUtils.POST_LAYOUT_FRONT_PAGE_POST, defaultPostLayout); - mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mGfycatRetrofit, + mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mRedgifsRetrofit, mStreamableApiProvider, mCustomThemeWrapper, locale, accessToken, accountName, postType, postLayout, true, mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences, @@ -796,7 +793,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { postLayout = mPostLayoutSharedPreferences.getInt(SharedPreferencesUtils.POST_LAYOUT_MULTI_REDDIT_POST_BASE + multiRedditPath, defaultPostLayout); - mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mGfycatRetrofit, + mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mRedgifsRetrofit, mStreamableApiProvider, mCustomThemeWrapper, locale, accessToken, accountName, postType, postLayout, true, mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences, @@ -853,7 +850,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { } postLayout = mPostLayoutSharedPreferences.getInt(SharedPreferencesUtils.POST_LAYOUT_FRONT_PAGE_POST, defaultPostLayout); - mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mGfycatRetrofit, + mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mRedgifsRetrofit, mStreamableApiProvider, mCustomThemeWrapper, locale, accessToken, accountName, postType, postLayout, true, mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences, diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java index eb68bbc1..249364f0 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java @@ -160,9 +160,6 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic @Named("application_only_oauth") Retrofit mApplicationOnlyRetrofit; @Inject - @Named("gfycat") - Retrofit mGfycatRetrofit; - @Inject @Named("redgifs") Retrofit mRedgifsRetrofit; @Inject @@ -601,7 +598,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic mPostAdapter = new PostDetailRecyclerViewAdapter(activity, this, mExecutor, mCustomThemeWrapper, mOauthRetrofit, mApplicationOnlyRetrofit, - mGfycatRetrofit, mRedgifsRetrofit, mStreamableApiProvider, mRedditDataRoomDatabase, mGlide, + mRedgifsRetrofit, mStreamableApiProvider, mRedditDataRoomDatabase, mGlide, mSeparatePostAndComments, mAccessToken, mAccountName, mPost, mLocale, mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostDetailsSharedPreferences, mExoCreator, post -> EventBus.getDefault().post(new PostUpdateEventToPostList(mPost, postListPosition))); @@ -1293,7 +1290,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic mPostAdapter = new PostDetailRecyclerViewAdapter(activity, ViewPostDetailFragment.this, mExecutor, mCustomThemeWrapper, - mOauthRetrofit, mApplicationOnlyRetrofit, mGfycatRetrofit, mRedgifsRetrofit, + mOauthRetrofit, mApplicationOnlyRetrofit, mRedgifsRetrofit, mStreamableApiProvider, mRedditDataRoomDatabase, mGlide, mSeparatePostAndComments, mAccessToken, mAccountName, mPost, mLocale, mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/post/FetchRemovedPost.java b/app/src/main/java/ml/docilealligator/infinityforreddit/post/FetchRemovedPost.java index 719e412d..5d815e83 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/post/FetchRemovedPost.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/post/FetchRemovedPost.java @@ -77,7 +77,7 @@ public class FetchRemovedPost { try { Uri uri = Uri.parse(url); String authority = uri.getAuthority(); - if (authority != null && (authority.contains("gfycat.com") || authority.contains("redgifs.com"))) { + if (authority != null && authority.contains("redgifs.com")) { post.setPostType(Post.LINK_TYPE); post.setUrl(url); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java b/app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java index f7a4a03e..9389c87e 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java @@ -312,18 +312,12 @@ public class ParsePost { String authority = uri.getAuthority(); if (authority != null) { - if (authority.contains("gfycat.com")) { - String gfycatId = url.substring(url.lastIndexOf("/") + 1).toLowerCase(); - post.setPostType(Post.VIDEO_TYPE); - post.setIsGfycat(true); - post.setVideoUrl(url); - post.setGfycatId(gfycatId); - } else if (authority.contains("redgifs.com")) { - String gfycatId = url.substring(url.lastIndexOf("/") + 1).toLowerCase(); + if (authority.contains("redgifs.com")) { + String redgifsId = url.substring(url.lastIndexOf("/") + 1).toLowerCase(); post.setPostType(Post.VIDEO_TYPE); post.setIsRedgifs(true); post.setVideoUrl(url); - post.setGfycatId(gfycatId); + post.setRedgifsId(redgifsId); } else if (authority.equals("streamable.com")) { String shortCode = url.substring(url.lastIndexOf("/") + 1); post.setPostType(Post.VIDEO_TYPE); @@ -500,18 +494,12 @@ public class ParsePost { String authority = uri.getAuthority(); if (authority != null) { - if (authority.contains("gfycat.com")) { - String gfycatId = url.substring(url.lastIndexOf("/") + 1).toLowerCase(); - post.setPostType(Post.VIDEO_TYPE); - post.setIsGfycat(true); - post.setVideoUrl(url); - post.setGfycatId(gfycatId); - } else if (authority.contains("redgifs.com")) { - String gfycatId = url.substring(url.lastIndexOf("/") + 1).toLowerCase(); + if (authority.contains("redgifs.com")) { + String redgifsId = url.substring(url.lastIndexOf("/") + 1).toLowerCase(); post.setPostType(Post.VIDEO_TYPE); post.setIsRedgifs(true); post.setVideoUrl(url); - post.setGfycatId(gfycatId); + post.setRedgifsId(redgifsId); } else if (authority.equals("streamable.com")) { String shortCode = url.substring(url.lastIndexOf("/") + 1); post.setPostType(Post.VIDEO_TYPE); @@ -573,18 +561,12 @@ public class ParsePost { String authority = uri.getAuthority(); if (authority != null) { - if (authority.contains("gfycat.com")) { - String gfycatId = url.substring(url.lastIndexOf("/") + 1).toLowerCase(); - post.setPostType(Post.VIDEO_TYPE); - post.setIsGfycat(true); - post.setVideoUrl(url); - post.setGfycatId(gfycatId); - } else if (authority.contains("redgifs.com")) { - String gfycatId = url.substring(url.lastIndexOf("/") + 1).toLowerCase(); + if (authority.contains("redgifs.com")) { + String redgifsId = url.substring(url.lastIndexOf("/") + 1).toLowerCase(); post.setPostType(Post.VIDEO_TYPE); post.setIsRedgifs(true); post.setVideoUrl(url); - post.setGfycatId(gfycatId); + post.setRedgifsId(redgifsId); } else if (authority.equals("streamable.com")) { String shortCode = url.substring(url.lastIndexOf("/") + 1); post.setPostType(Post.VIDEO_TYPE); @@ -601,22 +583,14 @@ public class ParsePost { try { String authority = uri.getAuthority(); if (authority != null) { - if (authority.contains("gfycat.com")) { - post.setIsGfycat(true); - post.setVideoUrl(url); - String gfycatId = url.substring(url.lastIndexOf("/") + 1); - if (gfycatId.contains("-")) { - gfycatId = gfycatId.substring(0, gfycatId.indexOf('-')); - } - post.setGfycatId(gfycatId.toLowerCase()); - } else if (authority.contains("redgifs.com")) { - String gfycatId = url.substring(url.lastIndexOf("/") + 1); - if (gfycatId.contains("-")) { - gfycatId = gfycatId.substring(0, gfycatId.indexOf('-')); + if (authority.contains("redgifs.com")) { + String redgifsId = url.substring(url.lastIndexOf("/") + 1); + if (redgifsId.contains("-")) { + redgifsId = redgifsId.substring(0, redgifsId.indexOf('-')); } post.setIsRedgifs(true); post.setVideoUrl(url); - post.setGfycatId(gfycatId.toLowerCase()); + post.setRedgifsId(redgifsId.toLowerCase()); } else if (authority.equals("streamable.com")) { String shortCode = url.substring(url.lastIndexOf("/") + 1); post.setPostType(Post.VIDEO_TYPE); @@ -684,18 +658,12 @@ public class ParsePost { String authority = uri.getAuthority(); if (authority != null) { - if (authority.contains("gfycat.com")) { - String gfycatId = url.substring(url.lastIndexOf("/") + 1).toLowerCase(); - post.setPostType(Post.VIDEO_TYPE); - post.setIsGfycat(true); - post.setVideoUrl(url); - post.setGfycatId(gfycatId); - } else if (authority.contains("redgifs.com")) { - String gfycatId = url.substring(url.lastIndexOf("/") + 1).toLowerCase(); + if (authority.contains("redgifs.com")) { + String redgifsId = url.substring(url.lastIndexOf("/") + 1).toLowerCase(); post.setPostType(Post.VIDEO_TYPE); post.setIsRedgifs(true); post.setVideoUrl(url); - post.setGfycatId(gfycatId); + post.setRedgifsId(redgifsId); } else if (authority.equals("streamable.com")) { String shortCode = url.substring(url.lastIndexOf("/") + 1); post.setPostType(Post.VIDEO_TYPE); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/post/Post.java b/app/src/main/java/ml/docilealligator/infinityforreddit/post/Post.java index 5985de46..f03a666c 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/post/Post.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/post/Post.java @@ -43,13 +43,12 @@ public class Post implements Parcelable { private String url; private String videoUrl; private String videoDownloadUrl; - private String gfycatId; + private String redgifsId; private String streamableShortCode; private boolean isImgur; - private boolean isGfycat; private boolean isRedgifs; private boolean isStreamable; - private boolean loadGfyOrStreamableVideoSuccess; + private boolean loadRedgifsOrStreamableVideoSuccess; private final String permalink; private String flair; private final long postTimeMillis; @@ -167,13 +166,12 @@ public class Post implements Parcelable { url = in.readString(); videoUrl = in.readString(); videoDownloadUrl = in.readString(); - gfycatId = in.readString(); + redgifsId = in.readString(); streamableShortCode = in.readString(); isImgur = in.readByte() != 0; - isGfycat = in.readByte() != 0; isRedgifs = in.readByte() != 0; isStreamable = in.readByte() != 0; - loadGfyOrStreamableVideoSuccess = in.readByte() != 0; + loadRedgifsOrStreamableVideoSuccess = in.readByte() != 0; permalink = in.readString(); flair = in.readString(); postTimeMillis = in.readLong(); @@ -328,12 +326,12 @@ public class Post implements Parcelable { this.videoDownloadUrl = videoDownloadUrl; } - public String getGfycatId() { - return gfycatId; + public String getRedgifsId() { + return redgifsId; } - public void setGfycatId(String gfycatId) { - this.gfycatId = gfycatId; + public void setRedgifsId(String redgifsId) { + this.redgifsId = redgifsId; } public String getStreamableShortCode() { @@ -352,14 +350,6 @@ public class Post implements Parcelable { return isImgur; } - public boolean isGfycat() { - return isGfycat; - } - - public void setIsGfycat(boolean isGfycat) { - this.isGfycat = isGfycat; - } - public boolean isRedgifs() { return isRedgifs; } @@ -376,12 +366,12 @@ public class Post implements Parcelable { this.isStreamable = isStreamable; } - public boolean isLoadGfycatOrStreamableVideoSuccess() { - return loadGfyOrStreamableVideoSuccess; + public boolean isLoadRedgifsOrStreamableVideoSuccess() { + return loadRedgifsOrStreamableVideoSuccess; } - public void setLoadGfyOrStreamableVideoSuccess(boolean loadGfyOrStreamableVideoSuccess) { - this.loadGfyOrStreamableVideoSuccess = loadGfyOrStreamableVideoSuccess; + public void setLoadRedgifsOrStreamableVideoSuccess(boolean loadRedgifsOrStreamableVideoSuccess) { + this.loadRedgifsOrStreamableVideoSuccess = loadRedgifsOrStreamableVideoSuccess; } public String getPermalink() { @@ -496,13 +486,12 @@ public class Post implements Parcelable { dest.writeString(url); dest.writeString(videoUrl); dest.writeString(videoDownloadUrl); - dest.writeString(gfycatId); + dest.writeString(redgifsId); dest.writeString(streamableShortCode); dest.writeByte((byte) (isImgur ? 1 : 0)); - dest.writeByte((byte) (isGfycat ? 1 : 0)); dest.writeByte((byte) (isRedgifs ? 1 : 0)); dest.writeByte((byte) (isStreamable ? 1 : 0)); - dest.writeByte((byte) (loadGfyOrStreamableVideoSuccess ? 1 : 0)); + dest.writeByte((byte) (loadRedgifsOrStreamableVideoSuccess ? 1 : 0)); dest.writeString(permalink); dest.writeString(flair); dest.writeLong(postTimeMillis); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/AdvancedPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/AdvancedPreferenceFragment.java index 9f9534fb..25a3bd82 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/AdvancedPreferenceFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/AdvancedPreferenceFragment.java @@ -227,6 +227,10 @@ public class AdvancedPreferenceFragment extends CustomFontPreferenceFragmentComp editor.remove(SharedPreferencesUtils.BLUR_SPOILER_KEY_LEGACY); editor.remove(SharedPreferencesUtils.CONFIRM_TO_EXIT_LEGACY); editor.remove(SharedPreferencesUtils.OPEN_LINK_IN_APP_LEGACY); + editor.remove(SharedPreferencesUtils.AUTOMATICALLY_TRY_REDGIFS_LEGACY); + editor.remove(SharedPreferencesUtils.DO_NOT_SHOW_REDDIT_API_INFO_AGAIN_LEGACY); + editor.remove(SharedPreferencesUtils.HIDE_THE_NUMBER_OF_AWARDS_LEGACY); + editor.remove(SharedPreferencesUtils.HIDE_COMMENT_AWARDS_LEGACY); SharedPreferences.Editor sortTypeEditor = mSortTypeSharedPreferences.edit(); sortTypeEditor.remove(SharedPreferencesUtils.SORT_TYPE_ALL_POST_LEGACY); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/APIUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/APIUtils.java index 10104f5a..5953285f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/APIUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/APIUtils.java @@ -18,7 +18,6 @@ public class APIUtils { public static final String API_BASE_URI = "https://www.reddit.com"; public static final String API_UPLOAD_MEDIA_URI = "https://reddit-uploaded-media.s3-accelerate.amazonaws.com"; public static final String API_UPLOAD_VIDEO_URI = "https://reddit-uploaded-video.s3-accelerate.amazonaws.com"; - public static final String GFYCAT_API_BASE_URI = "https://api.gfycat.com/v1/gfycats/"; public static final String REDGIFS_API_BASE_URI = "https://api.redgifs.com"; public static final String IMGUR_API_BASE_URI = "https://api.imgur.com/3/"; public static final String PUSHSHIFT_API_BASE_URI = "https://api.pushshift.io/"; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java index 863a49a6..15564ce7 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java @@ -106,7 +106,6 @@ public class SharedPreferencesUtils { public static final String VIDEO_AUTOPLAY_VALUE_NEVER = "0"; public static final String MUTE_AUTOPLAYING_VIDEOS = "mute_autoplaying_videos"; public static final String AUTOPLAY_NSFW_VIDEOS = "autoplay_nsfw_videos"; - public static final String AUTOMATICALLY_TRY_REDGIFS = "automatically_try_redgifs"; public static final String LOCK_JUMP_TO_NEXT_TOP_LEVEL_COMMENT_BUTTON = "lock_jump_to_next_top_level_comment_button"; public static final String SWAP_TAP_AND_LONG_COMMENTS = "swap_tap_and_long_in_comments"; public static final String SWIPE_UP_TO_HIDE_JUMP_TO_NEXT_TOP_LEVEL_COMMENT_BUTTON = "swipe_up_to_hide_jump_to_next_top_level_comments_button"; @@ -392,6 +391,7 @@ public class SharedPreferencesUtils { public static final String BLUR_SPOILER_KEY_LEGACY = "blur_spoiler"; public static final String CONFIRM_TO_EXIT_LEGACY = "confirm_to_exit"; public static final String OPEN_LINK_IN_APP_LEGACY = "open_link_in_app"; + public static final String AUTOMATICALLY_TRY_REDGIFS_LEGACY = "automatically_try_redgifs"; public static final String DO_NOT_SHOW_REDDIT_API_INFO_AGAIN_LEGACY = "do_not_show_reddit_api_info_again"; public static final String HIDE_THE_NUMBER_OF_AWARDS_LEGACY = "hide_the_number_of_awards"; diff --git a/app/src/main/res/layout/item_post_card_2_video_autoplay.xml b/app/src/main/res/layout/item_post_card_2_video_autoplay.xml index 618d2bff..11a829a4 100644 --- a/app/src/main/res/layout/item_post_card_2_video_autoplay.xml +++ b/app/src/main/res/layout/item_post_card_2_video_autoplay.xml @@ -42,7 +42,7 @@ android:visibility="gone" /> <ImageView - android:id="@+id/error_loading_gfycat_image_view_item_post_card_2_video_autoplay" + android:id="@+id/error_loading_video_image_view_item_post_card_2_video_autoplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="16dp" diff --git a/app/src/main/res/layout/item_post_card_2_video_autoplay_legacy_controller.xml b/app/src/main/res/layout/item_post_card_2_video_autoplay_legacy_controller.xml index c213b9ee..0c988e9d 100644 --- a/app/src/main/res/layout/item_post_card_2_video_autoplay_legacy_controller.xml +++ b/app/src/main/res/layout/item_post_card_2_video_autoplay_legacy_controller.xml @@ -42,7 +42,7 @@ android:visibility="gone" /> <ImageView - android:id="@+id/error_loading_gfycat_image_view_item_post_card_2_video_autoplay" + android:id="@+id/error_loading_video_image_view_item_post_card_2_video_autoplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="16dp" diff --git a/app/src/main/res/layout/item_post_card_3_video_type_autoplay.xml b/app/src/main/res/layout/item_post_card_3_video_type_autoplay.xml index 671513b7..383f4fb7 100644 --- a/app/src/main/res/layout/item_post_card_3_video_type_autoplay.xml +++ b/app/src/main/res/layout/item_post_card_3_video_type_autoplay.xml @@ -40,7 +40,7 @@ android:visibility="gone" /> <ImageView - android:id="@+id/error_loading_gfycat_image_view_item_post_card_3_video_type_autoplay" + android:id="@+id/error_loading_video_image_view_item_post_card_3_video_type_autoplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="16dp" diff --git a/app/src/main/res/layout/item_post_card_3_video_type_autoplay_legacy_controller.xml b/app/src/main/res/layout/item_post_card_3_video_type_autoplay_legacy_controller.xml index 07fd5b9d..54ec73a2 100644 --- a/app/src/main/res/layout/item_post_card_3_video_type_autoplay_legacy_controller.xml +++ b/app/src/main/res/layout/item_post_card_3_video_type_autoplay_legacy_controller.xml @@ -40,7 +40,7 @@ android:visibility="gone" /> <ImageView - android:id="@+id/error_loading_gfycat_image_view_item_post_card_3_video_type_autoplay" + android:id="@+id/error_loading_video_image_view_item_post_card_3_video_type_autoplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="16dp" diff --git a/app/src/main/res/layout/item_post_detail_video_autoplay.xml b/app/src/main/res/layout/item_post_detail_video_autoplay.xml index 042b13f7..1d0ed928 100644 --- a/app/src/main/res/layout/item_post_detail_video_autoplay.xml +++ b/app/src/main/res/layout/item_post_detail_video_autoplay.xml @@ -216,7 +216,7 @@ android:visibility="gone" /> <ImageView - android:id="@+id/error_loading_gfycat_image_view_item_post_detail_video_autoplay" + android:id="@+id/error_loading_video_image_view_item_post_detail_video_autoplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="16dp" diff --git a/app/src/main/res/layout/item_post_detail_video_autoplay_legacy_controller.xml b/app/src/main/res/layout/item_post_detail_video_autoplay_legacy_controller.xml index 5ebbcf6f..93b44880 100644 --- a/app/src/main/res/layout/item_post_detail_video_autoplay_legacy_controller.xml +++ b/app/src/main/res/layout/item_post_detail_video_autoplay_legacy_controller.xml @@ -217,7 +217,7 @@ android:visibility="gone" /> <ImageView - android:id="@+id/error_loading_gfycat_image_view_item_post_detail_video_autoplay" + android:id="@+id/error_loading_video_image_view_item_post_detail_video_autoplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="16dp" diff --git a/app/src/main/res/layout/item_post_video_type_autoplay.xml b/app/src/main/res/layout/item_post_video_type_autoplay.xml index 554ae93e..a75863a7 100644 --- a/app/src/main/res/layout/item_post_video_type_autoplay.xml +++ b/app/src/main/res/layout/item_post_video_type_autoplay.xml @@ -207,7 +207,7 @@ android:visibility="gone" /> <ImageView - android:id="@+id/error_loading_gfycat_image_view_item_post_video_type_autoplay" + android:id="@+id/error_loading_video_image_view_item_post_video_type_autoplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="16dp" diff --git a/app/src/main/res/layout/item_post_video_type_autoplay_legacy_controller.xml b/app/src/main/res/layout/item_post_video_type_autoplay_legacy_controller.xml index 13131024..18509755 100644 --- a/app/src/main/res/layout/item_post_video_type_autoplay_legacy_controller.xml +++ b/app/src/main/res/layout/item_post_video_type_autoplay_legacy_controller.xml @@ -207,7 +207,7 @@ android:visibility="gone" /> <ImageView - android:id="@+id/error_loading_gfycat_image_view_item_post_video_type_autoplay" + android:id="@+id/error_loading_video_image_view_item_post_video_type_autoplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="16dp" diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 997495f8..ffaa1c1f 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -341,7 +341,6 @@ <string name="settings_volume_keys_navigate_posts_title">"Použít tlačítka hlasitosti pro navigaci v příspěvcích"</string> <string name="settings_mute_video_title">"Ztlumit videa"</string> <string name="settings_mute_nsfw_video_title">"Ztlumit NSFW videa"</string> - <string name="settings_automatically_try_redgifs_title">"Automatický pokus o přístup k Redgifs, pokud jsou videa na Gfycat odstraněna."</string> <string name="settings_video_player_ignore_nav_bar_title">"Ignorovat navigační lištu v přehrávači videí"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Zabránit ovládání videa mít dodatečný okraj"</string> <string name="settings_confirm_to_exit">"Potvrdit pro odchod"</string> @@ -757,7 +756,6 @@ Chodí popředu."</string> <string name="notifications">"Oznámení"</string> <string name="messages">"Zprávy"</string> <string name="message">"Zpráva"</string> - <string name="fetch_gfycat_video_failed">"Získávání Gfycat videa selhalo"</string> <string name="fetch_redgifs_video_failed">"Získávání Redgifs videa selhalo"</string> <string name="fetching_video_info_please_wait">"Získávání informací o videu. Čekejte prosím."</string> <string name="error_fetching_imgur_media">"Nelze načíst obrázky"</string> diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 71953729..6892bb5f 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -343,7 +343,6 @@ Tippen für Neuversuch."</string> <string name="settings_mute_nsfw_video_title">"NSFW-Videos stummschalten"</string> <!-- Fuzzy --> - <string name="settings_automatically_try_redgifs_title">"Automatisch versuchen, Redgifs abzurufen, falls Videos auf Gfycat entfernt wurden."</string> <string name="settings_video_player_ignore_nav_bar_title">"Navigationsleiste im Video-Player ignorieren"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Kein extra Rand beim Video-Controller"</string> <string name="settings_confirm_to_exit">"Verlassen bestätigen"</string> @@ -773,7 +772,6 @@ Sie ist nicht krank oder so, aber sie könnte sich definitiv bessern."</string> <string name="notifications">"Benachrichtigungen"</string> <string name="messages">"Nachrichten"</string> <string name="message">"Nachricht"</string> - <string name="fetch_gfycat_video_failed">"Abruf des Gfycat-Videos fehlgeschlagen"</string> <string name="fetch_redgifs_video_failed">"Abruf des Redgifs-Videos fehlgeschlagen"</string> <string name="fetching_video_info_please_wait">"Lade Video-Info. Bitte warten."</string> <string name="error_fetching_imgur_media">"Kann Bilder nicht laden"</string> diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index d8dc0daf..54aefad0 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -304,7 +304,6 @@ <string name="settings_volume_keys_navigate_posts_title">"Περιήγηση στις αναρτήσεις με τα κουμπιά έντασης"</string> <string name="settings_mute_video_title">"Σίγαση βίντεο"</string> <string name="settings_mute_nsfw_video_title">"Σίγαση NSFW βίντεο"</string> - <string name="settings_automatically_try_redgifs_title">"Αύτοματη προσπάθεια προσπέλασης στο Redgifs αν τα Βίντεο στο Gfycat έχουν αφαιρεθεί."</string> <string name="settings_video_player_ignore_nav_bar_title">"Αγνόηση Μπάρας Πλοήγησης κατά την Αναπαραγωγή Βίντεο"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Αποτρέπει τα Χειριστήρια του Βίντεο να έχουν έξτρα περιθώριο"</string> <string name="settings_confirm_to_exit">"Επιβεβαίωση για Έξοδο"</string> @@ -703,7 +702,6 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="notifications">"Ειδοποιήσεις"</string> <string name="messages">"Μηνύματα"</string> <string name="message">"Μήνυμα"</string> - <string name="fetch_gfycat_video_failed">"Η ανάκτηση του βίντεο Gfycat απέτυχε"</string> <string name="fetch_redgifs_video_failed">"Η ανάκτηση του βίντεο Redgifs απέτυχε"</string> <string name="fetching_video_info_please_wait">"Ανάκτηση πληροφοριών βίντεο. Παρακαλώ περιμένετε."</string> <string name="error_fetching_imgur_media">"Αδυναμία φόρτωσης εικόνων"</string> @@ -1103,7 +1101,7 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="action_contact_mods">"Επικοινωνία με Συντονιστές"</string> <string name="settings_save_nsfw_media_in_different_folder_title">"Αποθήκευση NSFW Πολυμέσων σε Άλλη Τοποθεσία"</string> <string name="settings_nsfw_download_location_title">"Τοποθεσία Λήψης NSFW"</string> - <string name="fetch_streamable_video_failed">"Η ανάκτηση του βίντεο Gfycat απέτυχε"</string> + <string name="fetch_streamable_video_failed">"Η ανάκτηση του βίντεο Streamable απέτυχε"</string> <!-- EditProfileService Notification --> <string name="submit_change_avatar">"Υποβολή Αλλαγής Άβαταρ"</string> diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 5c31bc19..a6dc7fd4 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -358,7 +358,6 @@ Premio means prize, so it's better suited the first word instead of the second o <string name="settings_volume_keys_navigate_posts_title">"Usar las teclas de volumen para navegar publicaciones"</string> <string name="settings_mute_video_title">"Silenciar vídeos"</string> <string name="settings_mute_nsfw_video_title">"Silenciar vídeos NSFW"</string> - <string name="settings_automatically_try_redgifs_title">"Intentar acceder automáticamente a Redgifs si se eliminan los videos en Gfycat"</string> <string name="settings_video_player_ignore_nav_bar_title">"Ignorar la barra de navegación en el reproductor de vídeo"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Bloquear al controlador de vídeo para que no tenga margen extra"</string> <string name="settings_confirm_to_exit">"Confirmar para salir"</string> @@ -798,7 +797,6 @@ No está enferma ni nada, pero definitivamente podría mejorar."</string> <string name="notifications">"Notificaciones"</string> <string name="messages">"Mensajes"</string> <string name="message">"Mensaje"</string> - <string name="fetch_gfycat_video_failed">"No fue posible obtener el vídeo de Gfycat"</string> <string name="fetch_redgifs_video_failed">"No fue posible obtener el vídeo de Redgifs"</string> <string name="fetching_video_info_please_wait">"Obteniendo información del vídeo. Por favor espera."</string> <string name="error_fetching_imgur_media">"No fue posible cargar las imágenes"</string> diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index d49b466e..01bb0391 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -388,7 +388,6 @@ peut ne pas fonctionner sur Android 11"</string> <string name="settings_mute_nsfw_video_title">"Couper le son des vidéos NSFW"</string> <!-- Fuzzy --> - <string name="settings_automatically_try_redgifs_title">"Essayez d'accéder automatiquement aux Redgifs si les Vidéos sur Gfycat sont supprimées."</string> <string name="settings_video_player_ignore_nav_bar_title">"Ignorer la barre de navigation dans le lecteur vidéo"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Empêcher le Contrôleur Vidéo de créer une Marge Supplémentaire"</string> <string name="settings_confirm_to_exit">"Confirmer pour quitter"</string> @@ -844,7 +843,6 @@ Basé sur le thème sombre Indigo"</string> <string name="notifications">"Notifications"</string> <string name="messages">"Messages"</string> <string name="message">"Message"</string> - <string name="fetch_gfycat_video_failed">"Échec de la récupération de la vidéo Gfycat"</string> <string name="fetch_redgifs_video_failed">"Échec de la récupération de la vidéo Redgifs"</string> <string name="fetching_video_info_please_wait">"Récupération des informations vidéo. Veuillez patienter. "</string> <string name="error_fetching_imgur_media">"Impossible de charger les images"</string> diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml index f06553b3..3a6313a1 100644 --- a/app/src/main/res/values-hi/strings.xml +++ b/app/src/main/res/values-hi/strings.xml @@ -384,7 +384,6 @@ Behavior --> <string name="settings_mute_nsfw_video_title">"मौन NSFW वीडियोज"</string> <!-- Fuzzy --> - <string name="settings_automatically_try_redgifs_title">"स्वतः ही Redgifs खोलने का प्रयास यदि Gfycat पर वीडियोज हटा दी गयी हों "</string> <string name="settings_video_player_ignore_nav_bar_title">"वीडियो प्लेयर में नेवीगेशन बार का छिपना"</string> <string name="settings_video_player_ignore_nav_bar_summary">"वीडियो कंट्रोलर द्वारा अतिरिक्त हाशिया लेने पर रोक "</string> <string name="settings_confirm_to_exit">"एप छोड़ने की पुष्टि "</string> @@ -824,7 +823,6 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="notifications">"अधिसूचनाएं "</string> <string name="messages">"संदेश "</string> <string name="message">"संदेश "</string> - <string name="fetch_gfycat_video_failed">"Gfycat वीडियो प्राप्ति सफल "</string> <string name="fetch_redgifs_video_failed">"Redgifs वीडियो प्राप्ति असफल "</string> <string name="fetching_video_info_please_wait">"वीडियो इनफो प्राप्त हो रहा है। कृपया प्रतीक्षा करें। "</string> <string name="error_fetching_imgur_media">"चित्र लोड नहीं हो सका "</string> diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index 322cc477..acf0c68f 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -356,7 +356,6 @@ <string name="settings_mute_nsfw_video_title">"Isključi ton na NSFW videozapisima"</string> <!-- Fuzzy --> - <string name="settings_automatically_try_redgifs_title">"Automatski pokušaj pristupiti Redgifs ako su videozapisi na Gfycatu uklonjeni."</string> <string name="settings_video_player_ignore_nav_bar_title">"Ignoriraj navigacijsku traku u video playeru"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Onemogući dodatnu marginu na video kontroleru"</string> <string name="settings_confirm_to_exit">"Potvrdi izlaz"</string> @@ -791,7 +790,6 @@ Baziraj na Indigo Amoled temi"</string> <string name="notifications">"Obavijesti"</string> <string name="messages">"Poruke"</string> <string name="message">"Poruka"</string> - <string name="fetch_gfycat_video_failed">"Dohvaćanje Gfycat videozapisa nije uspjelo"</string> <string name="fetch_redgifs_video_failed">"Dohvaćanje Redgifs videozapisa nije uspjelo"</string> <string name="fetching_video_info_please_wait">"Dohvaćanje informacija o videozapisu. Molim pričekajte."</string> <string name="error_fetching_imgur_media">"Nije moguće učitati slike"</string> diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 3c13336a..11b01b33 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -307,7 +307,6 @@ <string name="settings_volume_keys_navigate_posts_title">"Hangerőgombok használata a bejegyzések közti navigációra"</string> <string name="settings_mute_video_title">"Videók némítása"</string> <string name="settings_mute_nsfw_video_title">"NSFW videók némítása"</string> - <string name="settings_automatically_try_redgifs_title">"A Redgifek automatikusa elérése, ha a videók el lettek távolítva a Gfycatről."</string> <string name="settings_video_player_ignore_nav_bar_title">"Navigációs sáv mellőzése a videólejátszóban"</string> <string name="settings_video_player_ignore_nav_bar_summary">"A videóvezérlő extra margójának megakadályozása"</string> <string name="settings_confirm_to_exit">"Kilépés megerősítése"</string> @@ -730,7 +729,6 @@ Az alap az indigó amoled téma"</string> <string name="notifications">"Értesítések"</string> <string name="messages">"Üzenetek"</string> <string name="message">"Üzenet"</string> - <string name="fetch_gfycat_video_failed">"Gfycat videó megszerzése nem sikerült"</string> <string name="fetch_redgifs_video_failed">"Redgifs videó megszerzése nem sikerült"</string> <string name="fetching_video_info_please_wait">"Videó infó megszerzése. Kérlek várj."</string> <string name="error_fetching_imgur_media">"Nem lehet betölteni a képeket"</string> diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 3dc16098..550f7843 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -311,7 +311,6 @@ Tocca per riprovare."</string> <string name="settings_volume_keys_navigate_posts_title">"Usa i Tasti del Volume per Navigare i Post"</string> <string name="settings_mute_video_title">"Muta i video"</string> <string name="settings_mute_nsfw_video_title">"Metti in muto i video NSFW"</string> - <string name="settings_automatically_try_redgifs_title">"Prova automaticamente ad accedere a Redgifs se i video su Gfycat vengono rimossi."</string> <string name="settings_video_player_ignore_nav_bar_title">"Ignora la Barra di Navigazione nel Lettore Video"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Impedisci ai controlli video di avere margine aggiuntivo"</string> <string name="settings_confirm_to_exit">"Conferma per uscire"</string> @@ -707,7 +706,6 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="notifications">"Notifiche"</string> <string name="messages">"Messaggi"</string> <string name="message">"Messaggio"</string> - <string name="fetch_gfycat_video_failed">"Impossibile recuperare il video da Gfycat"</string> <string name="fetch_redgifs_video_failed">"Impossibile recuperare il video da Redgifs"</string> <string name="fetching_video_info_please_wait">"Recupero delle informazioni sul video. Attendere prego."</string> <string name="error_fetching_imgur_media">"Impossibile caricare immagini"</string> diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 3e409923..7f63c702 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -383,7 +383,6 @@ <string name="settings_mute_nsfw_video_title">"NSFWの動画をミュート再生"</string> <!-- Fuzzy --> - <string name="settings_automatically_try_redgifs_title">"Gfycatの動画が削除されていた場合、自動的にRedgifsでリトライ"</string> <string name="settings_video_player_ignore_nav_bar_title">"動画プレーヤーでナビゲーションバーを無視"</string> <string name="settings_video_player_ignore_nav_bar_summary">"動画コントローラーが余分な余白を使用することを防止します"</string> <string name="settings_confirm_to_exit">"アプリの終了確認を表示"</string> @@ -836,7 +835,6 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="notifications">"通知"</string> <string name="messages">"メッセージ"</string> <string name="message">"メッセージ"</string> - <string name="fetch_gfycat_video_failed">"Gfycat動画を取得できませんでした"</string> <string name="fetch_redgifs_video_failed">"Redgifs動画を取得できませんでした"</string> <string name="fetching_video_info_please_wait">"動画の情報を取得中です。少々お待ちください。"</string> <string name="error_fetching_imgur_media">"画像をロードできませんでした"</string> diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index e41575ef..784f132c 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -334,7 +334,6 @@ <string name="settings_volume_keys_navigate_posts_title">"볼륨 키로 포스트 스크롤하기"</string> <string name="settings_mute_video_title">"둥영상 음소거"</string> <string name="settings_mute_nsfw_video_title">"NSFW 둥영상 음소거"</string> - <string name="settings_automatically_try_redgifs_title">"Gfycat 비디오가 제거되었을 시 자동으로 Redgifs 접근 시도하기"</string> <string name="settings_video_player_ignore_nav_bar_title">"영상에서 내비게이션 바 무시"</string> <string name="settings_confirm_to_exit">"나갈 때 확인"</string> <string name="settings_category_comment_title">"댓글"</string> diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 4d9b3405..e855da6a 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -340,7 +340,6 @@ Druk om opnieuw te proberen."</string> <string name="settings_mute_nsfw_video_title">"NSFW-video's dempen"</string> <!-- Fuzzy --> - <string name="settings_automatically_try_redgifs_title">"Automatisch trachten Redgifs te openen als video's zijn verwijderd van Gfycat"</string> <string name="settings_video_player_ignore_nav_bar_title">"Navigatiebalk verbergen in videospeler"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Voorkom dat de navigatiebalk extra opvulling heeft"</string> <string name="settings_confirm_to_exit">"Afsluiten bevestigen"</string> @@ -765,7 +764,6 @@ Ze is niet ziek of zo, maar ze kan zeker beter worden."</string> <string name="notifications">"Notificaties"</string> <string name="messages">"Berichten"</string> <string name="message">"Bericht"</string> - <string name="fetch_gfycat_video_failed">"Ophalen van Gfycat video is mislukt"</string> <string name="fetch_redgifs_video_failed">"Ophalen van Redgifs video is mislukt"</string> <string name="fetching_video_info_please_wait">"Ophalen van videoinfo. Even geduld aub."</string> <string name="error_fetching_imgur_media">"Kan afbeeldingen niet laden"</string> diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 82a8d2f5..b8d074aa 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -332,7 +332,6 @@ Naciśnij, aby spróbować ponownie."</string> <string name="settings_mute_nsfw_video_title">"Wycisz filmy NSFW"</string> <!-- Fuzzy --> - <string name="settings_automatically_try_redgifs_title">"Automatycznie próbuj uzyskać filmy z Redgifs, gdy są usunięte z Gfycat."</string> <string name="settings_video_player_ignore_nav_bar_title">"Ignoruj pasek nawigacji w odtwarzaczu wideo"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Zapobiegaj posiadaniu dodatkowego marginesu przez kontroler wideo"</string> <string name="settings_confirm_to_exit">"Potwierdź aby wyjść"</string> @@ -757,7 +756,6 @@ Nie jest chora ani nic, ale na pewno może stać się lepsza."</string> <string name="notifications">"Powiadomienia"</string> <string name="messages">"Wiadomości"</string> <string name="message">"Wiadomość"</string> - <string name="fetch_gfycat_video_failed">"Nie udało się pobrać filmu z Gfycat"</string> <string name="fetch_redgifs_video_failed">"Nie udało się pobrać filmu z Redgifs"</string> <string name="fetching_video_info_please_wait">"Pobieranie informacji o filmie. Proszę czekać."</string> <string name="error_fetching_imgur_media">"Nie można załadować obrazów"</string> diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 187b8f28..f96cb25b 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -333,7 +333,6 @@ Toque para tentar de novo."</string> <string name="settings_volume_keys_navigate_posts_title">"Usar as teclas de volume para navegar em posagens"</string> <string name="settings_mute_video_title">"Silenciar Vídeos"</string> <string name="settings_mute_nsfw_video_title">"Silenciar Vídeos NSFW"</string> - <string name="settings_automatically_try_redgifs_title">"Tentar acessar automaticamente o Redgifs se os vídeos do Gfycat forem excluídos."</string> <string name="settings_video_player_ignore_nav_bar_title">"Ignorar barra de navegação no reprodutor de vídeos"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Evitar que o Controle de Vídeo Tenha Margens Largas"</string> <string name="settings_confirm_to_exit">"Confirmar para Sair"</string> @@ -743,7 +742,6 @@ Ela não está doente ou algo assim, mas definitivamente poderia melhorar."</str <string name="notifications">"Notificações"</string> <string name="messages">"Mensagens"</string> <string name="message">"Mensagem"</string> - <string name="fetch_gfycat_video_failed">"Erro ao buscar vídeos do Gfycat"</string> <string name="fetch_redgifs_video_failed">"Erro ao buscar vídeos do Redgifs"</string> <string name="fetching_video_info_please_wait">"Obtendo informações do vídeo. Por favor, espere."</string> <string name="error_fetching_imgur_media">"Não pode carregar as imagens"</string> diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index acc1e76b..52ca9422 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -349,7 +349,6 @@ Toque para tentar novamente."</string> <string name="settings_mute_nsfw_video_title">"Vídeos 18+ Sem Som"</string> <!-- Fuzzy --> - <string name="settings_automatically_try_redgifs_title">"Tentar aceder ao Redgifs automaticamente caso os vídeos no Gfycat tenham sido removidos."</string> <string name="settings_video_player_ignore_nav_bar_title">"Ignorar Barra de Navegação no Reprodutor de Vídeo"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Impedir que o Controlador de Vídeo Tenha Margem Extra"</string> <string name="settings_confirm_to_exit">"Confirmar para Sair"</string> @@ -754,7 +753,6 @@ Ela não está doente nem nada, mas certamente poderá melhorar."</string> <string name="notifications">"Notificações"</string> <string name="messages">"Mensagens"</string> <string name="message">"Mensagem"</string> - <string name="fetch_gfycat_video_failed">"Falha ao obter vídeo do Gfycat"</string> <string name="fetch_redgifs_video_failed">"Falha ao obter vídeo do Redgifs"</string> <string name="fetching_video_info_please_wait">"A obter informações do vídeo. Aguarde."</string> <string name="error_fetching_imgur_media">"Impossível carregar imagens"</string> diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index 6b137ad3..baf6b796 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -335,7 +335,6 @@ Apăsați pentru reîncărcare."</string> <string name="settings_volume_keys_navigate_posts_title">"Utilizați tastele de volum pentru a naviga postările"</string> <string name="settings_mute_video_title">"Oprire sunet videoclipuri"</string> <string name="settings_mute_nsfw_video_title">"Oprire sunet videoclipuri NSFW"</string> - <string name="settings_automatically_try_redgifs_title">"Încercați să accesați Redgifs dacă videourile de pe Gfycat sunt șterse."</string> <string name="settings_video_player_ignore_nav_bar_title">"Ignorați bara de navigare în player-ul video"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Împiedicați player-ul video din a avea margine suplimentară"</string> <string name="settings_confirm_to_exit">"Confirmare ieșire"</string> @@ -749,7 +748,6 @@ Nu e bolnavă sau ceva de genul, dar cu siguranță ar putea să se facă bine." <string name="notifications">"Notificări"</string> <string name="messages">"Mesaje"</string> <string name="message">"Mesaj"</string> - <string name="fetch_gfycat_video_failed">"Obținerea videoclipului Gfycat a eșuat"</string> <string name="fetch_redgifs_video_failed">"Obținerea videoclipului Redgifs a eșuat"</string> <string name="fetching_video_info_please_wait">"Se obțin informații despre video. Te rugăm să aștepți."</string> <string name="error_fetching_imgur_media">"Nu s-au putut încărca imaginile"</string> diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 2a28699d..5b90a82b 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -348,7 +348,6 @@ <string name="settings_mute_nsfw_video_title">"NSFW-видео без звука"</string> <!-- Fuzzy --> - <string name="settings_automatically_try_redgifs_title">"Автопопытка доступа к Redgifs, если видео на Gfycat удалены."</string> <string name="settings_video_player_ignore_nav_bar_title">"Не использовать панель навигации в видеопроигрывателе"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Предотвращает случайные нажатия"</string> <string name="settings_confirm_to_exit">"Подтверждать выход"</string> @@ -765,7 +764,6 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="notifications">"Уведомления"</string> <string name="messages">"Сообщения"</string> <string name="message">"Сообщение"</string> - <string name="fetch_gfycat_video_failed">"Невозможно получить видео Gfycat"</string> <string name="fetch_redgifs_video_failed">"Невозможно получить видео Redgifs"</string> <string name="fetching_video_info_please_wait">"Получение информации о видео. Пожалуйста, подождите."</string> <string name="error_fetching_imgur_media">"Невозможно загрузить изображения"</string> diff --git a/app/src/main/res/values-tr-rTR/strings.xml b/app/src/main/res/values-tr-rTR/strings.xml index 8236305b..088f20ab 100644 --- a/app/src/main/res/values-tr-rTR/strings.xml +++ b/app/src/main/res/values-tr-rTR/strings.xml @@ -338,7 +338,6 @@ Tekrar denemek için tıklayın."</string> <string name="settings_mute_nsfw_video_title">"NSFW Videolarını Sessize Al"</string> <!-- Fuzzy --> - <string name="settings_automatically_try_redgifs_title">"Gfycat'teki Videolar Kaldırılmışsa Otomatik Olarak Redgif'lere Erişmeyi Dene."</string> <string name="settings_video_player_ignore_nav_bar_title">"Video Oynatıcısındaki Navigasyon Çubuğunu Yoksay"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Video Denetleyicisinde Fazladan Kenar Olmasını Önle"</string> <string name="settings_confirm_to_exit">"Çıkışı Doğrula"</string> @@ -757,7 +756,6 @@ Amoled Tema Şablonu Oluştur"</string> <string name="notifications">"Bildirimler"</string> <string name="messages">"Mesajlar"</string> <string name="message">"Mesaj"</string> - <string name="fetch_gfycat_video_failed">"Gfycat video'su alınamadı"</string> <string name="fetch_redgifs_video_failed">"Redgifs video'su alınamadı"</string> <string name="fetching_video_info_please_wait">"Video bilgisi alınıyor. Lütfen bekleyin."</string> <string name="error_fetching_imgur_media">"Görüntüler yüklenemedi"</string> diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index f7943ae3..9b8ee409 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -337,7 +337,6 @@ <string name="settings_volume_keys_navigate_posts_title">"Пересуватися дописами клавішами гучності"</string> <string name="settings_mute_video_title">"Глушити відео"</string> <string name="settings_mute_nsfw_video_title">"Глушити відео НБДР"</string> - <string name="settings_automatically_try_redgifs_title">"Автоматично пробувати отримати доступ до Redgifs, якщо відео на Gfycat видалено."</string> <string name="settings_video_player_ignore_nav_bar_title">"Ігнорувати панель пересування у відео-програвачі"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Не дозволяти відеоконтролеру мати додаткове поле"</string> <string name="settings_confirm_to_exit">"Підтверджувати вихід"</string> @@ -753,7 +752,6 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="notifications">"Сповіщення"</string> <string name="messages">"Повідомлення"</string> <string name="message">"Повідомлення"</string> - <string name="fetch_gfycat_video_failed">"Не вдалося отримати відеозапис Gfycat"</string> <string name="fetch_redgifs_video_failed">"Не вдалося отримати відеозапис Redgifs"</string> <string name="fetching_video_info_please_wait">"Отримання відомостей про відео. Зачекайте."</string> <string name="error_fetching_imgur_media">"Не можливо завантажити зображення"</string> diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml index 6abc758b..3236a559 100644 --- a/app/src/main/res/values-vi/strings.xml +++ b/app/src/main/res/values-vi/strings.xml @@ -350,7 +350,6 @@ Nhấn để thử lại."</string> <string name="settings_mute_nsfw_video_title">"Tắt tiếng video NSFW"</string> <!-- Fuzzy --> - <string name="settings_automatically_try_redgifs_title">"Tự động thử truy cập Redgifs nếu Video trên Gfycat bị xóa."</string> <string name="settings_video_player_ignore_nav_bar_title">"Bỏ qua thanh điều hướng trong trình phát video"</string> <string name="settings_video_player_ignore_nav_bar_summary">"Ngăn trình điều khiển video có thêm lề"</string> <string name="settings_confirm_to_exit">"Xác nhận để thoát"</string> @@ -766,7 +765,6 @@ Cô ta không ốm hay gì cả, nhưng cô ấy chắc chắn có thể khá h <string name="notifications">"Thông báo"</string> <string name="messages">"Tin nhắn"</string> <string name="message">"Tin nhắn"</string> - <string name="fetch_gfycat_video_failed">"Lấy video Gfycat thất bại"</string> <string name="fetch_redgifs_video_failed">"Lấy video Redgifs thất bại"</string> <string name="fetching_video_info_please_wait">"Đang lấy thông tin video. Vui lòng đợi."</string> <string name="error_fetching_imgur_media">"Không thể tải hình ảnh"</string> diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 36b2fc7d..a1243303 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -341,7 +341,6 @@ <string name="settings_mute_nsfw_video_title">"静音 NSFW 视频"</string> <!-- Fuzzy --> - <string name="settings_automatically_try_redgifs_title">"如果 Gfycat 上的视频已被删除,则自动尝试访问 Redgifs。"</string> <string name="settings_video_player_ignore_nav_bar_title">"视频播放器中忽略导航栏"</string> <!-- Fuzzy --> @@ -774,7 +773,6 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd <string name="notifications">"通知"</string> <string name="messages">"消息"</string> <string name="message">"消息"</string> - <string name="fetch_gfycat_video_failed">"获取 Gfycat 视频失败"</string> <string name="fetch_redgifs_video_failed">"获取 Redgifs 视频失败"</string> <string name="fetching_video_info_please_wait">"正在获取视频信息。请稍候。"</string> <string name="error_fetching_imgur_media">"无法加载图像"</string> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5767b9aa..542929a3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -403,7 +403,6 @@ <string name="settings_volume_keys_navigate_posts_title">Use Volume Keys to Navigate Posts</string> <string name="settings_mute_video_title">Mute Videos</string> <string name="settings_mute_nsfw_video_title">Mute NSFW Videos</string> - <string name="settings_automatically_try_redgifs_title">Automatically Try Accessing Redgifs if Videos on Gfycat are Removed.</string> <string name="settings_video_player_ignore_nav_bar_title">Ignore Navigation Bar in Video Player</string> <string name="settings_video_player_ignore_nav_bar_summary">Prevent the Video Controller Having Extra Margin</string> <string name="settings_main_page_back_button_action">Main Page Back Button Action</string> @@ -1019,7 +1018,6 @@ <string name="messages">Messages</string> <string name="message">Message</string> - <string name="fetch_gfycat_video_failed">Fetch Gfycat video failed</string> <string name="fetch_redgifs_video_failed">Fetch Redgifs video failed</string> <string name="fetching_video_info_please_wait">Fetching video info. Please wait.</string> <string name="fetch_streamable_video_failed">Fetch Streamable video failed</string> diff --git a/app/src/main/res/xml/video_preferences.xml b/app/src/main/res/xml/video_preferences.xml index ffc2a7f6..402497b8 100644 --- a/app/src/main/res/xml/video_preferences.xml +++ b/app/src/main/res/xml/video_preferences.xml @@ -15,11 +15,6 @@ app:title="@string/settings_mute_nsfw_video_title" /> <ml.docilealligator.infinityforreddit.customviews.CustomFontSwitchPreference - app:defaultValue="true" - app:key="automatically_try_redgifs" - app:title="@string/settings_automatically_try_redgifs_title" /> - - <ml.docilealligator.infinityforreddit.customviews.CustomFontSwitchPreference app:defaultValue="false" app:key="video_player_ignore_nav_bar" app:title="@string/settings_video_player_ignore_nav_bar_title" |