mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-28 11:58:23 +01:00
Fix subreddits not showing in SelectedSubredditsActivity when editing a multireddit by clicking Editing Multireddit in MultiRedditOptionsBottomSheetFragment. Support gfycat.com/ifr/<id>.
This commit is contained in:
parent
39ae0d3aaf
commit
3a621e2901
@ -42,7 +42,6 @@ import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils;
|
||||
import retrofit2.Retrofit;
|
||||
|
||||
public class EditMultiRedditActivity extends BaseActivity {
|
||||
public static final String EXTRA_MULTI_REDDIT = "EMR";
|
||||
public static final String EXTRA_MULTI_PATH = "EMP";
|
||||
private static final int SUBREDDIT_SELECTION_REQUEST_CODE = 1;
|
||||
private static final String NULL_ACCESS_TOKEN_STATE = "NATS";
|
||||
@ -126,7 +125,6 @@ public class EditMultiRedditActivity extends BaseActivity {
|
||||
bindView();
|
||||
}
|
||||
} else {
|
||||
multiReddit = getIntent().getParcelableExtra(EXTRA_MULTI_REDDIT);
|
||||
multipath = getIntent().getStringExtra(EXTRA_MULTI_PATH);
|
||||
getCurrentAccountAndBindView();
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ 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 = "/[\\w-]+$";
|
||||
private static final String GFYCAT_PATTERN = "(/ifr)?/[\\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+/?";
|
||||
@ -185,7 +185,7 @@ public class LinkResolverActivity extends AppCompatActivity {
|
||||
} 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(1));
|
||||
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);
|
||||
|
@ -48,9 +48,11 @@ public class MultiRedditOptionsBottomSheetFragment extends RoundedBottomSheetDia
|
||||
MultiReddit multiReddit = getArguments().getParcelable(EXTRA_MULTI_REDDIT);
|
||||
|
||||
editMultiRedditTextView.setOnClickListener(view -> {
|
||||
Intent editIntent = new Intent(subscribedThingListingActivity, EditMultiRedditActivity.class);
|
||||
editIntent.putExtra(EditMultiRedditActivity.EXTRA_MULTI_REDDIT, multiReddit);
|
||||
startActivity(editIntent);
|
||||
if (multiReddit != null) {
|
||||
Intent editIntent = new Intent(subscribedThingListingActivity, EditMultiRedditActivity.class);
|
||||
editIntent.putExtra(EditMultiRedditActivity.EXTRA_MULTI_PATH, multiReddit.getPath());
|
||||
startActivity(editIntent);
|
||||
}
|
||||
dismiss();
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user