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

View file

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