From 197c4109ac8c7fed236c31c4195475f27ceb73ec Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Wed, 30 Jul 2014 15:20:18 +0200 Subject: [PATCH] Added border and padding --- .../info/nerull7/mysqlbrowser/EntriesFragment.java | 13 +++++++++++++ app/src/main/res/drawable/border_emelent.xml | 8 ++++++++ app/src/main/res/values/styles.xml | 6 ++++++ 3 files changed, 27 insertions(+) create mode 100644 app/src/main/res/drawable/border_emelent.xml diff --git a/app/src/main/java/info/nerull7/mysqlbrowser/EntriesFragment.java b/app/src/main/java/info/nerull7/mysqlbrowser/EntriesFragment.java index 9dedffc..ee3114a 100644 --- a/app/src/main/java/info/nerull7/mysqlbrowser/EntriesFragment.java +++ b/app/src/main/java/info/nerull7/mysqlbrowser/EntriesFragment.java @@ -27,6 +27,15 @@ import info.nerull7.mysqlbrowser.db.AsyncDatabaseConnector; * Created by nerull7 on 15.07.14. */ public class EntriesFragment extends Fragment implements AsyncDatabaseConnector.MatrixReturnListener, AsyncDatabaseConnector.ListReturnListener, AsyncDatabaseConnector.IntegerReturnListener { + private static final int HEADER_PADDING_TOP = 15; + private static final int HEADER_PADDING_BOTTOM = 15; + private static final int HEADER_PADDING_LEFT = 15; + private static final int HEADER_PADDING_RIGHT = 15; + private static final int ENTRIES_PADDING_TOP = 30; + private static final int ENTRIES_PADDING_BOTTOM = 30; + private static final int ENTRIES_PADDING_LEFT = 15; + private static final int ENTRIES_PADDING_RIGHT = 15; + private TableLayout entriesTable; private CustomScrollView entriesScrollView; private FrameLayout headerFrame; @@ -154,6 +163,8 @@ public class EntriesFragment extends Fragment implements AsyncDatabaseConnector. TextView textView = new TextView(getActivity()); textView.setText(elements.get(j)); textView.setLayoutParams(layoutParams); + textView.setPadding(ENTRIES_PADDING_LEFT, ENTRIES_PADDING_TOP, ENTRIES_PADDING_RIGHT, ENTRIES_PADDING_BOTTOM); + textView.setBackgroundResource(R.drawable.border_emelent); newRow.addView(textView); } entriesTable.addView(newRow); @@ -184,6 +195,8 @@ public class EntriesFragment extends Fragment implements AsyncDatabaseConnector. textView.setText(fieldList.get(i)); textView.setTypeface(null, Typeface.BOLD); textView.setLayoutParams(layoutParams); + textView.setBackgroundResource(R.drawable.border_emelent); + textView.setPadding(HEADER_PADDING_LEFT, HEADER_PADDING_TOP, HEADER_PADDING_RIGHT, HEADER_PADDING_BOTTOM); headerRow.addView(textView); } headerFrame.addView(headerRow); diff --git a/app/src/main/res/drawable/border_emelent.xml b/app/src/main/res/drawable/border_emelent.xml new file mode 100644 index 0000000..84f7380 --- /dev/null +++ b/app/src/main/res/drawable/border_emelent.xml @@ -0,0 +1,8 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index ff6c9d2..292e457 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -5,4 +5,10 @@ + +