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.AppLogger.a,com.discord.app.AppPermissionsRequests,com.discord.media_picker.MediaPicker.Provider
public class SettingsPage extends AppFragmentSettings Page Fragment
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description SettingsPage()
-
Method Summary
Modifier and Type Method Description voidonViewBound(View view)final LinearLayoutgetLinearLayout()Returns the LinearLayout associated with this Page voidremoveScrollView()All Pages are wrapped into a Scrollview. final ToolbargetHeaderBar()Returns the Toolbar associated with this Page final voidsetPadding(int p)Sets the padding of the LinearLayout associated with this Page final intaddHeaderButton(int id, int order, String title, Drawable drawable, MenuItem.OnMenuItemClickListener onClick)Add a button to the header Toolbar of this page final intaddHeaderButton(int id, String title, Drawable drawable, MenuItem.OnMenuItemClickListener onClick)Add a button to the header Toolbar of this page final intaddHeaderButton(String title, Drawable drawable, MenuItem.OnMenuItemClickListener onClick)Add a button to the header Toolbar of this page final intaddHeaderButton(String title, @DrawableRes() int drawableId, MenuItem.OnMenuItemClickListener onClick)Add a button to the header Toolbar of this page final voidaddHeaderButton(ToolbarButton button)Adds a button from the Toolbar associated with this Page final voidremoveHeaderButton(ToolbarButton button)Removes a button to the Toolbar associated with this Page final voidremoveHeaderButton(int id)final voidaddDivider(Context context)Adds a Divider final voidaddHeader(Context context, String text)Add a header final voidaddView(View view)Adds a view to the LinearLayout associated with this Page final voidremoveView(View view)Removes a view from the LinearLayout associated with this Page final voidclear()Removes all views from the LinearLayout associated with this Page final voidreRender()Removes all views from the LinearLayout associated with this Page and calls onViewBound final voidclose()Closes this SettingsPage by simulating a back press final ContextgetContext()-
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
callStartTransitionListener, createFragmentContainer, dump, e, equals, findFragmentByWho, generateActivityResultKey, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getAnimatingAway, getAnimator, getArguments, getChildFragmentManager, getDefaultViewModelProviderFactory, getEnterTransition, getEnterTransitionCallback, getExitTransition, getExitTransitionCallback, getFocusedView, getFragmentManager, getHost, getId, getLayoutInflater, getLifecycle, getLoaderManager, getNextAnim, getNextTransition, getParentFragment, getParentFragmentManager, getPostOnViewCreatedAlpha, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSavedStateRegistry, getSharedElementEnterTransition, getSharedElementReturnTransition, getSharedElementSourceNames, getSharedElementTargetNames, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, getViewLifecycleOwner, getViewLifecycleOwnerLiveData, getViewModelStore, hasOptionsMenu, hashCode, initState, instantiate, isAdded, isDetached, isHidden, isHideReplaced, isInBackStack, isInLayout, isMenuVisible, isPostponed, isRemoving, isRemovingParent, isResumed, isStateSaved, isVisible, noteStateNotSaved, 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, performActivityCreated, performAttach, performConfigurationChanged, performContextItemSelected, performCreate, performCreateOptionsMenu, performCreateView, performDestroy, performDestroyView, performDetach, performGetLayoutInflater, performLowMemory, performMultiWindowModeChanged, performOptionsItemSelected, performOptionsMenuClosed, performPause, performPictureInPictureModeChanged, performPrepareOptionsMenu, performPrimaryNavigationFragmentChanged, performResume, performSaveInstanceState, performStart, performStop, performViewCreated, postponeEnterTransition, registerForActivityResult, registerForContextMenu, requestPermissions, requireActivity, requireArguments, requireContext, requireFragmentManager, requireHost, requireParentFragment, requireView, restoreChildFragmentState, restoreViewState, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setAnimatingAway, setAnimator, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setFocusedView, setHasOptionsMenu, setHideReplaced, setInitialSavedState, setMenuVisibility, setNextAnim, setNextTransition, setOnStartEnterTransitionListener, setPostOnViewCreatedAlpha, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementNames, 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
-
-
Method Detail
-
onViewBound
void onViewBound(View view)
-
getLinearLayout
final LinearLayout getLinearLayout()
Returns the LinearLayout associated with this Page
-
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.
-
getHeaderBar
final Toolbar getHeaderBar()
Returns the Toolbar associated with this Page
-
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 buttonorder- The order to show this button in.title- The title of this buttondrawable- The drawable this button should haveonClick- The onClick listener of this button- Returns:
The id of this header 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 buttontitle- The title of this buttondrawable- The drawable this button should haveonClick- The onClick listener of this button- Returns:
The id of this header button
-
addHeaderButton
final int addHeaderButton(String title, Drawable drawable, MenuItem.OnMenuItemClickListener onClick)
Add a button to the header Toolbar of this page
- Parameters:
title- The title of this buttondrawable- The drawable this button should haveonClick- The onClick listener of this button- Returns:
The id of this header button
-
addHeaderButton
final int addHeaderButton(String title, @DrawableRes() int drawableId, MenuItem.OnMenuItemClickListener onClick)
Add a button to the header Toolbar of this page
- Parameters:
title- The title of this buttondrawableId- The id of the drawable this button should have.onClick- The onClick listener of this button- Returns:
The id of this header button
-
addHeaderButton
@Deprecated() final void addHeaderButton(ToolbarButton button)
Adds a button from the Toolbar associated with this Page
-
removeHeaderButton
@Deprecated() final void removeHeaderButton(ToolbarButton button)
Removes a button to the Toolbar associated with this Page
-
removeHeaderButton
final void removeHeaderButton(int id)
-
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- Contexttext- Header text
-
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
-
getContext
final Context getContext()
-
-
-
-