Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Marging ViewPager

    int pagerPaddingVertical = Tools.dpToPx(SubscriptionActivity.this, 32);
    int pagerPaddingHorizontal = Tools.dpToPx(SubscriptionActivity.this, 32);
    int margin = Tools.dpToPx(SubscriptionActivity.this, 20);

    priceSlider.setClipToPadding(false);
    priceSlider.setPageMargin(margin);
    priceSlider.setPadding(pagerPaddingVertical, pagerPaddingHorizontal, pagerPaddingVertical, pagerPaddingHorizontal);

	// Convert dp to px
    public class Tools {
    	public static int dpToPx(Context c, int dp) {
        Resources r = c.getResources();
        return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: how to extract word from string in java 
Java :: youtube to mp4 stackoverflow 
Java :: bukkit api listener 
Java :: print zpl from java 
Java :: Longest decreasing subsequence in java 
Java :: how to stop extending jpa repository to every class in java 
Java :: java get first not null element 
Java :: functionality of consumer functional interface in java 
Java :: how to solve CopyBuffer from HiLo failed, no data 
Java :: longest subarray with equal 0 and 1 
Java :: managa firebase users 
Java :: arraycopy merging arrays 
Java :: java map get if contains else 0 
Java :: Set value of input in android webview 
Java :: Creating Hashmap from Treemap 
Java :: using for each loop for searching in array 
Java :: konva crop outside width and height of image 
Java :: unlock the screen 
Java :: dicom read with java 
Java :: download sources and javadoc 
Java :: System.Windows.Interactivity 
Java :: check if char is letter 
Java :: how to add a hyperlink in a string in java mail 
Java :: does stream map change original value 
Java :: getdatetimeinstance android 
Java :: dynamic fib 
Java :: java code for image encryption & decryption 
Java :: asserttrue in selenium java 
Java :: how do you create a txt file in java 
Java :: android studio analyze apk 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =