diff --git a/app/src/main/java/info/nerull7/mysqlbrowser/EntriesFragment.java b/app/src/main/java/info/nerull7/mysqlbrowser/EntriesFragment.java index be84df5..e2e9fea 100644 --- a/app/src/main/java/info/nerull7/mysqlbrowser/EntriesFragment.java +++ b/app/src/main/java/info/nerull7/mysqlbrowser/EntriesFragment.java @@ -1,19 +1,96 @@ package info.nerull7.mysqlbrowser; +import android.app.ActionBar; import android.app.Fragment; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Typeface; import android.os.Bundle; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.RelativeLayout; +import android.widget.TableLayout; +import android.widget.TableRow; +import android.widget.TextView; + +import java.util.List; /** * Created by nerull7 on 15.07.14. */ public class EntriesFragment extends Fragment { + String databaseName; + String tableName; + TableLayout entriesTable; +// TableLayout headerTable; + RelativeLayout uselessParent; + @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_entries, container, false); + databaseName = getArguments().getString("DatabaseName"); + 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); + setupTable(); return rootView; } + + private void setupTable(){ + List fieldList = Static.databaseConnector.getFields(tableName); + + TableRow.LayoutParams layoutParams = new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT); + + // First we need header + final TableRow headerRow = new TableRow(getActivity()); + headerRow.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT)); + for(int i =0;i> rows = Static.databaseConnector.getRows(20); //TODO some normal number definition in header + for(int i=0;i<20;i++){ // The same arbitrary number FIXME + List elements = rows.get(i); + TableRow newRow = new TableRow(getActivity()); + for(int j=0;j + tools:context="info.nerull7.mysqlbrowser.EntriesFragment" + android:id="@+id/uselessParent"> - + + + + + + + + android:layout_height="wrap_content" + android:layout_alignParentStart="true" + android:layout_alignParentEnd="true"> + + +