Google se compromete a impulsar la igualdad racial para las comunidades afrodescendientes. Obtén información al respecto.

AppCompatDelegate

abstract class AppCompatDelegate
kotlin.Any
   ↳ androidx.appcompat.app.AppCompatDelegate

This class represents a delegate which you can use to extend AppCompat's support to any android.app.Activity.

When using an AppCompatDelegate, you should call the following methods instead of the android.app.Activity method of the same name:

The following methods should be called from the android.app.Activity method of the same name:

An Activity can only be linked with one AppCompatDelegate instance, therefore the instance returned from create(Activity, AppCompatCallback) should be retained until the Activity is destroyed.

Summary

Constants
static Int

Flag for specifying the behavior of action modes when an Action Bar is not present.

static Int

Flag for enabling the support Action Bar.

static Int

Flag for requesting an support Action Bar that overlays window content.

static Int

static Int

Night mode which uses a dark mode when the system's 'Battery Saver' feature is enabled, otherwise it uses a 'light mode'.

static Int

Night mode which switches between dark and light mode depending on the time of day (dark at night, light in the day).

static Int

Mode which uses the system's night mode setting to determine if it is night or not.

static Int

Night mode which uses always uses a light mode, enabling notnight qualified resources regardless of the time.

static Int

An unspecified mode for night mode.

static Int

Night mode which uses always uses a dark mode, enabling night qualified resources regardless of the time.

Public methods
abstract Unit

Should be called instead of Activity#addContentView(android.view.View, android.view.ViewGroup.LayoutParams)}

abstract Boolean

Applies the currently selected night mode to this delegate's host component.

open Unit

open Context
attachBaseContext2(@NonNull context: Context)

Should be called from Activity#attachBaseContext(Context).

open static AppCompatDelegate
create(@NonNull activity: Activity, @Nullable callback: AppCompatCallback?)

Create an androidx.appcompat.app.AppCompatDelegate to use with activity.

open static AppCompatDelegate
create(@NonNull dialog: Dialog, @Nullable callback: AppCompatCallback?)

Create an androidx.appcompat.app.AppCompatDelegate to use with dialog.

open static AppCompatDelegate
create(@NonNull context: Context, @NonNull window: Window, @Nullable callback: AppCompatCallback?)

Create an androidx.appcompat.app.AppCompatDelegate to use with a context and a window.

open static AppCompatDelegate
create(@NonNull context: Context, @NonNull activity: Activity, @Nullable callback: AppCompatCallback?)

Create an androidx.appcompat.app.AppCompatDelegate to use with a context and hosted by an Activity.

abstract View!
createView(@Nullable parent: View?, name: String!, @NonNull context: Context, @NonNull attrs: AttributeSet)

This should be called from a LayoutInflater.Factory2 in order to return tint-aware widgets.

abstract T?
findViewById(@IdRes id: Int)

Finds a view that was identified by the id attribute from the XML that was processed in onCreate.

open static Int

Returns the default night mode.

abstract ActionBarDrawerToggle.Delegate?

Returns an ActionBarDrawerToggle.Delegate which can be returned from your Activity if it implements ActionBarDrawerToggle.DelegateProvider.

open Int

Returns the night mode previously set via getLocalNightMode().

abstract MenuInflater!

Return the value of this call from your Activity#getMenuInflater()

abstract ActionBar?

Support library version of Activity#getActionBar.

abstract Boolean
hasWindowFeature(featureId: Int)

Query for the availability of a certain feature.

abstract Unit

Installs AppCompat's android.view.LayoutInflater Factory so that it can replace the framework widgets with compatible tinted versions.

abstract Unit

Should be called from Activity#invalidateOptionsMenu()} or FragmentActivity#supportInvalidateOptionsMenu().

open static Boolean

Returns whether vector drawables on older platforms (< API 21) can be accessed from within resources.

abstract Boolean

Returns whether AppCompat handles any native action modes itself.

abstract Unit

Should be called from Activity#onConfigurationChanged

abstract Unit
onCreate(savedInstanceState: Bundle!)

Should be called from Activity#onCreate.

abstract Unit

Should be called from Activity#onDestroy()

abstract Unit
onPostCreate(savedInstanceState: Bundle!)

Should be called from Activity#onPostCreate(android.os.Bundle)

abstract Unit

Should be called from Activity#onPostResume()

abstract Unit

Allows AppCompat to save instance state.

abstract Unit

Should be called from Activity#onStart() Activity.

abstract Unit

Should be called from Activity.onStop()

abstract Boolean

Enable extended window features.

open static Unit

Sets whether vector drawables on older platforms (< API 21) can be used within