Remove Butterknife from AccountChooserDialogFragment

This commit is contained in:
Christoph Loy 2020-02-25 22:58:09 +01:00 committed by Niedermann IT-Dienstleistungen
parent b3ace46318
commit e4b5a413b1

View file

@ -17,17 +17,14 @@ import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
import java.util.Objects;
import butterknife.BindView;
import butterknife.ButterKnife;
import it.niedermann.owncloud.notes.R;
import it.niedermann.owncloud.notes.android.fragment.AccountChooserAdapter.AccountChooserListener;
import it.niedermann.owncloud.notes.databinding.DialogChooseAccountBinding;
import it.niedermann.owncloud.notes.model.LocalAccount;
import it.niedermann.owncloud.notes.persistence.NoteSQLiteOpenHelper;
public class AccountChooserDialogFragment extends AppCompatDialogFragment implements AccountChooserListener {
private AccountChooserListener accountChooserListener;
@BindView(R.id.accounts_list)
RecyclerView accountRecyclerView;
/**
* Use newInstance()-Method
@ -49,16 +46,16 @@ public class AccountChooserDialogFragment extends AppCompatDialogFragment implem
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
View view = View.inflate(getContext(), R.layout.dialog_choose_account, null);
ButterKnife.bind(this, view);
DialogChooseAccountBinding binding = DialogChooseAccountBinding.bind(view);
NoteSQLiteOpenHelper db = NoteSQLiteOpenHelper.getInstance(getActivity());
List<LocalAccount> accountsList = db.getAccounts();
RecyclerView.Adapter adapter = new AccountChooserAdapter(accountsList, this, requireActivity());
accountRecyclerView.setAdapter(adapter);
binding.accountsList.setAdapter(adapter);
return new AlertDialog.Builder(requireActivity())
.setView(view)
.setView(binding.getRoot())
.setTitle(R.string.simple_move)
.setNegativeButton(android.R.string.cancel, null)
.create();