From 4487985ea1589ab8d32330c22dac2e65cbede0bf Mon Sep 17 00:00:00 2001 From: cyBerta Date: Tue, 29 Dec 2020 14:38:43 +0100 Subject: update butterknife probably a last time --- .../base/fragments/DonationReminderDialog.java | 26 +++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'app/src/main/java/se/leap/bitmaskclient/base/fragments/DonationReminderDialog.java') diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/DonationReminderDialog.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/DonationReminderDialog.java index 0277933c..c39386fc 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/DonationReminderDialog.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/DonationReminderDialog.java @@ -6,19 +6,21 @@ import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Bundle; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.appcompat.app.AlertDialog; -import androidx.appcompat.app.AppCompatDialogFragment; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.widget.Button; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatDialogFragment; + import java.text.ParseException; +import butterknife.BindView; import butterknife.ButterKnife; -import butterknife.InjectView; +import butterknife.Unbinder; import se.leap.bitmaskclient.R; import se.leap.bitmaskclient.base.utils.DateHelper; import se.leap.bitmaskclient.base.utils.PreferenceHelper; @@ -35,12 +37,14 @@ public class DonationReminderDialog extends AppCompatDialogFragment { public final static String TAG = DonationReminderDialog.class.getName(); private static boolean isShown = false; - @InjectView(R.id.btnDonate) + @BindView(R.id.btnDonate) Button btnDonate; - @InjectView(R.id.btnLater) + @BindView(R.id.btnLater) Button btnLater; + private Unbinder unbinder; + @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -52,7 +56,7 @@ public class DonationReminderDialog extends AppCompatDialogFragment { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); LayoutInflater inflater = getActivity().getLayoutInflater(); View view = inflater.inflate(R.layout.donation_reminder_dialog, null); - ButterKnife.inject(this, view); + unbinder = ButterKnife.bind(this, view); isShown = true; builder.setView(view); @@ -76,6 +80,12 @@ public class DonationReminderDialog extends AppCompatDialogFragment { return builder.create(); } + @Override + public void onDestroyView() { + super.onDestroyView(); + unbinder.unbind(); + } + public static boolean isCallable(Context context) { if (isShown) { return false; -- cgit v1.2.3