Java Code Examples for android.util.AttributeSet

The following are top voted examples for showing how to use android.util.AttributeSet. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: Spyglass   File: TestDimensionHandlerCombinations.java   Source Code and License 6 votes vote down vote up
@Test
@UiThreadTest
public void testSpyglassCallsMethod_attributeMissing_defaultToNullPresent() {
	final AttributeSet attrs = fromXml(context, R.xml.dimension_handler_without_attr);

	final DimensionHandlerTestTargetBase target = new WithDefaultToNull(context, attrs);

	assertThat(target.getReceivedValue(), is(ReceivedValue.<Integer>of(null)));
}
 
Example 2
Project: poturnoChat   File: SlidingTabStrip.java   Source Code and License 6 votes vote down vote up
SlidingTabStrip(Context context, AttributeSet attrs) {
    super(context, attrs);
    setWillNotDraw(false);

    final float density = getResources().getDisplayMetrics().density;

    TypedValue outValue = new TypedValue();
    context.getTheme().resolveAttribute(android.R.attr.colorForeground, outValue, true);
    final int themeForegroundColor =  outValue.data;

    int defaultBottomBorderColor = setColorAlpha(themeForegroundColor,
            DEFAULT_BOTTOM_BORDER_COLOR_ALPHA);

    mDefaultTabColorizer = new SimpleTabColorizer();
    mDefaultTabColorizer.setIndicatorColors(DEFAULT_SELECTED_INDICATOR_COLOR);

    mBottomBorderThickness = (int) (DEFAULT_BOTTOM_BORDER_THICKNESS_DIPS * density);
    mBottomBorderPaint = new Paint();
    mBottomBorderPaint.setColor(defaultBottomBorderColor);

    mSelectedIndicatorThickness = (int) (SELECTED_INDICATOR_THICKNESS_DIPS * density);
    mSelectedIndicatorPaint = new Paint();
}
 
Example 3
Project: simple-keyboard   File: KeyboardBuilder.java   Source Code and License 6 votes vote down vote up
private KeyboardRow parseRowAttributes(final XmlPullParser parser)
        throws XmlPullParserException {
    final AttributeSet attr = Xml.asAttributeSet(parser);
    final TypedArray keyboardAttr = mResources.obtainAttributes(attr, R.styleable.Keyboard);
    try {
        if (keyboardAttr.hasValue(R.styleable.Keyboard_horizontalGap)) {
            throw new XmlParseUtils.IllegalAttribute(parser, TAG_ROW, "horizontalGap");
        }
        if (keyboardAttr.hasValue(R.styleable.Keyboard_verticalGap)) {
            throw new XmlParseUtils.IllegalAttribute(parser, TAG_ROW, "verticalGap");
        }
        return new KeyboardRow(mResources, mParams, parser, mCurrentY);
    } finally {
        keyboardAttr.recycle();
    }
}
 
Example 4
Project: EyeShopping   File: CameraBridgeViewBase.java   Source Code and License 6 votes vote down vote up
public CameraBridgeViewBase(Context context, AttributeSet attrs) {
    super(context, attrs);

    int count = attrs.getAttributeCount();
    Log.d(TAG, "Attr count: " + Integer.valueOf(count));

    TypedArray styledAttrs = getContext().obtainStyledAttributes(attrs, R.styleable.CameraBridgeViewBase);
    if (styledAttrs.getBoolean(R.styleable.CameraBridgeViewBase_show_fps, false))
        enableFpsMeter();

    mCameraIndex = styledAttrs.getInt(R.styleable.CameraBridgeViewBase_camera_id, -1);

    getHolder().addCallback(this);
    mMaxWidth = MAX_UNSPECIFIED;
    mMaxHeight = MAX_UNSPECIFIED;
    styledAttrs.recycle();
}
 
