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 UnreadableFileDialog extends Dialog implements android.view.View.OnClickListener {
32
33 private Button okButton;
34
35 public UnreadableFileDialog(Context context, String content) {
36 super(context);
37 requestWindowFeature(Window.FEATURE_NO_TITLE);
38 setContentView(R.layout.warning_dialog_layout);
39 TextView titleView = (TextView) findViewById(R.id.warning_dialog_title_view);
40 titleView.setText(context.getResources().getString(R.string.UnreachableFileTitle));
41 ImageView imageView = (ImageView) findViewById(R.id.warning_image);
42 imageView.setImageResource(R.drawable.icon_for_unreadable_file);
43 TextView contentView = (TextView) findViewById(R.id.warning_content);
44 if (content == null) {
45 contentView.setText(context.getResources().getString(R.string.UnreachableFile));
46 } else
47 contentView.setText(content);
48
49 okButton = (Button) findViewById(R.id.warning_ok_button);
50 okButton.setOnClickListener(this);
51 }
52
53 public void onClick(View view) {
54 if (view.equals(okButton)) {
55 dismiss();
56 }
57 }
58
59 }