1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2024-08-13 16:53:50 -04:00
Commit Graph

21 Commits

Author SHA1 Message Date
Steven Luo
06e0849c17 Bugfix notification system
* If there's a new message notification, keep showing the "New messages
   in" content text, even after a disconnect notification.
 * Handle the case of a channel/query name duplicated between two or more
   connections more gracefully in new message notifications
 * Fix a race in updating notifications
2011-06-08 23:11:28 +02:00
Steven Luo
35609e5529 IME behavior changes for the ConversationActivity
(1) Let full-screen IMEs wrap the text into multiple lines instead of
making the text scroll off the screen.

(2) Provide a preference to let the user choose whether or not to enable
autocorrection of typed text.

(3) Provide a preference to let the user choose whether or not to enable
autocapitalization of sentences.  Note that even when this is enabled,
autocapitalization will only happen if the option is also enabled in the
IME.

(4) In landscape mode only, don't replace the Enter key with a Send
button, to make it harder to accidentally send a message.  (We can't do
this in portrait, because we would be left without any send button at
all -- perhaps the input line should be changed to be similar to the
text message application, which has a send button next to the input
line?)
2011-06-08 23:11:28 +02:00
Steven Luo
aa355c4283 Rewrite onKey handling for the ConversationActivity input line
The current method of supplying an onKey handler for the input line
(having the activity implement OnKeyListener) is somewhat unusual -- the
documentation recommends creating an anonymous inner class to pass to
setOnKeyListener().  Do this, while refactoring the code to make it
somewhat more readable and removing some instances of code duplication.
2011-06-08 23:11:28 +02:00
Steven Luo
91d211c51d Make the conversation history size a configurable preference 2011-06-08 23:11:28 +02:00
Steven Luo
61960c9add Overhaul notifications system
Features:
* Now displays the number of mentions that the user has not seen in the
  notification.
* When no mentions are outstanding, display which servers the user is
  connected to, not the last message.
* When more than one mention is outstanding, display the names of the
  conversations with new mentions, not just the last message received.
* Notifications of mentions are suppressed if you're in the conversation
  at the time of the mention.
* Notifications of mentions automatically clear when you bring up the
  conversation.
* Vibrate notifications now generate the user's chosen default vibrate
  pattern, not a hard-coded one.
* Add ticker text to the notification that's displayed when the IRCService
  goes into the foreground, instead of displaying a blank ticker.

To allow for all of this, the implementation moves most of the details
of generating the notification text into the IRCService, which now
exposes addNewMention() and notifyConnected()/notifyDisconnected()
methods instead of the lower-level updateNotification().
2011-06-08 23:11:28 +02:00
Steven Luo
09fedc6975 Include channel topic in the displayed conversation title 2011-06-08 23:11:28 +02:00
Steven Luo
159cb8195d Remember switched conversations across screen orientation changes
As of now, the activity does not remember whether a conversation is
switched across configuration changes (such as screen rotations).  Fix
this by adding onSaveInstanceState() and onRestoreInstanceState()
callbacks in the activity to pass this information to the new instance.

To make the implementation of this simpler, all code to configure the
MessageListView, which was duplicated in several places in the codebase,
has been moved to the MessageListView's constructor.

While we're at it, make the padding setting independent of screen
density instead of specifying in fixed pixels (equivalent to specifying
the value in dp instead of px), and increase the padding for switched
views.  This ensures that message text isn't obscured by the gradient at
the edges of the ConversationGallery, which started happening when we
began caching MessageListViews in the DeckAdapter.
2011-06-08 23:11:28 +02:00
Steven Luo
ffe73b7c9f Hold MessageListAdapters and MessageListViews in DeckAdapter to avoid leaks
There are at least two significant memory leaks in Yaaic, which cause
the client to force close after a few hours with an
OutOfMemoryException:

(1) The IRCService holds Conversation objects, which contain a
MessageListAdapter, which have references to the ConversationActivity
context.  This causes Activity contexts to outlast the Activity, causing
a significant memory leak over time.

Fix this by holding the MessageListAdapter in the ConversationActivity's
DeckAdapter instead of in the Conversation objects.  The DeckAdapter's
lifecycle matches that of the Activity, so this prevents the leak.

(2) Every call to DeckAdapter.getView()/renderConversation() creates a
new MessageListView and adds it to the deck.  But adding the view to
the deck causes the deck to take a reference to the view, leaking the
MessageListView until the Activity is finished.  (This has the effect of
exacerbating the first leak, since the Activity context holds a
reference to the deck.)

Fix this leak by caching MessageListViews in the DeckAdapter, and
returning an existing MessageListView for a Conversation in getView() if
one already exists.
2011-06-08 23:11:28 +02:00
Steven Luo
f1b57c9e25 Don't scroll to a conversation in onCreate() unless it was previously selected
This has two advantages:
(1) The activity remembers which conversation was last selected if it's
    destroyed (e.g. via the Back button) and then recreated with the connection
    still running.
(2) It prevents onCreate() from clearing all the mentioned notifications for
    the conversations in that activity.
2011-06-08 23:11:27 +02:00
Sebastian Kaspari
4e266e1bb7 ConversationActivity: onCreate(): Check if server is returned by getServerById() - Fixes #55 2011-04-12 23:44:39 +02:00
Sebastian Kaspari
9387a02068 ConversationActivity: onStatusUpdate(): Check if service is already connected and initialized - Fixes #54 2011-04-12 23:37:11 +02:00
liato
624f8c5014 Add support for mIRC colors. 2011-03-27 19:40:26 +02:00
liato
1f9c8efcca Fix nullpointerexception. 2011-03-27 17:16:38 +02:00
Sebastian Kaspari
7563437343 Server: Fix typo in addConversation() 2011-03-15 23:59:49 +01:00
Sebastian Kaspari
95f3c4b255 Some more simple refactorings 2011-03-14 22:15:13 +01:00
Thomas Martitz
f4637ac582 Use a different color for join/part/quit for the circles in the ConversationSwitcher view.
This makes it easier to ignore unintersting messages wihout turning off the setting to show joins/parts/quits.
Once circle is colored for a new message, the join/part/quit cannot override it anymore.
2011-03-06 11:11:17 +01:00
Sebastian Kaspari
669113610a New user action view and new actions: reply, query 2011-02-05 16:04:36 +01:00
Sebastian Kaspari
d8b1a0218f Added 2011 to licence header 2011-02-05 13:00:12 +01:00
Sebastian Kaspari
7c63155cfb Fix voice recognition: Only add top match to the text input (and code cleanup) 2011-01-15 23:17:24 +01:00
Sebastian Kaspari
02b7ec1741 Replace all tabs with four spaces! 2010-11-18 18:52:19 +01:00
Sebastian Kaspari
1250c10d9c Merged application and test project into one repository 2010-11-07 08:35:45 +01:00