Fix EntriesFragment warnings

This commit is contained in:
Przemek Grondek 2014-08-17 13:29:26 +02:00
parent 2c42713d2b
commit 3bc4da9297

View file

@ -28,6 +28,8 @@ import info.nerull7.mysqlbrowser.db.AsyncDatabaseConnector;
/** /**
* Created by nerull7 on 15.07.14. * Created by nerull7 on 15.07.14.
*
* Fragment for showing elements
*/ */
public class EntriesFragment extends Fragment implements AsyncDatabaseConnector.MatrixReturnListener, AsyncDatabaseConnector.ListReturnListener, AsyncDatabaseConnector.IntegerReturnListener, View.OnClickListener { public class EntriesFragment extends Fragment implements AsyncDatabaseConnector.MatrixReturnListener, AsyncDatabaseConnector.ListReturnListener, AsyncDatabaseConnector.IntegerReturnListener, View.OnClickListener {
private static final int HEADER_PADDING_TOP = 15; private static final int HEADER_PADDING_TOP = 15;
@ -42,10 +44,8 @@ public class EntriesFragment extends Fragment implements AsyncDatabaseConnector.
private TableLayout entriesTable; private TableLayout entriesTable;
private ScrollView entriesScrollView; private ScrollView entriesScrollView;
private FrameLayout headerFrame; private FrameLayout headerFrame;
private RelativeLayout rootView;
private HorizontalScrollView horizontalScrollView; private HorizontalScrollView horizontalScrollView;
private TableRow.LayoutParams layoutParams; private TableRow.LayoutParams layoutParams;
private TableRow headerRow;
private String databaseName; private String databaseName;
private String tableName; private String tableName;
@ -93,8 +93,6 @@ public class EntriesFragment extends Fragment implements AsyncDatabaseConnector.
dummyView = rootView.findViewById(R.id.dummyView); dummyView = rootView.findViewById(R.id.dummyView);
horizontalScrollView = (HorizontalScrollView) rootView.findViewById(R.id.horizontalScrollView); horizontalScrollView = (HorizontalScrollView) rootView.findViewById(R.id.horizontalScrollView);
this.rootView = (RelativeLayout) rootView;
fakeScrollView.setOnTouchEventListener(new CustomScrollView.OnTouchEventListener() { fakeScrollView.setOnTouchEventListener(new CustomScrollView.OnTouchEventListener() {
@Override @Override
public boolean onTouchEvent(MotionEvent ev) { public boolean onTouchEvent(MotionEvent ev) {
@ -225,12 +223,13 @@ public class EntriesFragment extends Fragment implements AsyncDatabaseConnector.
@Override @Override
public void onListReturn(List<String> fieldList) { public void onListReturn(List<String> fieldList) {
// First we need header // First we need header
TableRow headerRow;
headerRow = new TableRow(getActivity()); headerRow = new TableRow(getActivity());
headerRow.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT)); headerRow.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT));
rowCount = fieldList.size(); rowCount = fieldList.size();
for(int i =0;i<fieldList.size();i++){ for (String aFieldList : fieldList) {
TextView textView = new TextView(getActivity()); TextView textView = new TextView(getActivity());
textView.setText(fieldList.get(i)); textView.setText(aFieldList);
textView.setTypeface(null, Typeface.BOLD); textView.setTypeface(null, Typeface.BOLD);
textView.setLayoutParams(layoutParams); textView.setLayoutParams(layoutParams);
textView.setBackgroundResource(R.drawable.background_header); textView.setBackgroundResource(R.drawable.background_header);