From 683dc81c28384479459c76d2ef8662bc62bf48d8 Mon Sep 17 00:00:00 2001 From: danwaters-stripe <37308241+danwaters-stripe@users.noreply.github.com> Date: Tue, 21 Jan 2020 13:56:47 -0800 Subject: [PATCH] Release 1.0.2 (#87) --- CHANGELOG.md | 11 ++- Example/javaapp/build.gradle | 12 ++-- .../javaapp/StripeTerminalApplication.java | 2 + .../javaapp/fragment/TerminalFragment.java | 27 ++------ .../fragment/UpdateReaderFragment.java | 67 +++++++++++++------ .../javaapp/fragment/event/EventAdapter.java | 18 ++--- .../javaapp/fragment/event/EventFragment.java | 37 +++++----- .../javaapp/fragment/event/EventHolder.java | 24 ++----- .../javaapp/viewmodel/DiscoveryViewModel.java | 2 +- .../javaapp/viewmodel/EventViewModel.java | 4 +- .../javaapp/viewmodel/TerminalViewModel.java | 22 ++---- .../viewmodel/UpdateReaderViewModel.java | 10 +++ .../src/main/res/layout/fragment_event.xml | 14 +--- .../src/main/res/layout/fragment_terminal.xml | 8 +-- .../res/layout/fragment_update_reader.xml | 28 ++------ .../src/main/res/layout/list_item_event.xml | 10 --- Example/kotlinapp/build.gradle | 12 ++-- .../example/StripeTerminalApplication.kt | 2 + .../fragment/discovery/ReaderAdapter.kt | 18 ++--- .../example/fragment/event/EventAdapter.kt | 18 ++--- .../example/fragment/event/EventFragment.kt | 6 +- docs/allclasses-frame.html | 4 +- docs/allclasses-noframe.html | 4 +- .../stripeterminal/Terminal.Companion.html | 4 +- docs/com/stripe/stripeterminal/Terminal.html | 4 +- .../TerminalLifecycleObserver.Companion.html | 4 +- .../TerminalLifecycleObserver.html | 62 ++++++++++++++++- .../stripe/stripeterminal/api/ApiError.html | 4 +- .../stripeterminal/api/ApiErrorType.html | 4 +- .../stripeterminal/api/package-frame.html | 4 +- .../stripeterminal/api/package-summary.html | 4 +- .../stripeterminal/api/package-tree.html | 4 +- .../stripeterminal/callable/Callback.html | 4 +- .../stripeterminal/callable/Cancelable.html | 4 +- .../callable/ConnectionTokenCallback.html | 4 +- .../callable/ConnectionTokenProvider.html | 4 +- .../callable/DiscoveryListener.html | 4 +- .../callable/ErrorCallback.html | 4 +- .../callable/PaymentIntentCallback.html | 4 +- .../callable/PaymentMethodCallback.html | 4 +- .../callable/ReaderCallback.html | 4 +- .../callable/ReaderDisplayListener.html | 4 +- .../ReaderSoftwareUpdateCallback.html | 4 +- .../ReaderSoftwareUpdateListener.html | 4 +- .../TerminalListener.DefaultImpls.html | 4 +- .../callable/TerminalListener.html | 4 +- .../callable/package-frame.html | 4 +- .../callable/package-summary.html | 4 +- .../stripeterminal/callable/package-tree.html | 4 +- .../stripe/stripeterminal/log/LogLevel.html | 4 +- .../stripeterminal/log/package-frame.html | 4 +- .../stripeterminal/log/package-summary.html | 4 +- .../stripeterminal/log/package-tree.html | 4 +- .../model/external/CardDetails.html | 4 +- .../model/external/CardPresentDetails.html | 4 +- .../stripeterminal/model/external/Charge.html | 4 +- .../model/external/ConnectionStatus.html | 4 +- .../external/ConnectionTokenException.html | 4 +- .../model/external/DeviceType.html | 4 +- .../external/DiscoveryConfiguration.html | 4 +- .../model/external/PaymentIntent.html | 4 +- .../PaymentIntentParameters.Builder.html | 4 +- .../external/PaymentIntentParameters.html | 4 +- .../model/external/PaymentIntentStatus.html | 4 +- .../model/external/PaymentMethod.html | 4 +- .../model/external/PaymentMethodDetails.html | 4 +- .../model/external/PaymentMethodType.html | 4 +- .../model/external/PaymentStatus.html | 4 +- .../ReadReusableCardParameters.Builder.html | 4 +- .../ReadReusableCardParameters.Companion.html | 4 +- .../external/ReadReusableCardParameters.html | 4 +- .../stripeterminal/model/external/Reader.html | 4 +- .../model/external/ReaderDisplayMessage.html | 4 +- .../model/external/ReaderEvent.html | 4 +- .../ReaderInputOptions.ReaderInputOption.html | 4 +- .../model/external/ReaderInputOptions.html | 4 +- ...aderSoftwareUpdate.UpdateTimeEstimate.html | 4 +- .../model/external/ReaderSoftwareUpdate.html | 4 +- .../model/external/ReceiptDetails.html | 4 +- .../TerminalException.TerminalErrorCode.html | 4 +- .../model/external/TerminalException.html | 4 +- .../model/external/package-frame.html | 4 +- .../model/external/package-summary.html | 4 +- .../model/external/package-tree.html | 8 +-- .../stripe/stripeterminal/package-frame.html | 4 +- .../stripeterminal/package-summary.html | 4 +- .../stripe/stripeterminal/package-tree.html | 4 +- docs/constant-values.html | 4 +- docs/deprecated-list.html | 4 +- docs/help-doc.html | 4 +- docs/index-all.html | 12 +++- docs/index.html | 2 +- docs/overview-frame.html | 4 +- docs/overview-summary.html | 4 +- docs/overview-tree.html | 6 +- 95 files changed, 368 insertions(+), 350 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09841577..85a8869b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,18 @@ -# 1.0.1 +# 1.0.2 If you're using Gradle, update your build file to: ``` -implementation "com.stripe:stripeterminal:1.0.1" +implementation "com.stripe:stripeterminal:1.0.2" ``` +## Other changes +- Update gradle dependencies to work on latest gradle plugin +- Example apps (databinding specifically) now compile on latest gradle plugin +- Minor polish for multi-activity apps' lifecycle automatic cleanup + +# 1.0.1 + ## Other changes - Fixed race condition in multi-activity apps that could lead to DB exception diff --git a/Example/javaapp/build.gradle b/Example/javaapp/build.gradle index b4b40365..ac3fe783 100644 --- a/Example/javaapp/build.gradle +++ b/Example/javaapp/build.gradle @@ -8,8 +8,8 @@ android { targetSdkVersion 29 } - dataBinding { - enabled true + buildFeatures { + dataBinding = true } compileOptions { @@ -31,18 +31,18 @@ ext { constraintVersion = '1.1.3' constraintlayoutVersion = '1.1.3' coreTestingVersion = '2.1.0' - coroutineVersion = '1.3.2' + coroutineVersion = '1.3.3' databindingVersion = '3.1.4' legacysupportVersion = '1.0.0' materialVersion = '1.0.0' okhttpVersion = '4.2.2' - retrofitVersion = '2.6.2' + retrofitVersion = '2.7.0' stethoVersion = '1.5.1' viewModelVersion = '2.1.0' - leakCanaryVersion = '2.0-beta-3' + leakCanaryVersion = '2.0' - stripeTerminalVersion = '1.0.1' + stripeTerminalVersion = '1.0.2' } dependencies { diff --git a/Example/javaapp/src/main/java/com/stripe/example/javaapp/StripeTerminalApplication.java b/Example/javaapp/src/main/java/com/stripe/example/javaapp/StripeTerminalApplication.java index 62546bd2..731788f4 100644 --- a/Example/javaapp/src/main/java/com/stripe/example/javaapp/StripeTerminalApplication.java +++ b/Example/javaapp/src/main/java/com/stripe/example/javaapp/StripeTerminalApplication.java @@ -2,6 +2,7 @@ import android.app.Application; import android.os.StrictMode; +import androidx.lifecycle.ProcessLifecycleOwner; import com.facebook.stetho.Stetho; import com.stripe.stripeterminal.TerminalLifecycleObserver; @@ -33,6 +34,7 @@ public void onCreate() { Stetho.initializeWithDefaults(this); registerActivityLifecycleCallbacks(observer); + ProcessLifecycleOwner.get().getLifecycle().addObserver(observer); } @Override diff --git a/Example/javaapp/src/main/java/com/stripe/example/javaapp/fragment/TerminalFragment.java b/Example/javaapp/src/main/java/com/stripe/example/javaapp/fragment/TerminalFragment.java index ea9a4d12..d58f3530 100644 --- a/Example/javaapp/src/main/java/com/stripe/example/javaapp/fragment/TerminalFragment.java +++ b/Example/javaapp/src/main/java/com/stripe/example/javaapp/fragment/TerminalFragment.java @@ -3,18 +3,14 @@ import android.content.Context; import android.content.SharedPreferences; import android.os.Bundle; -import android.view.LayoutInflater; import android.view.View; -import android.view.ViewGroup; import android.widget.TextView; -import androidx.databinding.DataBindingUtil; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; import com.stripe.example.javaapp.NavigationListener; import com.stripe.example.javaapp.R; -import com.stripe.example.javaapp.databinding.FragmentTerminalBinding; import com.stripe.example.javaapp.viewmodel.TerminalViewModel; import org.jetbrains.annotations.NotNull; @@ -29,7 +25,6 @@ public class TerminalFragment extends Fragment { public static final String TAG = "com.stripe.example.fragment.TerminalFragment"; private static final String SIMULATED_SWITCH = "simulated_switch"; - private FragmentTerminalBinding binding; private TerminalViewModel viewModel; @Override @@ -54,20 +49,6 @@ public void onCreate(@Nullable Bundle savedInstanceState) { } } - @Nullable - @Override - public View onCreateView( - @NotNull LayoutInflater inflater, - @Nullable ViewGroup container, - @Nullable Bundle savedInstanceState - ) { - // Inflate the layout for this fragment - binding = DataBindingUtil.inflate(inflater, R.layout.fragment_terminal, container, false); - binding.setLifecycleOwner(this); - binding.setViewModel(viewModel); - return binding.getRoot(); - } - @Override public void onViewCreated(@NotNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); @@ -75,10 +56,14 @@ public void onViewCreated(@NotNull View view, @Nullable Bundle savedInstanceStat view.findViewById(R.id.discover_button).setOnClickListener(v -> { final FragmentActivity activity = getActivity(); if (activity instanceof NavigationListener) { - ((NavigationListener) activity).onRequestDiscovery(viewModel.getSimulated()); + ((NavigationListener) activity).onRequestDiscovery(viewModel.simulated.getValue()); } }); + view.findViewById(R.id.simulated_switch).setOnClickListener(v -> { + viewModel.simulated.setValue(!viewModel.simulated.getValue()); + }); + // TODO: Do this dynamically from the type selected ((TextView) view.findViewById(R.id.device_type_button)).setText(R.string.chipper_2x); } @@ -90,7 +75,7 @@ public void onPause() { if (activity != null) { final SharedPreferences prefs = activity.getSharedPreferences(TAG, Context.MODE_PRIVATE); if (prefs != null) { - prefs.edit().putBoolean(SIMULATED_SWITCH, viewModel.getSimulated()).apply(); + prefs.edit().putBoolean(SIMULATED_SWITCH, viewModel.simulated.getValue()).apply(); } } } diff --git a/Example/javaapp/src/main/java/com/stripe/example/javaapp/fragment/UpdateReaderFragment.java b/Example/javaapp/src/main/java/com/stripe/example/javaapp/fragment/UpdateReaderFragment.java index 8205605c..f488eceb 100644 --- a/Example/javaapp/src/main/java/com/stripe/example/javaapp/fragment/UpdateReaderFragment.java +++ b/Example/javaapp/src/main/java/com/stripe/example/javaapp/fragment/UpdateReaderFragment.java @@ -1,15 +1,16 @@ package com.stripe.example.javaapp.fragment; import android.os.Bundle; -import android.view.LayoutInflater; import android.view.View; -import android.view.ViewGroup; -import androidx.databinding.DataBindingUtil; +import android.widget.TextView; + +import androidx.core.content.ContextCompat; import androidx.fragment.app.Fragment; import androidx.lifecycle.ViewModelProviders; + +import com.google.android.material.button.MaterialButton; import com.stripe.example.javaapp.MainActivity; import com.stripe.example.javaapp.R; -import com.stripe.example.javaapp.databinding.FragmentUpdateReaderBinding; import com.stripe.example.javaapp.viewmodel.UpdateReaderViewModel; import com.stripe.stripeterminal.Terminal; import com.stripe.stripeterminal.callable.Callback; @@ -22,6 +23,7 @@ import org.jetbrains.annotations.Nullable; import java.lang.ref.WeakReference; +import java.util.Objects; /** * The `UpdateReaderFragment` allows the user to check the current version of the [Reader] software, @@ -31,7 +33,6 @@ public class UpdateReaderFragment extends Fragment implements ReaderSoftwareUpda @NotNull public static final String TAG = "com.stripe.example.fragment.UpdateReaderFragment"; - private FragmentUpdateReaderBinding binding; private UpdateReaderViewModel viewModel; private WeakReference activityRef; @@ -39,26 +40,9 @@ public class UpdateReaderFragment extends Fragment implements ReaderSoftwareUpda public void onCreate(@Nullable Bundle bundle) { super.onCreate(bundle); viewModel = ViewModelProviders.of(this).get(UpdateReaderViewModel.class); - } - - @Nullable - @Override - public View onCreateView( - @NotNull LayoutInflater inflater, - @Nullable ViewGroup container, - @Nullable Bundle savedInstanceState - ) { - // Inflate the layout for this fragment - binding = DataBindingUtil.inflate( - inflater, R.layout.fragment_update_reader, container, false); - binding.setLifecycleOwner(this); - binding.setViewModel(viewModel); - if (viewModel.reader == null) { viewModel.reader = Terminal.getInstance().getConnectedReader(); } - - return binding.getRoot(); } @Override @@ -141,6 +125,45 @@ public void onFailure(@NotNull TerminalException e) { // Done button onClick listeners view.findViewById(R.id.done_button).setOnClickListener(v -> exitWorkflow(activityRef)); + + viewModel.doneButtonVisibility.observe(this, visibility -> { + final TextView textView = view.findViewById(R.id.cancel_button); + textView.setTextColor(ContextCompat.getColor( + Objects.requireNonNull(getContext()), + visibility ? R.color.colorPrimaryDark : R.color.colorAccent)); + view.findViewById(R.id.done_button) + .setVisibility(visibility ? View.VISIBLE : View.GONE); + }); + + ((TextView) view.findViewById(R.id.reader_description)).setText( + Objects.requireNonNull(getContext()).getString( + R.string.reader_description, + Objects.requireNonNull(viewModel.reader).getDeviceType().name(), + viewModel.reader.getSerialNumber())); + + ((MaterialButton) view.findViewById(R.id.current_version)).setText( + viewModel.reader.getSoftwareVersion()); + + viewModel.checkForUpdateButtonVisibility.observe(this, visibility -> + view.findViewById(R.id.check_for_update_description) + .setVisibility(visibility ? View.VISIBLE : View.GONE)); + + viewModel.checkForUpdateButtonText.observe(this, text -> + ((MaterialButton) view.findViewById(R.id.check_for_update_button)).setText(text)); + + viewModel.checkForUpdateButtonColor.observe(this, color -> + ((MaterialButton) view.findViewById(R.id.check_for_update_button)).setTextColor(color)); + + viewModel.checkForUpdateDescriptionText.observe(this, text -> + ((TextView) view.findViewById(R.id.check_for_update_description)).setText(text)); + + viewModel.checkForUpdateDescriptionVisibility.observe(this, visibility -> + view.findViewById(R.id.check_for_update_description) + .setVisibility(visibility ? View.VISIBLE : View.GONE)); + + viewModel.installDisclaimerVisibility.observe(this, visibility -> + view.findViewById(R.id.install_disclaimer) + .setVisibility(visibility ? View.VISIBLE : View.GONE)); } private void onCompleteUpdate() { diff --git a/Example/javaapp/src/main/java/com/stripe/example/javaapp/fragment/event/EventAdapter.java b/Example/javaapp/src/main/java/com/stripe/example/javaapp/fragment/event/EventAdapter.java index 2c4b03fb..6c3ca084 100644 --- a/Example/javaapp/src/main/java/com/stripe/example/javaapp/fragment/event/EventAdapter.java +++ b/Example/javaapp/src/main/java/com/stripe/example/javaapp/fragment/event/EventAdapter.java @@ -1,11 +1,13 @@ package com.stripe.example.javaapp.fragment.event; +import android.view.LayoutInflater; import android.view.ViewGroup; import androidx.databinding.BindingAdapter; import androidx.recyclerview.widget.RecyclerView; + +import com.stripe.example.javaapp.R; import com.stripe.example.javaapp.model.Event; -import com.stripe.example.javaapp.viewmodel.EventViewModel; import org.jetbrains.annotations.NotNull; @@ -16,19 +18,10 @@ * Our [RecyclerView.Adapter] implementation that allows us to update the list of events */ public class EventAdapter extends RecyclerView.Adapter { - @NotNull private final EventViewModel viewModel; @NotNull private List events; - @BindingAdapter("events") - public static void bindEvents(@NotNull RecyclerView recyclerView, @NotNull List events) { - if (recyclerView.getAdapter() instanceof EventAdapter) { - ((EventAdapter) recyclerView.getAdapter()).updateEvents(events); - } - } - - public EventAdapter(@NotNull EventViewModel viewModel) { + public EventAdapter() { super(); - this.viewModel = viewModel; events = new ArrayList<>(); } @@ -50,6 +43,7 @@ public void onBindViewHolder(@NotNull EventHolder holder, int position) { @NotNull @Override public EventHolder onCreateViewHolder(@NotNull ViewGroup parent, int viewType) { - return new EventHolder(parent); + return new EventHolder( + LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_event, parent)); } } diff --git a/Example/javaapp/src/main/java/com/stripe/example/javaapp/fragment/event/EventFragment.java b/Example/javaapp/src/main/java/com/stripe/example/javaapp/fragment/event/EventFragment.java index 82e730ad..44f9c7a8 100644 --- a/Example/javaapp/src/main/java/com/stripe/example/javaapp/fragment/event/EventFragment.java +++ b/Example/javaapp/src/main/java/com/stripe/example/javaapp/fragment/event/EventFragment.java @@ -2,10 +2,10 @@ import android.os.Bundle; import android.util.Log; -import android.view.LayoutInflater; import android.view.View; -import android.view.ViewGroup; -import androidx.databinding.DataBindingUtil; +import android.widget.TextView; + +import androidx.core.content.ContextCompat; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; import androidx.lifecycle.ViewModelProviders; @@ -160,7 +160,6 @@ public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); activityRef = new WeakReference<>(getActivity()); viewModel = ViewModelProviders.of(this).get(EventViewModel.class); - adapter = new EventAdapter(viewModel); if (savedInstanceState == null) { final Bundle arguments = getArguments(); @@ -184,27 +183,13 @@ public void onCreate(@Nullable Bundle savedInstanceState) { } } - @Nullable @Override - public View onCreateView( - @NotNull LayoutInflater inflater, - @Nullable ViewGroup container, - @Nullable Bundle savedInstanceState - ) { - // Inflate the layout for this fragment - binding = DataBindingUtil.inflate(inflater, R.layout.fragment_event, container, false); - binding.setLifecycleOwner(this); - binding.setViewModel(viewModel); - - eventRecyclerView = binding.getRoot().findViewById(R.id.event_recycler_view); + public void onViewCreated(@NotNull View view, @Nullable Bundle savedInstanceState) { + eventRecyclerView = view.findViewById(R.id.event_recycler_view); eventRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); + adapter = new EventAdapter(); eventRecyclerView.setAdapter(adapter); - return binding.getRoot(); - } - - @Override - public void onViewCreated(@NotNull View view, @Nullable Bundle savedInstanceState) { view.findViewById(R.id.cancel_button).setOnClickListener(v -> { if (viewModel.collectTask != null) { viewModel.collectTask.cancel(new Callback() { @@ -231,6 +216,16 @@ public void onFailure(@NotNull TerminalException e) { activity.runOnUiThread(((NavigationListener) activity)::onRequestExitWorkflow); } }); + + viewModel.isComplete.observe(this, isComplete -> { + ((TextView) view.findViewById(R.id.cancel_button)) + .setTextColor(ContextCompat.getColor(getContext(), + isComplete ? R.color.colorPrimaryDark : R.color.colorAccent)); + + view.findViewById(R.id.done_button).setVisibility(isComplete ? View.VISIBLE : View.GONE); + }); + + viewModel.events.observe(this, events -> adapter.updateEvents(events)); } @Override diff --git a/Example/javaapp/src/main/java/com/stripe/example/javaapp/fragment/event/EventHolder.java b/Example/javaapp/src/main/java/com/stripe/example/javaapp/fragment/event/EventHolder.java index 963f08ec..6ad37045 100644 --- a/Example/javaapp/src/main/java/com/stripe/example/javaapp/fragment/event/EventHolder.java +++ b/Example/javaapp/src/main/java/com/stripe/example/javaapp/fragment/event/EventHolder.java @@ -1,7 +1,10 @@ package com.stripe.example.javaapp.fragment.event; import android.view.LayoutInflater; +import android.view.View; import android.view.ViewGroup; +import android.widget.LinearLayout; +import android.widget.TextView; import androidx.databinding.DataBindingUtil; import androidx.databinding.library.baseAdapters.BR; @@ -17,28 +20,15 @@ * A simple [RecyclerView.ViewHolder] that displays various events */ public class EventHolder extends RecyclerView.ViewHolder { - @NotNull private final ListItemEventBinding binding; public EventHolder( - @NotNull ViewGroup parent + @NotNull View itemView ) { - this(DataBindingUtil.inflate( - LayoutInflater.from(parent.getContext()), - R.layout.list_item_event, - parent, - false - )); - } - - private EventHolder( - @NotNull ListItemEventBinding binding - ) { - super(binding.getRoot()); - this.binding = binding; + super(itemView); } public void bind(@NotNull Event event) { - binding.setVariable(BR.event, event); - binding.executePendingBindings(); + ((TextView) itemView.findViewById(R.id.method)).setText(event.getMethod()); + ((TextView) itemView.findViewById(R.id.message)).setText(event.getMessage()); } } diff --git a/Example/javaapp/src/main/java/com/stripe/example/javaapp/viewmodel/DiscoveryViewModel.java b/Example/javaapp/src/main/java/com/stripe/example/javaapp/viewmodel/DiscoveryViewModel.java index 60e8479e..3d4c692f 100644 --- a/Example/javaapp/src/main/java/com/stripe/example/javaapp/viewmodel/DiscoveryViewModel.java +++ b/Example/javaapp/src/main/java/com/stripe/example/javaapp/viewmodel/DiscoveryViewModel.java @@ -15,7 +15,7 @@ public class DiscoveryViewModel extends ViewModel { public final MutableLiveData> readers; - public MutableLiveData isConnecting; + public final MutableLiveData isConnecting; @Nullable public Cancelable discoveryTask; @Nullable public ReaderClickListener readerClickListener; diff --git a/Example/javaapp/src/main/java/com/stripe/example/javaapp/viewmodel/EventViewModel.java b/Example/javaapp/src/main/java/com/stripe/example/javaapp/viewmodel/EventViewModel.java index 5aea888c..9cebe1b9 100644 --- a/Example/javaapp/src/main/java/com/stripe/example/javaapp/viewmodel/EventViewModel.java +++ b/Example/javaapp/src/main/java/com/stripe/example/javaapp/viewmodel/EventViewModel.java @@ -13,8 +13,8 @@ public class EventViewModel extends ViewModel { @NotNull private List eventList; - @NotNull public MutableLiveData> events; - @NotNull public MutableLiveData isComplete; + @NotNull public final MutableLiveData> events; + @NotNull public final MutableLiveData isComplete; @Nullable public Cancelable collectTask; public EventViewModel() { diff --git a/Example/javaapp/src/main/java/com/stripe/example/javaapp/viewmodel/TerminalViewModel.java b/Example/javaapp/src/main/java/com/stripe/example/javaapp/viewmodel/TerminalViewModel.java index 87b916b8..5e6149e8 100644 --- a/Example/javaapp/src/main/java/com/stripe/example/javaapp/viewmodel/TerminalViewModel.java +++ b/Example/javaapp/src/main/java/com/stripe/example/javaapp/viewmodel/TerminalViewModel.java @@ -1,29 +1,17 @@ package com.stripe.example.javaapp.viewmodel; -import androidx.databinding.BaseObservable; -import androidx.databinding.Bindable; -import androidx.databinding.library.baseAdapters.BR; +import androidx.lifecycle.MutableLiveData; +import androidx.lifecycle.ViewModel; -public class TerminalViewModel extends BaseObservable { - private boolean simulated; +public class TerminalViewModel extends ViewModel { + public final MutableLiveData simulated; public TerminalViewModel() { this(false); } public TerminalViewModel(boolean simulated) { - this.simulated = simulated; + this.simulated = new MutableLiveData<>(simulated); } - @Bindable - public Boolean getSimulated() { - return simulated; - } - - public void setSimulated(Boolean value) { - if (simulated != value) { - simulated = value; - notifyPropertyChanged(BR.simulated); - } - } } diff --git a/Example/javaapp/src/main/java/com/stripe/example/javaapp/viewmodel/UpdateReaderViewModel.java b/Example/javaapp/src/main/java/com/stripe/example/javaapp/viewmodel/UpdateReaderViewModel.java index 71348c8a..811f6387 100644 --- a/Example/javaapp/src/main/java/com/stripe/example/javaapp/viewmodel/UpdateReaderViewModel.java +++ b/Example/javaapp/src/main/java/com/stripe/example/javaapp/viewmodel/UpdateReaderViewModel.java @@ -29,6 +29,7 @@ public class UpdateReaderViewModel extends AndroidViewModel { @NotNull public MediatorLiveData checkForUpdateButtonText = new MediatorLiveData<>(); @NotNull public MediatorLiveData checkForUpdateDescriptionText = new MediatorLiveData<>(); @NotNull public MediatorLiveData doneButtonVisibility = new MediatorLiveData<>(); + @NotNull public MediatorLiveData installDisclaimerVisibility = new MediatorLiveData<>(); @Nullable public Cancelable fetchUpdateOperation = null; @Nullable public Cancelable installOperation = null; @@ -86,6 +87,11 @@ public UpdateReaderViewModel(@NotNull Application app) { doneButtonVisibility.addSource(hasFinishedFetchingUpdate, doneButtonVisibilityLambda); doneButtonVisibility.addSource(hasStartedInstallingUpdate, doneButtonVisibilityLambda); doneButtonVisibility.addSource(readerSoftwareUpdate, doneButtonVisibilityLambda); + + final Observer installDisclaimerVisibilityLambda = + value -> installDisclaimerVisibility.setValue(getInstallDisclaimerVisiblity()); + installDisclaimerVisibility.addSource(hasStartedInstallingUpdate, installDisclaimerVisibilityLambda); + installDisclaimerVisibility.addSource(hasFinishedFetchingUpdate, installDisclaimerVisibilityLambda); } private boolean getCheckForUpdateDescriptionVisibility() { @@ -147,4 +153,8 @@ private boolean getDoneButtonVisibility() { hasFinishedFetchingUpdate.getValue() && !hasStartedInstallingUpdate.getValue() && readerSoftwareUpdate.getValue() == null); } + + private boolean getInstallDisclaimerVisiblity() { + return hasStartedInstallingUpdate.getValue() && hasFinishedFetchingUpdate.getValue(); + } } diff --git a/Example/javaapp/src/main/res/layout/fragment_event.xml b/Example/javaapp/src/main/res/layout/fragment_event.xml index a76d8cff..dae0075f 100644 --- a/Example/javaapp/src/main/res/layout/fragment_event.xml +++ b/Example/javaapp/src/main/res/layout/fragment_event.xml @@ -3,15 +3,6 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"> - - - - - - - @@ -54,7 +45,7 @@ android:paddingStart="12dp" android:paddingEnd="12dp" android:paddingTop="16dp" - android:visibility="@{viewModel.isComplete.getValue() ? View.VISIBLE : View.GONE}" + android:visibility="gone" android:text="@string/done" android:textColor="@color/colorAccent" /> @@ -89,7 +80,6 @@ android:layout_width="match_parent" android:layout_height="0dp" android:paddingTop="10dp" - app:events="@{viewModel.events}" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toBottomOf="@id/event_label" diff --git a/Example/javaapp/src/main/res/layout/fragment_terminal.xml b/Example/javaapp/src/main/res/layout/fragment_terminal.xml index dce78b15..ae8a4216 100644 --- a/Example/javaapp/src/main/res/layout/fragment_terminal.xml +++ b/Example/javaapp/src/main/res/layout/fragment_terminal.xml @@ -3,12 +3,6 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"> - - - - - - - - - - - @@ -39,7 +30,7 @@ android:paddingEnd="12dp" android:paddingTop="16dp" android:text="@string/cancel" - android:textColor="@{ContextCompat.getColor(context, viewModel.doneButtonVisibility.getValue() ? R.color.colorPrimaryDark : R.color.colorAccent)}" + android:textColor="@color/colorAccent" android:visibility="visible" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" @@ -55,7 +46,7 @@ android:paddingStart="12dp" android:paddingEnd="12dp" android:paddingTop="16dp" - android:visibility="@{viewModel.doneButtonVisibility.getValue() ? View.VISIBLE : View.GONE}" + android:visibility="gone" android:text="@string/done" android:textColor="@color/colorAccent" /> @@ -104,7 +95,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:textStyle="bold" - android:text="@{context.getString(R.string.reader_description, viewModel.reader.deviceType.name, viewModel.reader.serialNumber)}" android:gravity="center_horizontal" /> @@ -140,9 +129,7 @@ android:layout_marginTop="40dp" android:layoutDirection="rtl" android:textAlignment="textStart" - android:text="@{context.getString(viewModel.checkForUpdateButtonText.getValue())}" - android:textColor="@{ContextCompat.getColor(context, viewModel.checkForUpdateButtonColor.getValue())}" - android:visibility="@{viewModel.checkForUpdateButtonVisibility.getValue() ? View.VISIBLE : View.INVISIBLE}"/> + android:visibility="visible"/> + android:paddingEnd="16dp" /> + android:text="@string/installation_in_progress" /> diff --git a/Example/javaapp/src/main/res/layout/list_item_event.xml b/Example/javaapp/src/main/res/layout/list_item_event.xml index ecb4c8d4..873311c8 100644 --- a/Example/javaapp/src/main/res/layout/list_item_event.xml +++ b/Example/javaapp/src/main/res/layout/list_item_event.xml @@ -1,12 +1,5 @@ - - - - - @@ -30,9 +22,7 @@ android:id="@+id/method" android:layout_width="match_parent" android:layout_height="wrap_content" - android:text="@{event.method}" android:paddingStart="16dp" android:paddingEnd="16dp" /> - \ No newline at end of file diff --git a/Example/kotlinapp/build.gradle b/Example/kotlinapp/build.gradle index 2e03b552..b1629027 100644 --- a/Example/kotlinapp/build.gradle +++ b/Example/kotlinapp/build.gradle @@ -15,8 +15,8 @@ android { targetSdkVersion 29 } - dataBinding { - enabled true + buildFeatures { + dataBinding = true } compileOptions { @@ -34,18 +34,18 @@ ext { constraintVersion = '1.1.3' constraintlayoutVersion = '1.1.3' coreTestingVersion = '2.1.0' - coroutineVersion = '1.3.2' + coroutineVersion = '1.3.3' databindingVersion = '3.1.4' legacysupportVersion = '1.0.0' materialVersion = '1.0.0' okhttpVersion = '4.2.2' - retrofitVersion = '2.6.2' + retrofitVersion = '2.7.0' stethoVersion = '1.5.1' viewModelVersion = '2.1.0' - leakCanaryVersion = '2.0-beta-3' + leakCanaryVersion = '2.0' - stripeTerminalVersion = '1.0.1' + stripeTerminalVersion = '1.0.2' } dependencies { diff --git a/Example/kotlinapp/src/main/java/com/stripe/example/StripeTerminalApplication.kt b/Example/kotlinapp/src/main/java/com/stripe/example/StripeTerminalApplication.kt index f6f9db9c..a280b650 100644 --- a/Example/kotlinapp/src/main/java/com/stripe/example/StripeTerminalApplication.kt +++ b/Example/kotlinapp/src/main/java/com/stripe/example/StripeTerminalApplication.kt @@ -2,6 +2,7 @@ package com.stripe.example import android.app.Application import android.os.StrictMode +import androidx.lifecycle.ProcessLifecycleOwner import com.facebook.stetho.Stetho import com.stripe.stripeterminal.TerminalLifecycleObserver import kotlinx.coroutines.CoroutineScope @@ -36,6 +37,7 @@ class StripeTerminalApplication : Application() { } registerActivityLifecycleCallbacks(observer) + ProcessLifecycleOwner.get().lifecycle.addObserver(observer) } override fun onTrimMemory(level: Int) { diff --git a/Example/kotlinapp/src/main/java/com/stripe/example/fragment/discovery/ReaderAdapter.kt b/Example/kotlinapp/src/main/java/com/stripe/example/fragment/discovery/ReaderAdapter.kt index 37fc35a8..d16a3704 100644 --- a/Example/kotlinapp/src/main/java/com/stripe/example/fragment/discovery/ReaderAdapter.kt +++ b/Example/kotlinapp/src/main/java/com/stripe/example/fragment/discovery/ReaderAdapter.kt @@ -6,6 +6,15 @@ import androidx.recyclerview.widget.RecyclerView import com.stripe.example.viewmodel.DiscoveryViewModel import com.stripe.stripeterminal.model.external.Reader +object ItemsBindingAdapter { + @BindingAdapter("items") + @JvmStatic + fun RecyclerView.bindItems(items: List) { + val adapter = adapter as ReaderAdapter + adapter.updateReaders(items) + } +} + /** * Our [RecyclerView.Adapter] implementation that allows us to update the list of readers */ @@ -30,13 +39,4 @@ class ReaderAdapter( override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ReaderHolder { return ReaderHolder(parent, viewModel.readerClickListener!!) } - - companion object { - @BindingAdapter("items") - @JvmStatic - fun RecyclerView.bindItems(items: List) { - val adapter = adapter as ReaderAdapter - adapter.updateReaders(items) - } - } } diff --git a/Example/kotlinapp/src/main/java/com/stripe/example/fragment/event/EventAdapter.kt b/Example/kotlinapp/src/main/java/com/stripe/example/fragment/event/EventAdapter.kt index 5f2cf859..39bf74fd 100644 --- a/Example/kotlinapp/src/main/java/com/stripe/example/fragment/event/EventAdapter.kt +++ b/Example/kotlinapp/src/main/java/com/stripe/example/fragment/event/EventAdapter.kt @@ -6,6 +6,15 @@ import androidx.recyclerview.widget.RecyclerView import com.stripe.example.model.Event import com.stripe.example.viewmodel.EventViewModel +object EventsBindingAdapter { + @BindingAdapter("events") + @JvmStatic + fun RecyclerView.bindItems(events: List) { + val adapter = adapter as EventAdapter + adapter.updateEvents(events) + } +} + /** * Our [RecyclerView.Adapter] implementation that allows us to update the list of events */ @@ -30,13 +39,4 @@ class EventAdapter( override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): EventHolder { return EventHolder(parent) } - - companion object { - @BindingAdapter("events") - @JvmStatic - fun RecyclerView.bindItems(events: List) { - val adapter = adapter as EventAdapter - adapter.updateEvents(events) - } - } } diff --git a/Example/kotlinapp/src/main/java/com/stripe/example/fragment/event/EventFragment.kt b/Example/kotlinapp/src/main/java/com/stripe/example/fragment/event/EventFragment.kt index 69d9a684..ba667f8d 100644 --- a/Example/kotlinapp/src/main/java/com/stripe/example/fragment/event/EventFragment.kt +++ b/Example/kotlinapp/src/main/java/com/stripe/example/fragment/event/EventFragment.kt @@ -127,11 +127,11 @@ class EventFragment : Fragment(), ReaderDisplayListener { private val createPaymentIntentCallback by lazy { object : PaymentIntentCallback { - override fun onSuccess(intent: PaymentIntent) { - paymentIntent = intent + override fun onSuccess(paymentIntent: PaymentIntent) { + this@EventFragment.paymentIntent = paymentIntent addEvent("Created PaymentIntent", "terminal.createPaymentIntent") viewModel.collectTask = Terminal.getInstance().collectPaymentMethod( - intent, this@EventFragment, collectPaymentMethodCallback) + paymentIntent, this@EventFragment, collectPaymentMethodCallback) } override fun onFailure(e: TerminalException) { diff --git a/docs/allclasses-frame.html b/docs/allclasses-frame.html index f5320c15..7d0edfe3 100644 --- a/docs/allclasses-frame.html +++ b/docs/allclasses-frame.html @@ -2,10 +2,10 @@ - + All Classes - + diff --git a/docs/allclasses-noframe.html b/docs/allclasses-noframe.html index 719488dc..67a30c3b 100644 --- a/docs/allclasses-noframe.html +++ b/docs/allclasses-noframe.html @@ -2,10 +2,10 @@ - + All Classes - + diff --git a/docs/com/stripe/stripeterminal/Terminal.Companion.html b/docs/com/stripe/stripeterminal/Terminal.Companion.html index 690d6289..6c6d9c21 100644 --- a/docs/com/stripe/stripeterminal/Terminal.Companion.html +++ b/docs/com/stripe/stripeterminal/Terminal.Companion.html @@ -2,10 +2,10 @@ - + Terminal.Companion - + diff --git a/docs/com/stripe/stripeterminal/Terminal.html b/docs/com/stripe/stripeterminal/Terminal.html index b4f9e53d..cdda40ca 100644 --- a/docs/com/stripe/stripeterminal/Terminal.html +++ b/docs/com/stripe/stripeterminal/Terminal.html @@ -2,10 +2,10 @@ - + Terminal - + diff --git a/docs/com/stripe/stripeterminal/TerminalLifecycleObserver.Companion.html b/docs/com/stripe/stripeterminal/TerminalLifecycleObserver.Companion.html index fef173e6..81ecfa78 100644 --- a/docs/com/stripe/stripeterminal/TerminalLifecycleObserver.Companion.html +++ b/docs/com/stripe/stripeterminal/TerminalLifecycleObserver.Companion.html @@ -2,10 +2,10 @@ - + TerminalLifecycleObserver.Companion - + diff --git a/docs/com/stripe/stripeterminal/TerminalLifecycleObserver.html b/docs/com/stripe/stripeterminal/TerminalLifecycleObserver.html index a6068ff0..d2fd3a97 100644 --- a/docs/com/stripe/stripeterminal/TerminalLifecycleObserver.html +++ b/docs/com/stripe/stripeterminal/TerminalLifecycleObserver.html @@ -2,13 +2,17 @@ - + TerminalLifecycleObserver - + + + + + @@ -30,7 +34,7 @@ catch(err) { } //--> -var methods = {"i0":9,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10}; +var methods = {"i0":9,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10}; var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; @@ -241,6 +245,22 @@

Method Summary

void +onPause()  + + +void +onResume()  + + +void +onStart()  + + +void +onStop()  + + +void onTrimMemory(int level, android.app.Application application)  @@ -313,6 +333,42 @@

onTrimMemory

android.app.Application application) + + + +
    +
  • +

    onStart

    +
    public void onStart()
    +
  • +
