aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/ui
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2012-10-25 20:34:52 +0200
committerBananeweizen <bananeweizen@gmx.de>2012-10-25 20:34:52 +0200
commiteb77c0668c5187c6c00479269fa09524b2dbb6c6 (patch)
tree0b00c13133fe3dac859cc92a6c6f893cc806a118 /main/src/cgeo/geocaching/ui
parent869a2f4c995bab5285fc4ef6531c9b7e5d18becf (diff)
parent2ab1a677b17e79eed9ef389742e100280edc6b9a (diff)
downloadcgeo-eb77c0668c5187c6c00479269fa09524b2dbb6c6.zip
cgeo-eb77c0668c5187c6c00479269fa09524b2dbb6c6.tar.gz
cgeo-eb77c0668c5187c6c00479269fa09524b2dbb6c6.tar.bz2
Merge remote-tracking branch 'jowi24/feature_409'
* remove useless margins * hide personal note text view if empty
Diffstat (limited to 'main/src/cgeo/geocaching/ui')
-rw-r--r--main/src/cgeo/geocaching/ui/EditorDialog.java59
1 files changed, 59 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/ui/EditorDialog.java b/main/src/cgeo/geocaching/ui/EditorDialog.java
new file mode 100644
index 0000000..50b3e27
--- /dev/null
+++ b/main/src/cgeo/geocaching/ui/EditorDialog.java
@@ -0,0 +1,59 @@
+package cgeo.geocaching.ui;
+
+import cgeo.geocaching.CacheDetailActivity;
+import cgeo.geocaching.R;
+
+import android.app.Dialog;
+import android.os.Bundle;
+import android.view.View;
+import android.view.ViewGroup.LayoutParams;
+import android.view.Window;
+import android.widget.Button;
+import android.widget.EditText;
+
+public class EditorDialog extends Dialog {
+
+ private CharSequence editorText;
+ private EditorUpdate editorUpdate;
+
+ public EditorDialog(CacheDetailActivity cacheDetailActivity, CharSequence editable) {
+ super(cacheDetailActivity);
+ this.editorText = editable;
+ }
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ requestWindowFeature(Window.FEATURE_NO_TITLE);
+ setContentView(R.layout.editor);
+
+ final EditText editText = (EditText) findViewById(R.id.editorEditText);
+ editText.setText(editorText);
+
+ final Button buttonSave = (Button) findViewById(R.id.editorSave);
+ buttonSave.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ editorUpdate.update(editText.getEditableText());
+ EditorDialog.this.hide();
+ }
+ });
+ }
+
+ public interface EditorUpdate {
+ public void update(CharSequence editorText);
+ }
+
+ public void setOnEditorUpdate(EditorUpdate editorUpdate) {
+ this.editorUpdate = editorUpdate;
+
+ }
+
+ @Override
+ public void show() {
+ super.show();
+ getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
+ }
+
+}