- 授权协议: 未知
- 开发语言: Java
- 操作系统: Android
- 软件首页: https://github.com/liaohuqiu/android-ActionQueue
软件介绍
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();
}
};
Effective C++
[美]Scott Meyers / 侯捷 / 电子工业出版社 / 2006-7 / 58.00元
《Effective C++:改善程序与设计的55个具体做法》(中文版)(第3版)一共组织55个准则,每一条准则描述一个编写出更好的C++的方式。每一个条款的背后都有具体范例支撑。第三版有一半以上的篇幅是崭新内容,包括讨论资源管理和模板(templates)运用的两个新章。为反映出现代设计考虑,对第二版论题做了广泛的修订,包括异常(exceptions)、设计模式(design patterns)......一起来看看 《Effective C++》 这本书的介绍吧!
