Class ProfileFragment
- java.lang.Object
-
- androidx.fragment.app.Fragment
-
- com.cmput301w23t09.qrhunter.BaseFragment
-
- com.cmput301w23t09.qrhunter.profile.ProfileFragment
-
- All Implemented Interfaces:
android.content.ComponentCallbacks
,android.view.View.OnCreateContextMenuListener
,androidx.activity.result.ActivityResultCaller
,androidx.lifecycle.HasDefaultViewModelProviderFactory
,androidx.lifecycle.LifecycleOwner
,androidx.lifecycle.ViewModelStoreOwner
,androidx.savedstate.SavedStateRegistryOwner
- Direct Known Subclasses:
MyProfileFragment
,OtherProfileFragment
public abstract class ProfileFragment extends BaseFragment
This is the fragment displaying the user's profile
-
-
Field Summary
Fields Modifier and Type Field Description protected com.google.android.material.floatingactionbutton.FloatingActionButton
contactButton
This is the view displaying the settings buttonprotected ProfileController
controller
This is the controller that manages the fragmentprotected com.google.android.material.floatingactionbutton.FloatingActionButton
followButton
protected android.widget.TextView
followersText
protected android.widget.TextView
followingText
protected com.google.android.material.floatingactionbutton.FloatingActionButton
loadingFollowButton
protected com.google.android.material.floatingactionbutton.FloatingActionButton
rankingsButton
This is the button that allows the user to view their rankingsprotected com.google.android.material.floatingactionbutton.FloatingActionButton
unfollowButton
-
Constructor Summary
Constructors Constructor Description ProfileFragment(GameController gameController)
Initializes the fragment with the app controller
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
displayContactInfo(java.lang.String email, java.lang.String phoneNo)
Display a prompt showcasing the contact information for this profile.ProfileController
getController()
Gets the controller of the profile fragmentprotected abstract ProfileController
getProfileController()
android.view.View
onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState)
protected abstract void
setupSocialMethods()
Sets the social related buttons.-
Methods inherited from class com.cmput301w23t09.qrhunter.BaseFragment
getActivePlayer, getGameController
-
Methods inherited from class androidx.fragment.app.Fragment
dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getDefaultViewModelCreationExtras, getDefaultViewModelProviderFactory, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLayoutInflater, getLayoutInflater, getLifecycle, getLoaderManager, getParentFragment, getParentFragmentManager, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSavedStateRegistry, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, getViewLifecycleOwner, getViewLifecycleOwnerLiveData, getViewModelStore, hashCode, hasOptionsMenu, instantiate, instantiate, isAdded, isDetached, isHidden, isInLayout, isMenuVisible, isRemoving, isResumed, isStateSaved, isVisible, onActivityCreated, onActivityResult, onAttach, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreate, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onDestroy, onDestroyOptionsMenu, onDestroyView, onDetach, onGetLayoutInflater, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, onResume, onSaveInstanceState, onStart, onStop, onViewCreated, onViewStateRestored, postponeEnterTransition, postponeEnterTransition, registerForActivityResult, registerForActivityResult, registerForContextMenu, requestPermissions, requireActivity, requireArguments, requireContext, requireFragmentManager, requireHost, requireParentFragment, requireView, 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
-
-
-
-
Field Detail
-
controller
protected ProfileController controller
This is the controller that manages the fragment
-
contactButton
protected com.google.android.material.floatingactionbutton.FloatingActionButton contactButton
This is the view displaying the settings button
-
rankingsButton
protected com.google.android.material.floatingactionbutton.FloatingActionButton rankingsButton
This is the button that allows the user to view their rankings
-
followingText
protected android.widget.TextView followingText
-
followersText
protected android.widget.TextView followersText
-
followButton
protected com.google.android.material.floatingactionbutton.FloatingActionButton followButton
-
unfollowButton
protected com.google.android.material.floatingactionbutton.FloatingActionButton unfollowButton
-
loadingFollowButton
protected com.google.android.material.floatingactionbutton.FloatingActionButton loadingFollowButton
-
-
Constructor Detail
-
ProfileFragment
public ProfileFragment(GameController gameController)
Initializes the fragment with the app controller- Parameters:
gameController
- This is the app controller
-
-
Method Detail
-
getProfileController
protected abstract ProfileController getProfileController()
-
onCreateView
public android.view.View onCreateView(@NonNull android.view.LayoutInflater inflater, @Nullable android.view.ViewGroup container, @Nullable android.os.Bundle savedInstanceState)
- Overrides:
onCreateView
in classandroidx.fragment.app.Fragment
-
setupSocialMethods
protected abstract void setupSocialMethods()
Sets the social related buttons.
-
displayContactInfo
public void displayContactInfo(java.lang.String email, java.lang.String phoneNo)
Display a prompt showcasing the contact information for this profile.- Parameters:
email
- the email to displayphoneNo
- the phone number to display
-
getController
public ProfileController getController()
Gets the controller of the profile fragment- Returns:
- Return the controller of the fragment
-
-