add a sample row to the table layout
This commit is contained in:
parent
78f68b7895
commit
024357ec48
4 changed files with 81 additions and 0 deletions
|
@ -23,4 +23,5 @@ dependencies {
|
|||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||
testCompile 'junit:junit:4.12'
|
||||
compile 'com.android.support:appcompat-v7:23.1.1'
|
||||
compile 'joda-time:joda-time:2.9.1'
|
||||
}
|
||||
|
|
|
@ -2,6 +2,9 @@ package calendar.simplemobiletools.com;
|
|||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.widget.TableLayout;
|
||||
import android.widget.TableRow;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
|
@ -9,5 +12,10 @@ public class MainActivity extends AppCompatActivity {
|
|||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
TableLayout tableHolder = (TableLayout) findViewById(R.id.table_holder);
|
||||
LayoutInflater inflater = getLayoutInflater();
|
||||
TableRow row = (TableRow) inflater.inflate(R.layout.table_row, tableHolder, false);
|
||||
tableHolder.addView(row);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,4 +6,11 @@
|
|||
android:layout_height="match_parent"
|
||||
tools:context="calendar.simplemobiletools.com.MainActivity">
|
||||
|
||||
<TableLayout
|
||||
android:id="@+id/table_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center">
|
||||
|
||||
</TableLayout>
|
||||
</RelativeLayout>
|
||||
|
|
65
app/src/main/res/layout/table_row.xml
Normal file
65
app/src/main/res/layout/table_row.xml
Normal file
|
@ -0,0 +1,65 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TableRow
|
||||
android:id="@+id/row"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/col1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="1"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/col2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="2"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/col3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="3"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/col4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="4"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/col5"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="5"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/col6"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="6"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/col7"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="7"/>
|
||||
|
||||
</TableRow>
|
Loading…
Reference in a new issue