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

@@ -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++;