Formatted files via Eclipse to hopefully have correct spacing/ident.

This commit is contained in:
Jon Benson
2013-05-07 19:36:02 +10:00
parent 4906b57f15
commit b0e7110182
7 changed files with 281 additions and 210 deletions

View File

@ -28,18 +28,21 @@ public class IITC_Settings extends Activity {
ArrayList<String> asset_list = new ArrayList<String>();
ArrayList<String> asset_values = new ArrayList<String>();
for (int i = 0; i < asset_array.length ; i++) {
for (int i = 0; i < asset_array.length; i++) {
// find user plugin name for user readable entries
Scanner s = null;
String src = "";
try {
s = new Scanner(am.open("plugins/" + asset_array[i])).useDelimiter("\\A");
s = new Scanner(am.open("plugins/" + asset_array[i]))
.useDelimiter("\\A");
} catch (IOException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
if (s != null) src = s.hasNext() ? s.next() : "";
String header = src.substring(src.indexOf("==UserScript=="), src.indexOf("==/UserScript=="));
if (s != null)
src = s.hasNext() ? s.next() : "";
String header = src.substring(src.indexOf("==UserScript=="),
src.indexOf("==/UserScript=="));
// remove new line comments and replace with space
// this way we get double spaces instead of newline + double slash
header = header.replace("\n//", " ");
@ -48,7 +51,8 @@ public class IITC_Settings extends Activity {
String plugin_name = "not found";
for (int j = 0; j < attributes.length; j++) {
// search for name and use the value
if (attributes[j].equals("@name")) plugin_name = attributes[j+1];
if (attributes[j].equals("@name"))
plugin_name = attributes[j + 1];
}
asset_list.add(plugin_name);
// real value
@ -56,13 +60,14 @@ public class IITC_Settings extends Activity {
}
Bundle bundle = getIntent().getExtras();
bundle.putStringArray("ASSETS", (String[]) asset_list.toArray(new String[0]));
bundle.putStringArray("ASSETS_VAL", (String[]) asset_values.toArray(new String[0]));
bundle.putStringArray("ASSETS",
(String[]) asset_list.toArray(new String[0]));
bundle.putStringArray("ASSETS_VAL",
(String[]) asset_values.toArray(new String[0]));
settings.setArguments(bundle);
// Display the fragment as the main content.
getFragmentManager().beginTransaction()
.replace(android.R.id.content, settings)
.commit();
.replace(android.R.id.content, settings).commit();
}
}