From e4b5a413b18c2cdfbadc8def11f48931bece8d64 Mon Sep 17 00:00:00 2001 From: Christoph Loy Date: Tue, 25 Feb 2020 22:58:09 +0100 Subject: [PATCH] Remove Butterknife from AccountChooserDialogFragment --- .../fragment/AccountChooserDialogFragment.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/AccountChooserDialogFragment.java b/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/AccountChooserDialogFragment.java index e05314c6..94024987 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/AccountChooserDialogFragment.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/AccountChooserDialogFragment.java @@ -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 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();