Commit Graph

21 Commits

Author SHA1 Message Date
Sebastian Kaspari 21032950b7 Update copright line (2009-2012). 2012-01-21 23:12:55 +01:00
Sebastian Kaspari fbdebc2ca5 Add ActionBarSherlock to all activities. Restructure menu items. Fixes #96. 2012-01-21 23:07:44 +01:00
Sebastian Kaspari 25cf7eb2ad ConversationActivity: Add ViewPagerIndicator. 2012-01-21 11:30:41 +01:00
Sebastian Kaspari e04499070a Replace gallery view for conversations by ViewPager. Fixes #38. 2012-01-21 08:56:40 +01:00
Steven Luo 66006cabf5 Work around a crash on ICS when destroying a ConversationActivity
On Ice Cream Sandwich, something -- possibly even in the Android
framework classes (not in our code) -- is passing in null to a
MessageListAdapter's unregisterOnDataSetObserver(), which causes a
crash.

We should really find out whether this is something we can properly fix
or not, but in the meantime, wrap the superclass's method with our own
method which checks for null before calling through to the superclass
implementation.
2011-11-26 19:41:06 +01:00
Steven Luo c8266fbe62 Add method to remove conversation from DeckAdapter by position
This makes the following patch to remove old conversations much more
efficient.
2011-08-16 11:21:38 +02:00
Sebastian Kaspari 2350e9743a DeckAdapter: Remove unused imports 2011-06-08 23:16:49 +02:00
Steven Luo 91d211c51d Make the conversation history size a configurable preference 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
Sebastian Kaspari 1e5f016012 DeckAdapter: getView(): If no conversation is available (anymore) for the requested position, return an empty TextView. Fixes #56. 2011-04-15 20:39:33 +02:00
liato 1ebea8f7d6 Use integer division to calculate gallert item width. 2011-03-27 17:13:09 +02:00
liato b49ead73ad Fix width issues in gallery. 2011-03-27 17:10:54 +02:00
Sebastian Kaspari 95f3c4b255 Some more simple refactorings 2011-03-14 22:15:13 +01:00
Sebastian Kaspari 97c382c893 ServerListAdapter: Updated color codes 2011-02-11 12:54:48 +01:00
Sebastian Kaspari b3e26c626b ServerListAdapter: Change server label color in list depending on connect state 2011-02-08 23:58:04 +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 0fb2338f9c Code cleanup (Formatting) 2011-01-25 21:02:27 +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