mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-29 04:17:12 +01:00
Correctly handle r/popular and r/all links.
This commit is contained in:
parent
2c194d5120
commit
ae213259b3
@ -139,20 +139,11 @@ public class LinkResolverActivity extends AppCompatActivity {
|
||||
deepLinkError(uri);
|
||||
}
|
||||
} else if (path.matches(SUBREDDIT_PATTERN)) {
|
||||
String subredditName = path.substring(3);
|
||||
if (subredditName.equals("popular") || subredditName.equals("all")) {
|
||||
Intent intent = new Intent(this, MainActivity.class);
|
||||
intent.putExtra(MainActivity.EXTRA_POST_TYPE, subredditName);
|
||||
intent.putExtra(MainActivity.EXTRA_MESSSAGE_FULLNAME, messageFullname);
|
||||
intent.putExtra(MainActivity.EXTRA_NEW_ACCOUNT_NAME, newAccountName);
|
||||
startActivity(intent);
|
||||
} else {
|
||||
Intent intent = new Intent(this, ViewSubredditDetailActivity.class);
|
||||
intent.putExtra(ViewSubredditDetailActivity.EXTRA_SUBREDDIT_NAME_KEY, path.substring(3));
|
||||
intent.putExtra(ViewSubredditDetailActivity.EXTRA_MESSAGE_FULLNAME, messageFullname);
|
||||
intent.putExtra(ViewSubredditDetailActivity.EXTRA_NEW_ACCOUNT_NAME, newAccountName);
|
||||
startActivity(intent);
|
||||
}
|
||||
Intent intent = new Intent(this, ViewSubredditDetailActivity.class);
|
||||
intent.putExtra(ViewSubredditDetailActivity.EXTRA_SUBREDDIT_NAME_KEY, path.substring(3));
|
||||
intent.putExtra(ViewSubredditDetailActivity.EXTRA_MESSAGE_FULLNAME, messageFullname);
|
||||
intent.putExtra(ViewSubredditDetailActivity.EXTRA_NEW_ACCOUNT_NAME, newAccountName);
|
||||
startActivity(intent);
|
||||
} else if (path.matches(USER_PATTERN)) {
|
||||
Intent intent = new Intent(this, ViewUserDetailActivity.class);
|
||||
intent.putExtra(ViewUserDetailActivity.EXTRA_USER_NAME_KEY, segments.get(1));
|
||||
|
@ -112,7 +112,6 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
|
||||
PostTypeBottomSheetFragment.PostTypeSelectionCallback, PostLayoutBottomSheetFragment.PostLayoutSelectionCallback,
|
||||
ActivityToolbarInterface, FABMoreOptionsBottomSheetFragment.FABOptionSelectionCallback, RandomBottomSheetFragment.RandomOptionSelectionCallback {
|
||||
|
||||
static final String EXTRA_POST_TYPE = "EPT";
|
||||
static final String EXTRA_MESSSAGE_FULLNAME = "ENF";
|
||||
static final String EXTRA_NEW_ACCOUNT_NAME = "ENAN";
|
||||
|
||||
@ -844,15 +843,6 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
|
||||
}
|
||||
});
|
||||
|
||||
if (getIntent().hasExtra(EXTRA_POST_TYPE)) {
|
||||
String type = getIntent().getStringExtra(EXTRA_POST_TYPE);
|
||||
if (type != null && type.equals("popular")) {
|
||||
viewPager2.setCurrentItem(1);
|
||||
} else {
|
||||
viewPager2.setCurrentItem(2);
|
||||
}
|
||||
}
|
||||
|
||||
loadUserData();
|
||||
|
||||
if (mAccessToken != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user