forked from sam-lippert/Android.Dialog
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathActivity1.cs
More file actions
executable file
·62 lines (56 loc) · 2.36 KB
/
Activity1.cs
File metadata and controls
executable file
·62 lines (56 loc) · 2.36 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
using Android.App;
using Android.OS;
using Android.Views;
using Android.Widget;
using Android.Dialog;
using System;
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 = "MD.D Sample", MainLauncher = true, WindowSoftInputMode = SoftInput.AdjustPan)]
public class Activity1 : Activity
{
protected void StartNew()
{
StartActivity(typeof(Activity2));
}
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
var root = new RootElement("Test Root Elem")
{
new Section("Test Header", "Test Footer")
{
new StringElement("Do Something", "Foo"),
new ButtonElement("DialogActivity", (object sender, EventArgs e) => this.StartNew() ),
new BooleanElement("Push my button", true),
new BooleanElement("Push this too", false),
new StringElement("Text label", "The Value"),
new BooleanElement("Push my button", true),
new BooleanElement("Push this too", false),
},
new Section("Part II")
{
new StringElement("This is the String Element", "The Value"),
new CheckboxElement("Check this out", true),
new EntryElement("Username",""){
Hint = "Enter Login"
},
new EntryElement("Password", "") {
Hint = "Enter Password",
Password = true,
},
}
};
var da = new DialogAdapter(this, root);
var lv = new ListView(this) {Adapter = da};
SetContentView(lv);
}
}
}