Whitespace-only code formatting changes.

This commit is contained in:
akwizgran
2015-11-30 09:38:25 +00:00
parent 1950c13ffb
commit 027ae8340f
202 changed files with 2993 additions and 2993 deletions

View File

@@ -113,7 +113,7 @@ implements OnEditorActionListener, OnClickListener {
}
private void enableOrDisableCreateButton() {
if(progress == null) return; // Not created yet
if (progress == null) return; // Not created yet
createIdentityButton.setEnabled(validateNickname());
}
@@ -125,7 +125,7 @@ implements OnEditorActionListener, OnClickListener {
private boolean validateNickname() {
String nickname = nicknameEntry.getText().toString();
int length = StringUtils.toUtf8(nickname).length;
if(length > MAX_AUTHOR_NAME_LENGTH) {
if (length > MAX_AUTHOR_NAME_LENGTH) {
feedback.setText(R.string.name_too_long);
return false;
}
@@ -135,7 +135,7 @@ implements OnEditorActionListener, OnClickListener {
public void onClick(View view) {
hideSoftKeyboard();
if(!validateNickname()) return;
if (!validateNickname()) return;
// Replace the button with a progress bar
createIdentityButton.setVisibility(GONE);
progress.setVisibility(VISIBLE);
@@ -160,10 +160,10 @@ implements OnEditorActionListener, OnClickListener {
long now = System.currentTimeMillis();
db.addLocalAuthor(a);
long duration = System.currentTimeMillis() - now;
if(LOG.isLoggable(INFO))
if (LOG.isLoggable(INFO))
LOG.info("Storing author took " + duration + " ms");
} catch(DbException e) {
if(LOG.isLoggable(WARNING))
} catch (DbException e) {
if (LOG.isLoggable(WARNING))
LOG.log(WARNING, e.toString(), e);
}
setResultAndFinish(a);

View File

@@ -11,18 +11,18 @@ public class LocalAuthorItemComparator implements Comparator<LocalAuthorItem> {
new LocalAuthorItemComparator();
public int compare(LocalAuthorItem a, LocalAuthorItem b) {
if(a == b) return 0;
if (a == b) return 0;
// NEW comes after everything else
if(a == NEW) return 1;
if(b == NEW) return -1;
if (a == NEW) return 1;
if (b == NEW) return -1;
// ANONYMOUS comes after everything else except NEW
if(a == ANONYMOUS) return 1;
if(b == ANONYMOUS) return -1;
if (a == ANONYMOUS) return 1;
if (b == ANONYMOUS) return -1;
// Sort items in order of creation, so the oldest item is the default
long aCreated = a.getLocalAuthor().getTimeCreated();
long bCreated = b.getLocalAuthor().getTimeCreated();
if(aCreated < bCreated) return -1;
if(aCreated > bCreated) return 1;
if (aCreated < bCreated) return -1;
if (aCreated > bCreated) return 1;
return 0;
}
}

View File

@@ -40,7 +40,7 @@ implements SpinnerAdapter {
}
public int getCount() {
if(list.isEmpty()) return 0;
if (list.isEmpty()) return 0;
return includeAnonymous ? list.size() + 2 : list.size() + 1;
}
@@ -54,19 +54,19 @@ implements SpinnerAdapter {
int pad = LayoutUtils.getPadding(ctx);
name.setPadding(pad, pad, pad, pad);
LocalAuthorItem item = getItem(position);
if(item == ANONYMOUS) name.setText(R.string.anonymous);
else if(item == NEW) name.setText(R.string.new_identity_item);
if (item == ANONYMOUS) name.setText(R.string.anonymous);
else if (item == NEW) name.setText(R.string.new_identity_item);
else name.setText(item.getLocalAuthor().getName());
return name;
}
public LocalAuthorItem getItem(int position) {
if(includeAnonymous) {
if(position == list.size()) return ANONYMOUS;
if(position == list.size() + 1) return NEW;
if (includeAnonymous) {
if (position == list.size()) return ANONYMOUS;
if (position == list.size() + 1) return NEW;
return list.get(position);
} else {
if(position == list.size()) return NEW;
if (position == list.size()) return NEW;
return list.get(position);
}
}
@@ -81,8 +81,8 @@ implements SpinnerAdapter {
name.setSingleLine();
name.setEllipsize(END);
LocalAuthorItem item = getItem(position);
if(item == ANONYMOUS) name.setText(R.string.anonymous);
else if(item == NEW) name.setText(R.string.new_identity_item);
if (item == ANONYMOUS) name.setText(R.string.anonymous);
else if (item == NEW) name.setText(R.string.new_identity_item);
else name.setText(item.getLocalAuthor().getName());
return name;
}