Skip to content

Commit

Permalink
when oratation is landspace ,the code `activity.getResources().getDis…
Browse files Browse the repository at this point in the history
…playMetrics().heightPixels` return value when oratation is portrait
  • Loading branch information
tom committed Mar 23, 2016
1 parent 282742b commit 7c4aa23
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:appcompat-v7:23.2.1'
compile project(':giraffeplayer')

testCompile 'junit:junit:4.12'
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-beta6'
classpath 'com.android.tools.build:gradle:2.0.0-beta7'


// NOTE: Do not place your application dependencies here; they belong
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,9 @@ public void run() {
if (portrait) {
$.id(R.id.app_video_box).height(initHeight, false);
} else {
$.id(R.id.app_video_box).height(activity.getResources().getDisplayMetrics().heightPixels, false);
int heightPixels = activity.getResources().getDisplayMetrics().heightPixels;
int widthPixels = activity.getResources().getDisplayMetrics().widthPixels;
$.id(R.id.app_video_box).height(Math.min(heightPixels,widthPixels), false);
}
updateFullScreenButton();
}
Expand Down

1 comment on commit 7c4aa23

@wangrunxiang
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好像还是一样,并没有解决问题

Please sign in to comment.