xml - Error "Could not find class android.graphics.drawable.RippleDrawable" occurs while changing FAB icon -
i have fab using in order hide or show bottomnavigationbar in pplication. works fine in andorid 7.0 (1080p), when trying run app in android 4.4 (720p), fab not visible.
also, when hiding or showing bottomnavigationbar, moving fab down , respectively, , changing icon on fab in order make little better.
this xml code
<relativelayout android:layout_height="match_parent" android:layout_width="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android"> <android.support.design.widget.floatingactionbutton android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentend="true" android:layout_alignparentbottom="true" android:layout_gravity="bottom|end" android:clickable="true" app:fabsize="mini" app:elevation="8dp" app:ripplecolor="@color/colorprimary" android:layout_margin="16dp" app:srccompat="@drawable/ic_show" /> <framelayout android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/container" xmlns:android="http://schemas.android.com/apk/res/android"> <!-- frame layout content --> </framelayout> <framelayout android:id="@+id/frame_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@android:color/transparent" android:elevation="3dp"> <!-- frame layout content --> </framelayout> <android.support.design.widget.bottomnavigationview android:id="@+id/navigation" android:layout_width="match_parent" android:layout_height="56dp" android:layout_alignparentbottom="true" android:background="@color/colorprimary" android:iconifiedbydefault="false" app:itemicontint="#fff" app:itemtextcolor="#fff" app:menu="@menu/bottom_bar"/> </relativelayout>
this code have in activity
fab.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { if(bottomnavigationview.getvisibility() == view.visible){ bottomnavigationview.setvisibility(gone); fab.setimagedrawable(contextcompat.getdrawable(getapplicationcontext(), r.drawable.ic_show)); final objectanimator movefab = objectanimator.offloat(fab, view.translation_y, fab.gety(), 0); movefab.setduration(300); movefab.setinterpolator(new decelerateinterpolator()); movefab.start(); }else if(bottomnavigationview.getvisibility() == view.gone){ bottomnavigationview.setvisibility(view.visible); fab.setimagedrawable(contextcompat.getdrawable(getapplicationcontext(), r.drawable.ic_hide)); final objectanimator movefab = objectanimator.offloat(fab, view.translation_y, fab.gety(), -150); movefab.setduration(300); movefab.setinterpolator(new decelerateinterpolator()); movefab.start(); } } });
my log cat says
could not find class 'android.graphics.drawable.rippledrawable', referenced method android.support.v7.widget.appcompatimagehelper.hasoverlappingrendering
am using not supported android 4.4 or making mistake?
i have gone through many questions similar titles, nothing seems relevant.
Comments
Post a Comment