mirror of
https://github.com/etlegacy/etlegacy-android.git
synced 2024-11-10 06:52:06 +00:00
java: load xml file resource to display an image
This commit is contained in:
parent
4752d41532
commit
c1904cab07
1 changed files with 3 additions and 5 deletions
|
@ -101,14 +101,12 @@ public class ETLMain extends Activity {
|
|||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
|
||||
ImageView imageView = new ImageView(this);
|
||||
imageView.setBackgroundResource(R.drawable.ic_horizontal_black);
|
||||
imageView.setBackgroundResource(R.drawable.ic_horizontal_white);
|
||||
|
||||
LinearLayout etl_Layout = new LinearLayout(this);
|
||||
|
||||
RelativeLayout.LayoutParams etl_Params = new RelativeLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
|
||||
etl_Params.topMargin = pxToDp(Resources.getSystem().getDisplayMetrics().heightPixels / 2);
|
||||
RelativeLayout.LayoutParams etl_Params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
1024);
|
||||
|
||||
etl_Layout.addView(imageView, etl_Params);
|
||||
setContentView(etl_Layout);
|
||||
|
|
Loading…
Reference in a new issue