forked from Cheesebaron/DrawerSample
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlanetFragment.cs
26 lines (23 loc) · 879 Bytes
/
PlanetFragment.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using Android.App;
using Android.OS;
using Android.Views;
using Android.Widget;
namespace DrawerSample
{
public class PlanetFragment: Fragment
{
public static string ArgPlanetNumber = "planet_number";
public override View OnCreateView(LayoutInflater p0, ViewGroup p1, Bundle p2)
{
var rootView = p0.Inflate(Resource.Layout.FragmentPlanet, p1, false);
var i = Arguments.GetInt(ArgPlanetNumber);
var planet = Resources.GetStringArray(Resource.Array.PlanetsArray)[i];
var imageId = Resources.GetIdentifier(
"dk.ostebaronen.drawersample:drawable/" + planet.ToLowerInvariant(),
null, null);
rootView.FindViewById<ImageView>(Resource.Id.image).SetImageResource(imageId);
Activity.Title = planet;
return rootView;
}
}
}