Skip to content

Commit 7c4aa23

Browse files
author
tom
committed
when oratation is landspace ,the code activity.getResources().getDisplayMetrics().heightPixels return value when oratation is portrait
1 parent 282742b commit 7c4aa23

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ android {
2525

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

3131
testCompile 'junit:junit:4.12'

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.0.0-beta6'
8+
classpath 'com.android.tools.build:gradle:2.0.0-beta7'
99

1010

1111
// NOTE: Do not place your application dependencies here; they belong

giraffeplayer/src/main/java/tcking/github/com/giraffeplayer/GiraffePlayer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,9 @@ public void run() {
483483
if (portrait) {
484484
$.id(R.id.app_video_box).height(initHeight, false);
485485
} else {
486-
$.id(R.id.app_video_box).height(activity.getResources().getDisplayMetrics().heightPixels, false);
486+
int heightPixels = activity.getResources().getDisplayMetrics().heightPixels;
487+
int widthPixels = activity.getResources().getDisplayMetrics().widthPixels;
488+
$.id(R.id.app_video_box).height(Math.min(heightPixels,widthPixels), false);
487489
}
488490
updateFullScreenButton();
489491
}

0 commit comments

Comments
 (0)