From 55492dd4485c15c003adbcd26eeb387185f5f1dc Mon Sep 17 00:00:00 2001
From: akwizgran <akwizgran@users.sourceforge.net>
Date: Mon, 10 Feb 2014 11:23:30 +0000
Subject: [PATCH] Pad the top and bottom of the list

---
 .../android/contact/ConversationActivity.java        | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/briar-android/src/org/briarproject/android/contact/ConversationActivity.java b/briar-android/src/org/briarproject/android/contact/ConversationActivity.java
index 189d88d44f..213d115484 100644
--- a/briar-android/src/org/briarproject/android/contact/ConversationActivity.java
+++ b/briar-android/src/org/briarproject/android/contact/ConversationActivity.java
@@ -122,9 +122,19 @@ implements EventListener, OnClickListener, OnItemClickListener {
 		layout.setOrientation(VERTICAL);
 
 		adapter = new ConversationAdapter(this);
-		list = new ListView(this);
+		list = new ListView(this) {
+			@Override
+			public void onSizeChanged(int w, int h, int oldw, int oldh) {
+				// Scroll to the bottom when the keyboard is shown
+				super.onSizeChanged(w, h, oldw, oldh);
+				setSelection(getCount() - 1);
+			}
+		};
 		// Give me all the width and all the unused height
 		list.setLayoutParams(MATCH_WRAP_1);
+		int pad = LayoutUtils.getPadding(this);
+		list.setPadding(0, pad, 0, pad);
+		list.setClipToPadding(false);
 		// Make the dividers the same colour as the background
 		Resources res = getResources();
 		int background = res.getColor(R.color.conversation_background);
-- 
GitLab