RenderAndroid/WeexRender/src/main/java/com/taobao/weex/render/manager/RenderStats.java
/**
     * when fast fling,render when don't block main thread like normal view.
     * which lead to scroll so fast. and async render not responsive to screen.
     * so when fling too fast. when sleep while, which like normal view's layout and draw cost
     * and wait render to screen.
     * */
when fast fling,render when don't block main thread like normal view.
which lead to scroll so fast. and async render not responsive to screen.
so when fling too fast. when sleep while, which like normal view's layout and draw cost
and wait render to screen.
when fast fling render when don ' t block main thread like normal view . which lead to scroll so fast . and async render not responsive to screen . so when fling too fast . when sleep while which like normal view ' s layout and draw cost and wait render to screen .
public static void countPeriodDettachNum(Context context) {
        if(context instanceof Activity){
            Activity activity = (Activity) context;
            if(activity.isFinishing()){
                periodDettachNum = 0;
                return;
            }
        }
        if((System.currentTimeMillis() - lastDettachCountTime) > DETTACH_COUNT_PERIOD_TIME){
            lastDettachCountTime = System.currentTimeMillis();
            periodDettachNum = 1;
        }else{
            periodDettachNum++;
            if(periodDettachNum > MAX_DETTACH_NUM_ONE_PERIOD){
                if(sleepTime > 0){
                    try {
                        Thread.sleep(sleepTime);
                    } catch (InterruptedException e) {}
                }
            }
        }
        if(RenderLog.isDebugLogEnabled()){
            RenderLog.debug("RenderStats second dettach num " + periodDettachNum);
        }
    }
public static void countPeriodDettachNum ( Context context ) { if ( context instanceof Activity ) { Activity activity = ( Activity ) context ; if ( activity . isFinishing ( ) ) { periodDettachNum = 0 ; return ; } } if ( ( System . currentTimeMillis ( ) - lastDettachCountTime ) > DETTACH_COUNT_PERIOD_TIME ) { lastDettachCountTime = System . currentTimeMillis ( ) ; periodDettachNum = 1 ; } else { periodDettachNum ++ ; if ( periodDettachNum > MAX_DETTACH_NUM_ONE_PERIOD ) { if ( sleepTime > 0 ) { try { Thread . sleep ( sleepTime ) ; } catch ( InterruptedException e ) { } } } } if ( RenderLog . isDebugLogEnabled ( ) ) { RenderLog . debug ( "RenderStats second dettach num " + periodDettachNum ) ; } }
when fast fling,render when don't block main thread like normal view.
when fast fling render when don ' t block main thread like normal view .