Exemplo n.º 1
0
		internal void setMonkey (Monkey monkey)
		{
			var label = (TextView)getView ().findViewById (R.id.monkey_name);
			var image = (ImageView)getView ().findViewById (R.id.monkey_image_view);

			label.setText (java.lang.CharSequenceProxy.Wrap (monkey.Name));
			image.setImageDrawable (monkey.Drawable);
		}
Exemplo n.º 2
0
		public void onMonkeySelected (Monkey monkey)
		{
			var image = (MonkeyImage)getFragmentManager ().findFragmentById (R.id.image_fragment);
			if (image != null)
				image.setMonkey (monkey);
			else {
				Intent intent = new Intent (this, typeof (ImageActivity));
				intent.putExtra (EXTRA_TITLE, monkey.Name);
				intent.putExtra (EXTRA_RESOURCE, monkey.ResourceId);
				startActivityForResult (intent, 1);
			}
		}
Exemplo n.º 3
0
		List<Map<String,Object>> getData ()
		{
			var list = new ArrayList<Map<String,Object>> ();

			var drawables = getResources ().obtainTypedArray (R.array.lemur_drawables);
			var strings = getResources ().getStringArray (R.array.lemur_strings);

			for (int i = 0; i < drawables.length(); i++) {
				var drawable = drawables.getDrawable (i);
				var resId = drawables.getResourceId (i, -1);
				var monkey = new Monkey (strings [i], drawable, resId);
				var map = new HashMap<String,Object> ();
				map.put ("title", monkey.Name);
				map.put ("monkey", monkey);
				list.add (Collections.unmodifiableMap (map));
			}

			return Collections.unmodifiableList (list);
		}