Package io.github.inflationx.viewpump
Class ViewPumpContextWrapper
-
- All Implemented Interfaces:
public final class ViewPumpContextWrapper extends ContextWrapper
-
-
Method Summary
Modifier and Type Method Description ObjectgetSystemService(String name)final static ContextWrapperwrap(Context base)final static ContextWrapperwrap(Context base, ViewPump viewPump)Uses the default configuration from ViewPumpRemember if you are defining default in the ViewPump make sure this is initialised before the activity is created. final static ViewonActivityCreateView(Activity activity, View parent, View view, String name, Context context, AttributeSet attr)You only need to call this IF you disable ViewPump.Builder.setPrivateFactoryInjectionEnabled This will need to be called from the Activity.onCreateView method to enable view font injection if the view is created inside the activity onCreateView. -
Methods inherited from class android.content.Context
getColor, getColorStateList, getDrawable, getString, getString, getSystemService, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, revokeSelfPermissionOnKill, sendBroadcastWithMultiplePermissions -
Methods inherited from class android.content.ContextWrapper
bindIsolatedService, bindService, bindService, bindServiceAsUser, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingOrSelfUriPermissions, checkCallingPermission, checkCallingUriPermission, checkCallingUriPermissions, checkPermission, checkSelfPermission, checkUriPermission, checkUriPermission, checkUriPermissions, clearWallpaper, createAttributionContext, createConfigurationContext, createContext, createContextForSplit, createDeviceProtectedStorageContext, createDisplayContext, createPackageContext, createWindowContext, createWindowContext, databaseList, deleteDatabase, deleteFile, deleteSharedPreferences, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAssets, getAttributionSource, getAttributionTag, getBaseContext, getCacheDir, getClassLoader, getCodeCacheDir, getContentResolver, getDataDir, getDatabasePath, getDir, getDisplay, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getExternalMediaDirs, getFileStreamPath, getFilesDir, getMainExecutor, getMainLooper, getNoBackupFilesDir, getObbDir, getObbDirs, getOpPackageName, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getParams, getResources, getSharedPreferences, getSystemServiceName, getTheme, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isDeviceProtectedStorage, isRestricted, isUiContext, moveDatabaseFrom, moveSharedPreferencesFrom, openFileInput, openFileOutput, openOrCreateDatabase, openOrCreateDatabase, peekWallpaper, registerComponentCallbacks, registerReceiver, registerReceiver, registerReceiver, registerReceiver, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeSelfPermissionsOnKill, revokeUriPermission, revokeUriPermission, sendBroadcast, sendBroadcast, sendBroadcastAsUser, sendBroadcastAsUser, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setTheme, setWallpaper, setWallpaper, startActivities, startActivities, startActivity, startActivity, startForegroundService, startInstrumentation, startIntentSender, startIntentSender, startService, stopService, unbindService, unregisterComponentCallbacks, unregisterReceiver, updateServiceGroup -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getSystemService
Object getSystemService(String name)
-
wrap
@Deprecated(message = "Global singletons are bad for testing, scoping, and composition. Use local ViewPump instances instead.", replaceWith = @ReplaceWith(imports = {}, expression = "wrap(base, viewPump)"), level = DeprecationLevel.ERROR) final static ContextWrapper wrap(Context base)
-
wrap
final static ContextWrapper wrap(Context base, ViewPump viewPump)
Uses the default configuration from ViewPump
Remember if you are defining default in the ViewPump make sure this is initialised before the activity is created.
- Parameters:
base- ContextBase to Wrap.
-
onActivityCreateView
final static View onActivityCreateView(Activity activity, View parent, View view, String name, Context context, AttributeSet attr)
You only need to call this IF you disable ViewPump.Builder.setPrivateFactoryInjectionEnabled This will need to be called from the Activity.onCreateView method to enable view font injection if the view is created inside the activity onCreateView.
You would implement this method like so in you base activity.
@Override public View onCreateView(View parent, String name, Context context, AttributeSet attrs) { return ViewPumpContextWrapper.onActivityCreateView(this, parent, super.onCreateView(parent, name, context, attrs), name, context, attrs); }override fun onCreateView(parent: View, name: String, context: Context, attrs: AttributeSet): View { return ViewPumpContextWrapper.onActivityCreateView(this, parent, super.onCreateView(parent, name, context, attrs), name, context, attrs) }- Parameters:
activity- The activity the original that the ContextWrapper was attached too.parent- Parent view from onCreateViewview- The View Created inside onCreateView or from super.name- The View name from onCreateViewcontext- The context from onCreateViewattr- The AttributeSet from onCreateView
-
-
-
-