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.content.res.Resources;
26 import android.view.View;
27 import android.view.Window;
28 import android.widget.Button;
29 import android.widget.ImageView;
30 import android.widget.TextView;
31
32 public class ConnectionErrorDialog extends Dialog implements android.view.View.OnClickListener {
33 private TextView titleView;
34
35 private TextView contentView;
36
37 private Button okButton;
38
39 public ConnectionErrorDialog(Context context) {
40 super(context);
41 requestWindowFeature(Window.FEATURE_NO_TITLE);
42 setContentView(R.layout.warning_dialog_layout);
43 Resources res = context.getResources();
44 titleView = (TextView) findViewById(R.id.warning_dialog_title_view);
45 String titleString = res.getString(R.string.Warning);
46 titleView.setText(titleString);
47 ImageView imageView = (ImageView) findViewById(R.id.warning_image);
48 imageView.setImageResource(R.drawable.warning_icon);
49 contentView = (TextView) findViewById(R.id.warning_content);
50 String contentString = res.getString(R.string.ConnectionError);
51 contentView.setText(contentString);
52 okButton = (Button) findViewById(R.id.warning_ok_button);
53 String okString = res.getString(R.string.OK);
54 okButton.setText(okString);
55 okButton.setOnClickListener(this);
56 }
57
58 public void onClick(View view) {
59 if (view.equals(okButton)) {
60 dismiss();
61 }
62 }
63
64 }