Search in sources :

Example 11 with TableRow

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();
        }
    });
}
Also used : Button(android.widget.Button) TableRow(android.widget.TableRow) TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View) TableLayout(android.widget.TableLayout)

Example 12 with TableRow

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;
}
Also used : TableRow(android.widget.TableRow) TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View) MapView(org.osmdroid.views.MapView)

Example 13 with TableRow

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);
    }
}
Also used : TableRow(android.widget.TableRow) TextView(android.widget.TextView) TextView(android.widget.TextView) ImageView(android.widget.ImageView) PullScrollView(com.marshalchen.common.uimodule.huitanScrollView.PullScrollView) View(android.view.View)

Example 14 with 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();
        }
    });
}
Also used : ImageRadioButtonOption(org.eyeseetea.malariacare.views.option.ImageRadioButtonOption) ImageButton(android.widget.ImageButton) TableRow(android.widget.TableRow) IMultiQuestionView(org.eyeseetea.malariacare.views.question.IMultiQuestionView) Question(org.eyeseetea.malariacare.data.database.model.Question) QuestionOption(org.eyeseetea.malariacare.data.database.model.QuestionOption) ImageRadioButtonOption(org.eyeseetea.malariacare.views.option.ImageRadioButtonOption) Option(org.eyeseetea.malariacare.data.database.model.Option) AKeyboardQuestionView(org.eyeseetea.malariacare.views.question.AKeyboardQuestionView) ImageView(android.widget.ImageView) AOptionQuestionView(org.eyeseetea.malariacare.views.question.AOptionQuestionView) View(android.view.View) INavigationQuestionView(org.eyeseetea.malariacare.views.question.INavigationQuestionView) IQuestionView(org.eyeseetea.malariacare.views.question.IQuestionView) ImageRadioButtonSingleQuestionView(org.eyeseetea.malariacare.views.question.singlequestion.ImageRadioButtonSingleQuestionView) CustomTextView(org.eyeseetea.sdk.presentation.views.CustomTextView) ListView(android.widget.ListView) IMultiQuestionView(org.eyeseetea.malariacare.views.question.IMultiQuestionView) DynamicStockImageRadioButtonSingleQuestionView(org.eyeseetea.malariacare.views.question.singlequestion.DynamicStockImageRadioButtonSingleQuestionView) IImageQuestionView(org.eyeseetea.malariacare.views.question.IImageQuestionView) NumberRadioButtonMultiquestionView(org.eyeseetea.malariacare.views.question.multiquestion.NumberRadioButtonMultiquestionView) ScrollView(android.widget.ScrollView) LinearLayout(android.widget.LinearLayout) ImageRadioButtonSingleQuestionView(org.eyeseetea.malariacare.views.question.singlequestion.ImageRadioButtonSingleQuestionView) DynamicStockImageRadioButtonSingleQuestionView(org.eyeseetea.malariacare.views.question.singlequestion.DynamicStockImageRadioButtonSingleQuestionView)

Example 15 with TableRow

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);
}
Also used : ReviewFragmentStrategy(org.eyeseetea.malariacare.strategies.ReviewFragmentStrategy) TableRow(android.widget.TableRow) Value(org.eyeseetea.malariacare.data.database.model.Value)

Aggregations

TableRow (android.widget.TableRow)43 TextView (android.widget.TextView)25 View (android.view.View)21 TableLayout (android.widget.TableLayout)14 Button (android.widget.Button)8 ImageView (android.widget.ImageView)8 CPU (brunonova.drmips.simulator.CPU)7 MediumTest (android.test.suitebuilder.annotation.MediumTest)6 ViewGroup (android.view.ViewGroup)4 Question (org.eyeseetea.malariacare.data.database.model.Question)4 SuppressLint (android.annotation.SuppressLint)3 ListView (android.widget.ListView)3 ScrollView (android.widget.ScrollView)3 Option (org.eyeseetea.malariacare.data.database.model.Option)3 AOptionQuestionView (org.eyeseetea.malariacare.views.question.AOptionQuestionView)3 IImageQuestionView (org.eyeseetea.malariacare.views.question.IImageQuestionView)3 IMultiQuestionView (org.eyeseetea.malariacare.views.question.IMultiQuestionView)3 IQuestionView (org.eyeseetea.malariacare.views.question.IQuestionView)3 NumberRadioButtonMultiquestionView (org.eyeseetea.malariacare.views.question.multiquestion.NumberRadioButtonMultiquestionView)3 DynamicStockImageRadioButtonSingleQuestionView (org.eyeseetea.malariacare.views.question.singlequestion.DynamicStockImageRadioButtonSingleQuestionView)3