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

描述:

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

应用截图:

alert

源码:

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

Visibility Callbacks

 Alerter.create(ExampleActivity.this)
        .setTitle("Alert Title")
        .setOnShowListener(new OnShowAlertListener() {
            @Override
            public void onShow() {
                Toast.makeText(ExampleActivity.this, "Alert Shown", Toast.LENGTH_LONG).show();
            }
        })
        .setOnHideListener(new OnHideAlertListener() {
            @Override
            public void onHide() {
                Toast.makeText(ExampleActivity.this, "Alert Hidden", Toast.LENGTH_LONG).show();
            }
         })
        .show();

源码下载:https://github.com/Tapadoo/Alerter

未经允许不得转载:安度博客 » android从顶部下拉出来的的提示控件示例

赞 (0)
分享到:更多 ()

评论 0

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