OSDN Git Service

9aef65e0065cb4191c709292493d437eb745c7c6
[gokigen/MeMoMa.git] / app / src / main / java / jp / sourceforge / gokigen / memoma / CreditDialog.java
1 package jp.sourceforge.gokigen.memoma;
2
3 import android.app.Activity;
4 import android.app.AlertDialog;
5 import android.app.Dialog;
6 import android.content.Context;
7 import android.view.LayoutInflater;
8 import android.view.View;
9 import android.view.ViewGroup;
10 import android.widget.TextView;
11
12 /**
13  *  クレジットを表示する
14  * 
15  * @author MRSa
16  *
17  */
18 public class CreditDialog
19 {
20         private Activity context = null;
21
22         /**
23          *   コンストラクタ
24          * @param arg
25          */
26         public CreditDialog(Activity arg)
27         {
28                 context = arg;
29         }
30
31     /**
32      *   ダイアログを応答する
33      * @return
34      */
35     public Dialog getDialog()
36     {
37         LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
38         View layout = inflater.inflate(R.layout.creditdialog, (ViewGroup) null);  //  ?? http://www.mail-archive.com/android-developers@googlegroups.com/msg162003.html より
39         //View layout = inflater.inflate(R.layout.creditdialog, (ViewGroup) context.findViewById(R.id.layout_root));
40
41         TextView text = (TextView) layout.findViewById(R.id.creditmessage);
42         text.setText(context.getString(R.string.app_credit));
43  //     ImageView image = (ImageView) layout.findViewById(R.id.crediticon);
44  //     image.setImageResource(R.drawable.icon);
45
46         AlertDialog.Builder builder = new AlertDialog.Builder(context);
47         builder.setTitle(context.getString(R.string.app_name));
48         builder.setIcon(R.drawable.icon);
49         builder.setView(layout);
50         builder.setCancelable(true);
51         return (builder.create());
52     }
53 }