summaryrefslogtreecommitdiffstats
path: root/src/org/madore
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/madore')
-rw-r--r--src/org/madore/android/unicodeMap/UnicodeListActivity.java16
-rw-r--r--src/org/madore/android/unicodeMap/UnicodeMapActivity.java1
2 files changed, 13 insertions, 4 deletions
diff --git a/src/org/madore/android/unicodeMap/UnicodeListActivity.java b/src/org/madore/android/unicodeMap/UnicodeListActivity.java
index 1495bbc..a08dbe2 100644
--- a/src/org/madore/android/unicodeMap/UnicodeListActivity.java
+++ b/src/org/madore/android/unicodeMap/UnicodeListActivity.java
@@ -25,6 +25,7 @@ public final class UnicodeListActivity extends ListActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ setContentView(R.layout.main_layout);
this.db = new UnicodeDatabase(this);
Intent intent = getIntent();
int from = intent.getIntExtra(EXTRA_FROM, 0);
@@ -35,15 +36,22 @@ public final class UnicodeListActivity extends ListActivity {
final ClipboardManager cmgr
= (ClipboardManager)getSystemService(Context.CLIPBOARD_SERVICE);
setListAdapter(new ArrayAdapter<UnicodeCharacter>(this, R.layout.list_item, list));
- ListView lv = getListView();
+ final Button btn = (Button) findViewById(R.id.button);
+ final EditText txt = (EditText) findViewById(R.id.edit);
+ btn.setOnClickListener(new View.OnClickListener() {
+ public void onClick(View view) {
+ cmgr.setText(txt.getText());
+ Toast.makeText(getApplicationContext(), "Copied to clipboard",
+ Toast.LENGTH_SHORT).show();
+ }
+ });
+ final ListView lv = getListView();
lv.setTextFilterEnabled(true);
lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
UnicodeCharacter it = (UnicodeCharacter)parent.getItemAtPosition(position);
- Toast.makeText(getApplicationContext(), it.getName(),
- Toast.LENGTH_SHORT).show();
- cmgr.setText(new String(Character.toChars(it.getCodePoint())));
+ txt.append(new String(Character.toChars(it.getCodePoint())));
}
});
diff --git a/src/org/madore/android/unicodeMap/UnicodeMapActivity.java b/src/org/madore/android/unicodeMap/UnicodeMapActivity.java
index 55cf6ed..de026de 100644
--- a/src/org/madore/android/unicodeMap/UnicodeMapActivity.java
+++ b/src/org/madore/android/unicodeMap/UnicodeMapActivity.java
@@ -206,6 +206,7 @@ public final class UnicodeMapActivity extends ListActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
android.util.Log.v("UnicodeMapActivity", "creating activity");
+ setContentView(R.layout.main_layout);
final UnicodeDatabase db = new UnicodeDatabase(this);
final boolean needPopulate = db.needPopulate();
db.close();