- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {ArrayList a =
new ArrayList<String>()
new ArrayList()
new ArrayList<Object>()
- Smart code suggestions by Codota
}
@Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); drawUnit(canvas); drawBg(canvas); drawValue(canvas); drawButton(canvas); calculationToastIndex(); drawBubble(); showToastView(); }
public DoubleHeadedDragonBar(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.DoubleHeadedDragonBar, defStyleAttr, 0); buttonHeight = a.getDimension(R.styleable.DoubleHeadedDragonBar_button_height, dp2px(30)); buttonWidth = a.getDimension(R.styleable.DoubleHeadedDragonBar_button_width, dp2px(60)); textColor = a.getColor(R.styleable.DoubleHeadedDragonBar_text_color, Color.parseColor("#5C6980")); bgColor = a.getColor(R.styleable.DoubleHeadedDragonBar_bg_color, Color.parseColor("#F2F4FE")); bgHeight = (int) a.getDimension(R.styleable.DoubleHeadedDragonBar_seek_height, dp2px(4)); int valueColor = a.getColor(R.styleable.DoubleHeadedDragonBar_value_color, Color.parseColor("#1B97F7")); valuePaint.setColor(valueColor); int buttonImgId = a.getResourceId(R.styleable.DoubleHeadedDragonBar_button_img, R.drawable.button); a.recycle(); //设置单位显示额的字体 unitTextSize = buttonHeight * 0.4f; textPaint.setTextSize(unitTextSize); textPaint.setColor(textColor); bgPaint.setColor(bgColor); buttonImg = setImgSize(BitmapFactory.decodeResource(context.getResources(), buttonImgId), buttonWidth, buttonHeight); mWindowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); mLayoutParams2 = new WindowManager.LayoutParams(); mLayoutParams = new WindowManager.LayoutParams(); mLayoutParams1 = new WindowManager.LayoutParams(); initLayoutParams(mLayoutParams2); initLayoutParams(mLayoutParams); initLayoutParams(mLayoutParams1); }
public void drawBubble() { drawToast(); drawToast1(); if (toastView2 == null) { return; } if (isCoincide) { // if (toastView2.getVisibility() == GONE) { // } mLayoutParams2.x = (toastViewX + toastView1X) / 2; mLayoutParams2.y = toastViewY; if (toastView2.getParent() == null) { mWindowManager.addView(toastView2, mLayoutParams2); } else { mWindowManager.updateViewLayout(toastView2, mLayoutParams2); } toastView2.setVisibility(VISIBLE); } else { toastView2.setVisibility(GONE); } }