Android-NiceTab icon indicating copy to clipboard operation
Android-NiceTab copied to clipboard

Cost too much CPU on refresh Draw

Open HarryQian opened this issue 8 years ago • 5 comments

Usage in Layout xml:
<me.amiee.nicetab.NiceTabLayout android:id="@+id/sliding_nice_tabs" android:layout_width="match_parent" android:layout_height="30dp" android:background="?colorPrimary" app:ntlDividerPaddingLeft="8dp" app:ntlDividerPaddingRight="8dp" app:ntlIndicatorHeight="2dp" app:ntlOverlayColor="#aa1a237e" app:ntlTabMode="titleOnly" app:ntlTextSize="18sp" app:ntlTextStyle="normal" app:ntlUnderlineHeight="1dp" />

Detect by memory working history, as attached

HarryQian avatar Jul 15 '16 11:07 HarryQian

mem

HarryQian avatar Jul 15 '16 12:07 HarryQian

The sample APK also have the same trouble. CPU usage nearly 40% when app is on top and be idle.

OS: Android 5.0.2(HTC one/802D) Android buildToolsVersion "23.0.3"; targetSdkVersion 23 (with gradle:2.1.2)

HarryQian avatar Jul 17 '16 17:07 HarryQian

and more... when I choose sample apk mode as "only image, no text"。 everything will be silent. It seems like text on tabs make the views redraw continuously!!!

HarryQian avatar Jul 17 '16 17:07 HarryQian

And more messages

when settting: app:ntlShowUnderline="false" The trouble will be avoided.

SO, the bug is from: NiceTabStrip.drawUnderline()

HarryQian avatar Jul 18 '16 04:07 HarryQian