+ + + +
    +
  • +

    onResume

    +
    public void onResume()
    +
  • +
+ + + +
    +
  • +

    onStop

    +
    public void onStop()
    +
  • +
+ + + +
    +
  • +

    onPause

    +
    public void onPause()
    +
  • +
diff --git a/docs/com/stripe/stripeterminal/api/ApiError.html b/docs/com/stripe/stripeterminal/api/ApiError.html index 7c5f57bc..c3d39db5 100644 --- a/docs/com/stripe/stripeterminal/api/ApiError.html +++ b/docs/com/stripe/stripeterminal/api/ApiError.html @@ -2,10 +2,10 @@ - + ApiError - + diff --git a/docs/com/stripe/stripeterminal/api/ApiErrorType.html b/docs/com/stripe/stripeterminal/api/ApiErrorType.html index a84ffa54..d1f4353b 100644 --- a/docs/com/stripe/stripeterminal/api/ApiErrorType.html +++ b/docs/com/stripe/stripeterminal/api/ApiErrorType.html @@ -2,10 +2,10 @@ - + ApiErrorType - + diff --git a/docs/com/stripe/stripeterminal/api/package-frame.html b/docs/com/stripe/stripeterminal/api/package-frame.html index f2d94a34..e6ec4fe2 100644 --- a/docs/com/stripe/stripeterminal/api/package-frame.html +++ b/docs/com/stripe/stripeterminal/api/package-frame.html @@ -2,10 +2,10 @@ - + com.stripe.stripeterminal.api - + diff --git a/docs/com/stripe/stripeterminal/api/package-summary.html b/docs/com/stripe/stripeterminal/api/package-summary.html index eb3f5d4e..e656eb7f 100644 --- a/docs/com/stripe/stripeterminal/api/package-summary.html +++ b/docs/com/stripe/stripeterminal/api/package-summary.html @@ -2,10 +2,10 @@ - + com.stripe.stripeterminal.api - + diff --git a/docs/com/stripe/stripeterminal/api/package-tree.html b/docs/com/stripe/stripeterminal/api/package-tree.html index b5740696..74f10d7a 100644 --- a/docs/com/stripe/stripeterminal/api/package-tree.html +++ b/docs/com/stripe/stripeterminal/api/package-tree.html @@ -2,10 +2,10 @@ - + com.stripe.stripeterminal.api Class Hierarchy - + diff --git a/docs/com/stripe/stripeterminal/callable/Callback.html b/docs/com/stripe/stripeterminal/callable/Callback.html index 7e9ac336..8b569744 100644 --- a/docs/com/stripe/stripeterminal/callable/Callback.html +++ b/docs/com/stripe/stripeterminal/callable/Callback.html @@ -2,10 +2,10 @@ - + Callback - + diff --git a/docs/com/stripe/stripeterminal/callable/Cancelable.html b/docs/com/stripe/stripeterminal/callable/Cancelable.html index fd13893e..b55a5586 100644 --- a/docs/com/stripe/stripeterminal/callable/Cancelable.html +++ b/docs/com/stripe/stripeterminal/callable/Cancelable.html @@ -2,10 +2,10 @@ - + Cancelable - + diff --git a/docs/com/stripe/stripeterminal/callable/ConnectionTokenCallback.html b/docs/com/stripe/stripeterminal/callable/ConnectionTokenCallback.html index 52127fd0..9a7366f1 100644 --- a/docs/com/stripe/stripeterminal/callable/ConnectionTokenCallback.html +++ b/docs/com/stripe/stripeterminal/callable/ConnectionTokenCallback.html @@ -2,10 +2,10 @@ - + ConnectionTokenCallback - + diff --git a/docs/com/stripe/stripeterminal/callable/ConnectionTokenProvider.html b/docs/com/stripe/stripeterminal/callable/ConnectionTokenProvider.html index 6e007492..f34cb3d7 100644 --- a/docs/com/stripe/stripeterminal/callable/ConnectionTokenProvider.html +++ b/docs/com/stripe/stripeterminal/callable/ConnectionTokenProvider.html @@ -2,10 +2,10 @@ - + ConnectionTokenProvider - + diff --git a/docs/com/stripe/stripeterminal/callable/DiscoveryListener.html b/docs/com/stripe/stripeterminal/callable/DiscoveryListener.html index fa941657..bd7c36b6 100644 --- a/docs/com/stripe/stripeterminal/callable/DiscoveryListener.html +++ b/docs/com/stripe/stripeterminal/callable/DiscoveryListener.html @@ -2,10 +2,10 @@ - + DiscoveryListener - + diff --git a/docs/com/stripe/stripeterminal/callable/ErrorCallback.html b/docs/com/stripe/stripeterminal/callable/ErrorCallback.html index 47421529..35096907 100644 --- a/docs/com/stripe/stripeterminal/callable/ErrorCallback.html +++ b/docs/com/stripe/stripeterminal/callable/ErrorCallback.html @@ -2,10 +2,10 @@ - + ErrorCallback - + diff --git a/docs/com/stripe/stripeterminal/callable/PaymentIntentCallback.html b/docs/com/stripe/stripeterminal/callable/PaymentIntentCallback.html index 9bd0753e..6c36cb1f 100644 --- a/docs/com/stripe/stripeterminal/callable/PaymentIntentCallback.html +++ b/docs/com/stripe/stripeterminal/callable/PaymentIntentCallback.html @@ -2,10 +2,10 @@ - + PaymentIntentCallback - + diff --git a/docs/com/stripe/stripeterminal/callable/PaymentMethodCallback.html b/docs/com/stripe/stripeterminal/callable/PaymentMethodCallback.html index 3ee3b801..56b959a3 100644 --- a/docs/com/stripe/stripeterminal/callable/PaymentMethodCallback.html +++ b/docs/com/stripe/stripeterminal/callable/PaymentMethodCallback.html @@ -2,10 +2,10 @@ - + PaymentMethodCallback - + diff --git a/docs/com/stripe/stripeterminal/callable/ReaderCallback.html b/docs/com/stripe/stripeterminal/callable/ReaderCallback.html index bc6d09bb..61d0b55f 100644 --- a/docs/com/stripe/stripeterminal/callable/ReaderCallback.html +++ b/docs/com/stripe/stripeterminal/callable/ReaderCallback.html @@ -2,10 +2,10 @@ - + ReaderCallback - + diff --git a/docs/com/stripe/stripeterminal/callable/ReaderDisplayListener.html b/docs/com/stripe/stripeterminal/callable/ReaderDisplayListener.html index 58e44287..afbb0f70 100644 --- a/docs/com/stripe/stripeterminal/callable/ReaderDisplayListener.html +++ b/docs/com/stripe/stripeterminal/callable/ReaderDisplayListener.html @@ -2,10 +2,10 @@ - + ReaderDisplayListener - + diff --git a/docs/com/stripe/stripeterminal/callable/ReaderSoftwareUpdateCallback.html b/docs/com/stripe/stripeterminal/callable/ReaderSoftwareUpdateCallback.html index 46567828..2586a650 100644 --- a/docs/com/stripe/stripeterminal/callable/ReaderSoftwareUpdateCallback.html +++ b/docs/com/stripe/stripeterminal/callable/ReaderSoftwareUpdateCallback.html @@ -2,10 +2,10 @@ - + ReaderSoftwareUpdateCallback - + diff --git a/docs/com/stripe/stripeterminal/callable/ReaderSoftwareUpdateListener.html b/docs/com/stripe/stripeterminal/callable/ReaderSoftwareUpdateListener.html index 3dc0d07d..0bb2bfe4 100644 --- a/docs/com/stripe/stripeterminal/callable/ReaderSoftwareUpdateListener.html +++ b/docs/com/stripe/stripeterminal/callable/ReaderSoftwareUpdateListener.html @@ -2,10 +2,10 @@ - + ReaderSoftwareUpdateListener - + diff --git a/docs/com/stripe/stripeterminal/callable/TerminalListener.DefaultImpls.html b/docs/com/stripe/stripeterminal/callable/TerminalListener.DefaultImpls.html index 3fe653b7..3506c266 100644 --- a/docs/com/stripe/stripeterminal/callable/TerminalListener.DefaultImpls.html +++ b/docs/com/stripe/stripeterminal/callable/TerminalListener.DefaultImpls.html @@ -2,10 +2,10 @@ - + TerminalListener.DefaultImpls - + diff --git a/docs/com/stripe/stripeterminal/callable/TerminalListener.html b/docs/com/stripe/stripeterminal/callable/TerminalListener.html index 38a0b487..c4caa6cf 100644 --- a/docs/com/stripe/stripeterminal/callable/TerminalListener.html +++ b/docs/com/stripe/stripeterminal/callable/TerminalListener.html @@ -2,10 +2,10 @@ - + TerminalListener - + diff --git a/docs/com/stripe/stripeterminal/callable/package-frame.html b/docs/com/stripe/stripeterminal/callable/package-frame.html index ba4889b5..1ddafbef 100644 --- a/docs/com/stripe/stripeterminal/callable/package-frame.html +++ b/docs/com/stripe/stripeterminal/callable/package-frame.html @@ -2,10 +2,10 @@ - + com.stripe.stripeterminal.callable - + diff --git a/docs/com/stripe/stripeterminal/callable/package-summary.html b/docs/com/stripe/stripeterminal/callable/package-summary.html index 828dd9c4..2cd15561 100644 --- a/docs/com/stripe/stripeterminal/callable/package-summary.html +++ b/docs/com/stripe/stripeterminal/callable/package-summary.html @@ -2,10 +2,10 @@ - + com.stripe.stripeterminal.callable - + diff --git a/docs/com/stripe/stripeterminal/callable/package-tree.html b/docs/com/stripe/stripeterminal/callable/package-tree.html index fd5add30..a36dcc30 100644 --- a/docs/com/stripe/stripeterminal/callable/package-tree.html +++ b/docs/com/stripe/stripeterminal/callable/package-tree.html @@ -2,10 +2,10 @@ - + com.stripe.stripeterminal.callable Class Hierarchy - + diff --git a/docs/com/stripe/stripeterminal/log/LogLevel.html b/docs/com/stripe/stripeterminal/log/LogLevel.html index 84fd171b..816edf82 100644 --- a/docs/com/stripe/stripeterminal/log/LogLevel.html +++ b/docs/com/stripe/stripeterminal/log/LogLevel.html @@ -2,10 +2,10 @@ - + LogLevel - + diff --git a/docs/com/stripe/stripeterminal/log/package-frame.html b/docs/com/stripe/stripeterminal/log/package-frame.html index 679799dd..6aceff48 100644 --- a/docs/com/stripe/stripeterminal/log/package-frame.html +++ b/docs/com/stripe/stripeterminal/log/package-frame.html @@ -2,10 +2,10 @@ - + com.stripe.stripeterminal.log - + diff --git a/docs/com/stripe/stripeterminal/log/package-summary.html b/docs/com/stripe/stripeterminal/log/package-summary.html index 1c20cc64..94764d9e 100644 --- a/docs/com/stripe/stripeterminal/log/package-summary.html +++ b/docs/com/stripe/stripeterminal/log/package-summary.html @@ -2,10 +2,10 @@ - + com.stripe.stripeterminal.log - + diff --git a/docs/com/stripe/stripeterminal/log/package-tree.html b/docs/com/stripe/stripeterminal/log/package-tree.html index 8fddb76d..76d92b2e 100644 --- a/docs/com/stripe/stripeterminal/log/package-tree.html +++ b/docs/com/stripe/stripeterminal/log/package-tree.html @@ -2,10 +2,10 @@ - + com.stripe.stripeterminal.log Class Hierarchy - + diff --git a/docs/com/stripe/stripeterminal/model/external/CardDetails.html b/docs/com/stripe/stripeterminal/model/external/CardDetails.html index a67a30a1..27c6cb7f 100644 --- a/docs/com/stripe/stripeterminal/model/external/CardDetails.html +++ b/docs/com/stripe/stripeterminal/model/external/CardDetails.html @@ -2,10 +2,10 @@ - + CardDetails - + diff --git a/docs/com/stripe/stripeterminal/model/external/CardPresentDetails.html b/docs/com/stripe/stripeterminal/model/external/CardPresentDetails.html index d02ac19c..d2044bef 100644 --- a/docs/com/stripe/stripeterminal/model/external/CardPresentDetails.html +++ b/docs/com/stripe/stripeterminal/model/external/CardPresentDetails.html @@ -2,10 +2,10 @@ - + CardPresentDetails - + diff --git a/docs/com/stripe/stripeterminal/model/external/Charge.html b/docs/com/stripe/stripeterminal/model/external/Charge.html index 1e180e6b..55cf512b 100644 --- a/docs/com/stripe/stripeterminal/model/external/Charge.html +++ b/docs/com/stripe/stripeterminal/model/external/Charge.html @@ -2,10 +2,10 @@ - + Charge - + diff --git a/docs/com/stripe/stripeterminal/model/external/ConnectionStatus.html b/docs/com/stripe/stripeterminal/model/external/ConnectionStatus.html index 9aa0e7f1..24085a6b 100644 --- a/docs/com/stripe/stripeterminal/model/external/ConnectionStatus.html +++ b/docs/com/stripe/stripeterminal/model/external/ConnectionStatus.html @@ -2,10 +2,10 @@ - + ConnectionStatus - + diff --git a/docs/com/stripe/stripeterminal/model/external/ConnectionTokenException.html b/docs/com/stripe/stripeterminal/model/external/ConnectionTokenException.html index 3f255ff0..c78a9344 100644 --- a/docs/com/stripe/stripeterminal/model/external/ConnectionTokenException.html +++ b/docs/com/stripe/stripeterminal/model/external/ConnectionTokenException.html @@ -2,10 +2,10 @@ - + ConnectionTokenException - + diff --git a/docs/com/stripe/stripeterminal/model/external/DeviceType.html b/docs/com/stripe/stripeterminal/model/external/DeviceType.html index da60590b..072320a7 100644 --- a/docs/com/stripe/stripeterminal/model/external/DeviceType.html +++ b/docs/com/stripe/stripeterminal/model/external/DeviceType.html @@ -2,10 +2,10 @@ - + DeviceType - + diff --git a/docs/com/stripe/stripeterminal/model/external/DiscoveryConfiguration.html b/docs/com/stripe/stripeterminal/model/external/DiscoveryConfiguration.html index d694c322..67ac5a0f 100644 --- a/docs/com/stripe/stripeterminal/model/external/DiscoveryConfiguration.html +++ b/docs/com/stripe/stripeterminal/model/external/DiscoveryConfiguration.html @@ -2,10 +2,10 @@ - + DiscoveryConfiguration - + diff --git a/docs/com/stripe/stripeterminal/model/external/PaymentIntent.html b/docs/com/stripe/stripeterminal/model/external/PaymentIntent.html index a2e39b98..be105529 100644 --- a/docs/com/stripe/stripeterminal/model/external/PaymentIntent.html +++ b/docs/com/stripe/stripeterminal/model/external/PaymentIntent.html @@ -2,10 +2,10 @@ - + PaymentIntent - + diff --git a/docs/com/stripe/stripeterminal/model/external/PaymentIntentParameters.Builder.html b/docs/com/stripe/stripeterminal/model/external/PaymentIntentParameters.Builder.html index 7c2dc5d0..c3dad691 100644 --- a/docs/com/stripe/stripeterminal/model/external/PaymentIntentParameters.Builder.html +++ b/docs/com/stripe/stripeterminal/model/external/PaymentIntentParameters.Builder.html @@ -2,10 +2,10 @@ - + PaymentIntentParameters.Builder - + diff --git a/docs/com/stripe/stripeterminal/model/external/PaymentIntentParameters.html b/docs/com/stripe/stripeterminal/model/external/PaymentIntentParameters.html index 7e3c1546..4c607420 100644 --- a/docs/com/stripe/stripeterminal/model/external/PaymentIntentParameters.html +++ b/docs/com/stripe/stripeterminal/model/external/PaymentIntentParameters.html @@ -2,10 +2,10 @@ - + PaymentIntentParameters - + diff --git a/docs/com/stripe/stripeterminal/model/external/PaymentIntentStatus.html b/docs/com/stripe/stripeterminal/model/external/PaymentIntentStatus.html index b6c1880a..020bc6cf 100644 --- a/docs/com/stripe/stripeterminal/model/external/PaymentIntentStatus.html +++ b/docs/com/stripe/stripeterminal/model/external/PaymentIntentStatus.html @@ -2,10 +2,10 @@ - + PaymentIntentStatus - + diff --git a/docs/com/stripe/stripeterminal/model/external/PaymentMethod.html b/docs/com/stripe/stripeterminal/model/external/PaymentMethod.html index 2f0f20e7..cd4162e4 100644 --- a/docs/com/stripe/stripeterminal/model/external/PaymentMethod.html +++ b/docs/com/stripe/stripeterminal/model/external/PaymentMethod.html @@ -2,10 +2,10 @@ - + PaymentMethod - + diff --git a/docs/com/stripe/stripeterminal/model/external/PaymentMethodDetails.html b/docs/com/stripe/stripeterminal/model/external/PaymentMethodDetails.html index 11d5b6f6..5c28181e 100644 --- a/docs/com/stripe/stripeterminal/model/external/PaymentMethodDetails.html +++ b/docs/com/stripe/stripeterminal/model/external/PaymentMethodDetails.html @@ -2,10 +2,10 @@ - + PaymentMethodDetails - + diff --git a/docs/com/stripe/stripeterminal/model/external/PaymentMethodType.html b/docs/com/stripe/stripeterminal/model/external/PaymentMethodType.html index a5f70fbe..56068ffc 100644 --- a/docs/com/stripe/stripeterminal/model/external/PaymentMethodType.html +++ b/docs/com/stripe/stripeterminal/model/external/PaymentMethodType.html @@ -2,10 +2,10 @@ - + PaymentMethodType - + diff --git a/docs/com/stripe/stripeterminal/model/external/PaymentStatus.html b/docs/com/stripe/stripeterminal/model/external/PaymentStatus.html index 7b7052cb..fdd9d814 100644 --- a/docs/com/stripe/stripeterminal/model/external/PaymentStatus.html +++ b/docs/com/stripe/stripeterminal/model/external/PaymentStatus.html @@ -2,10 +2,10 @@ - + PaymentStatus - + diff --git a/docs/com/stripe/stripeterminal/model/external/ReadReusableCardParameters.Builder.html b/docs/com/stripe/stripeterminal/model/external/ReadReusableCardParameters.Builder.html index a27e9c4f..c1937205 100644 --- a/docs/com/stripe/stripeterminal/model/external/ReadReusableCardParameters.Builder.html +++ b/docs/com/stripe/stripeterminal/model/external/ReadReusableCardParameters.Builder.html @@ -2,10 +2,10 @@ - + ReadReusableCardParameters.Builder - + diff --git a/docs/com/stripe/stripeterminal/model/external/ReadReusableCardParameters.Companion.html b/docs/com/stripe/stripeterminal/model/external/ReadReusableCardParameters.Companion.html index ab3f06ee..f7348b56 100644 --- a/docs/com/stripe/stripeterminal/model/external/ReadReusableCardParameters.Companion.html +++ b/docs/com/stripe/stripeterminal/model/external/ReadReusableCardParameters.Companion.html @@ -2,10 +2,10 @@ - + ReadReusableCardParameters.Companion - + diff --git a/docs/com/stripe/stripeterminal/model/external/ReadReusableCardParameters.html b/docs/com/stripe/stripeterminal/model/external/ReadReusableCardParameters.html index ff0cfbec..096abcb5 100644 --- a/docs/com/stripe/stripeterminal/model/external/ReadReusableCardParameters.html +++ b/docs/com/stripe/stripeterminal/model/external/ReadReusableCardParameters.html @@ -2,10 +2,10 @@ - + ReadReusableCardParameters - + diff --git a/docs/com/stripe/stripeterminal/model/external/Reader.html b/docs/com/stripe/stripeterminal/model/external/Reader.html index c6bf8cb3..7a99c71b 100644 --- a/docs/com/stripe/stripeterminal/model/external/Reader.html +++ b/docs/com/stripe/stripeterminal/model/external/Reader.html @@ -2,10 +2,10 @@ - + Reader - + diff --git a/docs/com/stripe/stripeterminal/model/external/ReaderDisplayMessage.html b/docs/com/stripe/stripeterminal/model/external/ReaderDisplayMessage.html index 3b6b8b49..88e25f97 100644 --- a/docs/com/stripe/stripeterminal/model/external/ReaderDisplayMessage.html +++ b/docs/com/stripe/stripeterminal/model/external/ReaderDisplayMessage.html @@ -2,10 +2,10 @@ - + ReaderDisplayMessage - + diff --git a/docs/com/stripe/stripeterminal/model/external/ReaderEvent.html b/docs/com/stripe/stripeterminal/model/external/ReaderEvent.html index c10bb2b5..d91f4868 100644 --- a/docs/com/stripe/stripeterminal/model/external/ReaderEvent.html +++ b/docs/com/stripe/stripeterminal/model/external/ReaderEvent.html @@ -2,10 +2,10 @@ - + ReaderEvent - + diff --git a/docs/com/stripe/stripeterminal/model/external/ReaderInputOptions.ReaderInputOption.html b/docs/com/stripe/stripeterminal/model/external/ReaderInputOptions.ReaderInputOption.html index a50e37a9..4d444e65 100644 --- a/docs/com/stripe/stripeterminal/model/external/ReaderInputOptions.ReaderInputOption.html +++ b/docs/com/stripe/stripeterminal/model/external/ReaderInputOptions.ReaderInputOption.html @@ -2,10 +2,10 @@ - + ReaderInputOptions.ReaderInputOption - + diff --git a/docs/com/stripe/stripeterminal/model/external/ReaderInputOptions.html b/docs/com/stripe/stripeterminal/model/external/ReaderInputOptions.html index e01d7f23..21e75bf6 100644 --- a/docs/com/stripe/stripeterminal/model/external/ReaderInputOptions.html +++ b/docs/com/stripe/stripeterminal/model/external/ReaderInputOptions.html @@ -2,10 +2,10 @@ - + ReaderInputOptions - + diff --git a/docs/com/stripe/stripeterminal/model/external/ReaderSoftwareUpdate.UpdateTimeEstimate.html b/docs/com/stripe/stripeterminal/model/external/ReaderSoftwareUpdate.UpdateTimeEstimate.html index 42de455d..8382f97e 100644 --- a/docs/com/stripe/stripeterminal/model/external/ReaderSoftwareUpdate.UpdateTimeEstimate.html +++ b/docs/com/stripe/stripeterminal/model/external/ReaderSoftwareUpdate.UpdateTimeEstimate.html @@ -2,10 +2,10 @@ - + ReaderSoftwareUpdate.UpdateTimeEstimate - + diff --git a/docs/com/stripe/stripeterminal/model/external/ReaderSoftwareUpdate.html b/docs/com/stripe/stripeterminal/model/external/ReaderSoftwareUpdate.html index 2717aa3a..cb7fdb25 100644 --- a/docs/com/stripe/stripeterminal/model/external/ReaderSoftwareUpdate.html +++ b/docs/com/stripe/stripeterminal/model/external/ReaderSoftwareUpdate.html @@ -2,10 +2,10 @@ - + ReaderSoftwareUpdate - + diff --git a/docs/com/stripe/stripeterminal/model/external/ReceiptDetails.html b/docs/com/stripe/stripeterminal/model/external/ReceiptDetails.html index ef79590c..b23202ba 100644 --- a/docs/com/stripe/stripeterminal/model/external/ReceiptDetails.html +++ b/docs/com/stripe/stripeterminal/model/external/ReceiptDetails.html @@ -2,10 +2,10 @@ - + ReceiptDetails - + diff --git a/docs/com/stripe/stripeterminal/model/external/TerminalException.TerminalErrorCode.html b/docs/com/stripe/stripeterminal/model/external/TerminalException.TerminalErrorCode.html index 03d1d9d5..4ba9501d 100644 --- a/docs/com/stripe/stripeterminal/model/external/TerminalException.TerminalErrorCode.html +++ b/docs/com/stripe/stripeterminal/model/external/TerminalException.TerminalErrorCode.html @@ -2,10 +2,10 @@ - + TerminalException.TerminalErrorCode - + diff --git a/docs/com/stripe/stripeterminal/model/external/TerminalException.html b/docs/com/stripe/stripeterminal/model/external/TerminalException.html index 0ed4ca5d..669e9950 100644 --- a/docs/com/stripe/stripeterminal/model/external/TerminalException.html +++ b/docs/com/stripe/stripeterminal/model/external/TerminalException.html @@ -2,10 +2,10 @@ - + TerminalException - + diff --git a/docs/com/stripe/stripeterminal/model/external/package-frame.html b/docs/com/stripe/stripeterminal/model/external/package-frame.html index 14b390c4..3157adea 100644 --- a/docs/com/stripe/stripeterminal/model/external/package-frame.html +++ b/docs/com/stripe/stripeterminal/model/external/package-frame.html @@ -2,10 +2,10 @@ - + com.stripe.stripeterminal.model.external - + diff --git a/docs/com/stripe/stripeterminal/model/external/package-summary.html b/docs/com/stripe/stripeterminal/model/external/package-summary.html index ce331d5e..f688eae8 100644 --- a/docs/com/stripe/stripeterminal/model/external/package-summary.html +++ b/docs/com/stripe/stripeterminal/model/external/package-summary.html @@ -2,10 +2,10 @@ - + com.stripe.stripeterminal.model.external - + diff --git a/docs/com/stripe/stripeterminal/model/external/package-tree.html b/docs/com/stripe/stripeterminal/model/external/package-tree.html index b524c9e9..a0fb1e81 100644 --- a/docs/com/stripe/stripeterminal/model/external/package-tree.html +++ b/docs/com/stripe/stripeterminal/model/external/package-tree.html @@ -2,10 +2,10 @@ - + com.stripe.stripeterminal.model.external Class Hierarchy - + @@ -89,8 +89,8 @@

