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;
|
import retrofit2.Retrofit;
|
||||||
|
|
||||||
public class EditMultiRedditActivity extends BaseActivity {
|
public class EditMultiRedditActivity extends BaseActivity {
|
||||||
public static final String EXTRA_MULTI_REDDIT = "EMR";
|
|
||||||
public static final String EXTRA_MULTI_PATH = "EMP";
|
public static final String EXTRA_MULTI_PATH = "EMP";
|
||||||
private static final int SUBREDDIT_SELECTION_REQUEST_CODE = 1;
|
private static final int SUBREDDIT_SELECTION_REQUEST_CODE = 1;
|
||||||
private static final String NULL_ACCESS_TOKEN_STATE = "NATS";
|
private static final String NULL_ACCESS_TOKEN_STATE = "NATS";
|
||||||
@ -126,7 +125,6 @@ public class EditMultiRedditActivity extends BaseActivity {
|
|||||||
bindView();
|
bindView();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
multiReddit = getIntent().getParcelableExtra(EXTRA_MULTI_REDDIT);
|
|
||||||
multipath = getIntent().getStringExtra(EXTRA_MULTI_PATH);
|
multipath = getIntent().getStringExtra(EXTRA_MULTI_PATH);
|
||||||
getCurrentAccountAndBindView();
|
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 = "/user/\\w+/m/\\w+/?";
|
||||||
private static final String MULTIREDDIT_PATTERN_2 = "/[rR]/(\\w+\\+?)+/?";
|
private static final String MULTIREDDIT_PATTERN_2 = "/[rR]/(\\w+\\+?)+/?";
|
||||||
private static final String REDD_IT_POST_PATTERN = "/\\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 REDGIFS_PATTERN = "/watch/[\\w-]+$";
|
||||||
private static final String IMGUR_GALLERY_PATTERN = "/gallery/\\w+/?";
|
private static final String IMGUR_GALLERY_PATTERN = "/gallery/\\w+/?";
|
||||||
private static final String IMGUR_ALBUM_PATTERN = "/(album|a)/\\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")) {
|
} else if (authority.contains("gfycat.com")) {
|
||||||
if (path.matches(GFYCAT_PATTERN)) {
|
if (path.matches(GFYCAT_PATTERN)) {
|
||||||
Intent intent = new Intent(this, ViewVideoActivity.class);
|
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_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_GFYCAT);
|
||||||
intent.putExtra(ViewVideoActivity.EXTRA_IS_NSFW, getIntent().getBooleanExtra(EXTRA_IS_NSFW, false));
|
intent.putExtra(ViewVideoActivity.EXTRA_IS_NSFW, getIntent().getBooleanExtra(EXTRA_IS_NSFW, false));
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
@ -48,9 +48,11 @@ public class MultiRedditOptionsBottomSheetFragment extends RoundedBottomSheetDia
|
|||||||
MultiReddit multiReddit = getArguments().getParcelable(EXTRA_MULTI_REDDIT);
|
MultiReddit multiReddit = getArguments().getParcelable(EXTRA_MULTI_REDDIT);
|
||||||
|
|
||||||
editMultiRedditTextView.setOnClickListener(view -> {
|
editMultiRedditTextView.setOnClickListener(view -> {
|
||||||
Intent editIntent = new Intent(subscribedThingListingActivity, EditMultiRedditActivity.class);
|
if (multiReddit != null) {
|
||||||
editIntent.putExtra(EditMultiRedditActivity.EXTRA_MULTI_REDDIT, multiReddit);
|
Intent editIntent = new Intent(subscribedThingListingActivity, EditMultiRedditActivity.class);
|
||||||
startActivity(editIntent);
|
editIntent.putExtra(EditMultiRedditActivity.EXTRA_MULTI_PATH, multiReddit.getPath());
|
||||||
|
startActivity(editIntent);
|
||||||
|
}
|
||||||
dismiss();
|
dismiss();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user