-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMainDialogActivity.cs
More file actions
92 lines (85 loc) · 3.5 KB
/
MainDialogActivity.cs
File metadata and controls
92 lines (85 loc) · 3.5 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
using Android.App;
using Android.OS;
using Android.Views;
using Android.Widget;
using Android.Dialog;
using System.Linq;
namespace DialogSampleApp
{
//
// NOTE: with the new update you will have to add all the dialog_* prefixes to your main application.
// This is because the current version of Mono for Android will not add resources from assemblies
// to the main application like it does for libraries in Android/Java/Eclipse... This could
// change in a future version (it's slated for 1.0 post release) but for now, just add them
// as in this sample...
//
[Activity(Label = "Android.Dialog Sample", MainLauncher = true, WindowSoftInputMode = SoftInput.AdjustPan)]
public class MainDialogActivity : DialogActivity
{
protected void StartNew()
{
StartActivity(typeof(DialogListViewActivity));
}
protected void ClickList()
{
StartActivity(typeof(NameActivity));
}
protected void ClickElementTest()
{
StartActivity(typeof(EntryActivity));
}
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
Root = new RootElement("Test Root Elem")
{
new Section
{
new StringElement("Label", "Only Element in a Blank Section"),
},
new Section("Test Header", "Test Footer")
{
new ButtonElement("DialogActivity", (o, e) => StartNew()),
new StringElement("DialogListView Activity", Resource.Layout.dialog_labelfieldright)
{
Click = (o, e) => ClickList(),
},
new BooleanElement("Push my button", true),
new BooleanElement("Push this too", false),
new StringElement("Text label", "Click for EntryElement Test")
{
Click = (o, e) => ClickElementTest(),
},
},
new Section("Part II")
{
new StringElement("This is the String Element", "The Value"),
new CheckboxElement("Check this out", true),
new EntryElement("Username", string.Empty){ Hint = "Enter Login", },
new EntryElement("Password", string.Empty) {
Hint = "Enter Password",
Password = true,
},
},
new Section("Group", new ViewElement(Android.Resource.Layout.SimpleListItem1)
{ Populate = view => { view.FindViewById<TextView>(Android.Resource.Id.Text1).Text = "Custom footer view"; }, })
{
(Element)new RootElement("Radio Group", new Android.Dialog.RadioGroup("dessert", 2))
{
new Section
{
new RadioElement("Ice Cream Sandwich", "dessert"),
new RadioElement("Honeycomb", "dessert"),
new RadioElement("Gingerbread", "dessert"),
},
},
}
};
ValueChanged += root_ValueChanged;
}
void root_ValueChanged(object sender, System.EventArgs e)
{
Toast.MakeText(this, "Changed", ToastLength.Short).Show();
}
}
}