【发布时间】:2015-02-13 14:16:33
【问题描述】:
我已经下载了 AppRate (https://github.com/TimotheeJeannin/AppRate) 并使用它来提示一个对话框,要求用户在特定的启动次数和时间过去后对应用程序进行评分。到目前为止它工作正常.. 唯一的事情是,我想将它与定制的布局(在 XML 文件上制作)合并,这样对话框看起来会与标准应用程序主题不同。 这有可能吗?
代码:
private void showDefaultDialog() {
Log.d(TAG, "Create default dialog.");
String title = "Rate " + getApplicationName(hostActivity.getApplicationContext());
String message = "If you enjoy using " + getApplicationName(hostActivity.getApplicationContext()) + ", please take a moment to rate it. Thanks for your support!";
String rate = "Rate it !";
String remindLater = "Remind me later";
String dismiss = "No thanks";
new AlertDialog.Builder(hostActivity)
.setTitle(title)
.setMessage(message)
.setPositiveButton(rate, this)
.setNegativeButton(dismiss, this)
.setNeutralButton(remindLater, this)
.setOnCancelListener(this)
.create().show();
}
非常感谢。
【问题讨论】:
-
亲爱的魔像。我尝试了该解决方案,但遇到了很多错误:p 并且仍在尝试..
-
亲爱的 Zakaria Bouhanna,我目前正在使用它。并用它做了最奇怪的事情。没有问题。
标签: android layout dialog rate