从顶部下拉出来的的提示控件。

Paste_Image.png
Paste_Image.png
1487522070101111.gif

Icon
Alerter.create(this)
.setText(“Alert text…”)
.setIcon(R.drawable.ic_face)
.show();

1487522135341198.gif

On screen duration, in milliseconds
Alerter.create(this)
.setTitle(“Alert Title”)
.setText(“Alert text…”)
.setDuration(10000)
.show();

Without title
Alerter.create(this)
.setText(“Alert text…”)
.show();

1487522220699266.gif

Adding an On Click Listener
Alerter.create(ExampleActivity.this)
.setTitle(“Alert Title”)
.setText(“Alert text…”)
.setDuration(10000)
.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(ExampleActivity.this, “OnClick Called”, Toast.LENGTH_LONG).show();
}
})
.show();

1487522284901989.gif

Verbose text
Alerter.create(ExampleActivity.this)
.setTitle(“Alert Title”)
.setText(“The alert scales to accommodate larger bodies of text. ” +
“The alert scales to accommodate larger bodies of text. ” +
“The alert scales to accommodate larger bodies of text.”)
.show();

1487522357887315.gif
IT文库 » 从顶部下拉出来的的提示控件。
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址