Class Hierarchy

  • com.stripe.stripeterminal.model.external.PaymentIntent
  • com.stripe.stripeterminal.model.external.PaymentIntentParameters
  • com.stripe.stripeterminal.model.external.CardPresentDetails
  • -
  • com.stripe.stripeterminal.model.external.CardDetails
  • com.stripe.stripeterminal.model.external.Reader
  • +
  • com.stripe.stripeterminal.model.external.CardDetails
  • com.stripe.stripeterminal.model.external.Charge
  • com.stripe.stripeterminal.model.external.PaymentIntentParameters.Builder
  • com.stripe.stripeterminal.model.external.PaymentMethod
  • @@ -104,8 +104,8 @@

    Enum Hierarchy

  • com.stripe.stripeterminal.model.external.ReaderDisplayMessage
  • com.stripe.stripeterminal.model.external.PaymentMethodType
  • com.stripe.stripeterminal.model.external.TerminalException.TerminalErrorCode
  • -
  • com.stripe.stripeterminal.model.external.ConnectionStatus
  • com.stripe.stripeterminal.model.external.PaymentIntentStatus
  • +
  • com.stripe.stripeterminal.model.external.ConnectionStatus
  • com.stripe.stripeterminal.model.external.DeviceType
  • com.stripe.stripeterminal.model.external.ReaderInputOptions.ReaderInputOption
  • diff --git a/docs/com/stripe/stripeterminal/package-frame.html b/docs/com/stripe/stripeterminal/package-frame.html index 56efcdd1..4fb3cb1b 100644 --- a/docs/com/stripe/stripeterminal/package-frame.html +++ b/docs/com/stripe/stripeterminal/package-frame.html @@ -2,10 +2,10 @@ - + com.stripe.stripeterminal - + diff --git a/docs/com/stripe/stripeterminal/package-summary.html b/docs/com/stripe/stripeterminal/package-summary.html index 834aaddf..eb5ab2d2 100644 --- a/docs/com/stripe/stripeterminal/package-summary.html +++ b/docs/com/stripe/stripeterminal/package-summary.html @@ -2,10 +2,10 @@ - + com.stripe.stripeterminal - + diff --git a/docs/com/stripe/stripeterminal/package-tree.html b/docs/com/stripe/stripeterminal/package-tree.html index 09c0fa8d..799a3881 100644 --- a/docs/com/stripe/stripeterminal/package-tree.html +++ b/docs/com/stripe/stripeterminal/package-tree.html @@ -2,10 +2,10 @@ - + com.stripe.stripeterminal Class Hierarchy - + diff --git a/docs/constant-values.html b/docs/constant-values.html index 907fa5fe..3960b3b2 100644 --- a/docs/constant-values.html +++ b/docs/constant-values.html @@ -2,10 +2,10 @@ - + Constant Field Values - + diff --git a/docs/deprecated-list.html b/docs/deprecated-list.html index 62dda72a..cf7451ec 100644 --- a/docs/deprecated-list.html +++ b/docs/deprecated-list.html @@ -2,10 +2,10 @@ - + Deprecated List - + diff --git a/docs/help-doc.html b/docs/help-doc.html index ec4d6a46..e1e3fdea 100644 --- a/docs/help-doc.html +++ b/docs/help-doc.html @@ -2,10 +2,10 @@ - + API Help - + diff --git a/docs/index-all.html b/docs/index-all.html index 29b87cee..ede673f8 100644 --- a/docs/index-all.html +++ b/docs/index-all.html @@ -2,10 +2,10 @@ - + Index - + @@ -1407,6 +1407,8 @@

    O

    This method will be called any time the the current operation fails.
    +
    onPause() - Method in class com.stripe.stripeterminal.TerminalLifecycleObserver
    +
     
    onPaymentStatusChange($this, status) - Static method in class com.stripe.stripeterminal.callable.TerminalListener.DefaultImpls
    The class Terminal's payment status changed.
    @@ -1448,6 +1450,12 @@

    O

    options. If the reader emits a message, the .onRequestReaderDisplayMessage method will be called.
    +
    onResume() - Method in class com.stripe.stripeterminal.TerminalLifecycleObserver
    +
     
    +
    onStart() - Method in class com.stripe.stripeterminal.TerminalLifecycleObserver
    +
     
    +
    onStop() - Method in class com.stripe.stripeterminal.TerminalLifecycleObserver
    +
     
    onSuccess() - Method in interface com.stripe.stripeterminal.callable.Callback
    This method will be called whenever the current operation completes with no errors.
    diff --git a/docs/index.html b/docs/index.html index 7b15237c..ed0bef41 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2,7 +2,7 @@ - + Generated Documentation (Untitled) diff --git a/docs/overview-summary.html b/docs/overview-summary.html index 1af48075..ea167562 100644 --- a/docs/overview-summary.html +++ b/docs/overview-summary.html @@ -2,10 +2,10 @@ - + Overview - + diff --git a/docs/overview-tree.html b/docs/overview-tree.html index 60c80783..58f8a570 100644 --- a/docs/overview-tree.html +++ b/docs/overview-tree.html @@ -2,10 +2,10 @@ - + Class Hierarchy - + @@ -101,8 +101,8 @@

    Class Hierarchy

  • com.stripe.stripeterminal.TerminalLifecycleObserver.Companion
  • com.stripe.stripeterminal.model.external.PaymentIntent
  • com.stripe.stripeterminal.model.external.PaymentIntentParameters
  • -
  • com.stripe.stripeterminal.model.external.CardDetails
  • com.stripe.stripeterminal.model.external.Reader
  • +
  • com.stripe.stripeterminal.model.external.CardDetails
  • com.stripe.stripeterminal.model.external.Charge
  • com.stripe.stripeterminal.model.external.PaymentIntentParameters.Builder
  • com.stripe.stripeterminal.model.external.PaymentMethod