Commit e20fdafa authored by Thomas's avatar Thomas
Browse files

Fix crash with profile and context

parent 7e36abb2
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -68,12 +68,13 @@ public class ContextActivity extends BaseActivity implements FragmentMastodonCon
    private Status focusedStatus;
    private String focusedStatusURI;
    private boolean checkRemotely;
    private ActivityConversationBinding binding;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        ActivityConversationBinding binding = ActivityConversationBinding.inflate(getLayoutInflater());
        binding = ActivityConversationBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
        setSupportActionBar(binding.toolbar);
        ActionBar actionBar = getSupportActionBar();
@@ -93,7 +94,7 @@ public class ContextActivity extends BaseActivity implements FragmentMastodonCon
        manageTopBarScrolling(binding.toolbar, sharedpreferences);
        displayCW = sharedpreferences.getBoolean(getString(R.string.SET_EXPAND_CW), false);
        focusedStatus = null; // or other values
        MastodonHelper.loadPPMastodon(binding.profilePicture, currentAccount.mastodon_account);


        Bundle args = getIntent().getExtras();
        if (args != null) {
@@ -126,6 +127,9 @@ public class ContextActivity extends BaseActivity implements FragmentMastodonCon
            loadRemotelyConversation(true);
            invalidateOptionsMenu();
        }
        if(currentAccount != null) {
            MastodonHelper.loadPPMastodon(binding.profilePicture, currentAccount.mastodon_account);
        }
    }


+9 −3
Original line number Diff line number Diff line
@@ -61,7 +61,9 @@ public class FedilabProfilePageAdapter extends FragmentStatePagerAdapter {
            case 0 -> {
                fragmentMastodonTimeline = new FragmentMastodonTimeline();
                bundle.putSerializable(Helper.ARG_TIMELINE_TYPE, Timeline.TimeLineEnum.ACCOUNT_TIMELINE);
                if(account != null) {
                    bundle.putSerializable(Helper.ARG_CACHED_ACCOUNT_ID, account.id);
                }
                bundle.putBoolean(Helper.ARG_SHOW_PINNED, true);
                bundle.putBoolean(Helper.ARG_SHOW_REPLIES, false);
                bundle.putBoolean(Helper.ARG_SHOW_REBLOGS, true);
@@ -72,7 +74,9 @@ public class FedilabProfilePageAdapter extends FragmentStatePagerAdapter {
            case 1 -> {
                fragmentMastodonTimeline = new FragmentMastodonTimeline();
                bundle.putSerializable(Helper.ARG_TIMELINE_TYPE, Timeline.TimeLineEnum.ACCOUNT_TIMELINE);
                if(account != null) {
                    bundle.putSerializable(Helper.ARG_CACHED_ACCOUNT_ID, account.id);
                }
                bundle.putBoolean(Helper.ARG_SHOW_PINNED, false);
                bundle.putBoolean(Helper.ARG_SHOW_REPLIES, true);
                bundle.putBoolean(Helper.ARG_SHOW_REBLOGS, false);
@@ -82,7 +86,9 @@ public class FedilabProfilePageAdapter extends FragmentStatePagerAdapter {
            }
            case 2 -> {
                FragmentMediaProfile fragmentMediaProfile = new FragmentMediaProfile();
                if(account != null) {
                    bundle.putSerializable(Helper.ARG_CACHED_ACCOUNT_ID, account.id);
                }
                bundle.putBoolean(Helper.ARG_CHECK_REMOTELY, checkRemotely);
                fragmentMediaProfile.setArguments(bundle);
                return fragmentMediaProfile;