Skip to content

Commit

Permalink
Update MainActivity.java
Browse files Browse the repository at this point in the history
  • Loading branch information
robertoviola-systemelectronics committed Jun 26, 2024
1 parent df25f9e commit 2089e26
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions app/src/main/java/org/cagnulein/android_remote/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -296,16 +296,17 @@ public void set_display_nd_touch() {
float this_device_aspect_ratio;
int padding = 0;
/*if(context.getSharedPreferences(PREFERENCE_KEY, 0).getBoolean("original_aspect_ratio", false))*/ {
if (!landscape) {
/*if (!landscape)*/ {
//Portrait
this_device_aspect_ratio = this_dev_height/this_dev_width;
if (remote_device_aspect_ratio > this_device_aspect_ratio) {
padding = (int)((this_dev_width - (this_dev_height / remote_device_aspect_ratio)) / 2);
linearLayout.setPadding(padding,0,padding,0);
linearLayout.setPadding(padding, 0, padding, 0);
} else if (remote_device_aspect_ratio < this_device_aspect_ratio) {
//linearLayout.setPadding(0,(int) (((this_device_aspect_ratio - remote_device_aspect_ratio)*this_dev_width)),0,0);
padding = (int)((this_dev_height - (this_dev_width / remote_device_aspect_ratio)) / 2);
linearLayout.setPadding(0, padding 0, padding);
}

/*
}else{ //Landscape
this_device_aspect_ratio = this_dev_width/this_dev_height;
if (remote_device_aspect_ratio > this_device_aspect_ratio) {
Expand All @@ -316,7 +317,7 @@ public void set_display_nd_touch() {
//linearLayout.setPadding(((int) (((this_device_aspect_ratio - remote_device_aspect_ratio)*this_dev_height))/2),0,((int) (((this_device_aspect_ratio - remote_device_aspect_ratio)*this_dev_height))/2),0);
}
}
}*/
logger.info("aspect_ratio " + landscape + " " + remote_device_aspect_ratio + " " + this_device_aspect_ratio + " " + this_dev_width + " " + this_dev_height + " " + padding + " " + remote_device_height + " " + remote_device_width);
}

Expand Down

0 comments on commit 2089e26

Please sign in to comment.