• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java BlankDrawable类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中com.rey.material.drawable.BlankDrawable的典型用法代码示例。如果您正苦于以下问题:Java BlankDrawable类的具体用法?Java BlankDrawable怎么用?Java BlankDrawable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

BlankDrawable类属于com.rey.material.drawable包,在下文中一共展示了BlankDrawable类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: init

点赞 3

import com.rey.material.drawable.BlankDrawable; //导入依赖的package包/类
private void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes){
    setWillNotDraw(false);
    mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mPaint.setStyle(Paint.Style.FILL);

    mAdapter = new YearAdapter();
    setAdapter(mAdapter);
    setScrollBarStyle(SCROLLBARS_OUTSIDE_OVERLAY);
    setSelector(BlankDrawable.getInstance());
    setDividerHeight(0);
    setCacheColorHint(Color.TRANSPARENT);
    setClipToPadding(false);

    mPadding = ThemeUtil.dpToPx(context, 4);

    mSelectionColor = ThemeUtil.colorPrimary(context, 0xFF000000);

    applyStyle(context, attrs, defStyleAttr, defStyleRes);
}
 

开发者ID:iamzhangdejian,
项目名称:material-master,
代码行数:20,
代码来源:YearPicker.java

示例2: initListView

点赞 2

import com.rey.material.drawable.BlankDrawable; //导入依赖的package包/类
private void initListView() {
    mListView = new InternalListView(getContext());
    mListView.setDividerHeight(0);
    mListView.setCacheColorHint(0x00000000);
    mListView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
    mListView.setClipToPadding(false);
    mListView.setSelector(BlankDrawable.getInstance());
    mListView.setPadding(0, 0, 0, mContentPadding - mActionPadding);
    mListView.setVerticalFadingEdgeEnabled(false);
    mListView.setOverScrollMode(ListView.OVER_SCROLL_NEVER);
    ViewCompat.setLayoutDirection(mListView, ViewCompat.LAYOUT_DIRECTION_INHERIT);

    mAdapter = new InternalAdapter();
    mListView.setAdapter(mAdapter);
}
 

开发者ID:XhinLiang,
项目名称:MDPreference,
代码行数:16,
代码来源:SimpleDialog.java

示例3: Dialog

点赞 2

import com.rey.material.drawable.BlankDrawable; //导入依赖的package包/类
public Dialog(Context context, int style) {
    super(context, style);

    //Override style to ensure not show window's title or background.
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setBackgroundDrawable(BlankDrawable.getInstance());
    WindowManager.LayoutParams layout = getWindow().getAttributes();
    layout.width = ViewGroup.LayoutParams.MATCH_PARENT;
    layout.height = ViewGroup.LayoutParams.MATCH_PARENT;
    layout.windowAnimations = R.style.DialogNoAnimation;
    getWindow().setAttributes(layout);

    init(context, style);
}
 

开发者ID:XhinLiang,
项目名称:MDPreference,
代码行数:15,
代码来源:Dialog.java

示例4: initListView

点赞 2

import com.rey.material.drawable.BlankDrawable; //导入依赖的package包/类
private void initListView(){
    mListView = new InternalListView(getContext());
    mListView.setDividerHeight(0);
    mListView.setCacheColorHint(0x00000000);
    mListView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
    mListView.setClipToPadding(false);
    mListView.setSelector(BlankDrawable.getInstance());
    mListView.setPadding(0, 0, 0, mContentPadding - mActionPadding);
    mListView.setVerticalFadingEdgeEnabled(false);
    mListView.setOverScrollMode(ListView.OVER_SCROLL_NEVER);
    ViewCompat.setLayoutDirection(mListView, View.LAYOUT_DIRECTION_INHERIT);

    mAdapter = new InternalAdapter();
    mListView.setAdapter(mAdapter);
}
 

开发者ID:iamzhangdejian,
项目名称:material-master,
代码行数:16,
代码来源:SimpleDialog.java

示例5: Dialog

点赞 2

import com.rey.material.drawable.BlankDrawable; //导入依赖的package包/类
public Dialog(Context context, int style) {
    super(context, style);

    //Override style to ensure not show window's title or background.
    //TODO: find a way to ensure windowIsFloating attribute is false.
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setBackgroundDrawable(BlankDrawable.getInstance());
    WindowManager.LayoutParams layout = getWindow().getAttributes();
    layout.width = ViewGroup.LayoutParams.MATCH_PARENT;
    layout.height = ViewGroup.LayoutParams.MATCH_PARENT;
    layout.windowAnimations = R.style.DialogNoAnimation;
    getWindow().setAttributes(layout);

    init(context, style);
}
 

开发者ID:iamzhangdejian,
项目名称:material-master,
代码行数:16,
代码来源:Dialog.java

示例6: BottomSheetDialog

点赞 2

import com.rey.material.drawable.BlankDrawable; //导入依赖的package包/类
public BottomSheetDialog(Context context, int style) {
    super(context, style);

    //Override style to ensure not show window's title or background.
    //TODO: find a way to ensure windowIsFloating attribute is false.
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setBackgroundDrawable(BlankDrawable.getInstance());
    WindowManager.LayoutParams layout = getWindow().getAttributes();
    layout.width = ViewGroup.LayoutParams.MATCH_PARENT;
    layout.height = ViewGroup.LayoutParams.MATCH_PARENT;
    layout.windowAnimations = R.style.DialogNoAnimation;
    getWindow().setAttributes(layout);

    init(context, style);
}
 

