android-overlaydialog

A customizable dialog shown on top of the window

Лицензия

Лицензия

MIT
Группа

Группа

com.github.fernandospr
Идентификатор

Идентификатор

overlaydialog
Последняя версия

Последняя версия

1.0.1
Дата

Дата

Тип

Тип

aar
Описание

Описание

android-overlaydialog
A customizable dialog shown on top of the window
Ссылка на сайт

Ссылка на сайт

https://github.com/fernandospr/android-overlay-dialog
Система контроля версий

Система контроля версий

https://github.com/fernandospr/android-overlay-dialog

Скачать overlaydialog

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.fernandospr/overlaydialog/ -->
<dependency>
    <groupId>com.github.fernandospr</groupId>
    <artifactId>overlaydialog</artifactId>
    <version>1.0.1</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.github.fernandospr/overlaydialog/
implementation 'com.github.fernandospr:overlaydialog:1.0.1'
// https://jarcasting.com/artifacts/com.github.fernandospr/overlaydialog/
implementation ("com.github.fernandospr:overlaydialog:1.0.1")
'com.github.fernandospr:overlaydialog:aar:1.0.1'
<dependency org="com.github.fernandospr" name="overlaydialog" rev="1.0.1">
  <artifact name="overlaydialog" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.github.fernandospr', module='overlaydialog', version='1.0.1')
)
libraryDependencies += "com.github.fernandospr" % "overlaydialog" % "1.0.1"
[com.github.fernandospr/overlaydialog "1.0.1"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

android-overlay-dialog

A customizable dialog shown on top of the window. Useful for showing info/error messages.

Sample app

How to use

Please, add the following dependency to your gradle file:

compile 'com.github.fernandospr:overlaydialog:1.0.1'

OverlayDialog inherits from android.app.Dialog, so you can use the same methods from Dialog, for example:

OverlayDialog dialog = new OverlayDialog(this);
dialog.setCancelable(true);
...
dialog.show();
...
dialog.dismiss();

To customize the view for the dialog, you should use:

View customView = LayoutInflater.from(this).inflate(layoutResID, root, false);
...
dialog.setContentView(customView);

To customize the auto dismiss time, you should use:

dialog.setAutoDismissDelayMillis(5000);

To customize the enter/exit animations, you should create a theme and set it in the constructor, for example:

OverlayDialog dialog = new OverlayDialog(this, R.style.TopMessageDialog);
  • res/values/styles.xml
<style name="TopMessageDialog" parent="Theme.AppCompat.Dialog">
    <item name="android:windowAnimationStyle">@style/TopMessageDialogAnimation</item>
</style>

<style name="TopMessageDialogAnimation">
    <item name="android:windowEnterAnimation">@anim/translate_from_top</item>
    <item name="android:windowExitAnimation">@anim/translate_to_top</item>
</style>
  • res/anim/translate_from_top.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="600">
    <translate
        android:fromYDelta="-100%"
        android:toYDelta="0%" />
    <alpha
        android:fromAlpha="0"
        android:toAlpha="1" />
</set>
  • res/anim/translate_to_top.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="600">
    <translate
        android:fromYDelta="0%"
        android:toYDelta="-100%" />
    <alpha
        android:fromAlpha="1"
        android:toAlpha="0" />
</set>

See the sample app for more examples.

Версии библиотеки

Версия
1.0.1
1.0.0