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:
Alex Ning 2020-07-18 12:45:40 +08:00
parent 39ae0d3aaf
commit 3a621e2901
3 changed files with 7 additions and 7 deletions

View File

@ -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();
}

View File

@ -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);

View File

@ -48,9 +48,11 @@ public class MultiRedditOptionsBottomSheetFragment extends RoundedBottomSheetDia
MultiReddit multiReddit = getArguments().getParcelable(EXTRA_MULTI_REDDIT);
editMultiRedditTextView.setOnClickListener(view -> {
if (multiReddit != null) {
Intent editIntent = new Intent(subscribedThingListingActivity, EditMultiRedditActivity.class);
editIntent.putExtra(EditMultiRedditActivity.EXTRA_MULTI_REDDIT, multiReddit);
editIntent.putExtra(EditMultiRedditActivity.EXTRA_MULTI_PATH, multiReddit.getPath());
startActivity(editIntent);
}
dismiss();
});