Code example for View

Methods: getLayoutParamssetLayoutParams

0
        int lm = ((page * this.mForegroundWidth)
                 + (this.mForegroundWidth == 0 ?
                        0 : 
                        (int)(scrollOffSet * this.mForegroundWidth)));
        RelativeLayout.LayoutParams params =
                (RelativeLayout.LayoutParams)this.mForegroundBar.getLayoutParams();
        params.leftMargin = lm;
        this.mForegroundBar.setLayoutParams(params);
 
        // Reschedule the timer 
        rescheduleDimTimer(); 
        showIndicator(false); 
    } 
 
    /** 
     * Method that calculate and sets the page indicator size based on the 
     * number of pages. 
     */ 
    private void calculatePageIndicatorSize() { 
        // Only if number of pages has set 
        if (this.mNumberOfPages < 1) return;
 
        //Set the layout preferences 
        this.mForegroundWidth = this.mBackgroundWidth / this.mNumberOfPages;
        RelativeLayout.LayoutParams params =
                        new RelativeLayout.LayoutParams(
                                this.mForegroundWidth, this.mBackgroundgHeight);
        this.mForegroundBar.setLayoutParams(params);
    } 
 
    /** 
     * Method that reschedule the timer for hide the indicator 
     */ 
Experience pair programming with AI  Get Codota for Java