Example 5
Project: MiPushFramework   File: BottomNavigationItemView.java   Source Code and License 6 votes vote down vote up
public BottomNavigationItemView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    final Resources res = getResources();
    int inactiveLabelSize =
            res.getDimensionPixelSize(R.dimen.design_bottom_navigation_text_size);
    int activeLabelSize = res.getDimensionPixelSize(
            R.dimen.design_bottom_navigation_active_text_size);
    mDefaultMargin = res.getDimensionPixelSize(R.dimen.design_bottom_navigation_margin);
    mShiftAmount = inactiveLabelSize - activeLabelSize;
    mScaleUpFactor = 1f * activeLabelSize / inactiveLabelSize;
    mScaleDownFactor = 1f * inactiveLabelSize / activeLabelSize;

    LayoutInflater.from(context).inflate(R.layout.design_bottom_navigation_item, this, true);
    setBackgroundResource(R.drawable.design_bottom_navigation_item_background);
    mIcon = (ImageView) findViewById(R.id.icon);
    mSmallLabel = (TextView) findViewById(R.id.smallLabel);
    mLargeLabel = (TextView) findViewById(R.id.largeLabel);

}
 
Example 6
Project: YMenuView   File: YMenu.java   Source Code and License 6 votes vote down vote up
private void initAttr(Context context, AttributeSet attrs) {
    TypedArray typedArray = context.getTheme().obtainStyledAttributes(attrs, R.styleable.YMenuView, 0, 0);
    mYMenuButtonWidth = typedArray.getDimensionPixelSize(R.styleable.YMenuView_menuButtonWidth, mYMenuButtonWidth);
    mYMenuButtonHeight = typedArray.getDimensionPixelSize(R.styleable.YMenuView_menuButtonHeight, mYMenuButtonHeight);
    mYOptionButtonWidth = typedArray.getDimensionPixelSize(R.styleable.YMenuView_optionButtonWidth, mYOptionButtonWidth);
    mYOptionButtonHeight = typedArray.getDimensionPixelSize(R.styleable.YMenuView_optionButtonHeight, mYOptionButtonHeight);
    mYMenuToParentXMargin = typedArray.getDimensionPixelSize(R.styleable.YMenuView_menuToParentXMargin, mYMenuToParentXMargin);
    mYMenuToParentYMargin = typedArray.getDimensionPixelSize(R.styleable.YMenuView_menuToParentYMargin, mYMenuToParentYMargin);
    optionPositionCount = typedArray.getInteger(R.styleable.YMenuView_optionPositionCounts, optionPositionCount);
    optionColumns = typedArray.getInteger(R.styleable.YMenuView_optionColumns, optionColumns);
    mYOptionToParentYMargin = typedArray.getDimensionPixelSize(R.styleable.YMenuView_optionToParentYMargin, mYOptionToParentYMargin);
    mYOptionToParentXMargin = typedArray.getDimensionPixelSize(R.styleable.YMenuView_optionToParentXMargin, mYOptionToParentXMargin);
    mYOptionYMargin = typedArray.getDimensionPixelSize(R.styleable.YMenuView_optionYMargin, mYOptionYMargin);
    mYOptionXMargin = typedArray.getDimensionPixelSize(R.styleable.YMenuView_optionXMargin, mYOptionXMargin);
    mMenuButtonBackGroundId = typedArray.getResourceId(R.styleable.YMenuView_menuButtonBackGround, mMenuButtonBackGroundId);
    mOptionsBackGroundId = typedArray.getResourceId(R.styleable.YMenuView_optionsBackGround, R.drawable.null_drawable);
    mOptionSD_AnimationMode = typedArray.getInt(R.styleable.YMenuView_sd_animMode, mOptionSD_AnimationMode);
    mOptionSD_AnimationDuration = typedArray.getInt(R.styleable.YMenuView_sd_duration, mOptionSD_AnimationDuration);
    isShowMenu = typedArray.getBoolean(R.styleable.YMenuView_isShowMenu, isShowMenu);

    typedArray.recycle();
}
 
Example 7
Project: QiangHongBao   File: BorderCircleView.java   Source Code and License 6 votes vote down vote up
private void init(Context context, AttributeSet attrs) {
    borderWidth = DisplayUtils.converDip2px(1);
    backgroundColor = Color.TRANSPARENT;
    borderColor = Color.BLACK;

    if (attrs != null) {
        TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.BorderCircleView);
        borderWidth = ta.getDimensionPixelSize(R.styleable.BorderCircleView_borderWidth, borderWidth);
        backgroundColor = ta.getColor(R.styleable.BorderCircleView_backgroundColor, backgroundColor);
        borderColor = ta.getColor(R.styleable.BorderCircleView_borderCircleColor, borderColor);
        ta.recycle();
    }

    paint = new Paint();
    paint.setAntiAlias(true);
    paint.setStyle(Paint.Style.FILL);
    paint.setColor(backgroundColor);

    paintBorder = new Paint();
    paintBorder.setAntiAlias(true);
    paintBorder.setStyle(Paint.Style.STROKE);
    paintBorder.setColor(borderColor);

    setBackground(null);
}
 
