Codota Logo
DoubleHeadedDragonBar
Code IndexAdd Codota to your IDE (free)

How to use
DoubleHeadedDragonBar
in
cn.bar

Best Java code snippets using cn.bar.DoubleHeadedDragonBar (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: yujinzhao123/DoubleHeadedDragonBar

@Override
protected void onDraw(Canvas canvas) {
  super.onDraw(canvas);
  drawUnit(canvas);
  drawBg(canvas);
  drawValue(canvas);
  drawButton(canvas);
  calculationToastIndex();
  drawBubble();
  showToastView();
}
origin: yujinzhao123/DoubleHeadedDragonBar

private void drawUnit(Canvas canvas) {
  drawText(canvas, buttonWidth / 2, unitTextSize, unitStr1);
  drawText(canvas, viewWidth - buttonWidth / 2, unitTextSize, unitStr2);
}
origin: yujinzhao123/DoubleHeadedDragonBar

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);
}
origin: yujinzhao123/DoubleHeadedDragonBar

  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);
    }


  }

cn.barDoubleHeadedDragonBar

Most used methods

  • calculationToastIndex
    计算toast坐标
  • dp2px
  • drawBg
  • drawBubble
  • drawButton
  • drawText
  • drawToast
  • drawToast1
  • drawUnit
  • drawValue
  • getContext
  • getLocationOnScreen
  • getContext,
  • getLocationOnScreen,
  • getParent,
  • getStatus_bar_height,
  • getTouchSeekValue,
  • hideToastView,
  • initLayoutParams,
  • invalidate,
  • isTouchSeek,
  • performClick

Popular in Java

  • Parsing JSON documents to java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • getSharedPreferences (Context)
  • Menu (java.awt)
  • IOException (java.io)
    Signals that an I/O exception of some sort has occurred. This class is the general class of exceptio
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now