Added border and padding

This commit is contained in:
Przemek Grondek 2014-07-30 15:20:18 +02:00
parent 26a9181a44
commit 197c4109ac
3 changed files with 27 additions and 0 deletions

View file

@ -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);

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!--<solid android:color="#0fff"/>-->
<stroke android:width="1dp" android:color="#000"/>
</shape>

View file

@ -5,4 +5,10 @@
<!-- Customize your theme here. -->
</style>
<style name="TableTheme">
<item name="android:layout_width">1dip</item>
<item name="android:layout_height">match_parent</item>
<item name="android:background">@android:color/white</item>
</style>
</resources>