Skip to content

Mori-hub/AnimDialog

Repository files navigation

Animation Header Dialog

This is kind of a Dialog which is includes simple animations in the header of it.

Features

  • Simple animation
  • Support all languages
  • Unlimited call functions
  • Easy Use
  • All Dialog: Welcome, Exit, Warning, Info, Delete, Success
  • Easy Theme
  • Custom Dialog

Installation

Install my-project with https://jitpack.io/

  dependencies {
	         implementation 'com.github.Mori-hub:AnimDialog:1.0.13'
	}

Version

JitPack

TOML Kotlin

  1. build.gradle.kts:
dependencies
   { ...
   implementation (libs.anim.dialogs.mori)
   }
  1. libs.version.toml:
   [versions]

   anim_dialogs="1.0.14"

   [libraries]

   anim_dialogs_mori = { module = "com.github.Mori-hub:AnimDialog", version.ref = "anim_dialogs" }

Usage

    // Call Lib (Small or Large)
        val animDialog = AnimDialog(this)
    // Main Way
        animDialog.welcome(
            description: String,
            titleOfPositiveButton: String? = null,
            positiveButtonFunction: (() -> Unit)? = null)

Explain

  • ButtonFunction : Here you can add your Unit, Method or Calss. (such as Toast)
  • null : For any attributes you can put null then use defualt
  • Show Dialog: When you call any method this will show, so please ues in side OnClick.
  • Colors: A color must be a name ("yellow") or a Hex code ("#DFD3C3")

Examples

        // Welcome Dialog
            
            animDialog.welcome("Welcome to this", null, {})
        
        // Exit Dialog
            animDialog.exit("Do you want exit?", null, "Cancel", {
                Toast.makeText(this, "goodbye", Toast.LENGTH_SHORT).show()
            }, this)
        // Rate Dialog
            animDialog.rate("Do you enjoy it? \n Please rate us", "Rate", "Maybe later")
        
        // Information Dialog
            animDialog.info("This message inform you about this", "Got it")
        
        // Warning Dialog
            animDialog.warning("Attention! \n You are going in bad way", "Accept", "Ignore", {})
        
        
        // Delete Dialog
            animDialog.del("Do you want Delete it!? \n You will lose this",
            "Delete",
            "Ignore",
            { Toast.makeText(this, "It's deleted!", Toast.LENGTH_SHORT).show() })

        

Sample

    // Editable Dialog
        animDialog.simple(
            headerImage = android.R.drawable.presence_video_online,
            description = "Hi thi is a test",
            titleOfPositiveButton = "OK",
            titleOfNegativeButton = "Cancel",
            positiveButtonFunction = {
                Toast.makeText(
                    this,
                    "Click on OK",
                    Toast.LENGTH_SHORT
                ).show()
            },
            negativeButtonFunction = {
                Toast.makeText(
                    this,
                    "Click on Cancel",
                    Toast.LENGTH_SHORT
                ).show()
            }
        )

Optinal Theme

    // You set theme for all dialoges 
        animDialog.dialogTheme(
            true,
            "White",
            "#DFD3C3", "black",
            "#000B49", "yellow"
        )

Screenshots

One Header

Two Headers

Gifs

🚀 About Me

I'm a full stack developer...find me in Google Play Store

🛠 Skills

Java, Kotlin, CSS....

Tech Stack

Important:

For Gradle 8.4 dependency use TOML Kotlin & jitpack.io Please use this way : https://stackoverflow.com/a/77630488

Update: DeC 2023

🔗 Links

portfolio linkedin twitter Google

Feedback

If you have any feedback, please reach out to us at ✉️ [email protected]

License

MIT