About I build a custom animated alert dialog with rounded corners - Java🚀🔥

Overview

Custom Animated AlertDialog

Animated AlertDialog With Rounded Corners

Alert Dialog Style

First you need add this code to your project themes.xml file

    <style name="MaterialAlertDialog.Rounded" parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog">
        <item name="shapeAppearanceOverlay">@style/ShapeAppearanceOverlay.MaterialAlertDialog.Rounded</item>
    </style>

    <style name="ShapeAppearanceOverlay.MaterialAlertDialog.Rounded" parent="">
        <item name="cornerSize">10dp</item>
    </style>

For Activity

Follow this step to add animated alert dialog

  1. Copy this code
private void launchAlertDialog() {
        new MaterialAlertDialogBuilder(AlertDialog.this, R.style.MaterialAlertDialog_Rounded)
                .setTitle("Quity update required")
                .setMessage("Quity recommends that you to update to latest version")
                .setPositiveButton("Update", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int i) {
                        try {
                            startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=com.anuhas.quity")));
                        }catch (Exception e){
                            startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=com.anuhas.quity")));
                        }
                    }
                })
                .setCancelable(false)
                .show();

    }
  1. After that, paste in your activity like this
  2. Now you can call alert dialog using this code launchAlertDialog();

For Fragment

Follow this step to add animated alert dialog

  1. Copy this code
private void launchAlertDialog() {
        new MaterialAlertDialogBuilder(getcontext(), R.style.MaterialAlertDialog_Rounded)
                .setTitle("Quity update required")
                .setMessage("Quity recommends that you to update to latest version")
                .setPositiveButton("Update", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int i) {
                        try {
                            startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=com.anuhas.quity")));
                        }catch (Exception e){
                            startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=com.anuhas.quity")));
                        }
                    }
                })
                .setCancelable(false)
                .show();

    }
  1. After that, paste in your activity like this
  2. Now you can call alert dialog using this code launchAlertDialog();
You might also like...

Querystream - Build JPA Criteria queries using a Stream-like API

QueryStream QueryStream allows you to perform JPA queries using a Stream-like API. Just like a Java 8 Stream, a QueryStream is built up in a pipeline,

Sep 24, 2022

A Jenkins plugin for inserting the commits changelog into the jenkins build environment.

commits-changelog-env-plugin A Jenkins plugin for inserting the commits changelog into the jenkins build environment. Jenkins插件, 在构建时通过将提交的更新列表插入 Jenk

Feb 16, 2022

Business Application Platform - no-code/low-code platform to build business applications

Business Application Platform - no-code/low-code platform to build business applications

Orienteer What is Orienteer Orienteer is Business Application Platform: Easy creation of business applications Extendable to fit your needs Dynamic da

Dec 6, 2022

Eclipse Temurin™ build scripts - common across all releases/versions

Repository for code and instructions for building OpenJDK binaries, defaulting to Eclipse Temurin™ These scripts can be used to build OpenJDK anywhere

Jan 4, 2023

Hi, Spring fans! We're going to learn how to build Kubernetes operators, CRDs, and controllers

Bootiful Kubernetes Operators Make sure youre in the default namespace of a Kubernetes cluster. Not sure fi this matters but I am, so it might help. T

Dec 29, 2022

Example how to reduce React Native iOS build times drastically

Reduce React Native iOS build times Introduction Amount of code in pods can be huge. Pods don’t change often. On CI, all pods are compiled over and ov

Dec 15, 2022

The bapeclient decompiled source code (Build able)

请大家帮忙泄露一份吴雨桐女士的最新客户端 根据吴女士在客户端被反编译之后毫不在意的态度吴女士可能即将要跑路,如果有人可以泄露吴女士的最新客户端可以创建issue(除了Bape更新) Bape 3.32 Decompiled and ModCode Pack Renamed 太烂了,快离开我的世界开外

Jan 7, 2023

Build your own Minecraft authentication system with Mojang authentication server support.

Build your own Minecraft authentication system with Mojang authentication server support. A fork of yushijinhun/authlib-injector.

Dec 17, 2022

Melnica Server is a custom basic Servlet Container application which depends on Socket Programming.

Melnica Server is a custom basic Servlet Container application which depends on Socket Programming.

Melnica Server Melnica Server is a custom basic Servlet Container application which depends on Socket Programming. The Description of Project Melnica

Jun 26, 2022
Owner
Kaveesha Anuhas
👨‍🎓 Student 🇱🇰 From Sri Lanka 👨‍💻 Developer
Kaveesha Anuhas
An Android library for member secretGFX group, This can be used to growing your apps and get more install via a simple banner view & native view and interstitial dialog.

GFX-AdPromote An Android library for member secretGFX group, This can be used to growing your apps and get more install via a simple banner view & nat

SAID MOTYA 10 Dec 25, 2022
Android Library to create Lottie animation view dialog easily with a lot of customization

LottieDialog Android Library to create Lottie animation view dialog easily with a lot of customization Why you should use Lottie Dialog You have no li

Amr Hesham 39 Oct 7, 2022
🏗 Build container images for your Java applications.

Jib ☑️ Jib User Survey What do you like best about Jib? What needs to be improved? Please tell us by taking a one-minute survey. Your responses will h

null 12.4k Jan 9, 2023
Jlink.online - Build optimized Java runtimes in your browser!

jlink.online is a HTTP microservice that builds optimized/minimized Java runtimes on the fly. This project is currently experimental and subject to ch

Tyler Cook 1 Dec 2, 2020
An advanced and highly optimized Java library to build framework

An advanced and highly optimized Java library to build frameworks: it's useful for scanning class paths, generating classes at runtime, facilitating the use of reflection, scanning the filesystem, executing stringified source code and much more...

Burningwave 119 Dec 21, 2022
See how simple it is to build a REST API with a database using Java and Spring Boot

Seu primeiro projeto Java Web no Spring Boot 2022 Veja como é simples construir uma API REST com banco de dados usando Java e Spring Boot Realização D

DevSuperior 74 Dec 26, 2022
An example on how to build a configurable widget to trigger external searches along with Liferay search to Elasticsearch.

Liferay External Searches An example on how to build a configurable widget to trigger external searches along with Liferay search to Elasticsearch. Ge

Louis-Guillaume Durand 4 Oct 25, 2021
In this course, we will learn how to build a complete full-stack web application using Spring boot as backend and React (React Hooks) as frontend

In this course, we will learn how to build a complete full-stack web application using Spring boot as backend and React (React Hooks) as frontend. We will use MySQL database to store and retrieve the data.

Ramesh Fadatare 43 Dec 22, 2022
This is a Food Delivery Mobile Application. Build Using React Native

Ax Food Delivery Service This is a Food Delivery Mobile Application build using ?????????? ???????????? ?? Installation Clone this repository git clon

Mindula Dilthushan Manamperi 13 Jul 14, 2022
Build criterion and ecosystem above multi-model databases

ShardingSphere - Building a Criterion and Ecosystem Above Multi-Model Databases Official Website: https://shardingsphere.apache.org/ Stargazers Over T

The Apache Software Foundation 17.8k Jan 9, 2023