Skip to content

Commit acf238d

Browse files
committed
code formatting
1 parent 9553c08 commit acf238d

File tree

11 files changed

+33
-26
lines changed

11 files changed

+33
-26
lines changed

core/src/processing/android/PFragment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
219219
}
220220

221221
@Override
222-
public boolean onOptionsItemSelected(MenuItem item){
222+
public boolean onOptionsItemSelected(MenuItem item) {
223223
if (sketch != null) return sketch.onOptionsItemSelected(item);
224224
return super.onOptionsItemSelected(item);
225225
}

core/src/processing/android/PWatchFaceGLES.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ public void onCreate(SurfaceHolder surfaceHolder) {
173173
public EGLConfig chooseEglConfig(EGLDisplay eglDisplay) {
174174
int[] numEglConfigs = new int[1];
175175
EGLConfig[] eglConfigs = new EGLConfig[1];
176-
if(!EGL14.eglChooseConfig(eglDisplay, CONFIG_ATTRIB_LIST, 0, eglConfigs, 0, eglConfigs.length, numEglConfigs, 0)) {
176+
if (!EGL14.eglChooseConfig(eglDisplay, CONFIG_ATTRIB_LIST, 0, eglConfigs, 0, eglConfigs.length, numEglConfigs, 0)) {
177177
throw new RuntimeException("eglChooseConfig failed");
178-
} else if(numEglConfigs[0] == 0) {
178+
} else if (numEglConfigs[0] == 0) {
179179
throw new RuntimeException("no matching EGL configs");
180180
} else {
181181
return eglConfigs[0];

mode/src/processing/mode/android/AndroidBuild.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ private File signPackage(File projectFolder, String keyStorePassword, String fil
771771
if (keyStore == null) return null;
772772

773773
String path=getPathToAPK();
774-
if(fileExt.equals("aab")){
774+
if (fileExt.equals("aab")) {
775775
path = getPathToAAB();
776776
}
777777
File unsignedPackage = new File(projectFolder,
@@ -785,7 +785,7 @@ private File signPackage(File projectFolder, String keyStorePassword, String fil
785785
AndroidKeyStore.ALIAS_STRING, keyStorePassword,
786786
keyStore.getAbsolutePath(), keyStorePassword);
787787

788-
if(fileExt.equals("aab")){
788+
if (fileExt.equals("aab")) {
789789
return signedPackage;
790790
}
791791
File alignedPackage = zipalignPackage(signedPackage, projectFolder, fileExt);

mode/src/processing/mode/android/AndroidLineBreakpoint.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public AndroidLineBreakpoint(int lineIdx, Debugger dbg) {
5151
* the logical class name to the VM (Physical) class name
5252
*/
5353
private void addPackageName() {
54-
if (!alreadyAdded){
54+
if (!alreadyAdded) {
5555
className = ((AndroidDebugger) dbg).getPackageName() + "." + className;
5656
alreadyAdded = !alreadyAdded;
5757
}

mode/src/processing/mode/android/AndroidMode.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ public boolean checkPackageName(Sketch sketch, int comp, boolean forBundle) {
332332
String name = manifest.getPackageName();
333333
if (name.toLowerCase().equals(defName.toLowerCase())) {
334334
// The user did not set the package name, show error and stop
335-
if(forBundle){
335+
if (forBundle) {
336336
AndroidUtil.showMessage(AndroidMode.getTextString("android_mode.dialog.cannot_export_bundle_title"),
337337
AndroidMode.getTextString("android_mode.dialog.cannot_export_package_body", DISTRIBUTING_APPS_TUT_URL));
338338
}else {
@@ -360,7 +360,7 @@ public boolean checkAppIcons(Sketch sketch, int comp, boolean forBundle) {
360360

361361
if (!allFilesExist) {
362362
// The user did not set custom icons, show error and stop
363-
if(forBundle){
363+
if (forBundle) {
364364
AndroidUtil.showMessage(AndroidMode.getTextString("android_mode.dialog.cannot_use_default_icons_title_bundle"),
365365
AndroidMode.getTextString("android_mode.dialog.cannot_use_default_icons_body", DISTRIBUTING_APPS_TUT_URL));
366366
}else {

mode/src/processing/mode/android/AndroidRunner.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public AndroidRunner(AndroidBuild build, RunnerListener listener) {
6262
this.build = build;
6363
this.listener = listener;
6464

65-
if (listener instanceof AndroidEditor){
65+
if (listener instanceof AndroidEditor) {
6666
isDebugEnabled = ((AndroidEditor) listener).isDebuggerEnabled();
6767
}
6868

@@ -139,7 +139,7 @@ public boolean launch(Future<Device> deviceFuture, int comp, boolean emu) {
139139
}
140140

141141
// Start Debug if Debugger is enabled
142-
if (isDebugEnabled){
142+
if (isDebugEnabled) {
143143
((AndroidEditor) listener).getDebugger()
144144
.startDebug(this, device);
145145
}
@@ -183,7 +183,7 @@ private VirtualMachine connect(
183183
return connector.attach(args);
184184
}
185185

186-
public VirtualMachine vm(){
186+
public VirtualMachine vm() {
187187
return vm;
188188
}
189189

mode/src/processing/mode/android/Device.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public boolean launchApp(final String packageName, boolean isDebuggerEnabled)
189189
return false;
190190
}
191191
ProcessResult pr;
192-
if (isDebuggerEnabled){
192+
if (isDebuggerEnabled) {
193193
String[] cmd = {
194194
"shell", "am", "start",
195195
"-e", "debug", "true",
@@ -245,7 +245,7 @@ private class JDWPProcessor implements LineProcessor {
245245
public void processLine(final String line) {
246246
pId = Integer.parseInt(line);
247247
}
248-
public int getId(){
248+
public int getId() {
249249
return pId;
250250
}
251251
}

mode/src/processing/mode/android/KeyStoreManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public void actionPerformed(ActionEvent e) {
105105
localityName.getText(), stateName.getText(), country.getText());
106106

107107
setVisible(false);
108-
if(forBundleExport){
108+
if (forBundleExport) {
109109
editor.startExportBundle(new String(passwordField.getPassword()));
110110
}else {
111111
editor.startExportPackage(new String(passwordField.getPassword()));
@@ -115,7 +115,7 @@ public void actionPerformed(ActionEvent e) {
115115
}
116116
} else {
117117
setVisible(false);
118-
if(forBundleExport){
118+
if (forBundleExport) {
119119
editor.startExportBundle(new String(passwordField.getPassword()));
120120
}else {
121121
editor.startExportPackage(new String(passwordField.getPassword()));

mode/src/processing/mode/android/Manifest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public void setPermissions(String[] names) {
164164
hasReadExtStorage = true;
165165
continue;
166166
}
167-
if(appComp == AndroidBuild.AR && name.equals(PERMISSION_PREFIX + "CAMERA")){
167+
if (appComp == AndroidBuild.AR && name.equals(PERMISSION_PREFIX + "CAMERA")) {
168168
hasCameraAccess = true;
169169
continue;
170170
}
@@ -235,7 +235,7 @@ private void fixPermissions(XML mf) {
235235
hasReadExtStorage = true;
236236
continue;
237237
}
238-
if (appComp == AndroidBuild.AR && name.equals(PERMISSION_PREFIX + "CAMERA")){
238+
if (appComp == AndroidBuild.AR && name.equals(PERMISSION_PREFIX + "CAMERA")) {
239239
hasCameraAccess = true;
240240
continue;
241241
}

mode/src/processing/mode/android/SDKDownloader.java

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -308,15 +308,18 @@ private void getMainDownloadUrls(SDKUrlHolder urlHolder,
308308
NodeList childNodes = remotePackages.item(buildTool).getChildNodes();
309309

310310
NodeList channel = ((Element) childNodes).getElementsByTagName("channelRef");
311-
if(!channel.item(0).getAttributes().item(0).getNodeValue().equals("channel-0"))
311+
if (!channel.item(0).getAttributes().item(0).getNodeValue().equals("channel-0")) {
312312
continue; // Stable channel only, skip others
313+
}
313314

314315
NodeList revision = ((Element) childNodes).getElementsByTagName("revision");
315316
String major = (((Element) revision.item(0)).getElementsByTagName("major")).item(0).getTextContent();
316317
String minor = (((Element) revision.item(0)).getElementsByTagName("minor")).item(0).getTextContent();
317318
String micro = (((Element) revision.item(0)).getElementsByTagName("micro")).item(0).getTextContent();
318-
if(!major.equals(AndroidBuild.TARGET_SDK)) // Allows only the latest build tools for the target platform
319-
continue;
319+
if (!major.equals(AndroidBuild.TARGET_SDK)) {
320+
continue; // Allows only the latest build tools for the target platform
321+
}
322+
320323
urlHolder.buildToolsVersion = major + "." + minor + "." + micro;
321324

322325
NodeList archives = ((Element) childNodes).getElementsByTagName("archive");
@@ -354,8 +357,9 @@ private void getMainDownloadUrls(SDKUrlHolder urlHolder,
354357
NodeList childNodes = remotePackages.item(tool).getChildNodes();
355358

356359
NodeList channel = ((Element) childNodes).getElementsByTagName("channelRef");
357-
if(!channel.item(0).getAttributes().item(0).getNodeValue().equals("channel-0"))
358-
continue; // Stable channel only, skip others
360+
if (!channel.item(0).getAttributes().item(0).getNodeValue().equals("channel-0")) {
361+
continue; // Stable channel only, skip others
362+
}
359363

360364
NodeList archives = ((Element) childNodes).getElementsByTagName("archive");
361365
for (int i = 0; i < archives.getLength(); ++i) {
@@ -392,8 +396,9 @@ private void getMainDownloadUrls(SDKUrlHolder urlHolder,
392396
NodeList childNodes = remotePackages.item(i).getChildNodes();
393397

394398
NodeList channel = ((Element) childNodes).getElementsByTagName("channelRef");
395-
if(!channel.item(0).getAttributes().item(0).getNodeValue().equals("channel-0"))
399+
if (!channel.item(0).getAttributes().item(0).getNodeValue().equals("channel-0")) {
396400
continue; //Stable channel only, skip others
401+
}
397402

398403
NodeList archives = ((Element) childNodes).getElementsByTagName("archive");
399404

@@ -485,8 +490,9 @@ private void getHaxmDownloadUrl(SDKUrlHolder urlHolder,
485490
NodeList archive = archives.item(0).getChildNodes();
486491
NodeList os = ((Element) archive).getElementsByTagName("host-os");
487492

488-
if (!os.item(0).getTextContent().equals(requiredHostOs))
493+
if (!os.item(0).getTextContent().equals(requiredHostOs)) {
489494
continue;
495+
}
490496

491497
NodeList complete = ((Element) archive).getElementsByTagName("complete");
492498
NodeList url = ((Element) complete.item(0)).getElementsByTagName("url");
@@ -514,8 +520,9 @@ private void parseAndSet(SDKUrlHolder urlHolder, NodeList remotePackages, String
514520
switch (packageN) {
515521
case PLATFORM_TOOLS:
516522
NodeList os = ((Element) archive).getElementsByTagName("host-os");
517-
if (!os.item(0).getTextContent().equals(requiredHostOs))
523+
if (!os.item(0).getTextContent().equals(requiredHostOs)) {
518524
continue;
525+
}
519526
urlHolder.platformToolsFilename = url.item(0).getTextContent();
520527
urlHolder.platformToolsUrl = REPOSITORY_URL + urlHolder.platformToolsFilename;
521528
urlHolder.totalSize += Integer.parseInt(size.item(0).getTextContent());

0 commit comments

Comments
 (0)