Class 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
    • Nested Class Summary

      • Nested classes/interfaces inherited from class androidx.fragment.app.Fragment

        androidx.fragment.app.Fragment.InstantiationException, androidx.fragment.app.Fragment.SavedState
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected com.google.android.material.floatingactionbutton.FloatingActionButton contactButton
      This is the view displaying the settings button
      protected ProfileController controller
      This is the controller that manages the fragment
      protected 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 rankings
      protected com.google.android.material.floatingactionbutton.FloatingActionButton unfollowButton  
      • Fields inherited from class androidx.fragment.app.Fragment

        mPreviousWho
    • 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 fragment
      protected 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 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
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 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

      • onCreateView

        public android.view.View onCreateView​(@NonNull
                                              android.view.LayoutInflater inflater,
                                              @Nullable
                                              android.view.ViewGroup container,
                                              @Nullable
                                              android.os.Bundle savedInstanceState)
        Overrides:
        onCreateView in class androidx.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 display
        phoneNo - the phone number to display
      • getController

        public ProfileController getController()
        Gets the controller of the profile fragment
        Returns:
        Return the controller of the fragment