Search in sources :

Example 1 with AppCompatSeekBar

use of android.support.v7.widget.AppCompatSeekBar in project MaxLock by Maxr1998.

the class SeekBarPreference method initPreference.

private void initPreference(Context context, AttributeSet attrs) {
    setValuesFromXml(attrs);
    mSeekBar = new AppCompatSeekBar(context, attrs);
    mSeekBar.setPadding(0, 0, 0, 0);
    mSeekBar.setMax(mMaxValue - mMinValue);
    mSeekBar.setOnSeekBarChangeListener(this);
    setWidgetLayoutResource(R.layout.seek_bar_preference);
}
Also used : AppCompatSeekBar(android.support.v7.widget.AppCompatSeekBar)

Example 2 with AppCompatSeekBar

use of android.support.v7.widget.AppCompatSeekBar in project EssayJoke by qiyei2015.

the class SkinAppCompatViewInflater method createView.

public final View createView(View parent, final String name, @NonNull Context context, @NonNull AttributeSet attrs, boolean inheritContext, boolean readAndroidTheme, boolean readAppTheme) {
    final Context originalContext = context;
    // by using the parent's context
    if (inheritContext && parent != null) {
        context = parent.getContext();
    }
    if (readAndroidTheme || readAppTheme) {
        // We then apply the theme on the context, if specified
        context = themifyContext(context, attrs, readAndroidTheme, readAppTheme);
    }
    View view = null;
    // We need to 'inject' our tint aware Views in place of the standard framework versions
    switch(name) {
        case "TextView":
            view = new AppCompatTextView(context, attrs);
            break;
        case "ImageView":
            view = new AppCompatImageView(context, attrs);
            break;
        case "Button":
            view = new AppCompatButton(context, attrs);
            break;
        case "EditText":
            view = new AppCompatEditText(context, attrs);
            break;
        case "Spinner":
            view = new AppCompatSpinner(context, attrs);
            break;
        case "ImageButton":
            view = new AppCompatImageButton(context, attrs);
            break;
        case "CheckBox":
            view = new AppCompatCheckBox(context, attrs);
            break;
        case "RadioButton":
            view = new AppCompatRadioButton(context, attrs);
            break;
        case "CheckedTextView":
            view = new AppCompatCheckedTextView(context, attrs);
            break;
        case "AutoCompleteTextView":
            view = new AppCompatAutoCompleteTextView(context, attrs);
            break;
        case "MultiAutoCompleteTextView":
            view = new AppCompatMultiAutoCompleteTextView(context, attrs);
            break;
        case "RatingBar":
            view = new AppCompatRatingBar(context, attrs);
            break;
        case "SeekBar":
            view = new AppCompatSeekBar(context, attrs);
            break;
    }
    if (view == null) {
        // If the original context does not equal our themed context, then we need to manually
        // inflate it using the name so that android:theme takes effect.
        view = createViewFromTag(context, name, attrs);
    }
    if (view != null) {
        // If we have created a view, check it's android:onClick
        checkOnClickListener(view, attrs);
    }
    return view;
}
Also used : Context(android.content.Context) AppCompatSeekBar(android.support.v7.widget.AppCompatSeekBar) AppCompatRadioButton(android.support.v7.widget.AppCompatRadioButton) AppCompatRatingBar(android.support.v7.widget.AppCompatRatingBar) AppCompatTextView(android.support.v7.widget.AppCompatTextView) AppCompatImageButton(android.support.v7.widget.AppCompatImageButton) AppCompatCheckedTextView(android.support.v7.widget.AppCompatCheckedTextView) AppCompatAutoCompleteTextView(android.support.v7.widget.AppCompatAutoCompleteTextView) View(android.view.View) AppCompatImageView(android.support.v7.widget.AppCompatImageView) AppCompatMultiAutoCompleteTextView(android.support.v7.widget.AppCompatMultiAutoCompleteTextView) AppCompatTextView(android.support.v7.widget.AppCompatTextView) AppCompatImageView(android.support.v7.widget.AppCompatImageView) AppCompatSpinner(android.support.v7.widget.AppCompatSpinner) AppCompatButton(android.support.v7.widget.AppCompatButton) AppCompatCheckBox(android.support.v7.widget.AppCompatCheckBox) AppCompatEditText(android.support.v7.widget.AppCompatEditText) AppCompatCheckedTextView(android.support.v7.widget.AppCompatCheckedTextView) AppCompatMultiAutoCompleteTextView(android.support.v7.widget.AppCompatMultiAutoCompleteTextView) AppCompatAutoCompleteTextView(android.support.v7.widget.AppCompatAutoCompleteTextView)

Aggregations

AppCompatSeekBar (android.support.v7.widget.AppCompatSeekBar)2 Context (android.content.Context)1 AppCompatAutoCompleteTextView (android.support.v7.widget.AppCompatAutoCompleteTextView)1 AppCompatButton (android.support.v7.widget.AppCompatButton)1 AppCompatCheckBox (android.support.v7.widget.AppCompatCheckBox)1 AppCompatCheckedTextView (android.support.v7.widget.AppCompatCheckedTextView)1 AppCompatEditText (android.support.v7.widget.AppCompatEditText)1 AppCompatImageButton (android.support.v7.widget.AppCompatImageButton)1 AppCompatImageView (android.support.v7.widget.AppCompatImageView)1 AppCompatMultiAutoCompleteTextView (android.support.v7.widget.AppCompatMultiAutoCompleteTextView)1 AppCompatRadioButton (android.support.v7.widget.AppCompatRadioButton)1 AppCompatRatingBar (android.support.v7.widget.AppCompatRatingBar)1 AppCompatSpinner (android.support.v7.widget.AppCompatSpinner)1 AppCompatTextView (android.support.v7.widget.AppCompatTextView)1 View (android.view.View)1