Example 8
Project: aftercare-app-android   File: DCDashboardTeeth.java   Source Code and License 5 votes vote down vote up
private void init(AttributeSet attributeSet) {
    inflate(getContext(), R.layout.view_dashboard_teeth, this);

    teeth = new DCTooth[32];
    for (int i = 0; i < 32; i++) {
        teeth[i] = (DCTooth) findViewById(getResources().getIdentifier("iv_t" + (i + 1), "id", getContext().getPackageName()));
    }

    hideAll();
}
 
Example 9
Project: boohee_v5.6   File: ProgressIndicator.java   Source Code and License 5 votes vote down vote up
public ProgressIndicator(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    this.mParams = new LayoutParams(-2, -2);
    this.cpIndicator = new CircleProgress(this, context);
    addView(this.cpIndicator);
    this.mParams.addRule(13);
    this.mParams.setMargins(24, 24, 24, 24);
}
 
Example 10
Project: Muse-EEG-Toolkit   File: EpochSurfaceView.java   Source Code and License 5 votes vote down vote up
/** Creates a SurfaceView graph by parsing attributes. */
public EpochSurfaceView(Context context, AttributeSet attrs) {
  super(context, attrs);
  setWillNotDraw(false);

  int color = Color.BLACK;
  for (int i = 0; i < attrs.getAttributeCount(); i++) {
    if ("lineColor".equals(attrs.getAttributeName(i))) {
      color = Color.parseColor(attrs.getAttributeValue(i));
    }
  }
  this.color = color;
}
 
Example 11
Project: simple-stack   File: MessageView.java   Source Code and License 5 votes vote down vote up
public MessageView(Context context, AttributeSet attrs) {
    super(context, attrs);
    setOrientation(VERTICAL);
    Utils.getComponent(context).inject(this);

    MessagePath screen = Backstack.getKey(context);
    message = conversations.get(screen.conversationIndex()).items.get(screen.messageId());
}
 
Example 12
Project: UiLib   File: EasySwitcher.java   Source Code and License 5 votes vote down vote up
public EasySwitcher(Context context, AttributeSet attrs) {
    super(context, attrs);
    mContext = context;
    mAllItemArray = new ArrayList<>();
    mDefaultSelection = 0;
    initBaseView();
}
 
Example 13
Project: materialExpansionPanel   File: Expandable.java   Source Code and License 5 votes vote down vote up
private void initAttrs(AttributeSet attrs) {
    if (attrs == null) return;

    TypedArray ta = getContext().getTheme().obtainStyledAttributes(attrs, R.styleable.Expandable, 0, 0);

    icon = ta.getDrawable(R.styleable.Expandable_exp_icon);
    iconStyle = ta.getInt(R.styleable.Expandable_exp_iconStyle, ExpandableUtils.ICON_STYLE_SQUARE);
    animateExpand = ta.getBoolean(R.styleable.Expandable_exp_animateExpand, false);
    backgroundColor = ta.getColor(R.styleable.Expandable_exp_backgroundColor, ContextCompat.getColor(getContext(), R.color.colorDefaultBackground));
    headerBackgroundColor = ta.getColor(R.styleable.Expandable_exp_headerBackgroundColor, ContextCompat.getColor(getContext(), R.color.colorDefaultBackground));
    expandIndicator = ta.getDrawable(R.styleable.Expandable_exp_expandIndicator);

    ta.recycle();
}
 
Example 14
Project: chromium-for-android-56-debug-video   File: TextScalePreference.java   Source Code and License 5 votes vote down vote up
/**
 * Constructor for inflating from XML.
 */
