1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.exoplatform.widget;
20
21 import org.exoplatform.R;
22
23 import android.app.Dialog;
24 import android.content.Context;
25 import android.view.View;
26 import android.view.Window;
27 import android.widget.Button;
28 import android.widget.ImageView;
29 import android.widget.TextView;
30
31 public class WarningDialog extends Dialog implements android.view.View.OnClickListener {
32 private TextView titleView;
33
34 private TextView contentView;
35
36 protected Button okButton;
37
38 public WarningDialog(Context context, String titleString, String contentString, String okString) {
39 super(context);
40 requestWindowFeature(Window.FEATURE_NO_TITLE);
41 setContentView(R.layout.warning_dialog_layout);
42 titleView = (TextView) findViewById(R.id.warning_dialog_title_view);
43 titleView.setText(titleString);
44 ImageView imageView = (ImageView) findViewById(R.id.warning_image);
45 imageView.setImageResource(R.drawable.warning_icon);
46 contentView = (TextView) findViewById(R.id.warning_content);
47 contentView.setText(contentString);
48 okButton = (Button) findViewById(R.id.warning_ok_button);
49 okButton.setText(okString);
50 okButton.setOnClickListener(this);
51 }
52
53 public void onClick(View view) {
54 if (view.equals(okButton)) {
55 dismiss();
56 }
57 }
58
59 }