Search in sources :

Example 6 with TextView

use of android.widget.TextView in project android-betterpickers by code-troopers.

the class RadialTimePickerDialogFragment method setCurrentItemShowing.

// Show either Hours or Minutes.
private void setCurrentItemShowing(int index, boolean animateCircle, boolean delayLabelAnimate, boolean announce) {
    mTimePicker.setCurrentItemShowing(index, animateCircle);
    TextView labelToAnimate;
    if (index == HOUR_INDEX) {
        int hours = mTimePicker.getHours();
        if (!mIs24HourMode) {
            hours = hours % 12;
        }
        mTimePicker.setContentDescription(mHourPickerDescription + ": " + hours);
        if (announce) {
            Utils.tryAccessibilityAnnounce(mTimePicker, mSelectHours);
        }
        labelToAnimate = mHourView;
    } else {
        int minutes = mTimePicker.getMinutes();
        mTimePicker.setContentDescription(mMinutePickerDescription + ": " + minutes);
        if (announce) {
            Utils.tryAccessibilityAnnounce(mTimePicker, mSelectMinutes);
        }
        labelToAnimate = mMinuteView;
    }
    int hourColor = (index == HOUR_INDEX) ? mSelectedColor : mUnselectedColor;
    int minuteColor = (index == MINUTE_INDEX) ? mSelectedColor : mUnselectedColor;
    mHourView.setTextColor(hourColor);
    mMinuteView.setTextColor(minuteColor);
    ObjectAnimator pulseAnimator = Utils.getPulseAnimator(labelToAnimate, 0.85f, 1.1f);
    if (delayLabelAnimate) {
        pulseAnimator.setStartDelay(PULSE_ANIMATOR_DELAY);
    }
    pulseAnimator.start();
}
Also used : ObjectAnimator(com.nineoldandroids.animation.ObjectAnimator) NumberPickerErrorTextView(com.codetroopers.betterpickers.numberpicker.NumberPickerErrorTextView) TextView(android.widget.TextView)

Example 7 with TextView

use of android.widget.TextView in project android-betterpickers by code-troopers.

the class SampleHmsThemeLight method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.text_and_button);
    mResultTextView = (TextView) findViewById(R.id.text);
    Button button = (Button) findViewById(R.id.button);
    mResultTextView.setText(R.string.no_value);
    button.setText(R.string.hms_picker_set);
    button.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            HmsPickerBuilder hpb = new HmsPickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment_Light);
            hpb.show();
        }
    });
}
Also used : Button(android.widget.Button) HmsPickerBuilder(com.codetroopers.betterpickers.hmspicker.HmsPickerBuilder) TextView(android.widget.TextView) View(android.view.View)

Example 8 with TextView

use of android.widget.TextView in project android-betterpickers by code-troopers.

the class SampleNumberBasicUsage method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.text_and_button);
    mResultTextView = (TextView) findViewById(R.id.text);
    Button button = (Button) findViewById(R.id.button);
    mResultTextView.setText(R.string.no_value);
    button.setText(R.string.number_picker_set);
    button.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            NumberPickerBuilder npb = new NumberPickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment);
            npb.show();
        }
    });
}
Also used : Button(android.widget.Button) TextView(android.widget.TextView) View(android.view.View) NumberPickerBuilder(com.codetroopers.betterpickers.numberpicker.NumberPickerBuilder)

Example 9 with TextView

use of android.widget.TextView in project android-betterpickers by code-troopers.

the class SampleNumberMaxValue method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.text_and_button);
    mResultTextView = (TextView) findViewById(R.id.text);
    Button button = (Button) findViewById(R.id.button);
    final BigDecimal maxNumberAllowed = new BigDecimal("1227");
    mResultTextView.setText(R.string.no_value);
    button.setText("Set Number below " + maxNumberAllowed);
    button.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            NumberPickerBuilder npb = new NumberPickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment).setMaxNumber(maxNumberAllowed);
            npb.show();
        }
    });
}
Also used : Button(android.widget.Button) TextView(android.widget.TextView) View(android.view.View) NumberPickerBuilder(com.codetroopers.betterpickers.numberpicker.NumberPickerBuilder) BigDecimal(java.math.BigDecimal)

Example 10 with TextView

use of android.widget.TextView in project android-betterpickers by code-troopers.

the class SampleNumberMinValue method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.text_and_button);
    mResultTextView = (TextView) findViewById(R.id.text);
    Button button = (Button) findViewById(R.id.button);
    final BigDecimal minNumberAllowed = new BigDecimal("1227");
    mResultTextView.setText(R.string.no_value);
    button.setText("Set Number above " + minNumberAllowed);
    button.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            NumberPickerBuilder npb = new NumberPickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment).setMinNumber(minNumberAllowed);
            npb.show();
        }
    });
}
Also used : Button(android.widget.Button) TextView(android.widget.TextView) View(android.view.View) NumberPickerBuilder(com.codetroopers.betterpickers.numberpicker.NumberPickerBuilder) BigDecimal(java.math.BigDecimal)

Aggregations

TextView (android.widget.TextView)4784 View (android.view.View)2545 ImageView (android.widget.ImageView)1082 Button (android.widget.Button)423 LinearLayout (android.widget.LinearLayout)417 LayoutInflater (android.view.LayoutInflater)401 ListView (android.widget.ListView)375 Intent (android.content.Intent)367 AdapterView (android.widget.AdapterView)356 ViewGroup (android.view.ViewGroup)314 OnClickListener (android.view.View.OnClickListener)291 Test (org.junit.Test)197 RecyclerView (android.support.v7.widget.RecyclerView)177 ScrollView (android.widget.ScrollView)157 Drawable (android.graphics.drawable.Drawable)152 DialogInterface (android.content.DialogInterface)145 Context (android.content.Context)144 EditText (android.widget.EditText)138 Bundle (android.os.Bundle)133 AlertDialog (android.app.AlertDialog)127