use of android.widget.TableRow 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.TableRow in project Android-IMSI-Catcher-Detector by CellularPrivacy.
the class CellTowerMarker method getInfoContents.
/**
* Defines the contents of the InfoWindow
*
* The info window could be more advanced, if possible, by using
* more available items as explained in the related issue here:
* https://github.com/CellularPrivacy/Android-IMSI-Catcher-Detector/issues/234
*
*/
public View getInfoContents(MarkerData data) {
TextView tv;
// Getting view from the layout file: marker_info_window.xml
View v = LayoutInflater.from(mContext).inflate(R.layout.marker_info_window, null);
if (v != null) {
if (data != null) {
// We would also like to show this in HEX: "CID: 65535 (0xFFFF)"
if (data.openCellID) {
TableRow tr = (TableRow) v.findViewById(R.id.open_cell_label);
tr.setVisibility(View.VISIBLE);
}
// CID
tv = (TextView) v.findViewById(R.id.cell_id);
tv.setText(data.cellID);
// LAC
tv = (TextView) v.findViewById(R.id.lac);
tv.setText(data.lac);
// LAT
tv = (TextView) v.findViewById(R.id.lat);
tv.setText(String.valueOf(data.lat));
// LON
tv = (TextView) v.findViewById(R.id.lng);
tv.setText(String.valueOf(data.lng));
// PSC
tv = (TextView) v.findViewById(R.id.psc);
tv.setText(data.getPSC());
// RAT
tv = (TextView) v.findViewById(R.id.rat);
tv.setText(data.getRAT());
// PC = <MNC> "-" <MCC>
tv = (TextView) v.findViewById(R.id.pc);
tv.setText(data.getPC());
// Samples
tv = (TextView) v.findViewById(R.id.samples);
tv.setText(data.getSamples());
}
}
// Returning the view containing InfoWindow contents
return v;
}
use of android.widget.TableRow in project UltimateAndroid by cymcsg.
the class PulldownViewActivity method showTable.
public void showTable() {
TableRow.LayoutParams layoutParams = new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT);
layoutParams.gravity = Gravity.CENTER;
layoutParams.leftMargin = 30;
layoutParams.bottomMargin = 10;
layoutParams.topMargin = 10;
for (int i = 0; i < 30; i++) {
TableRow tableRow = new TableRow(this);
TextView textView = new TextView(this);
textView.setText("Test pull down scroll view " + i);
textView.setTextSize(20);
textView.setPadding(15, 15, 15, 15);
tableRow.addView(textView, layoutParams);
if (i % 2 != 0) {
tableRow.setBackgroundColor(Color.LTGRAY);
} else {
tableRow.setBackgroundColor(Color.WHITE);
}
final int n = i;
tableRow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(PulldownViewActivity.this, "Click item " + n, Toast.LENGTH_SHORT).show();
}
});
mMainLayout.addView(tableRow);
}
}
use of android.widget.TableRow in project pictureapp by EyeSeeTea.
the class DynamicTabAdapter method initializeNavigationButtons.
private void initializeNavigationButtons(View navigationButtonsHolder) {
ImageButton button = (ImageButton) navigationButtonsHolder.findViewById(R.id.next_btn);
((LinearLayout) button.getParent()).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (isClicked) {
Log.d(TAG, "onClick ignored to avoid double click");
return;
}
Log.d(TAG, "onClicked");
isClicked = true;
boolean questionsWithError = false;
for (IMultiQuestionView multiquestionView : mMultiQuestionViews) {
if (multiquestionView.hasError()) {
questionsWithError = true;
break;
}
}
Log.d(TAG, "Questions with failed validation " + failedValidations);
if (failedValidations == 0 && !questionsWithError) {
TableRow currentRow = (TableRow) tableLayout.getChildAt(0);
if (!readOnly && currentRow != null && currentRow.getChildAt(0) instanceof ImageRadioButtonSingleQuestionView) {
navigationController.isMovingToForward = true;
ImageRadioButtonSingleQuestionView imageRadioButtonSingleQuestionView = (ImageRadioButtonSingleQuestionView) currentRow.getChildAt(0);
ImageRadioButtonOption selectedOptionView = imageRadioButtonSingleQuestionView.getSelectedOptionView();
if (selectedOptionView != null) {
final Question question = navigationController.getCurrentQuestion();
Option selectedOption = selectedOptionView.getOption();
Question counterQuestion = question.findCounterByOption(selectedOption);
if ((mReviewMode && isCounterValueEqualToMax(question, selectedOption))) {
saveOptionValue(selectedOptionView, selectedOptionView.getOption(), question, true);
} else if (counterQuestion != null) {
showConfirmCounter(selectedOptionView, selectedOptionView.getOption(), question, counterQuestion);
} else {
finishOrNext();
}
} else {
isClicked = false;
}
} else {
finishOrNext();
}
} else if (navigationController.getCurrentQuestion().hasCompulsoryNotAnswered() || Tab.isDynamicTreatmentTab(navigationController.getCurrentTab().getType())) {
UIMessagesStrategy.getInstance().showCompulsoryUnansweredToast();
isClicked = false;
return;
} else {
isClicked = false;
}
}
});
button = (ImageButton) navigationButtonsHolder.findViewById(R.id.back_btn);
//Save the numberpicker value in the DB, and continue to the next screen.
((LinearLayout) button.getParent()).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
previous();
}
});
}
use of android.widget.TableRow in project pictureapp by EyeSeeTea.
the class ReviewScreenAdapter method getView.
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
// Get the row layout
Value value = (Value) getItem(position);
TableRow rowView = (TableRow) this.lInflater.inflate(getRecordLayout(), parent, false);
ReviewFragmentStrategy reviewFragmentStrategy = new ReviewFragmentStrategy();
return reviewFragmentStrategy.createViewRow(rowView, value);
}
Aggregations