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
32
33
34
35 public class ConnTimeOutDialog extends Dialog implements android.view.View.OnClickListener {
36
37 private TextView titleView;
38
39 private TextView contentView;
40
41 private Button okButton;
42
43 public ConnTimeOutDialog(Context context, String titleString, String okString) {
44 super(context);
45 requestWindowFeature(Window.FEATURE_NO_TITLE);
46 setContentView(R.layout.warning_dialog_layout);
47 titleView = (TextView) findViewById(R.id.warning_dialog_title_view);
48 titleView.setText(titleString);
49 ImageView imageView = (ImageView) findViewById(R.id.warning_image);
50 imageView.setImageResource(R.drawable.warning_icon);
51 contentView = (TextView) findViewById(R.id.warning_content);
52 contentView.setText(context.getString(R.string.NetworkTimeout));
53 okButton = (Button) findViewById(R.id.warning_ok_button);
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 }