PageRenderTime 27ms CodeModel.GetById 18ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/Code/src/com/game/ViewData/AboutViewData.java

https://bitbucket.org/DeveloperUX/behaviortree
Java | 50 lines | 33 code | 7 blank | 10 comment | 0 complexity | 4f805c4b2ebc659b57d40b8e740875c5 MD5 | raw file
 1package com.game.ViewData;
 2
 3import com.game.MessageHandler;
 4import com.game.MsgType;
 5import com.game.R;
 6import com.game.MessageHandler.MsgReceiver;
 7
 8import android.app.Activity;
 9import android.content.Context;
10import android.util.Log;
11import android.view.LayoutInflater;
12import android.view.View;
13import android.view.View.OnClickListener;
14import android.widget.Button;
15
16/**
17 * Specific view data class for the "About Us" screen.
18 * @author Ying
19 *
20 */
21public class AboutViewData extends ViewData 
22{
23	/**
24	 * @see ViewData createXMLView(Activity activity) 
25	 */
26	@Override
27	public View createXMLView(Activity activity) 
28	{
29		Log.i("AboutViewData", "createXMLView");
30		
31		// Access xml layout
32		LayoutInflater li = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
33        View xmlLayout = (View) li.inflate(R.layout.about, null);
34        
35        // Callback for the buttons
36        Button okButton = (Button) xmlLayout.findViewById(R.id.ok_about_but);
37        okButton.setOnClickListener(new OnClickListener() 
38        {
39          @Override
40          public void onClick(View v) 
41          {
42            Log.i("ViewData", " Clicked OK button");            
43            MessageHandler.Get().Send(MsgReceiver.LOGIC, MsgType.BUTTON_CLICK, R.id.ok_about_but);
44          }
45        });
46        
47		return xmlLayout;
48	}
49
50}