I have a project in which i have to fill a glass of Beer with Bubbles & Fizz effect.
I am using a library : https://github.com/andyb129/BeerProgressView & after implementing this library, the animation does not works on arm based devices, i.e. arm64-v8a & armeabi-v7a.
Here is my code: https://drive.google.com/open?id=0B5kjnHTF2m1DWVNfQWtpYmlielk
I tried adding the library as a Module, as well as tried adding library using gradle also.
Also, enquired about issue on GitHub page also: https://github.com/andyb129/BeerProgressView/issues/7
Whereas Sample code is working: https://drive.google.com/open?id=0B5kjnHTF2m1DMXBIR2hwdUVleFU
If anybody can point out my mistake, i will be very grateful to you.
To display the progress: Custom View code is:
public void setBeerProgress(int beerProgress) {
mBeerProgress = beerProgress;
if (mBeerProgress > mMax){
mBeerProgress = mMax;
}
if (mBeerProgress < 0){
mBeerProgress = 0;
}
float pecent = mBeerProgress * 1.0f / mMax;
mBeerProgressHeight = pecent * mBeerHeight;
invalidate();
}
In the above code, mBeerHeight is always 0.
So i searched ahead,
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
mBeerWidth = (int) (getWidth() - mHaftBorderRadius);
Log.d(TAG, "Pawan getHeight(): "+getHeight());
mBeerHeight = (int) (getHeight() - mHaftBorderRadius);
mBorderRectF.set(mHaftBorderRadius, mHaftBorderRadius, mBeerWidth, mBeerHeight);
}
Here, in the above code, getHeight() is always 0.... :-(