My favorites
▼
|
Sign in
microemu
MicroEmu is a pure Java implementation of Java ME.
Project Home
Downloads
Wiki
Issues
Source
Export to GitHub
READ-ONLY: This project has been
archived
. For more information see
this post
.
Search
Search within:
All issues
Open issues
New issues
Issues to verify
for
Advanced search
Search tips
Subscriptions
Issue
85
attachment: android.list.diff
(1.8 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
Index: microemu-android/src/org/microemu/android/device/ui/AndroidListUI.java
===================================================================
--- microemu-android/src/org/microemu/android/device/ui/AndroidListUI.java (revision 2374)
+++ microemu-android/src/org/microemu/android/device/ui/AndroidListUI.java (working copy)
@@ -39,6 +39,7 @@
import org.microemu.android.device.AndroidMutableImage;
import android.content.Context;
+import android.view.Gravity;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
@@ -114,19 +115,11 @@
}
public void delete(final int elementNum) {
- activity.post(new Runnable() {
- public void run() {
- listAdapter.delete(elementNum);
- }
- });
+ listAdapter.delete(elementNum);
}
public void deleteAll() {
- activity.post(new Runnable() {
- public void run() {
- listAdapter.deleteAll();
- }
- });
+ listAdapter.deleteAll();
}
public void setSelectedIndex(int elementNum, boolean selected) {
@@ -134,7 +127,15 @@
listView.setSelection(elementNum);
}
}
+
+ public int size() {
+ return listAdapter.getCount();
+ }
+ public void set(int elementNum, String stringPart, Image imagePart) {
+ listAdapter.set(elementNum, stringPart, imagePart);
+ }
+
private class AndroidListAdapter extends BaseAdapter {
private class ViewHolder
@@ -160,6 +161,18 @@
return objects.lastIndexOf(vh);
}
+ public void set(int elementNum, String stringPart, Object image) {
+ ViewHolder vh = getItem(elementNum);
+ vh.image = image;
+ vh.text = stringPart;
+
+ activity.post(new Runnable() {
+ public void run() {
+ notifyDataSetChanged();
+ }
+ });
+ }
+
public int getCount() {
return objects.size();
}
Powered by
Google Project Hosting