When an activity sets FLAG_FULLSCREEN on its window, Android assumes
that the window size will always be the same as the screen size. This
causes the window to scroll instead of resizing when the soft keyboard
comes up, which (according to a quick Google search) isn't the behavior
most developers are expecting.
This patch implements an ugly workaround: extend the root element of the
layout (in our case, a LinearLayout) to hook into the onMeasure()
callback, which is called when the window size changes, so that we can
resize ourselves when the window size 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.
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.