Some moar fun with Table
This commit is contained in:
parent
fb550c183e
commit
836cfe964a
2 changed files with 19 additions and 10 deletions
app/src/main
|
@ -10,7 +10,10 @@ import android.util.Log;
|
|||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.TableLayout;
|
||||
import android.widget.TableRow;
|
||||
import android.widget.TextView;
|
||||
|
@ -25,7 +28,8 @@ public class EntriesFragment extends Fragment {
|
|||
String tableName;
|
||||
TableLayout entriesTable;
|
||||
// TableLayout headerTable;
|
||||
RelativeLayout uselessParent;
|
||||
ScrollView entriesScrollView;
|
||||
FrameLayout headerFrame;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
|
@ -35,7 +39,8 @@ public class EntriesFragment extends Fragment {
|
|||
tableName = getArguments().getString("TableName");
|
||||
entriesTable = (TableLayout) rootView.findViewById(R.id.entriesTable);
|
||||
// headerTable = (TableLayout) rootView.findViewById(R.id.headerTable);
|
||||
uselessParent = (RelativeLayout) rootView.findViewById(R.id.uselessParent);
|
||||
entriesScrollView = (ScrollView) rootView.findViewById(R.id.entriesScrollView);
|
||||
headerFrame = (FrameLayout) rootView.findViewById(R.id.headerFrame);
|
||||
setupTable();
|
||||
return rootView;
|
||||
}
|
||||
|
@ -57,6 +62,7 @@ public class EntriesFragment extends Fragment {
|
|||
}
|
||||
// headerTable.addView(headerRow);
|
||||
entriesTable.addView(headerRow);
|
||||
headerRow.setVisibility(View.INVISIBLE);
|
||||
|
||||
View fakeHeaderView = new View(getActivity()){
|
||||
@Override
|
||||
|
@ -76,8 +82,7 @@ public class EntriesFragment extends Fragment {
|
|||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
}
|
||||
};
|
||||
fakeHeaderView.setBackgroundColor(getResources().getColor(android.R.color.background_light));
|
||||
uselessParent.addView(fakeHeaderView);
|
||||
headerFrame.addView(fakeHeaderView);
|
||||
|
||||
// Now we get Rows
|
||||
List<List<String>> rows = Static.databaseConnector.getRows(20); //TODO some normal number definition in header
|
||||
|
|
|
@ -6,8 +6,7 @@
|
|||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
tools:context="info.nerull7.mysqlbrowser.EntriesFragment"
|
||||
android:id="@+id/uselessParent">
|
||||
tools:context="info.nerull7.mysqlbrowser.EntriesFragment">
|
||||
|
||||
<!--<TableLayout-->
|
||||
<!--android:layout_width="fill_parent"-->
|
||||
|
@ -16,11 +15,16 @@
|
|||
<!--android:layout_alignParentStart="true"-->
|
||||
<!--android:layout_alignParentEnd="true"></TableLayout>-->
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="wrap_content"
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentEnd="true">
|
||||
android:id="@+id/headerFrame"></FrameLayout>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/entriesScrollView"
|
||||
android:layout_below="@+id/headerFrame">
|
||||
<TableLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue