public class ScanDeviceFragment extends android.support.v4.app.Fragment implements NFCTagDiscoveredListener
ScanActivity
if you need an Activity instead
To instantiate the fragment see newInstance()
and newInstance(Bundle)
A tap device can be selected, it will instantiate a IoTizeDevice
and emit
the newly created tap device thanks to callback ScanDeviceFragment.OnScanDeviceFragmentEvent.onCreateDeviceSuccess(IoTizeDevice)
.
If an error occurred during device creation, see ScanDeviceFragment.OnScanDeviceFragmentEvent.onCreateDeviceError(Exception)
callback.
Activities that contain this fragment must implement the
ScanDeviceFragment.OnScanDeviceFragmentEvent
interface
to handle interaction events.
Use the newInstance()
factory method to
create an instance of this fragment.
Modifier and Type | Class and Description |
---|---|
static interface |
ScanDeviceFragment.Args |
class |
ScanDeviceFragment.BindingModel
Data binding
|
static class |
ScanDeviceFragment.BundleOptions
Instance builder for
ScanDeviceFragment bundle options
You can enable/disable specific scanners with ScanDeviceFragment.BundleOptions.setScanner(String, boolean)
Set runScanOnStart() to true |
static interface |
ScanDeviceFragment.OnScanDeviceFragmentEvent
This interface must be implemented by activities that contain this
fragment to allow an interaction in this fragment to be communicated
to the activity and potentially other fragments contained in that
activity.
|
Constructor and Description |
---|
ScanDeviceFragment() |
Modifier and Type | Method and Description |
---|---|
void |
clearResults() |
static ScanDeviceFragment |
newInstance()
Use this factory method to create a new instance of
this fragment using default parameter
|
static ScanDeviceFragment |
newInstance(android.os.Bundle bundle)
Use this factory method to create a new instance of
this fragment with custom parameters
To build parameter bundles you can use builder class
ScanDeviceFragment.BundleOptions |
void |
onAttach(android.content.Context context) |
void |
onCreate(android.os.Bundle savedInstanceState) |
void |
onCreateOptionsMenu(android.view.Menu menu,
android.view.MenuInflater inflater) |
android.view.View |
onCreateView(android.view.LayoutInflater inflater,
android.view.ViewGroup container,
android.os.Bundle savedInstanceState) |
void |
onDetach() |
void |
onNFCTagDiscovered(android.content.Intent intent) |
boolean |
onOptionsItemSelected(android.view.MenuItem item) |
void |
onPause() |
void |
onResume() |
void |
onStart() |
void |
onStop() |
void |
onViewCreated(android.view.View view,
android.os.Bundle savedInstanceState) |
void |
refreshScan() |
boolean |
runScanOnStart() |
void |
showError(java.lang.String message) |
void |
startScan() |
void |
stopScan() |
void |
toggleScan() |
dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLayoutInflater, getLayoutInflater, getLifecycle, getLoaderManager, getParentFragment, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, getViewModelStore, hashCode, hasOptionsMenu, instantiate, instantiate, isAdded, isDetached, isHidden, isInLayout, isMenuVisible, isRemoving, isResumed, isStateSaved, isVisible, onActivityCreated, onActivityResult, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onDestroy, onDestroyOptionsMenu, onDestroyView, onGetLayoutInflater, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsMenuClosed, onPictureInPictureModeChanged, onPrepareOptionsMenu, onRequestPermissionsResult, onSaveInstanceState, onViewStateRestored, postponeEnterTransition, registerForContextMenu, requestPermissions, requireActivity, requireContext, requireFragmentManager, requireHost, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setHasOptionsMenu, setInitialSavedState, setMenuVisibility, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementReturnTransition, setTargetFragment, setUserVisibleHint, shouldShowRequestPermissionRationale, startActivity, startActivity, startActivityForResult, startActivityForResult, startIntentSenderForResult, startPostponedEnterTransition, toString, unregisterForContextMenu
public static ScanDeviceFragment newInstance()
public static ScanDeviceFragment newInstance(android.os.Bundle bundle)
To build parameter bundles you can use builder class ScanDeviceFragment.BundleOptions
public void onAttach(android.content.Context context)
onAttach
in class android.support.v4.app.Fragment
public void onCreate(android.os.Bundle savedInstanceState)
onCreate
in class android.support.v4.app.Fragment
public void onDetach()
onDetach
in class android.support.v4.app.Fragment
public android.view.View onCreateView(@NonNull android.view.LayoutInflater inflater, @Nullable android.view.ViewGroup container, @Nullable android.os.Bundle savedInstanceState)
onCreateView
in class android.support.v4.app.Fragment
public void onViewCreated(@NonNull android.view.View view, @Nullable android.os.Bundle savedInstanceState)
onViewCreated
in class android.support.v4.app.Fragment
public void showError(java.lang.String message)
public void onNFCTagDiscovered(android.content.Intent intent)
onNFCTagDiscovered
in interface NFCTagDiscoveredListener
public void onStart()
onStart
in class android.support.v4.app.Fragment
public boolean runScanOnStart()
public void onResume()
onResume
in class android.support.v4.app.Fragment
public void startScan()
public void stopScan()
public void refreshScan()
public void clearResults()
public void onPause()
onPause
in class android.support.v4.app.Fragment
public void onStop()
onStop
in class android.support.v4.app.Fragment
public void toggleScan()
public void onCreateOptionsMenu(android.view.Menu menu, android.view.MenuInflater inflater)
onCreateOptionsMenu
in class android.support.v4.app.Fragment
public boolean onOptionsItemSelected(android.view.MenuItem item)
onOptionsItemSelected
in class android.support.v4.app.Fragment