Commit bf8543bc authored by Thomas's avatar Thomas
Browse files

Some cleaning

parent 8b26deb0
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -65,8 +65,7 @@ public class AccountActivity extends BaseBarActivity {
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = ActivityAccountPeertubeBinding.inflate(getLayoutInflater());
        View view = binding.getRoot();
        setContentView(view);
        setContentView(binding.getRoot());
        if (getSupportActionBar() != null)
            getSupportActionBar().setDisplayHomeAsUpEnabled(true);

+1 −1
Original line number Diff line number Diff line
@@ -518,7 +518,7 @@ public class PeertubeMainActivity extends PeertubeBaseMainActivity {
                    account.refresh_token = token.getRefresh_token();
                    account.peertube_account = userMe.getAccount();
                    account.software = Account.API.PEERTUBE.name();
                    account.user_id = userMe.getAccount().getUserId();
                    account.user_id = userMe.getAccount().getId();
                    account.instance = userMe.getAccount().getHost();
                    SharedPreferences.Editor editor = sharedpreferences.edit();
                    editor.putString(PREF_USER_TOKEN, token.getAccess_token());
+1 −1
Original line number Diff line number Diff line
@@ -180,7 +180,7 @@ public class RetrofitPeertubeAPI {
            account.api = Account.API.PEERTUBE;
            account.software = Account.API.PEERTUBE.name();
            account.peertube_account = peertubeAccount;
            account.user_id = peertubeAccount.getUserId();
            account.user_id = peertubeAccount.getId();
            SharedPreferences.Editor editor = sharedpreferences.edit();
            editor.putString(PREF_USER_ID, account.user_id);
            editor.putString(PREF_USER_INSTANCE, host);
+4 −0
Original line number Diff line number Diff line
@@ -140,6 +140,10 @@ public class ChannelListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo

    private boolean isMyChannel(Channel channel) {
        SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context);

        if (channel.getOwnerAccount() == null) {
            return true;
        }
        String channeIdOwner = channel.getOwnerAccount().getId();
        String channeInstanceOwner = channel.getOwnerAccount().getHost();
        String instanceShar = sharedpreferences.getString(PREF_USER_INSTANCE, null);
+4 −7
Original line number Diff line number Diff line
@@ -95,14 +95,11 @@ public class DisplayChannelsFragment extends Fragment implements ChannelListAdap
            search_peertube = bundle.getString("search_peertube", null);
        }

        if (getActivity() != null) {
        action_button = getActivity().findViewById(R.id.action_button);
        if (action_button != null) {
            action_button.setVisibility(View.VISIBLE);
            action_button.setOnClickListener(view -> manageAlert(null));
        }
        }

        binding.lvElements.addItemDecoration(new DividerItemDecoration(context, DividerItemDecoration.VERTICAL));
        channelListAdapter = new ChannelListAdapter(this.channels);
        channelListAdapter.allChannelRemoved = this;
Loading