Search in sources :

Example 6 with HmsPickerBuilder

use of com.codetroopers.betterpickers.hmspicker.HmsPickerBuilder in project android-betterpickers by code-troopers.

the class SampleHmsNegativeDurationUsage 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().setPlusMinusVisibility(View.VISIBLE).setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment);
            hpb.show();
        }
    });
}
Also used : Button(android.widget.Button) HmsPickerBuilder(com.codetroopers.betterpickers.hmspicker.HmsPickerBuilder) TextView(android.widget.TextView) View(android.view.View)

Example 7 with HmsPickerBuilder

use of com.codetroopers.betterpickers.hmspicker.HmsPickerBuilder in project android-betterpickers by code-troopers.

the class SampleHmsFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.text_and_button, container, false);
    mResultTextView = (TextView) view.findViewById(R.id.text);
    Button button = (Button) view.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(getChildFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment).setTargetFragment(SampleHmsFragment.this);
            hpb.show();
        }
    });
    return view;
}
Also used : Button(android.widget.Button) HmsPickerBuilder(com.codetroopers.betterpickers.hmspicker.HmsPickerBuilder) TextView(android.widget.TextView) View(android.view.View)

Aggregations

View (android.view.View)7 Button (android.widget.Button)7 TextView (android.widget.TextView)7 HmsPickerBuilder (com.codetroopers.betterpickers.hmspicker.HmsPickerBuilder)7