public class UpdateFragment extends android.app.DialogFragment implements android.view.View.OnClickListener, UpdateInfoListener
Copyright (c) 2011-2014 Bit Stadium GmbH Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Constructor and Description |
---|
UpdateFragment() |
Modifier and Type | Method and Description |
---|---|
String |
getAppName()
Returns the app's name.
|
int |
getCurrentVersionCode()
Returns the current version of the app.
|
android.view.View |
getLayoutView()
Creates and returns a new instance of UpdateView.
|
static UpdateFragment |
newInstance(org.json.JSONArray versionInfo,
String urlString)
Creates a new instance of the fragment.
|
void |
onClick(android.view.View view)
Called when the download button is tapped.
|
void |
onCreate(android.os.Bundle savedInstanceState)
Called when the fragment is starting.
|
android.view.View |
onCreateView(android.view.LayoutInflater inflater,
android.view.ViewGroup container,
android.os.Bundle savedInstanceState)
Creates the root view of the fragement, set title, the version number and
the listener for the download button.
|
void |
onRequestPermissionsResult(int requestCode,
String[] permissions,
int[] grantResults) |
void |
prepareDownload() |
dismiss, dismissAllowingStateLoss, dump, getDialog, getShowsDialog, getTheme, isCancelable, onActivityCreated, onAttach, onCancel, onCreateDialog, onDestroyView, onDetach, onDismiss, onSaveInstanceState, onStart, onStop, setCancelable, setShowsDialog, setStyle, show, show
equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLoaderManager, getParentFragment, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, hashCode, instantiate, instantiate, isAdded, isDetached, isHidden, isInLayout, isRemoving, isResumed, isVisible, onActivityResult, onAttach, onConfigurationChanged, onContextItemSelected, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onDestroy, onDestroyOptionsMenu, onHiddenChanged, onInflate, onInflate, onInflate, onLowMemory, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPrepareOptionsMenu, onResume, onTrimMemory, onViewCreated, onViewStateRestored, registerForContextMenu, requestPermissions, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setHasOptionsMenu, setInitialSavedState, setMenuVisibility, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementReturnTransition, setTargetFragment, setUserVisibleHint, shouldShowRequestPermissionRationale, startActivity, startActivity, startActivityForResult, startActivityForResult, toString, unregisterForContextMenu
public static UpdateFragment newInstance(org.json.JSONArray versionInfo, String urlString)
versionInfo
- JSON array with a JSON object for each version.urlString
- HockeyApp URL as a string.public void onCreate(android.os.Bundle savedInstanceState)
onCreate
in class android.app.DialogFragment
savedInstanceState
- Data it most recently supplied in
onSaveInstanceState(Bundle)public android.view.View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState)
onCreateView
in class android.app.Fragment
public void onClick(android.view.View view)
onClick
in interface android.view.View.OnClickListener
public void prepareDownload()
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults)
onRequestPermissionsResult
in class android.app.Fragment
public int getCurrentVersionCode()
getCurrentVersionCode
in interface UpdateInfoListener
public String getAppName()
public android.view.View getLayoutView()
Copyright © 2015. All Rights Reserved.