Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Commit a52305d

Browse files
kunall17niftynei
authored andcommitted
Reformat code
1 parent e1f4285 commit a52305d

File tree

13 files changed

+36
-25
lines changed

13 files changed

+36
-25
lines changed

app/src/main/java/com/zulip/android/ZulipApp.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public void onCreate() {
104104
afterLogin();
105105
}
106106

107-
mutedTopics = new HashSet<>(settings.getStringSet(MUTED_TOPIC_KEY, new HashSet<String>()));
107+
mutedTopics = new HashSet<>(settings.getStringSet(MUTED_TOPIC_KEY, new HashSet<String>()));
108108
// create unread message queue
109109
unreadMessageHandler = new Handler(new Handler.Callback() {
110110
@Override
@@ -147,14 +147,14 @@ private void setupEmoji() {
147147
final String emojis[] = getAssets().list("emoji");
148148
TransactionManager.callInTransaction(getDatabaseHelper()
149149
.getConnectionSource(),
150-
new Callable<Void>() {
151-
public Void call() throws Exception {
152-
for (String newEmoji : emojis) {
153-
dao.create(new Emoji(newEmoji));
150+
new Callable<Void>() {
151+
public Void call() throws Exception {
152+
for (String newEmoji : emojis) {
153+
dao.create(new Emoji(newEmoji));
154+
}
155+
return null;
154156
}
155-
return null;
156-
}
157-
});
157+
});
158158
} catch (SQLException | IOException e) {
159159
ZLog.logException(e);
160160
}
@@ -176,6 +176,7 @@ public void clearConnectionState() {
176176
public String getServerURI() {
177177
return settings.getString("server_url", DEFAULT_SERVER_URL);
178178
}
179+
179180
public String getApiKey() {
180181
return api_key;
181182
}
@@ -221,7 +222,7 @@ public void setServerURL(String serverURL) {
221222
}
222223

223224
public void useDefaultServerURL() {
224-
setServerURL(DEFAULT_SERVER_URL);
225+
setServerURL(DEFAULT_SERVER_URL);
225226
}
226227

227228
public void setLoggedInApiKey(String apiKey) {
@@ -335,6 +336,7 @@ public void markMessageAsRead(Message message) {
335336
unreadMessageHandler.sendEmptyMessageDelayed(0, 2000);
336337
}
337338
}
339+
338340
public void muteTopic(Message message) {
339341
mutedTopics.add(message.concatStreamAndTopic());
340342
SharedPreferences.Editor editor = settings.edit();

app/src/main/java/com/zulip/android/activities/LoginActivity.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
5050
private EditText serverIn;
5151

5252
private View mGoogleSignInButton;
53+
5354
@Override
5455
protected void onCreate(Bundle savedInstanceState) {
5556
super.onCreate(savedInstanceState);
@@ -378,6 +379,7 @@ public void onTaskFailure(String result) {
378379
break;
379380
}
380381
}
382+
381383
private boolean isInputValidForDevAuth() {
382384
boolean isValid = true;
383385

@@ -388,13 +390,14 @@ private boolean isInputValidForDevAuth() {
388390
String serverString = mServerEditText.getText().toString();
389391
if (!serverString.contains("://")) serverString = "https://" + serverString;
390392

391-
if (!Patterns.WEB_URL.matcher(serverString).matches()) {
392-
mServerEditText.setError(getString(R.string.invalid_domain));
393-
isValid = false;
394-
}
393+
if (!Patterns.WEB_URL.matcher(serverString).matches()) {
394+
mServerEditText.setError(getString(R.string.invalid_domain));
395+
isValid = false;
395396
}
397+
}
396398
return isValid;
397399
}
400+
398401
private boolean isInputValid() {
399402
boolean isValid = true;
400403

app/src/main/java/com/zulip/android/activities/MessageListFragment.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,13 @@ public class MessageListFragment extends Fragment implements MessageListener {
5757
*/
5858
public interface Listener {
5959
void onListResume(MessageListFragment f);
60+
6061
void addToList(Message message);
62+
6163
void muteTopic(Message message);
6264

6365
void recyclerViewScrolled();
66+
6467
void clearChatBox();
6568
}
6669

@@ -145,7 +148,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
145148
recyclerView = (RecyclerView) view.findViewById(R.id.recyclerView);
146149
linearLayoutManager = new LinearLayoutManager(getContext());
147150
recyclerView.setLayoutManager(linearLayoutManager);
148-
adapter = new RecyclerMessageAdapter(messageList, getActivity(), (filter==null));
151+
adapter = new RecyclerMessageAdapter(messageList, getActivity(), (filter == null));
149152
recyclerView.addItemDecoration(new HeaderSpaceItemDecoration(PIXEL_OFFSET_MESSAGE_HEADERS, getContext()));
150153
recyclerView.setAdapter(adapter);
151154
registerForContextMenu(recyclerView);

app/src/main/java/com/zulip/android/activities/RecyclerMessageAdapter.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ public boolean addMessage(Message message, int messageAndHeadersCount) {
222222
}
223223

224224

225-
226225
public void addNewMessage(Message message) {
227226
MessageHeaderParent item = null;
228227
for (int i = getItemCount(false) - 1; i > 1; i--) {

app/src/main/java/com/zulip/android/activities/ZulipActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,7 @@ private Cursor makePeopleCursor(CharSequence email) throws SQLException {
960960
DatabaseHelper.likeEscape(piece) + "%")
961961
.closeableIterator().getRawResults()).getRawCursor();
962962
}
963+
963964
private void switchToStream() {
964965
removeEditTextErrors();
965966
if (!isCurrentModeStream()) {
@@ -1125,8 +1126,7 @@ public void onNarrowFillSendBox(Message message, boolean openSoftKeyboard) {
11251126
topicActv.setText(message.getSubject());
11261127
if ("".equals(message.getSubject())) {
11271128
topicActv.requestFocus();
1128-
}
1129-
else messageEt.requestFocus();
1129+
} else messageEt.requestFocus();
11301130
}
11311131
if (openSoftKeyboard) {
11321132
((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)).toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);

app/src/main/java/com/zulip/android/models/Stream.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ public static Stream getFromJSON(ZulipApp app, JSONObject message)
169169
app.getDao(Stream.class).update(stream);
170170
return stream;
171171
}
172+
172173
public int getId() {
173174
return id;
174175
}

app/src/main/java/com/zulip/android/networking/AsyncGetEvents.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ public void run() {
247247
}
248248

249249

250-
251250
/**
252251
* Handles any event returned by the server that we care about.
253252
*/

app/src/main/java/com/zulip/android/networking/AsyncStatusUpdate.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ private JSONObject chooseLatestPresence(JSONObject person)
7878
latestPresence = presence;
7979
}
8080
} else if (status.equals(PresenceType.IDLE.toString())
81-
&& latestStatus.equals(PresenceType.IDLE.toString())
82-
&& latestPresence.getLong(TIMESTAMP) < timestamp) {
83-
latestPresence = presence;
81+
&& latestStatus.equals(PresenceType.IDLE.toString())
82+
&& latestPresence.getLong(TIMESTAMP) < timestamp) {
83+
latestPresence = presence;
8484
}
8585
}
8686
}

app/src/main/java/com/zulip/android/util/BuildHelper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
public class BuildHelper {
88

9-
private BuildHelper() {}
9+
private BuildHelper() {
10+
}
1011

1112
public static boolean shouldLogToCrashlytics() {
1213
return !isEmulator() && !BuildConfig.DEBUG;

app/src/main/java/com/zulip/android/util/MD5Util.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ public class MD5Util {
1212

1313
private static final String TAG = "MD5Util";
1414

15-
private MD5Util() {}
15+
private MD5Util() {
16+
}
1617

1718
private static String hex(byte[] array) {
1819
StringBuilder sb = new StringBuilder();

0 commit comments

Comments
 (0)