Remove gkitchy adjustViewBounds, add landscape hack

This commit is contained in:
mittorn 2018-04-05 11:57:41 +07:00
parent b48d965111
commit 72e3313c30
2 changed files with 8 additions and 5 deletions

View file

@ -6,17 +6,18 @@
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_gravity="top"
android:layout_weight="1">
<ImageView
android:id="@+id/image"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="fill_horizontal|top"
android:layout_marginBottom="16dp"
android:layout_marginTop="16dp"
android:adjustViewBounds="true" />
android:layout_marginTop="0dp"
android:scaleType="fitStart"/>
</LinearLayout>
<TextView

View file

@ -185,7 +185,7 @@ public class XashTutorialActivity extends Activity implements View.OnClickListen
LayoutInflater inflater;
inflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
LinearLayout container = (LinearLayout)findViewById(R.id.container);
ViewGroup container = (ViewGroup)findViewById(R.id.container);
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
@ -200,7 +200,7 @@ public class XashTutorialActivity extends Activity implements View.OnClickListen
if( titleres == 0 )
break;
LinearLayout layout = (LinearLayout) inflater.inflate(R.layout.tutorial_step , null);
ViewGroup layout = (ViewGroup) inflater.inflate(R.layout.tutorial_step , null);
TextView title = (TextView) layout.findViewById(R.id.title);
TextView text = (TextView) layout.findViewById(R.id.content);
@ -215,6 +215,8 @@ public class XashTutorialActivity extends Activity implements View.OnClickListen
title.setText(titleres);
text.setText(contentres);
if( FWGSLib.isLandscapeOrientation(this) )
drawable.setScaleType(ImageView.ScaleType.FIT_CENTER);
drawable.setImageResource(drawableres);
scroll.addPage(layout);
numPages++;