Top Related Projects
Advanced dialog solution for android
😍 A beautiful, fluid, and extensible dialogs API for Kotlin & Android.
SweetAlert for Android, a beautiful and clever alert dialog
Nifty Modal Dialog Effects
一个富有动感的Sheet(选择器)
Quick Overview
NiftyDialogEffects is an Android library that provides a collection of custom dialog animations. It offers developers a way to create visually appealing and interactive dialog boxes with various transition effects, enhancing the user experience in Android applications.
Pros
- Offers a wide variety of pre-built dialog animations
- Easy to integrate into existing Android projects
- Customizable appearance and behavior of dialogs
- Improves user engagement with attractive visual effects
Cons
- Limited documentation and examples
- Not actively maintained (last update was several years ago)
- May not be fully compatible with the latest Android versions
- Potential performance impact on older devices due to animations
Code Examples
- Creating a basic dialog with a fade effect:
NiftyDialogBuilder dialogBuilder = NiftyDialogBuilder.getInstance(this);
dialogBuilder
.withTitle("Hello")
.withMessage("This is a basic dialog")
.withEffect(Effectstype.Fadein)
.withButton1Text("OK")
.show();
- Customizing dialog appearance:
NiftyDialogBuilder dialogBuilder = NiftyDialogBuilder.getInstance(this);
dialogBuilder
.withTitle("Custom Dialog")
.withTitleColor("#FFFFFF")
.withDividerColor("#11000000")
.withMessageColor("#FFFFFFFF")
.withDialogColor("#FFE74C3C")
.withEffect(Effectstype.Slidetop)
.withButton1Text("OK")
.withButton2Text("Cancel")
.show();
- Using a shake effect and setting button click listeners:
NiftyDialogBuilder dialogBuilder = NiftyDialogBuilder.getInstance(this);
dialogBuilder
.withTitle("Shake Dialog")
.withMessage("This dialog shakes!")
.withEffect(Effectstype.Shake)
.withButton1Text("OK")
.setButton1Click(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(v.getContext(), "OK Clicked", Toast.LENGTH_SHORT).show();
}
})
.show();
Getting Started
To use NiftyDialogEffects in your Android project:
- Add the JitPack repository to your build file:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
- Add the dependency:
dependencies {
implementation 'com.github.sd6352051:NiftyDialogEffects:1.0.0'
}
- In your activity or fragment, create and show a dialog:
NiftyDialogBuilder dialogBuilder = NiftyDialogBuilder.getInstance(this);
dialogBuilder
.withTitle("Welcome")
.withMessage("Hello, NiftyDialogEffects!")
.withEffect(Effectstype.Slideright)
.withButton1Text("OK")
.show();
Competitor Comparisons
Advanced dialog solution for android
Pros of DialogPlus
- More customizable with various content types (list, grid, custom view)
- Supports multiple animations and positions
- Actively maintained with recent updates
Cons of DialogPlus
- Less visually striking effects compared to NiftyDialogEffects
- Requires more setup for complex layouts
- Limited to standard dialog shapes
Code Comparison
NiftyDialogEffects:
NiftyDialogBuilder dialogBuilder = NiftyDialogBuilder.getInstance(this);
dialogBuilder
.withTitle("Title")
.withMessage("Message")
.withEffect(Effectstype.Slidetop)
.show();
DialogPlus:
DialogPlus dialog = DialogPlus.newDialog(this)
.setContentHolder(new ViewHolder(R.layout.content))
.setExpanded(true)
.create();
dialog.show();
Summary
NiftyDialogEffects offers visually appealing and unique dialog animations, making it ideal for projects that prioritize eye-catching effects. However, it has not been updated recently.
DialogPlus provides more flexibility in terms of content types and positioning, making it suitable for a wider range of use cases. It's actively maintained but offers less dramatic visual effects.
Choose NiftyDialogEffects for striking animations or DialogPlus for greater customization and ongoing support.
😍 A beautiful, fluid, and extensible dialogs API for Kotlin & Android.
Pros of material-dialogs
- More comprehensive and feature-rich, offering a wide range of dialog types and customization options
- Actively maintained with regular updates and bug fixes
- Better integration with Material Design guidelines and themes
Cons of material-dialogs
- Larger library size, which may impact app size and performance
- Steeper learning curve due to more complex API and numerous options
- Less focus on unique animations compared to NiftyDialogEffects
Code Comparison
NiftyDialogEffects:
Effectstype effect = Effectstype.Slidetop;
NiftyDialogBuilder dialogBuilder = NiftyDialogBuilder.getInstance(this);
dialogBuilder
.withTitle("Title")
.withMessage("Message")
.withEffect(effect)
.show();
material-dialogs:
MaterialDialog(this).show {
title(R.string.title)
message(R.string.message)
positiveButton(R.string.agree)
negativeButton(R.string.disagree)
}
NiftyDialogEffects focuses on providing visually appealing animations for dialogs, while material-dialogs offers a more comprehensive set of features and better integration with Material Design principles. The code comparison shows that NiftyDialogEffects uses a builder pattern with specific animation effects, whereas material-dialogs uses a DSL-style approach with more emphasis on content and buttons.
SweetAlert for Android, a beautiful and clever alert dialog
Pros of sweet-alert-dialog
- More customizable with a wider range of options for dialog appearance and behavior
- Better documentation and examples, making it easier for developers to implement
- Actively maintained with regular updates and bug fixes
Cons of sweet-alert-dialog
- Larger library size, potentially impacting app performance
- More complex implementation due to additional features and options
Code Comparison
NiftyDialogEffects:
NiftyDialogBuilder dialogBuilder = NiftyDialogBuilder.getInstance(this);
dialogBuilder
.withTitle("Title")
.withMessage("Message")
.withEffect(Effectstype.Slidetop)
.show();
sweet-alert-dialog:
new SweetAlertDialog(this, SweetAlertDialog.WARNING_TYPE)
.setTitleText("Are you sure?")
.setContentText("Won't be able to recover this file!")
.setConfirmText("Yes,delete it!")
.setConfirmClickListener(sDialog -> sDialog.dismissWithAnimation())
.show();
The code comparison shows that sweet-alert-dialog offers more customization options and a more expressive API, while NiftyDialogEffects focuses on simplicity and ease of use with predefined effects.
Nifty Modal Dialog Effects
Pros of NiftyDialogEffects
- Provides a variety of customizable dialog effects for Android applications
- Easy to implement and integrate into existing projects
- Offers smooth animations and transitions for enhanced user experience
Cons of NiftyDialogEffects
- Limited to Android platform, not available for other mobile or web applications
- May require additional customization for specific design requirements
- Potential performance impact on older devices due to complex animations
Code Comparison
NiftyDialogEffects:
NiftyDialogBuilder dialogBuilder = NiftyDialogBuilder.getInstance(this);
dialogBuilder
.withTitle("Title")
.withMessage("Message")
.withEffect(Effectstype.Slidetop)
.withButton1Text("OK")
.withButton2Text("Cancel")
.show();
As both repositories mentioned in the prompt are the same (litao0621/NiftyDialogEffects), there is no different code to compare. The code snippet above demonstrates how to use NiftyDialogEffects in an Android application.
Summary
NiftyDialogEffects is a useful library for Android developers looking to enhance their app's dialog animations. While it offers a range of customizable effects and easy implementation, it is limited to the Android platform and may require additional work for specific design needs. The library's performance should be considered when targeting older devices.
一个富有动感的Sheet(选择器)
Pros of AndroidSweetSheet
- More customizable with multiple style options (fatup, Maple, and Custom)
- Smoother animations and transitions
- Better support for material design principles
Cons of AndroidSweetSheet
- Limited to bottom sheet functionality
- May require more setup and configuration
- Less suitable for full-screen dialog effects
Code Comparison
NiftyDialogEffects:
NiftyDialogBuilder dialogBuilder = NiftyDialogBuilder.getInstance(this);
dialogBuilder
.withTitle("Title")
.withMessage("Message")
.withEffect(Effectstype.Slidetop)
.show();
AndroidSweetSheet:
SweetSheet sweetSheet = new SweetSheet(findViewById(R.id.ll_content));
sweetSheet.setMenuList(R.menu.menu_sweet)
.setDelegate(new RecyclerViewDelegate(true))
.setBackgroundEffect(new DimEffect(0.5f))
.show();
Summary
NiftyDialogEffects focuses on providing various dialog animation effects, while AndroidSweetSheet specializes in bottom sheet implementations with multiple styles. NiftyDialogEffects is simpler to use for quick dialog animations, whereas AndroidSweetSheet offers more customization options for bottom sheets. The choice between the two depends on the specific UI requirements of your Android application.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
NiftyDialogEffects
NiftyDialogEffects is deprecated
Nifty Modal Dialog Effects look like this(Nifty Modal Window Effects)
ScreenShot
. . .
Gradle
using JitPack:
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
compile 'com.github.sd6352051:NiftyDialogEffects:v1.0.3'
}
Usage
NiftyDialogBuilder dialogBuilder=NiftyDialogBuilder.getInstance(this);
dialogBuilder
.withTitle("Modal Dialog")
.withMessage("This is a modal Dialog.")
.show();
Configuration
dialogBuilder
.withTitle("Modal Dialog") //.withTitle(null) no title
.withTitleColor("#FFFFFF") //def
.withDividerColor("#11000000") //def
.withMessage("This is a modal Dialog.") //.withMessage(null) no Msg
.withMessageColor("#FFFFFFFF") //def | withMessageColor(int resid)
.withDialogColor("#FFE74C3C") //def | withDialogColor(int resid)
.withIcon(getResources().getDrawable(R.drawable.icon))
.withDuration(700) //def
.withEffect(effect) //def Effectstype.Slidetop
.withButton1Text("OK") //def gone
.withButton2Text("Cancel") //def gone
.isCancelableOnTouchOutside(true) //def | isCancelable(true)
.setCustomView(R.layout.custom_view,v.getContext()) //.setCustomView(View or ResId,context)
.setButton1Click(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(v.getContext(), "i'm btn1", Toast.LENGTH_SHORT).show();
}
})
.setButton2Click(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(v.getContext(),"i'm btn2",Toast.LENGTH_SHORT).show();
}
})
.show();
Effects
Fadein
, Slideleft
, Slidetop
, SlideBottom
, Slideright
, Fall
, Newspager
, Fliph
, Flipv
, RotateBottom
, RotateLeft
, Slit
, Shake
, Sidefill
Developed By
- ææ¶-Li Tao - onresume@live.com
License
Copyright 2014 litao.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
by cncounter
Top Related Projects
Advanced dialog solution for android
😍 A beautiful, fluid, and extensible dialogs API for Kotlin & Android.
SweetAlert for Android, a beautiful and clever alert dialog
Nifty Modal Dialog Effects
一个富有动感的Sheet(选择器)
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot