summaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-10-31 12:00:03 +0000
committerThomas Martitz <kugel@rockbox.org>2010-10-31 12:00:03 +0000
commit2d05d2f9daebd7559c9dd05f4784e5f677b6dbbe (patch)
treeebaaf5d90d0ed0914e279df369ff263f1bd90d18 /android
parentcc758e42b9456c6093636647ae1dd8f64e639ff0 (diff)
downloadrockbox-2d05d2f9daebd7559c9dd05f4784e5f677b6dbbe.tar.gz
rockbox-2d05d2f9daebd7559c9dd05f4784e5f677b6dbbe.zip
Clean up r28408 coding style a bit to follow our guidelines with regard to
brace placement, tabs and 80 char line width. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28410 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'android')
-rw-r--r--android/src/org/rockbox/HostCallback.java5
-rw-r--r--android/src/org/rockbox/KeyboardActivity.java49
-rw-r--r--android/src/org/rockbox/RockboxActivity.java11
-rw-r--r--android/src/org/rockbox/RockboxKeyboardInput.java51
4 files changed, 59 insertions, 57 deletions
diff --git a/android/src/org/rockbox/HostCallback.java b/android/src/org/rockbox/HostCallback.java
index 0e69b3f283..8584fedd6a 100644
--- a/android/src/org/rockbox/HostCallback.java
+++ b/android/src/org/rockbox/HostCallback.java
@@ -2,6 +2,7 @@ package org.rockbox;
import android.content.Intent;
-public interface HostCallback {
- public void onComplete(int resultCode, Intent data);
+public interface HostCallback
+{
+ public void onComplete(int resultCode, Intent data);
}
diff --git a/android/src/org/rockbox/KeyboardActivity.java b/android/src/org/rockbox/KeyboardActivity.java
index f32aae28f8..c77f686780 100644
--- a/android/src/org/rockbox/KeyboardActivity.java
+++ b/android/src/org/rockbox/KeyboardActivity.java
@@ -10,32 +10,39 @@ import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
-public class KeyboardActivity extends Activity {
- public void onCreate(Bundle savedInstanceState) {
+public class KeyboardActivity extends Activity
+{
+ public void onCreate(Bundle savedInstanceState)
+ {
super.onCreate(savedInstanceState);
LayoutInflater inflater=LayoutInflater.from(this);
View addView=inflater.inflate(R.layout.keyboardinput, null);
EditText input = (EditText) addView.findViewById(R.id.KbdInput);
input.setText(getIntent().getStringExtra("value"));
new AlertDialog.Builder(this)
- .setTitle(R.string.KbdInputTitle)
- .setView(addView)
- .setIcon(R.drawable.icon)
- .setPositiveButton(R.string.OK, new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int whichButton) {
- EditText input = (EditText)((Dialog)dialog).findViewById(R.id.KbdInput);
- Editable s = input.getText();
- getIntent().putExtra("value", s.toString());
- setResult(RESULT_OK, getIntent());
- finish();
- }
- })
- .setNegativeButton(R.string.Cancel, new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int whichButton) {
- setResult(RESULT_CANCELED, getIntent());
- finish();
- }
- })
- .show();
+ .setTitle(R.string.KbdInputTitle)
+ .setView(addView)
+ .setIcon(R.drawable.icon)
+ .setPositiveButton(R.string.OK, new DialogInterface.OnClickListener()
+ {
+ public void onClick(DialogInterface dialog, int whichButton) {
+ EditText input = (EditText)((Dialog)dialog)
+ .findViewById(R.id.KbdInput);
+ Editable s = input.getText();
+ getIntent().putExtra("value", s.toString());
+ setResult(RESULT_OK, getIntent());
+ finish();
+ }
+ })
+
+ .setNegativeButton(R.string.Cancel, new DialogInterface.OnClickListener()
+ {
+ public void onClick(DialogInterface dialog, int whichButton)
+ {
+ setResult(RESULT_CANCELED, getIntent());
+ finish();
+ }
+ })
+ .show();
}
}
diff --git a/android/src/org/rockbox/RockboxActivity.java b/android/src/org/rockbox/RockboxActivity.java
index 9eed3f48dc..fed17c67f9 100644
--- a/android/src/org/rockbox/RockboxActivity.java
+++ b/android/src/org/rockbox/RockboxActivity.java
@@ -24,7 +24,6 @@ package org.rockbox;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
-import android.content.IntentFilter;
import android.os.Bundle;
import android.util.Log;
import android.view.ViewGroup;
@@ -167,15 +166,15 @@ public class RockboxActivity extends Activity
if (hostcallback != null)
{
LOG("Something has gone wrong");
- }
- hostcallback = callback;
- startActivityForResult(i, 0);
+ }
+ hostcallback = callback;
+ startActivityForResult(i, 0);
}
public void onActivityResult(int requestCode, int resultCode, Intent data)
{
- hostcallback.onComplete(resultCode, data);
- hostcallback = null;
+ hostcallback.onComplete(resultCode, data);
+ hostcallback = null;
}
private void LOG(CharSequence text)
diff --git a/android/src/org/rockbox/RockboxKeyboardInput.java b/android/src/org/rockbox/RockboxKeyboardInput.java
index b037f6c4bb..5601b16662 100644
--- a/android/src/org/rockbox/RockboxKeyboardInput.java
+++ b/android/src/org/rockbox/RockboxKeyboardInput.java
@@ -22,48 +22,43 @@
package org.rockbox;
import android.app.Activity;
-import android.content.BroadcastReceiver;
import android.content.Intent;
-import android.util.Log;
public class RockboxKeyboardInput
{
- private BroadcastReceiver b;
private String result;
public RockboxKeyboardInput()
{
- result = null;
+ result = null;
}
public void kbd_input(String text)
{
- RockboxActivity a = (RockboxActivity) RockboxService.get_instance().get_activity();
- Intent kbd = new Intent(a, KeyboardActivity.class);
- kbd.putExtra("value", text);
- a.waitForActivity(kbd, new HostCallback(){
-
- @Override
- public void onComplete(int resultCode, Intent data) {
- if (resultCode == Activity.RESULT_OK)
- {
- result = data.getStringExtra("value");
- }
- else {
- result = "";
- }
- }
- });
+ RockboxActivity a = (RockboxActivity) RockboxService.get_instance().get_activity();
+ Intent kbd = new Intent(a, KeyboardActivity.class);
+ kbd.putExtra("value", text);
+ a.waitForActivity(kbd, new HostCallback()
+ {
+ public void onComplete(int resultCode, Intent data)
+ {
+ if (resultCode == Activity.RESULT_OK)
+ {
+ result = data.getStringExtra("value");
+ }
+ else {
+ result = "";
+ }
+ }
+ });
}
- public String get_result()
+ public String get_result()
{
- return result;
+ return result;
}
-
- public boolean is_usable()
- {
- return RockboxService.get_instance().get_activity() != null;
- }
-
+ public boolean is_usable()
+ {
+ return RockboxService.get_instance().get_activity() != null;
+ }
}