Android 开发包 android-ActionQueue

码农软件 · 软件分类 · 手机开发包 · 2019-05-05 13:14:51

软件介绍

ActionQueue 允许你一个一个的执行任务。

导入:

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

加依赖:

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

使用

创建 action:

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);
}

处理 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);
    }
}

action 执行完之后通知提醒:

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

本文地址:https://codercto.com/soft/d/5073.html

UCD火花集

UCD火花集

UCDChina / 人民邮电出版社 / 2009 / 25.00元

本书收集了UCDChina上线以来推出的13个话题,内容涵盖了产品设计的全部流程,按顺序集结到第一到第十三章中,讨论了如何研究用户、如何将用户需求应用到产品设计中、如何传达和协作。在第十四章,几位设计师分享了生活中的UE故事。第十五章,列举了一些实例和实践者的观点。本书适合有一定工作经验,从事产品设计、产品策划、交互设计、视觉设计、用户研究、前端开发、网站运营,以及所有与互联网有关的从业人员阅读。一起来看看 《UCD火花集》 这本书的介绍吧!

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试