Marlinski / Rumble

Rumble allows the sharing of messages and pictures without relying on the Internet, in a Delay Tolerant Fashion following the Store-Carry and Forward paradigm
http://disruptedsystems.org
GNU General Public License v3.0
298 stars 27 forks source link

Notifications on Chat Messages & Opening Images in Gallery #30

Closed PrasannaVenkadesh closed 8 years ago

PrasannaVenkadesh commented 8 years ago

5 Commits in this Pull Request:

Commit 1: When attached image file is displayed, people would like to Zoom in / Zoom out & Share on other platforms too. With DisplayImage.java only the image is displayed, but can't zoom in / zoom out or share. Instead of re-writing in DisplayImage.java we could just re-use the in-built gallery view.

Commit 2: Moved the vibration logic to be handled by Network Coordinator, so the device will vibrate on ChatMessageReceived even when the app is not in focus.

Commit 3: Display notifications when new chat messages are received.

Commit 4: Rectified incorrect comment statements made along with Commit 3.

Commit 5: Touching on Notification opens the Chat Tab instead of default Status Tab.

deavmi commented 8 years ago

This feature is so needed. :)

Marlinski commented 8 years ago

Thanks for your commit Prasanna, However I am not enterely satisfied with the NetworCoordinator keeping a state about the UserInterface, I think both logic should be kept enterely separated.

I would suggest that under reception of a ChatMessage, the NetworkCoordinator might send a "probe"-event like "ProbeChatFocus" that, if "catched" by the ChatFragment class would set an attribute of this event to true so something like that:

public void onEvent(ChatMessageReceived event) { ProbeChatFocus event = new ProbeChatFocus; EventBus.getDefault().post(event) if(event.hasAnybodyCatchedThisEvent()) { Vibrator vibrator = (Vibrator)
getApplicationContext().getSystemService(Context.VIBRATOR_SERVICE); vibrator.vibrate(300); } }

By doing so you don't have to "export" the state of ChatFragment through the use of two new event (UserEntered and UserLeft) but instead you request for it using an event.

Marlinski commented 8 years ago

There seem to be a problem with your indentation, your code appear shifted to the left in my android-studio IDE

Marlinski commented 8 years ago

I merged the first commit (Display Image in Gallery) but didn't merge the NetworkCoordinator yet for the reason above.

PrasannaVenkadesh commented 8 years ago

I am not enterely satisfied with the NetworCoordinator keeping a state about the UserInterface, I think both logic should be kept enterely separated.

I understand the reason for you concern and that's a good practice too, thanks for pointing it out. I will try to rewrite those.