Fixed resizing for landscape view.
Change-Id: I5d0ce922efef1eea682e61c05eba3554f9263a8d
Before Width: | Height: | Size: 202 B |
Before Width: | Height: | Size: 263 B After Width: | Height: | Size: 263 B |
BIN
android/sdremote/res/drawable-land-hdpi/handle_light.9.png
Normal file
After Width: | Height: | Size: 201 B |
BIN
android/sdremote/res/drawable-land-ldpi/handle_default.9.png
Normal file
After Width: | Height: | Size: 263 B |
BIN
android/sdremote/res/drawable-land-ldpi/handle_light.9.png
Normal file
After Width: | Height: | Size: 201 B |
BIN
android/sdremote/res/drawable-land-mdpi/handle_default.9.png
Normal file
After Width: | Height: | Size: 263 B |
BIN
android/sdremote/res/drawable-land-mdpi/handle_light.9.png
Normal file
After Width: | Height: | Size: 201 B |
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:drawable="@drawable/handle_vertical_light" android:state_activated="true"/>
|
||||
<item android:drawable="@drawable/handle_vertical_light" android:state_pressed="true"/>
|
||||
<item android:drawable="@drawable/handle_vertical_light" android:state_focused="true"/>
|
||||
<item android:drawable="@drawable/handle_vertical_default"/>
|
||||
|
||||
</selector>
|
@@ -134,8 +134,10 @@ public class PresentationFragment extends Fragment {
|
||||
|
||||
boolean aPortrait = (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT);
|
||||
|
||||
int aFlowSize = mTopView.getHeight();
|
||||
int aViewSize = mLayout.getHeight();
|
||||
int aFlowSize = aPortrait ? mTopView.getHeight() : mTopView
|
||||
.getWidth();
|
||||
int aViewSize = aPortrait ? mLayout.getHeight() : mLayout
|
||||
.getWidth();
|
||||
|
||||
// Calculate height change, taking limits into account
|
||||
int aDiff = (int) (aPortrait ? aEvent.getY() : aEvent.getX());
|
||||
@@ -163,12 +165,12 @@ public class PresentationFragment extends Fragment {
|
||||
aDiff = (int) (aHeightNew - mTopView.getImageHeight());
|
||||
}
|
||||
} else {
|
||||
aWidthNew = mTopView.getImageWidth();
|
||||
aWidthNew = mTopView.getImageWidth() + aDiff;
|
||||
aHeightNew = (float) (aWidthNew / aRatio);
|
||||
// Too High -- so scale down
|
||||
if (aHeightNew > mLayout.getHeight() - 50) {
|
||||
aHeightNew = mLayout.getHeight() - 50;
|
||||
aWidthNew = (float) (aHeightNew / aRatio);
|
||||
aWidthNew = (float) (aHeightNew * aRatio);
|
||||
aDiff = (int) (aWidthNew - mTopView.getImageWidth());
|
||||
}
|
||||
}
|
||||
|