public TextScalePreference(Context context, AttributeSet attrs) {
    super(context, attrs);

    mFontSizePrefs = FontSizePrefs.getInstance(getContext());

    setLayoutResource(R.layout.custom_preference);
    setWidgetLayoutResource(R.layout.preference_text_scale);
}
 
Example 15
Project: firebase-testlab-instr-lib   File: NoteEditor.java   Source Code and License 5 votes vote down vote up
public LinedEditText(Context context, AttributeSet attrs) {
    super(context, attrs);
    
    mRect = new Rect();
    mPaint = new Paint();
    mPaint.setStyle(Paint.Style.STROKE);
    mPaint.setColor(0x800000FF);
}
 
Example 16
Project: QMark   File: CornersFrameLayout.java   Source Code and License 5 votes vote down vote up
public CornersFrameLayout(Context context, AttributeSet attrs, int defStyle) {
	super(context, attrs, defStyle);
	TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CornersFrameLayout, defStyle, 0);
	mCornersRadius = a.getDimensionPixelOffset(R.styleable.CornersFrameLayout_cornersRadius, 0);
	mAspectRatio = a.getFloat(R.styleable.CornersFrameLayout_cornersAspectRatio, 0);
	a.recycle();
	init();
}
 
Example 17
Project: anyRTC-Meeting-Android   File: CircleImageView.java   Source Code and License 5 votes vote down vote up
public CircleImageView(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView, defStyle, 0);

    mBorderWidth = a.getDimensionPixelSize(R.styleable.CircleImageView_civ_border_width, DEFAULT_BORDER_WIDTH);
    mBorderColor = a.getColor(R.styleable.CircleImageView_civ_border_color, DEFAULT_BORDER_COLOR);
    mBorderOverlay = a.getBoolean(R.styleable.CircleImageView_civ_border_overlay, DEFAULT_BORDER_OVERLAY);
    mFillColor = a.getColor(R.styleable.CircleImageView_civ_fill_color, DEFAULT_FILL_COLOR);

    a.recycle();

    init();
}
 
Example 18
Project: Spyglass   File: WithDefaultToDpDimensionResource.java   Source Code and License 5 votes vote down vote up
private void init(final AttributeSet attrs, final int defStyleAttr, final int defStyleRes) {
	WithDefaultToDpDimensionResource_SpyglassCompanion
			.builder()
			.withTarget(this)
			.withContext(getContext())
			.withStyleableResource(R.styleable.DimensionHandlerTestTargetBase)
			.withAttributeSet(attrs)
			.withDefaultStyleAttribute(defStyleAttr)
			.withDefaultStyleResource(defStyleRes)
			.build()
			.passDataToMethods();
}
 
Example 19
Project: iosched-reader   File: BezelImageView.java   Source Code and License 5 votes vote down vote up
public BezelImageView(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    // Attribute initialization.
    final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.BezelImageView,
            defStyle, 0);

    mMaskDrawable = a.getDrawable(R.styleable.BezelImageView_maskDrawable);
    if (mMaskDrawable != null) {
        mMaskDrawable.setCallback(this);
    }

    mBorderDrawable = a.getDrawable(R.styleable.BezelImageView_borderDrawable);
    if (mBorderDrawable != null) {
        mBorderDrawable.setCallback(this);
    }

    mDesaturateOnPress = a.getBoolean(R.styleable.BezelImageView_desaturateOnPress,
            mDesaturateOnPress);

    a.recycle();

    // Other initialization.
    mBlackPaint = new Paint();
    mBlackPaint.setColor(0xff000000);
    
    mMaskedPaint = new Paint();
    mMaskedPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));

    // Always want a cache allocated.
    mCacheBitmap = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888);

    if (mDesaturateOnPress) {
        // Create a desaturate color filter for pressed state.
        ColorMatrix cm = new ColorMatrix();
        cm.setSaturation(0);
        mDesaturateColorFilter = new ColorMatrixColorFilter(cm);
    }
}
 
Example 20
Project: boohee_v5.6   File: DietShareEatItem.java   Source Code and License 5 votes vote down vote up
public DietShareEatItem(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    mItem.put("breakfast", Integer.valueOf(R.drawable.pr));
    mItem.put("lunch", Integer.valueOf(R.drawable.pt));
    mItem.put("dinner", Integer.valueOf(R.drawable.ps));
    mItem.put(SNACK, Integer.valueOf(R.drawable.pq));
    mItem.put("sport", Integer.valueOf(R.drawable.pu));
    this.mView = LayoutInflater.from(getContext()).inflate(R.layout.os, null);
    addView(this.mView);
    ButterKnife.inject((View) this);
}
 
Example 21
Project: AssistantBySDK   File: LoginoutButton.java   Source Code and License 5 votes vote down vote up
/**
 * 初始化函数。
 * 
 * @param context 上下文环境,一般为放置该 Button 的 Activity 
 * @param attrs   XML 属性集合对象
 */
private void initialize(Context context, AttributeSet attrs) {
	mContext = context;
	this.setOnClickListener(this);
	
	// 如果布局文件中未设置 style,加载默认的 style
	loadDefaultStyle(attrs);
}
 
Example 22
Project: LongImageCamera   File: CameraView.java   Source Code and License 5 votes vote down vote up
@SuppressWarnings("WrongConstant")
public CameraView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    if (isInEditMode()){
        mCallbacks = null;
        mDisplayOrientationDetector = null;
        return;
    }
    // Internal setup
    final PreviewImpl preview = createPreviewImpl(context);
    mCallbacks = new CallbackBridge();
    if (Build.VERSION.SDK_INT < 21) {
        mImpl = new Camera1(mCallbacks, preview);
    } else if (Build.VERSION.SDK_INT < 23) {
        mImpl = new Camera2(mCallbacks, preview, context);
    } else {
        mImpl = new Camera2Api23(mCallbacks, preview, context);
    }
    // Attributes
    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CameraView, defStyleAttr,
            R.style.Widget_CameraView);
    mAdjustViewBounds = a.getBoolean(R.styleable.CameraView_android_adjustViewBounds, false);
    setFacing(a.getInt(R.styleable.CameraView_facing, FACING_BACK));
    String aspectRatio = a.getString(R.styleable.CameraView_aspectRatio);
    if (aspectRatio != null) {
        setAspectRatio(AspectRatio.parse(aspectRatio));
    } else {
        setAspectRatio(Constants.DEFAULT_ASPECT_RATIO);
    }
    setAutoFocus(a.getBoolean(R.styleable.CameraView_autoFocus, true));
    setFlash(a.getInt(R.styleable.CameraView_flash, Constants.FLASH_AUTO));
    a.recycle();
    // Display orientation detector
    mDisplayOrientationDetector = new DisplayOrientationDetector(context) {
        @Override
        public void onDisplayOrientationChanged(int displayOrientation) {
            mImpl.setDisplayOrientation(displayOrientation);
        }
    };
}
 
Example 23
Project: DizzyPassword   File: PswInputView.java   Source Code and License 5 votes vote down vote up
/**
     * 初始化相关参数
     */
    void init(AttributeSet attrs) {
        final float dp = getResources().getDisplayMetrics().density;
        this.setFocusable(true);
        this.setFocusableInTouchMode(true);
        input = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
        result = new ArrayList<>();
        if (attrs != null) {
            TypedArray ta = getContext().obtainStyledAttributes(attrs, R.styleable.PswInputView);
//            mBorderColor = ta.getColor(R.styleable.PswInputView_border_color, getResources().getColor(R.color.color_13));
            mBorderColor = ta.getColor(R.styleable.PswInputView_border_color, ThemeUtils.getPrimaryColor(AppManager.getAppManager().currentActivity()));
            mDotColor = ta.getColor(R.styleable.PswInputView_dot_color, getResources().getColor(R.color.color_bg));
            count = ta.getInt(R.styleable.PswInputView_count, 6);
            ta.recycle();
        } else {
            mBorderColor = Color.LTGRAY;
            mDotColor = Color.GRAY;
            count = 6;//默认6位密码
        }
        size = (int) (dp * 30);//默认30dp一格
        //color
        mBorderPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
        mBorderPaint.setStrokeWidth(2);
        mBorderPaint.setStyle(Paint.Style.STROKE);
        mBorderPaint.setColor(mBorderColor);
        mDotPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
        mDotPaint.setStrokeWidth(3);
        mDotPaint.setStyle(Paint.Style.FILL);
        mDotPaint.setColor(mDotColor);
        mRoundRect = new RectF();
        mRoundRadius = (int) (5 * dp);
        mFocusLineLength = 0;
        this.setOnKeyListener(new MyKeyListener());
    }
 
Example 24
Project: SnappyRecyclerView   File: SnappingRecyclerView.java   Source Code and License 4 votes vote down vote up
public SnappingRecyclerView(Context context, @Nullable AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
    initialise(context, attrs);
}
 
Example 25
Project: PreviewSeekBar   File: PreviewGeneralLayout.java   Source Code and License 4 votes vote down vote up
public PreviewGeneralLayout(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    init(context, attrs);
}
 
Example 26
Project: TrendChartView   File: TrendChartView.java   Source Code and License 4 votes vote down vote up
private void init(Context context, AttributeSet attrs) {
    initPaint();
}
 
Example 27
Project: Cluttr   File: SquareFrameLayout.java   Source Code and License 4 votes vote down vote up
public SquareFrameLayout(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
}
 
Example 28
Project: Idea-ijkplayer   File: TimeBarView.java   Source Code and License 4 votes vote down vote up
public TimeBarView(Context context, AttributeSet attrs) {
    this(context, attrs,0);
}
 
Example 29
Project: CXJPadProject   File: DishesView.java   Source Code and License 4 votes vote down vote up
private DishesView(Context context, AttributeSet attrs, int defStyleAttr) {
	super(context, attrs, defStyleAttr);
	final TypedArray a= context.obtainStyledAttributes(attrs,R.styleable.dishesStyleable);
	updateBackgroundFromTypedArray(a);
	a.recycle();
}
 
Example 30
Project: Hands-On-Android-UI-Development   File: ColorizedCardView.java   Source Code and License 4 votes vote down vote up
public ColorizedCardView(
        final Context context,
        final AttributeSet attrs,
        final int defStyleAttr) {
    super(context, attrs, defStyleAttr);
}
 
Example 31
Project: CustomListView   File: PullToRefreshBase.java   Source Code and License 4 votes vote down vote up
public PullToRefreshBase(Context context, AttributeSet attrs) {
	super(context, attrs);
	init(context, attrs);
}
 
Example 32
Project: YCUtils   File: MaterialRippleLayout.java   Source Code and License 4 votes vote down vote up
public MaterialRippleLayout(Context context, AttributeSet attrs) {
    this(context, attrs, 0);
}
 
Example 33
Project: FontUtils   File: FontTextView.java   Source Code and License 4 votes vote down vote up
public FontTextView(Context context, @Nullable AttributeSet attrs) {
    super(context, attrs);
    init(context,attrs);
}
 
Example 34
Project: qmui   File: QMUICollapsingTopBarLayout.java   Source Code and License 4 votes vote down vote up
public QMUICollapsingTopBarLayout(Context context, AttributeSet attrs) {
    this(context, attrs, 0);
}
 
Example 35
Project: recyclviewpagger   File: MetalRecyclerViewPager.java   Source Code and License 4 votes vote down vote up
public MetalRecyclerViewPager(Context context, @Nullable AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
    init(context, attrs);
}
 
Example 36
Project: ImageFrame   File: ImageFrameView.java   Source Code and License 4 votes vote down vote up
public ImageFrameView(Context context, @Nullable AttributeSet attrs) {
  super(context, attrs);
  init();
}
 
Example 37
Project: pipe   File: SquareLayout.java   Source Code and License 4 votes vote down vote up
public SquareLayout(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
}
 
Example 38
Project: JBase   File: CustomViewPager.java   Source Code and License 4 votes vote down vote up
public CustomViewPager(Context context, AttributeSet attrs) {
    super(context, attrs);
}
 
Example 39
Project: DailyStudy   File: SlideLayout.java   Source Code and License 4 votes vote down vote up
public SlideLayout(@NonNull Context context, @Nullable AttributeSet attrs) {
    super(context, attrs);
    init(context);
}
 
Example 40
Project: GitHub   File: EmptyRecyclerView.java   Source Code and License 4 votes vote down vote up
public EmptyRecyclerView(Context context, @Nullable AttributeSet attrs) {
    super(context, attrs);
}
 
Example 41
Project: ImitateZHRB   File: AVLoadingIndicatorView.java   Source Code and License 4 votes vote down vote up
public AVLoadingIndicatorView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    init(attrs, defStyleAttr);
}
 
Example 42
Project: Veggietizer   File: BarChart.java   Source Code and License 4 votes vote down vote up
/**
 * Class constructor taking a context and an attribute set. This constructor
 * is used by the layout engine to construct a {@link BarChart} from a set of
 * XML attributes.
 *
 * @param context The application context.
 * @param attrs An attribute set.
 */
public BarChart(Context context, AttributeSet attrs) {
    super(context, attrs);

    this.context = context;

    // attrs contains the raw values for the XML attributes
    // that were specified in the layout, which don't include
    // attributes set by styles or themes, and which may have
    // unresolved references. Call obtainStyledAttributes()
    // to get the final values for each attribute.
    //
    // This call uses R.styleable.BarChart, which is an array of
    // the custom attributes that were declared in attrs.xml.
    TypedArray a = context.getTheme().obtainStyledAttributes(
            attrs,
            R.styleable.BarChart,
            0, 0
    );

    try {
    	barWidthPercentage = a.getFloat(R.styleable.BarChart_barWidthPercentage, 85);
    	textBarMargin = a.getDimension(R.styleable.BarChart_textBarMargin, 20);
    	textSize = a.getDimension(R.styleable.BarChart_textSize, 30);
    	barChartHeight = a.getDimension(R.styleable.BarChart_barChartHeight, 20);
    	borderWidth = a.getDimension(R.styleable.BarChart_borderWidth, 3);
    	sBarTitle = a.getString(R.styleable.BarChart_barHeading);
    	innerColor = a.getColor(R.styleable.BarChart_innerColor,
                getResources().getColor(R.color.veggie_green));
    	borderColor = a.getColor(R.styleable.BarChart_borderColor,
                getResources().getColor(R.color.holo_gray_light));
    	drawGreyBar = a.getBoolean(R.styleable.BarChart_greyBar, true);
    	animDuration = a.getInteger(R.styleable.BarChart_animDuration, 1500);
    	startDelay = a.getInteger(R.styleable.BarChart_startDelayBarChart, 300);
    	showBorder = a.getBoolean(R.styleable.BarChart_showBorder, false);

    } finally {
        // release the TypedArray so that it can be reused.
        a.recycle();
    }
    init();
}
 
Example 43
Project: javaide   File: TwoDScrollView.java   Source Code and License 4 votes vote down vote up
public TwoDScrollView(Context context, AttributeSet attrs) {
    super(context, attrs);
    initTwoDScrollView();
}
 
Example 44
Project: AndroidOpen   File: OverScrollView.java   Source Code and License 4 votes vote down vote up
public OverScrollView(Context context, AttributeSet attrs) {
    super(context, attrs);
}
 
Example 45
Project: furry-sniffle   File: seekBarPref.java   Source Code and License 4 votes vote down vote up
public seekBarPref(Context context, AttributeSet attrs) {
    this(context, attrs, 0);
}
 
Example 46
Project: MultiSelecter   File: SuperSwipeRefreshLayout.java   Source Code and License 4 votes vote down vote up
public CircleProgressView(Context context, AttributeSet attrs) {
    super(context, attrs);
}
 
Example 47
Project: UIKit-ViewBlock   File: UIKitRelativeLayout.java   Source Code and License 4 votes vote down vote up
public UIKitRelativeLayout(Context context, AttributeSet attrs) {
    super(context, attrs);
}
 
Example 48
Project: GitHub   File: WaterDropHeader.java   Source Code and License 4 votes vote down vote up
public WaterDropHeader(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    this.initView(context);
}
 
Example 49
Project: BBSSDK-for-Android   File: ForumFormGridView.java   Source Code and License 4 votes vote down vote up
public ForumFormGridView(Context context, AttributeSet attrs, int defStyle) {
	super(context, attrs, defStyle);
}
 
Example 50
Project: PeSanKita-android   File: ImageDivet.java   Source Code and License 4 votes vote down vote up
public ImageDivet(Context context, AttributeSet attrs) {
  super(context, attrs);
  initialize(attrs);
}
 
