Skip to content

Commit 7662e39

Browse files
committed
Cleaned up whitespace
1 parent a5f97b6 commit 7662e39

File tree

2 files changed

+31
-27
lines changed

2 files changed

+31
-27
lines changed

Android/ContactView/ContactView.java

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,39 +11,43 @@
1111
import com.phonegap.api.PluginResult;
1212

1313
public class ContactView extends Plugin {
14-
private static final int PICK_CONTACT = 1;
15-
private String name = null;
16-
public String callback;
17-
14+
private static final int PICK_CONTACT = 1;
15+
private String name = null;
16+
public String callback;
17+
1818
@Override
1919
public PluginResult execute(String action, JSONArray args, String callbackId) {
2020
startContactActivity();
21-
PluginResult mPlugin = new PluginResult(PluginResult.Status.NO_RESULT);
21+
PluginResult mPlugin = new PluginResult(PluginResult.Status.NO_RESULT);
2222
mPlugin.setKeepCallback(true);
2323
this.callback = callbackId;
2424
return mPlugin;
2525
}
2626

2727
public void startContactActivity() {
28-
Intent intent = new Intent(Intent.ACTION_PICK);
29-
intent.setType(ContactsContract.Contacts.CONTENT_TYPE);
30-
this.ctx.startActivityForResult((Plugin) this, intent, PICK_CONTACT);
31-
}
32-
28+
Intent intent = new Intent(Intent.ACTION_PICK);
29+
intent.setType(ContactsContract.Contacts.CONTENT_TYPE);
30+
this.ctx.startActivityForResult((Plugin) this, intent, PICK_CONTACT);
31+
}
32+
3333
@Override
3434
public void onActivityResult(int reqCode, int resultCode, Intent data) {
35-
switch (reqCode) {
36-
case (PICK_CONTACT) :
37-
if (resultCode == Activity.RESULT_OK) {
38-
Uri contactData = data.getData();
39-
Cursor c = this.ctx.managedQuery(contactData, null, null, null, null);
40-
if (c.moveToFirst()) {
41-
name = c.getString(c.getColumnIndexOrThrow(ContactsContract.Contacts.DISPLAY_NAME));
42-
this.success(new PluginResult(PluginResult.Status.OK, name), this.callback);
43-
}
44-
}
45-
break;
46-
}
47-
}
35+
switch (reqCode) {
36+
case (PICK_CONTACT):
37+
if (resultCode == Activity.RESULT_OK) {
38+
Uri contactData = data.getData();
39+
Cursor c = this.ctx.managedQuery(contactData, null, null, null,
40+
null);
41+
if (c.moveToFirst()) {
42+
name = c.getString(c
43+
.getColumnIndexOrThrow(ContactsContract.Contacts.DISPLAY_NAME));
44+
this.success(
45+
new PluginResult(PluginResult.Status.OK, name),
46+
this.callback);
47+
}
48+
}
49+
break;
50+
}
51+
}
4852

4953
}

Android/ContactView/ContactView.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ ContactView.prototype.show = function(element) {
1212
}
1313

1414
return PhoneGap.exec(function(args) {
15-
success(args);
16-
}, function(args) {
17-
fail(args);
18-
}, 'ContactView', '', []);
15+
success(args);
16+
}, function(args) {
17+
fail(args);
18+
}, 'ContactView', '', []);
1919
};
2020

2121
PhoneGap.addConstructor(function() {

0 commit comments

Comments
 (0)