congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
VerticalStepView
Code IndexAdd Tabnine to your IDE (free)

How to use
VerticalStepView
in
jsc.kit.component.stepview

Best Java code snippets using jsc.kit.component.stepview.VerticalStepView (Showing top 5 results out of 315)

origin: JustinRoom/JSCKit

@Override
protected void onDraw(Canvas canvas) {
  super.onDraw(canvas);
  if (points.size() > 1) {
    paint.setStrokeWidth(lineWidth);
    paint.setStyle(Paint.Style.STROKE);
    paint.setColor(lineColor);
    canvas.drawLine(
        points.get(0).getBasicX(),
        points.get(0).getBasicY(),
        points.get(points.size() - 1).getBasicX(),
        points.get(points.size() - 1).getBasicY(),
        paint
    );
  }
  for (RouteViewPoint p : points) {
    if (isDrawCircle())
      drawCircle(canvas, p, paint);
    if (isDrawIndex())
      drawIndex(canvas, p, textPaint);
    if (isDrawLabel())
      drawLabel(canvas, p, 10, textPaint);
    if (isDrawTransit())
      drawTransit(canvas, p, 10, textPaint);
    if (isDrawCursor())
      drawCursor(canvas, p, 10, textPaint);
  }
}
origin: JustinRoom/JSCKit

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
  int offsetY = getPaddingTop();
  int startX = (int) (getPaddingLeft() + 10 + getMaxRadius() + 0.5f);
  if (isDrawTransit())
    startX = startX + getMaxTransitWidth();
  if (points.size() > 1) {
    for (int i = 0; i < points.size(); i++) {
      RouteViewPoint p = points.get(i);
      if (i == 0)
        offsetY += p.getRadius();
      if (i > 0)
        offsetY += p.getDistance();
      p.setBasicX(startX);
      p.setBasicY(offsetY);
      if (i == points.size() - 1)
        offsetY += p.getRadius();
    }
  } else if (points.size() == 1) {
    RouteViewPoint p = points.get(0);
    offsetY += p.getRadius();
    p.setBasicY(offsetY);
    offsetY += p.getRadius();
  }
  offsetY += getPaddingBottom();
  heightMeasureSpec = MeasureSpec.makeMeasureSpec(offsetY, MeasureSpec.EXACTLY);
  super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
origin: JustinRoom/JSCKit

private void showCustomStepView() {
  setTitleBarTitle("CustomStep");
  initMenu(false);
  if (cScrollView == null) {
    cScrollView = new ScrollView(this);
    VerticalStepView verticalStepView = new VerticalStepView(this);
    verticalStepView.setPadding(
        getResources().getDimensionPixelOffset(R.dimen.space_16) * 2,
        getResources().getDimensionPixelOffset(R.dimen.space_16) / 2,
        getResources().getDimensionPixelOffset(R.dimen.space_16) * 2,
        getResources().getDimensionPixelOffset(R.dimen.space_16) / 2
    );
    cScrollView.addView(verticalStepView, new ScrollView.LayoutParams(ScrollView.LayoutParams.MATCH_PARENT, ScrollView.LayoutParams.WRAP_CONTENT));
    verticalStepView.setPoints(gePoints());
  }
  if (layout.getChildCount() > 1) {
    layout.removeViewAt(0);
  }
  layout.addView(cScrollView, 0, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 0, 1));
}
origin: JustinRoom/JSCKit

/**
 * draw label
 *
 * @param canvas
 * @param p
 * @param marginLeft left margin from the circle background of index
 * @param textPaint
 */
private void drawLabel(Canvas canvas, RouteViewPoint p, int marginLeft, TextPaint textPaint) {
  if (p == null)
    return;
  String label = p.getLabel();
  if (label == null || label.length() == 0)
    return;
  textPaint.setColor(p.getLabelColor());
  textPaint.setTextSize(p.getLabelSize());
  textPaint.setTypeface(Typeface.defaultFromStyle(p.isLabelBold() ? Typeface.BOLD : Typeface.NORMAL));
  textPaint.getTextBounds(label, 0, label.length(), textBoundRect);
  Paint.FontMetrics fontMetrics = textPaint.getFontMetrics();
  int w = textBoundRect.right - textBoundRect.left;
  int h = textBoundRect.bottom - textBoundRect.top;
  float xStart = p.getBasicX() + getMaxRadius() + marginLeft;
  float baseLine = p.getBasicY() - h / 2.0f + (h - fontMetrics.bottom + fontMetrics.top) / 2 - fontMetrics.top;
  canvas.drawText(label, xStart, baseLine, textPaint);
}
origin: JustinRoom/JSCKit

int w = textBoundRect.right - textBoundRect.left;
int h = textBoundRect.bottom - textBoundRect.top;
float xStart = p.getBasicX() + getMaxRadius() + marginLeft;
float newBasicY = p.getBasicY() + p.getRadius() + h / 2.0f;
float baseLine = newBasicY - h / 2.0f + (h - fontMetrics.bottom + fontMetrics.top) / 2 - fontMetrics.top;
jsc.kit.component.stepviewVerticalStepView

Javadoc


Email:1006368252@qq.com
QQ:1006368252
https://github.com/JustinRoom/JSCKit

Most used methods

  • <init>
  • drawCircle
    draw circle
  • drawCursor
    draw cursor
  • drawIndex
    draw index
  • drawLabel
    draw label
  • drawTransit
    draw transit
  • getMaxRadius
  • getMaxTransitWidth
  • getPaddingBottom
  • getPaddingLeft
  • getPaddingTop
  • getResources
  • getPaddingTop,
  • getResources,
  • init,
  • isDrawCircle,
  • isDrawCursor,
  • isDrawIndex,
  • isDrawLabel,
  • isDrawTransit,
  • postInvalidate,
  • requestLayout

Popular in Java

  • Finding current android device location
  • getApplicationContext (Context)
  • setContentView (Activity)
  • getResourceAsStream (ClassLoader)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now