开发者ID:iamzhangdejian,
项目名称:material-master,
代码行数:16,
代码来源:BottomSheetDialog.java

示例7: init

点赞 2

import com.rey.material.drawable.BlankDrawable; //导入依赖的package包/类
private void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes){
    setWillNotDraw(false);
    setSelector(BlankDrawable.getInstance());
    setCacheColorHint(0);
    setDivider(null);
    setItemsCanFocus(true);
    setFastScrollEnabled(false);
    setVerticalScrollBarEnabled(false);
    setOnScrollListener(this);
    setFadingEdgeLength(0);
    setFrictionIfSupported(ViewConfiguration.getScrollFriction() * mFriction);

    mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mPaint.setStyle(Paint.Style.FILL);
    mPaint.setTextAlign(Paint.Align.CENTER);

    mDayPadding = ThemeUtil.dpToPx(context, 4);

    mSelectionColor = ThemeUtil.colorPrimary(context, 0xFF000000);

    mCalendar = Calendar.getInstance();
    mFirstDayOfWeek = mCalendar.getFirstDayOfWeek();

    int index = mCalendar.get(Calendar.DAY_OF_WEEK) - 1;
    DateFormat format = new SimpleDateFormat(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 ? "EEEEE" : "E");
    for(int i = 0; i < 7; i++){
        mLabels[index] = format.format(mCalendar.getTime());
        index = (index + 1) % 7;
        mCalendar.add(Calendar.DAY_OF_MONTH, 1);
    }

    mAdapter = new MonthAdapter();
    setAdapter(mAdapter);

    applyStyle(context, attrs, defStyleAttr, defStyleRes);
}
 

开发者ID:iamzhangdejian,
项目名称:material-master,
代码行数:37,
代码来源:DatePicker.java

示例8: init

点赞 2

import com.rey.material.drawable.BlankDrawable; //导入依赖的package包/类
private void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes){
    setWillNotDraw(false);

    mRippleManager.onCreate(this, context, attrs, defStyleAttr, defStyleRes);

    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ContactView, defStyleAttr, defStyleRes);

    mAvatarSize = a.getDimensionPixelSize(R.styleable.ContactView_cv_avatarSize, ThemeUtil.dpToPx(context, 40));
    mSpacing = a.getDimensionPixelOffset(R.styleable.ContactView_cv_spacing, ThemeUtil.dpToPx(context, 8));
    mMinHeight = a.getDimensionPixelOffset(R.styleable.ContactView_android_minHeight, 0);
    int avatarSrc = a.getResourceId(R.styleable.ContactView_cv_avatarSrc, 0);

    mNameView = new TextView(context);
    mNameView.setGravity(GravityCompat.START);
    mNameView.setSingleLine(true);
    mNameView.setEllipsize(TextUtils.TruncateAt.END);
    int nameTextSize = a.getDimensionPixelSize(R.styleable.ContactView_cv_nameTextSize, 0);
    ColorStateList nameTextColor = a.getColorStateList(R.styleable.ContactView_cv_nameTextColor);
    int nameTextAppearance = a.getResourceId(R.styleable.ContactView_cv_nameTextAppearance, 0);
    if(nameTextAppearance > 0)
        mNameView.setTextAppearance(context, nameTextAppearance);
    if(nameTextSize > 0)
        mNameView.setTextSize(TypedValue.COMPLEX_UNIT_PX, nameTextSize);
    if(nameTextColor != null)
        mNameView.setTextColor(nameTextColor);
    setNameText(a.getString(R.styleable.ContactView_cv_name));

    mAddressView = new TextView(context);
    mAddressView.setGravity(GravityCompat.START);
    mAddressView.setSingleLine(true);
    mAddressView.setEllipsize(TextUtils.TruncateAt.END);
    int addressTextSize = a.getDimensionPixelSize(R.styleable.ContactView_cv_addressTextSize, 0);
    ColorStateList addressTextColor = a.getColorStateList(R.styleable.ContactView_cv_addressTextColor);
    int addressTextAppearance = a.getResourceId(R.styleable.ContactView_cv_addressTextAppearance, 0);
    if(addressTextAppearance > 0)
        mAddressView.setTextAppearance(context, addressTextAppearance);
    if(addressTextSize > 0)
        mAddressView.setTextSize(TypedValue.COMPLEX_UNIT_PX, addressTextSize);
    if(addressTextColor != null)
        mAddressView.setTextColor(addressTextColor);
    setAddressText(a.getString(R.styleable.ContactView_cv_address));

    mButtonSize = a.getDimensionPixelOffset(R.styleable.ContactView_cv_buttonSize, 0);

    if(mButtonSize > 0){
        mButton = new ImageButton(context);
        int resId = a.getResourceId(R.styleable.ContactView_cv_buttonSrc, 0);
        if(resId != 0)
            mButton.setImageResource(resId);
        ViewUtil.setBackground(mButton, BlankDrawable.getInstance());
        mButton.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
        mButton.setFocusableInTouchMode(false);
        mButton.setFocusable(false);
        mButton.setClickable(false);
    }

    a.recycle();

    addView(mNameView);
    addView(mAddressView);
    if(mButton != null)
        addView(mButton);

    mAvatarDrawable = new AvatarDrawable();
    if(avatarSrc != 0)
        setAvatarResource(avatarSrc);
}
 

开发者ID:iamzhangdejian,
项目名称:material-master,
代码行数:68,
代码来源:ContactView.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)