Git Product home page Git Product logo

Comments (6)

gabri15 avatar gabri15 commented on September 26, 2024

The same problem

from android-stepsview.

karimi12 avatar karimi12 commented on September 26, 2024

if size 2 index are 0 , 1

from android-stepsview.

yanshengqi avatar yanshengqi commented on September 26, 2024

The same , who solved this problem?

from android-stepsview.

Arisono avatar Arisono commented on September 26, 2024

我解决了这个问题,关键是这个函数导致的 public void onSizeChanged(int w, int h, int oldw, int oldh) ,详情请加qq群联系151909524。

from android-stepsview.

Arisono avatar Arisono commented on September 26, 2024
public void setStepSize(int size) {
    mNumOfStep = size;
    refreshSizePosition();//每次设置的时候,重新计算 mThumbContainerXPosition
    invalidate();
}

@OverRide
public void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
//refreshSizePosition();//这一行必须注释掉
}

private void refreshSizePosition() {
    mCenterY = 0.5f * getHeight();
    mLeftX = mPadding;
    mLeftY = mCenterY - (mLineHeight / 2);
    mRightX = getWidth() - mPadding;
    mRightY = 0.5f * (getHeight() + mLineHeight);
    mDelta = (mRightX - mLeftX) / (mNumOfStep - 1);
  //  if (mThumbContainerXPosition.size()>0)mThumbContainerXPosition.clear();
    mThumbContainerXPosition.add(mLeftX);
    for (int i = 1; i < mNumOfStep - 1; i++) {
        mThumbContainerXPosition.add(mLeftX + (i * mDelta));

}
mThumbContainerXPosition.add(mRightX);
mDrawListener.onReady();
}

from android-stepsview.

Arisono avatar Arisono commented on September 26, 2024

如果不采取上面的方法, mStepsView.setCompletedPosition(position%labels.length)
.setLabels(labels)
.setBarColorIndicator(
ct.getResources().getColor(R.color.light_gray))
.setProgressColorIndicator(ct.getResources().getColor(R.color.orange))
.setLabelColorIndicator(ct.getResources().getColor(R.color.orange))
.drawView();
需要初始化一次,然后从网络取数据的时候,再执行一次,如果采取上述的解决方案,
就不需要初始化一次,直接网络加载完毕执行一段这样的代码,加载数据就可以;

from android-stepsview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.