Class SettingsPage

  • 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 , com.discord.app.AppComponent , com.discord.app.AppPermissionsRequests

    
    public class SettingsPage
    extends AppFragment
                        

    Settings Page Fragment

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
      SettingsPage()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      void onViewBound(View view)
      final LinearLayout getLinearLayout() Returns the LinearLayout associated with this Page
      void removeScrollView() All Pages are wrapped into a Scrollview.
      final Toolbar getHeaderBar() Returns the Toolbar associated with this Page
      final void setPadding(int p) Sets the padding of the LinearLayout associated with this Page
      final int addHeaderButton(int id, int order, String title, Drawable drawable, MenuItem.OnMenuItemClickListener onClick) Add a button to the header Toolbar of this page
      final int addHeaderButton(int id, String title, Drawable drawable, MenuItem.OnMenuItemClickListener onClick) Add a button to the header Toolbar of this page
      final int addHeaderButton(String title, Drawable drawable, MenuItem.OnMenuItemClickListener onClick) Add a button to the header Toolbar of this page
      final int addHeaderButton(String title, @DrawableRes() int drawableId, MenuItem.OnMenuItemClickListener onClick) Add a button to the header Toolbar of this page
      final void addHeaderButton(ToolbarButton button) Adds a button from the Toolbar associated with this Page
      final void removeHeaderButton(ToolbarButton button) Removes a button to the Toolbar associated with this Page
      final void removeHeaderButton(int id)
      final void addDivider(Context context) Adds a Divider
      final void addHeader(Context context, String text) Add a header
      final void addView(View view) Adds a view to the LinearLayout associated with this Page
      final void removeView(View view) Removes a view from the LinearLayout associated with this Page
      final void clear() Removes all views from the LinearLayout associated with this Page
      final void reRender() Removes all views from the LinearLayout associated with this Page and calls onViewBound
      final void close() Closes this SettingsPage by simulating a back press
      final Context getContext()
      • Methods inherited from class com.discord.app.AppFragment

        bindToolbar, bindToolbar$default, getActionBarTitleLayout, getAppActivity, getAppLogger, getFileManager, getImageFile, getLoggingConfig, getMostRecentIntent, getUnsubscribeSignal, hasMedia, hideKeyboard, hideKeyboard$default, isRecreated, onActivityResult, onDestroyView, onDetach, onImageChosen, onImageCropped, onPause, onResume, onViewBoundOrOnResume, onViewCreated, openMediaChooser, requestCameraQRScanner, requestContacts, requestMedia, requestMediaDownload, requestMicrophone, requestVideoCallPermissions, requireAppActivity, setActionBarDisplayHomeAsUpEnabled, setActionBarDisplayHomeAsUpEnabled$default, setActionBarOptionsMenu, setActionBarOptionsMenu$default, setActionBarSubtitle, setActionBarTitle, setActionBarTitle, setActionBarTitleAccessibilityViewFocused, setActionBarTitleClick, setActionBarTitleColor, setActionBarTitleLayoutExpandedTappableArea, setActionBarTitleLayoutMinimumTappableArea, setOnBackPressed, setOnBackPressed$default, setOnNewIntentListener, showKeyboard
      • Methods inherited from class androidx.fragment.app.Fragment

        dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getDefaultViewModelProviderFactory, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLayoutInflater, getLifecycle, getLoaderManager, getParentFragment, getParentFragmentManager, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSavedStateRegistry, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, getViewLifecycleOwner, getViewLifecycleOwnerLiveData, getViewModelStore, hasOptionsMenu, hashCode, instantiate, isAdded, isDetached, isHidden, isInLayout, isMenuVisible, isRemoving, isResumed, isStateSaved, isVisible, onActivityCreated, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreate, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onCreateView, onDestroy, onDestroyOptionsMenu, onGetLayoutInflater, onHiddenChanged, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, onSaveInstanceState, onStart, onStop, onViewStateRestored, postponeEnterTransition, 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, startActivityForResult, startIntentSenderForResult, startPostponedEnterTransition, toString, unregisterForContextMenu
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SettingsPage

        SettingsPage()
    • Method Detail

      • removeScrollView

         void removeScrollView()

        All Pages are wrapped into a Scrollview. This makes it so that if the page extends the screen height, it will automatically be scrollable, however it introduces lag if you add a recycler and may mess up your layout.

        This method removes the scrollview so you are only working with a linear layout.

      • setPadding

         final void setPadding(int p)

        Sets the padding of the LinearLayout associated with this Page

      • addHeaderButton

         final int addHeaderButton(int id, int order, String title, Drawable drawable, MenuItem.OnMenuItemClickListener onClick)

        Add a button to the header Toolbar of this page

        Parameters:
        id - The id of this button
        order - The order to show this button in.
        title - The title of this button
        drawable - The drawable this button should have
        onClick - The onClick listener of this button
      • addHeaderButton

         final int addHeaderButton(int id, String title, Drawable drawable, MenuItem.OnMenuItemClickListener onClick)

        Add a button to the header Toolbar of this page

        Parameters:
        id - The id of this button
        title - The title of this button
        drawable - The drawable this button should have
        onClick - The onClick listener of this button
      • addDivider

         final void addDivider(Context context)

        Adds a Divider

        Parameters:
        context - Context
      • addHeader

         final void addHeader(Context context, String text)

        Add a header

        Parameters:
        context - Context
        text - Header text
      • addView

         final void addView(View view)

        Adds a view to the LinearLayout associated with this Page

      • removeView

         final void removeView(View view)

        Removes a view from the LinearLayout associated with this Page

      • clear

         final void clear()

        Removes all views from the LinearLayout associated with this Page

      • reRender

         final void reRender()

        Removes all views from the LinearLayout associated with this Page and calls onViewBound

      • close

         final void close()

        Closes this SettingsPage by simulating a back press