summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid A. Madore <david@procyon.(none)>2010-04-25 19:52:37 +0200
committerDavid A. Madore <david@procyon.(none)>2010-04-25 19:52:37 +0200
commit8d56c5f19480646445fc277ee14addad597617c6 (patch)
tree6f434096f0bf5aea755de407b239a99d3d002a0c /src
parentd63ec044325c153fc1bfb3913b207a961382316e (diff)
downloadUnicodeMap-8d56c5f19480646445fc277ee14addad597617c6.tar.gz
UnicodeMap-8d56c5f19480646445fc277ee14addad597617c6.tar.bz2
UnicodeMap-8d56c5f19480646445fc277ee14addad597617c6.zip
Start using a non-trivial layout. So far, doesn't do much.
Diffstat (limited to 'src')
-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();