Class IngredientEditContract


  • public class IngredientEditContract
    extends androidx.activity.result.contract.ActivityResultContract<StorageIngredient,​android.util.Pair<java.lang.String,​StorageIngredient>>
    A contract for creating intents to edit an Ingredient, and results of these intents.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class androidx.activity.result.contract.ActivityResultContract

        androidx.activity.result.contract.ActivityResultContract.SynchronousResult<T extends java.lang.Object>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      android.content.Intent createIntent​(android.content.Context context, StorageIngredient storageIngredient)
      Creates an Intent for the IngredientEditActivity.
      android.util.Pair<java.lang.String,​StorageIngredient> parseResult​(int i, android.content.Intent intent)
      Pair object for the result of the IngredientEditActivity.
      • Methods inherited from class androidx.activity.result.contract.ActivityResultContract

        getSynchronousResult
      • Methods inherited from class java.lang.Object

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

      • IngredientEditContract

        public IngredientEditContract()
    • Method Detail

      • createIntent

        @NonNull
        public android.content.Intent createIntent​(@NonNull
                                                   android.content.Context context,
                                                   StorageIngredient storageIngredient)
        Creates an Intent for the IngredientEditActivity.
        Specified by:
        createIntent in class androidx.activity.result.contract.ActivityResultContract<StorageIngredient,​android.util.Pair<java.lang.String,​StorageIngredient>>
        Parameters:
        context - Context object for the activity.
        storageIngredient - StorageIngredient object for the ingredient.
        Returns:
        Intent object for the IngredientEditActivity.
      • parseResult

        public android.util.Pair<java.lang.String,​StorageIngredient> parseResult​(int i,
                                                                                       android.content.Intent intent)
        Pair object for the result of the IngredientEditActivity.
        Specified by:
        parseResult in class androidx.activity.result.contract.ActivityResultContract<StorageIngredient,​android.util.Pair<java.lang.String,​StorageIngredient>>
        Parameters:
        i - index of the ingredient.
        intent - Intent object for the IngredientEditActivity.
        Returns:
        Pair object for the result of the IngredientEditActivity.