SkillAgentSearch skills...

M2Dia

🦄 This is a Material Design 2 pop-up component developed in Java, combined with Lottie to achieve perfect pop-up functionality. It provides rich interface design and animation effects.

Install / Use

/learn @uyevan/M2Dia
About this skill

Quality Score

0/100

Category

Design

Supported Platforms

Universal

README

❤️M2Dia Android Dialog Tool

<div align="center"> <img src="https://pan.losfer.cn/view.php/911f908b42b9c15bfcf1543cb45f33d8.png"> </div>
  • 🕊️ This is a Material Design 2 pop-up component developed in Java, combined with Lottie to achieve perfect pop-up functionality. It provides rich interface design and animation effects.
  • 🐬这是一个使用Java开发的Material Design 2弹出式组件,结合Lottie,可以实现完美的弹出功能。它提供了丰富的界面设计和动画效果。

🤡Configuration

Context, title, and type must be assigned, and other parameters can be customized and implemented. Place this anywhere in your app:

m2Dia = M2Dia.createSuccess(MainActivity.this, getString(R.string.success_title), M2Dia.M2ButTpe.HAVE_ALL_BUT)
             .setContent(getString(R.string.context)) // set the context , default null
             .setConfirmClick(con) // confirm button click , default dismiss
             .setCloseClick(clo) // close button click , default dismiss
             .setConfirmButText("confirm T") // confirm button text , default "confirm"
             .setCloseButText("close T") // close button text , default "close"
             .setLottieJson(M2Dia.M2Type.SUCCESS, "success.json") // custom lottie , default success.json
             .setRepeatCount(5) // lottie count ,if 0 then only play 1 , default 0
             .setCancelables(false) // Allow closing by clicking the return button , default true
             .setCanceledOnTouchOutsides(false) // Allow closing by clicking on the screen , default true
             .showM2(); // show the dialog

When you want to close it, you can define an M2Dia class variable and implement the following methods:

private M2Dia m2Dia; //import
...
m2Dia = M2Dia.createError(MainActivity.this, getString(R.string.error_title), M2Dia.M2ButTpe.NO_CLOSE_BUT)
             .showM2(); //create
...
m2Dia.dismiss(); //dismiss

🐳Usage

Each method always returns a Toast object, so you can customize the Toast much more. DON'T FORGET THE show() METHOD! Have confirm and close button:

M2Dia.createWarning(MainActivity.this, getString(R.string.warning_title), M2Dia.M2ButTpe.HAVE_ALL_BUT)
     .showM2();

Have confirm button ,no have close button:

M2Dia.createError(MainActivity.this, getString(R.string.error_title), M2Dia.M2ButTpe.NO_CLOSE_BUT)
     .showM2();

🤢Email

Hi there 👋,I'm Evan.

  • 🔭 I’m currently working on something cool.
  • 🌱 I’m currently learning Everything I like.
  • 💬 Ask me about anything related to Java/Python.
  • 📫 How to reach me: uyevan@163.com
  • 😄 Read more about my Blog: GoTo

🏁Screenshots

gif

c5b96a847e28db5356a4296bf54ca8ec

img
<img title="" src="https://pan.losfer.cn/view.php/a649e8418926da7df8e957703e369afa.jpg" alt="" width="221" data-align="center"> <img title="" src="https://pan.losfer.cn/view.php/1e657818d594831f94722e6f442cb3d2.jpg" alt="" width="221" data-align="center"> <img title="" src="https://pan.losfer.cn/view.php/d46b2866c9c52f02cf8e29d23629f41f.jpg" alt="" width="221" data-align="center">

Related Skills

View on GitHub
GitHub Stars47
CategoryDesign
Updated1mo ago
Forks0

Languages

Java

Security Score

75/100

Audited on Feb 22, 2026

No findings