Action Queue

Action-Queue

Лицензия

Лицензия

Apache 2
Группа

Группа

in.srain.cube
Идентификатор

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

action-queue
Последняя версия

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

1.0.1
Дата

Дата

Тип

Тип

aar
Описание

Описание

Action Queue
Action-Queue
Ссылка на сайт

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

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

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

https://github.com/liaohuqiu/android-ActionQueue

Скачать action-queue

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

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

Зависимости

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

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

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

Android Gems

ActionQueue allows you run action one by one.

Import

Repositories:

allprojects {
    repositories {
        mavenCentral()
        maven {
            url "https://oss.sonatype.org/content/repositories/snapshots"
        }
        jcenter()
    }
}

Add to dependencies:

compile 'in.srain.cube:action-queue:1.0.1'

Usage

  • create actions

    String[] messageList = new String[]{
            "message 1",
            "message 2",
            "message 3",
    };
    for (int i = 0; i < messageList.length; i++) {
        String message = messageList[i];
        PopDialogAction action = new PopDialogAction(message);
        mActionQueue.add(action);
    }
  • process action

    class PopDialogAction extends ActionQueue.Action<String> {
    
        public PopDialogAction(String badge) {
            super(badge);
        }
    
        @Override
        public void onAction() {
            AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
            Dialog dialog = builder.setMessage(getBadge()).show();
            // notify action is done, and next aciton will be executed
            dialog.setOnDismissListener(mOnDismissListener);
        }
    }
  • notify when action is done

    DialogInterface.OnDismissListener mOnDismissListener = new DialogInterface.OnDismissListener() {
        @Override
        public void onDismiss(DialogInterface dialog) {
            mActionQueue.notifyActionDoneThenTryToPopNext();
        }
    };
  • LICENSE: MIT

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

Версия
1.0.1