Example 51
Project: MyAnimeViewer   File: GridRecyclerView.java   Source Code and License 4 votes vote down vote up
public GridRecyclerView(Context context, AttributeSet attrs) {
    super(context, attrs);
}
 
Example 52
Project: Nird2   File: CameraView.java   Source Code and License 4 votes vote down vote up
public CameraView(Context context, AttributeSet attrs, int defStyleAttr) {
	super(context, attrs, defStyleAttr);
}
 
Example 53
Project: Auto.js   File: JsTextView.java   Source Code and License 4 votes vote down vote up
public JsTextView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
}
 
Example 54
Project: financisto1-holo   File: MyViewFlipper.java   Source Code and License 4 votes vote down vote up
public MyViewFlipper(Context context, AttributeSet attrs) {
	super(context, attrs);
}
 
Example 55
Project: TableView   File: TableView.java   Source Code and License 4 votes vote down vote up
private void initialDefaultValues(AttributeSet attrs) {
    // Dimensions
    m_nRowHeaderWidth = (int) getResources().getDimension(R.dimen.default_row_header_width);
    m_nColumnHeaderHeight = (int) getResources().getDimension(R.dimen
            .default_column_header_height);

    // Colors
    m_nSelectedColor = ContextCompat.getColor(getContext(), R.color
            .table_view_default_selected_background_color);
    m_nUnSelectedColor = ContextCompat.getColor(getContext(), R.color
            .table_view_default_unselected_background_color);
    m_nShadowColor = ContextCompat.getColor(getContext(), R.color
            .table_view_default_shadow_background_color);

    if (attrs == null) {
        // That means TableView is created programmatically.
        return;
    }

    // Get values from xml attributes
    TypedArray a = getContext().getTheme().obtainStyledAttributes(attrs, R.styleable
            .TableView, 0, 0);
    try {
        // Dimensions
        m_nRowHeaderWidth = (int) a.getDimension(R.styleable.TableView_row_header_width,
                m_nRowHeaderWidth);
        m_nColumnHeaderHeight = (int) a.getDimension(R.styleable
                .TableView_column_header_height, m_nColumnHeaderHeight);

        // Colors
        m_nSelectedColor = a.getColor(R.styleable.TableView_selected_color, m_nSelectedColor);
        m_nUnSelectedColor = a.getColor(R.styleable.TableView_unselected_color,
                m_nUnSelectedColor);
        m_nShadowColor = a.getColor(R.styleable.TableView_shadow_color, m_nShadowColor);
        m_nSeparatorColor = a.getColor(R.styleable.TableView_separator_color, ContextCompat
                .getColor(getContext(), R.color.table_view_default_separator_color));

        // Booleans
        m_bShowVerticalSeparators = a.getBoolean(R.styleable
                .TableView_show_vertical_separator, m_bShowVerticalSeparators);
        m_bShowHorizontalSeparators = a.getBoolean(R.styleable
                .TableView_show_horizontal_separator, m_bShowHorizontalSeparators);

    } finally {
        a.recycle();
    }
}
 
Example 56
Project: Paper-Melody   File: AutoFitTextureView.java   Source Code and License 4 votes vote down vote up
public AutoFitTextureView(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
}
 
Example 57
Project: MVPArmsTest1   File: AutoTabLayout.java   Source Code and License 4 votes vote down vote up
public AutoTabLayout(Context context, AttributeSet attrs)
{
    this(context, attrs, 0);
}
 
Example 58
Project: easyfilemanager   File: DirectoryView.java   Source Code and License 4 votes vote down vote up
public DirectoryView(Context context, AttributeSet attrs) {
    super(context, attrs);
}
 
Example 59
Project: QSVideoPlayer   File: QSVideoView.java   Source Code and License 4 votes vote down vote up
public QSVideoView(Context context, AttributeSet attrs) {
    this(context, attrs, 0);
}
 
Example 60
Project: letv   File: BottomRedPointView.java   Source Code and License 4 votes vote down vote up
public BottomRedPointView(Context context, AttributeSet attrs, View target) {
    this(context, attrs, 0, target);
}