use of android.widget.TableLayout in project mounts2sd by SpazeDog.
the class FragmentTabLog method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
ViewGroup view = (ViewGroup) inflater.inflate(R.layout.fragment_tab_log, container, false);
TableLayout table = (TableLayout) view.findViewById(R.id.log_table);
if (oLogEntry == null) {
RootFW rootfw = Root.initiate();
FileData data = rootfw.file(getResources().getString(R.string.config_dir_tmp) + "/log.txt").read();
if (data == null) {
data = rootfw.file("/data/m2sd.fallback.log").read();
if (data != null) {
oLogEntry = data.getArray();
}
} else {
oLogEntry = data.getArray();
}
if (oLogEntry == null || oLogEntry.length == 0) {
oLogEntry = new String[] { "I/" + getResources().getString(R.string.log_empty) };
}
Root.release();
}
Boolean bool = false;
Integer color1 = getResources().getColor(resolveAttr(R.attr.colorRef_logItemBackgroundFirst));
Integer color2 = getResources().getColor(resolveAttr(R.attr.colorRef_logItemBackgroundSecond));
for (int i = 0; i < oLogEntry.length; i++) {
TableRow row = (TableRow) inflater.inflate(R.layout.inflate_log_item, table, false);
String[] parts = oLogEntry[i].split("/", 2);
((TextView) row.getChildAt(0)).setText(parts.length > 1 ? parts[0] : "?");
((TextView) row.getChildAt(1)).setText(parts.length > 1 ? parts[1] : parts[0]);
if ((bool = !bool)) {
row.setBackgroundColor(color1);
} else {
row.setBackgroundColor(color2);
}
table.addView(row);
}
return (View) view;
}
use of android.widget.TableLayout in project android_frameworks_base by ParanoidAndroid.
the class AddColumn method onCreate.
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.add_column_in_table);
final Button addRowButton = (Button) findViewById(R.id.add_row_button);
addRowButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
final TableLayout table = (TableLayout) findViewById(R.id.table);
final TableRow newRow = new TableRow(AddColumn.this);
for (int i = 0; i < 4; i++) {
final TextView view = new TextView(AddColumn.this);
view.setText("Column " + (i + 1));
view.setPadding(3, 3, 3, 3);
newRow.addView(view, new TableRow.LayoutParams());
}
table.addView(newRow, new TableLayout.LayoutParams());
newRow.requestLayout();
}
});
}
use of android.widget.TableLayout in project android_frameworks_base by ResurrectionRemix.
the class AddColumn method onCreate.
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.add_column_in_table);
final Button addRowButton = (Button) findViewById(R.id.add_row_button);
addRowButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
final TableLayout table = (TableLayout) findViewById(R.id.table);
final TableRow newRow = new TableRow(AddColumn.this);
for (int i = 0; i < 4; i++) {
final TextView view = new TextView(AddColumn.this);
view.setText("Column " + (i + 1));
view.setPadding(3, 3, 3, 3);
newRow.addView(view, new TableRow.LayoutParams());
}
table.addView(newRow, new TableLayout.LayoutParams());
newRow.requestLayout();
}
});
}
use of android.widget.TableLayout in project android_frameworks_base by DirtyUnicorns.
the class AddColumn method onCreate.
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.add_column_in_table);
final Button addRowButton = (Button) findViewById(R.id.add_row_button);
addRowButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
final TableLayout table = (TableLayout) findViewById(R.id.table);
final TableRow newRow = new TableRow(AddColumn.this);
for (int i = 0; i < 4; i++) {
final TextView view = new TextView(AddColumn.this);
view.setText("Column " + (i + 1));
view.setPadding(3, 3, 3, 3);
newRow.addView(view, new TableRow.LayoutParams());
}
table.addView(newRow, new TableLayout.LayoutParams());
newRow.requestLayout();
}
});
}
use of android.widget.TableLayout in project platform_frameworks_base by android.
the class AddColumn method onCreate.
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.add_column_in_table);
final Button addRowButton = (Button) findViewById(R.id.add_row_button);
addRowButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
final TableLayout table = (TableLayout) findViewById(R.id.table);
final TableRow newRow = new TableRow(AddColumn.this);
for (int i = 0; i < 4; i++) {
final TextView view = new TextView(AddColumn.this);
view.setText("Column " + (i + 1));
view.setPadding(3, 3, 3, 3);
newRow.addView(view, new TableRow.LayoutParams());
}
table.addView(newRow, new TableLayout.LayoutParams());
newRow.requestLayout();
}
});
}
Aggregations