Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

set layout params in dp value

float factor = getResources().getDisplayMetrics().density;
int pxWidth = (int)(dpWidth * factor);
int pxHeight = (int)(dpHeight * factor);
LinearLayout.LayoutParams layoutParams = 
  new LinearLayout.LayoutParams(pxWidth, pxHeight);
Comment

PREVIOUS NEXT
Code Example
Java :: System.out.println("Hello world") 
Java :: press enter in robot java 
Java :: enhanced for loop with arraylist 
Java :: check first character of string is number java 
Java :: cardview implementation 
Java :: how to multiply bigdecimals 
Java :: Java alt + f4 
Java :: java get jar execution directory 
Java :: how to get string from resource id android 
Java :: richest customer wealth leetcode 
Java :: map in java 
Java :: input file in java 
Java :: android studio get id name from view 
Java :: How to check if a string is in alphabetical order in java 
Java :: current time stamp android java 
Java :: binary to int java 
Java :: java try with resources 
Java :: get input in java 
Java :: Java ArrayList Class of Collections 
Java :: sound file java 
Java :: java arraylist with double 
Java :: settext java 
Java :: how to plus two numbers in java 
Java :: java queue implementation 
Java :: objectmapper in java 8 
Java :: java check if string contains multiple words 
Java :: Java How to use Map? 
Java :: return two values in java 
Java :: android studio clock bar change color programmatically 
Java :: MyLinkedList 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =