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

Commit

Permalink
Formatted code in ZulipActivty.java
Browse files Browse the repository at this point in the history
  • Loading branch information
nitish1211 committed Feb 28, 2017
1 parent c1f2ca2 commit 0f79f03
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions app/src/main/java/com/zulip/android/activities/ZulipActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@
import com.zulip.android.networking.response.UploadResponse;
import com.zulip.android.util.ActivityTransitionAnim;
import com.zulip.android.util.AnimationHelper;
import com.zulip.android.util.Constants;
import com.zulip.android.util.CommonProgressDialog;
import com.zulip.android.util.Constants;
import com.zulip.android.util.FilePathHelper;
import com.zulip.android.util.MutedTopics;
import com.zulip.android.util.RemoveViewsOnScroll;
Expand Down Expand Up @@ -209,7 +209,7 @@ public void onReceive(Context contenxt, Intent intent) {
private EditText etSearchStream;
private ImageView ivSearchStreamCancel;
private ListView peopleDrawer;
private Toast toast;
private Toast toast;
//
private String streamSearchFilterKeyword = "";
private SimpleCursorAdapter.ViewBinder peopleBinder = new SimpleCursorAdapter.ViewBinder() {
Expand Down Expand Up @@ -1112,7 +1112,7 @@ public void onClick(View view) {
*/
private void showSoftKeyboard() {
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT,InputMethodManager.HIDE_IMPLICIT_ONLY);
imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, InputMethodManager.HIDE_IMPLICIT_ONLY);
}

private void displayChatBox(boolean show) {
Expand Down Expand Up @@ -1700,7 +1700,7 @@ public void onBackPressed() {
drawerLayout.closeDrawers();
return;
}
//check for narrowed or not
//check for narrowed or not
if (narrowedList == null) {

if (backPressedOnce) {
Expand Down Expand Up @@ -1755,7 +1755,8 @@ private void dismissToast() {

/**
* If previous toast is showing cancel it and show new one
* @param string message in the toast
*
* @param string message in the toast
* @param duration of the toast to be shown
*/
private void showToast(String string, int duration) {
Expand Down Expand Up @@ -1821,7 +1822,7 @@ private void narrowPMWith(final Person person) {
if (!person.getEmail().equals(app.getYou().getEmail()))
list.add(app.getYou());
doNarrow(new NarrowFilterPM(list));
onNarrowFillSendBoxPrivate(new Person[]{person},false);
onNarrowFillSendBoxPrivate(new Person[]{person}, false);
}

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
Expand Down Expand Up @@ -1861,7 +1862,8 @@ public void doNarrow(NarrowFilter filter) {
/**
* This method creates a new Instance of the MessageListFragment and displays it with the filter
* whiling keeping the view anchored at {@param messageId}.
* @param filter NarrowFilter passed
*
* @param filter NarrowFilter passed
* @param messageId used as anchor for fetching messages
*/
public void doNarrow(NarrowFilter filter, int messageId) {
Expand Down Expand Up @@ -2150,7 +2152,7 @@ private void setNightMode(@AppCompatDelegate.NightMode int nightMode) {
private void logout() {
commonProgressDialog.showWithMessage(getString(R.string.logging_out));
this.logged_in = false;
final String serverUrl = app.getServerHostUri() ;
final String serverUrl = app.getServerHostUri();

notifications.logOut(new Runnable() {
public void run() {
Expand Down Expand Up @@ -2296,6 +2298,7 @@ private void setupSnackBar() {
NarrowFilter narrowFilter;
String prevId = null;
int prevMessageSameCount = -1;

private void showSnackbarNotification(Message[] messages) {
MutedTopics mutedTopics = MutedTopics.get();
String notificationMessage;
Expand Down Expand Up @@ -2337,7 +2340,7 @@ public void onClick(View view) {
});
} else {
if (messages.length == 1) tempMessage = messages[0];
String name = (tempMessage.getType() == MessageType.PRIVATE_MESSAGE) ? getString(R.string.notify_private, tempMessage.getSenderFullName()) : getString(R.string.notify_stream, tempMessage.getStream().getName() , tempMessage.getSubject());
String name = (tempMessage.getType() == MessageType.PRIVATE_MESSAGE) ? getString(R.string.notify_private, tempMessage.getSenderFullName()) : getString(R.string.notify_stream, tempMessage.getStream().getName(), tempMessage.getSubject());
if (prevMessageSameCount > 0) name += " (" + prevMessageSameCount + ")";
notificationMessage = getResources().getQuantityString(R.plurals.new_message, nonMutedMessagesCount, nonMutedMessagesCount, name);
narrowFilter = (tempMessage.getType() == MessageType.PRIVATE_MESSAGE) ? new NarrowFilterPM(Arrays.asList(tempMessage.getRecipients(app))) : new NarrowFilterStream(tempMessage.getStream(), tempMessage.getSubject());
Expand Down Expand Up @@ -2369,6 +2372,7 @@ public MessageListFragment getCurrentMessageList() {
return narrowedList;
}
}

/**
* This function shows the snackbar stating the connectivity status of the device and also changes the behaviour of the
* fab.
Expand All @@ -2391,7 +2395,7 @@ public void handleMessage(android.os.Message msg) {
displayChatBox(false);
displayFAB(true);
//Displays old offline messages
if(narrowedList==null)
if (narrowedList == null)
onReadyToDisplay(true);
networkStatus = Constants.STATUS_NOT_CONNECTED;
Snackbar.make(coordinatorLayout, R.string.no_connection, Snackbar.LENGTH_INDEFINITE).show();
Expand Down

0 comments on commit 0f79f03

Please sign in to comment.