-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFabioActivity.cs
More file actions
119 lines (92 loc) · 3.61 KB
/
FabioActivity.cs
File metadata and controls
119 lines (92 loc) · 3.61 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
using Android.App;
using Android.Widget;
using Android.OS;
using System.Collections.Generic;
using System;
using PCLStorage;
using System.Threading.Tasks;
using Android.Content;
namespace po4
{
public class holder
{
public string first;
public string second;
}
[Activity(Label = "boodschapp", MainLauncher = false, Theme ="@style/Theme.AppCompat.Light.NoActionBar")]
public class FabioActivity : Activity
{
Button button, buttonDemi;
public List<holder> mItems = new List<holder>();
ListView mListView;
EditText editText1;
EditText editText2;
myListViewAdapter adapter;
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
SetContentView(Resource.Layout.MainFabio);
button = FindViewById<Button>(Resource.Id.button1);
buttonDemi = FindViewById<Button>(Resource.Id.demi);
mListView = FindViewById<ListView>(Resource.Id.mylistView);
mItems.Add(new holder() { first = "Appel", second = "2 stuks"});
adapter = new myListViewAdapter(this, mItems);
mListView.Adapter = adapter;
button.Click += Button_Click;
mListView.ItemClick += MListView_ItemClick;
buttonDemi.Click += ButtonDemi_Click;
}
//public async Task PCLStorageSample()
//{
// IFolder folder = await rootFolder.CreateFolderAsync("MySubFolder", CreationCollisionOption.OpenIfExists);
// IFile file = await folder.CreateFileAsync("answer.txt", CreationCollisionOption.ReplaceExisting);
// await file.WriteAllTextAsync("42");
//}
//public static async Task<string> ReadFileContent(string fileName, IFolder rootFolder)
//{
// ExistenceCheckResult exist = await rootFolder.CheckExistsAsync(fileName);
// string text = null;
// if (exist == ExistenceCheckResult.FileExists)
// {
// IFile file = await rootFolder.GetFileAsync(fileName);
// text = await file.ReadAllTextAsync();
// }
// return text;
//}
void Button_Click(object sender, System.EventArgs e)
{
editText1 = FindViewById<EditText>(Resource.Id.editText1);
editText2 = FindViewById<EditText>(Resource.Id.editText2);
var currentvar1 = editText1.Text;
var currentvar2 = editText2.Text;
if (currentvar1 != "")
{
mItems.Add(new holder() { first = currentvar1, second = currentvar2 });
adapter.NotifyDataSetChanged();
editText1.Text = "";
editText2.Text = "";
}
if (currentvar1 == "")
{
Toast.MakeText(this, "Spoor jij Niet? nigga u gay lil fag ass midget strapon anal bish", ToastLength.Long).Show();
}
}
void MListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
{
mItems.Remove(mItems[e.Position]);
adapter.NotifyDataSetChanged();
}
void ButtonDemi_Click(object sender, EventArgs e)
{
var demiIntent = new Intent(this, typeof(DemiMainActivity));
StartActivity(demiIntent);
}
public void functio()
{
mItems.Add(new holder() { first = "Appel", second = "2 stuks" });
adapter.NotifyDataSetChanged();
var intent = new Intent(this, typeof(FabioActivity));
StartActivity(intent);
}
}
}