android - CardsLib with SpinnerWheel libraries - getting width and height must be > 0 on swipe -
im building application uses both libraries android-spinnerwheel & cardslib. spinnerwheel works fine, when seek utilize swipe delete feature of cardslib, messes spinnerwheel. error this:
06-21 10:43:04.873 17102-17102/com.bitcoinwatcher.app e/androidruntime﹕ fatal exception: main java.lang.illegalargumentexception: width , height must > 0 @ android.graphics.bitmap.createbitmap(bitmap.java:638) @ android.graphics.bitmap.createbitmap(bitmap.java:620) @ antistatic.spinnerwheel.abstractwheelview.recreateassets(abstractwheelview.java:185) @ antistatic.spinnerwheel.abstractwheel.onlayout(abstractwheel.java:457) i think somehow need tell wheel beingness deleted, yet couldnt find out how exactly. if manage so, happens before implementation occurs:
@override public void onswipe(card card) { } @override public void onundoswipe(card card) { } }
well, solution quite easy. appears cardslib continuously draws slider when not visible, causing draw bitmap width/height of 0. adding next safety check
if (width == 0 || height == 0) return; to abstractwheelview.java fixes issue. in conclusion,
protected void recreateassets(int width, int height) { if (width == 0 || height == 0) return; mspinbitmap = bitmap.createbitmap(width, height, bitmap.config.argb_8888); mseparatorsbitmap = bitmap.createbitmap(width, height, bitmap.config.argb_8888); setselectorpaintcoeff(0); } android
No comments:
Post a Comment