From 37afc0da35945f3ef3bb01814ed3e2f14f2c1553 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Sun, 12 Oct 2014 16:00:28 +0200 Subject: [PATCH] QuestionHelpFragment: Use ApmeM's FlowLayout. To avoid the example images going off the right hand side of the screen when there are too many. --- app/app.iml | 1 + app/build.gradle | 1 + .../com/murrayc/galaxyzoo/app/QuestionHelpFragment.java | 6 ++++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/app.iml b/app/app.iml index f3d6a117..e75b65b9 100644 --- a/app/app.iml +++ b/app/app.iml @@ -82,6 +82,7 @@ + diff --git a/app/build.gradle b/app/build.gradle index 5ec604cb..7a0c35c3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -27,5 +27,6 @@ android { dependencies { compile 'com.android.support:support-v4:20.0.0' + compile 'org.apmem.tools:layouts:1.4' androidTestCompile 'com.squareup.okhttp:mockwebserver:2.0.0' } diff --git a/app/src/main/java/com/murrayc/galaxyzoo/app/QuestionHelpFragment.java b/app/src/main/java/com/murrayc/galaxyzoo/app/QuestionHelpFragment.java index 54bfe610..5d385291 100644 --- a/app/src/main/java/com/murrayc/galaxyzoo/app/QuestionHelpFragment.java +++ b/app/src/main/java/com/murrayc/galaxyzoo/app/QuestionHelpFragment.java @@ -19,6 +19,8 @@ import com.murrayc.galaxyzoo.app.Config; +import org.apmem.tools.layouts.FlowLayout; + /** * A simple {@link Fragment} subclass. @@ -106,8 +108,8 @@ private void addRowForAnswer(Activity activity, TableLayout tableLayout, Decisio textViewAnswer.setText(answer.getText()); layoutVertical.addView(textViewAnswer); - final LinearLayout layoutHorizontal = new LinearLayout(activity); - layoutHorizontal.setOrientation(LinearLayout.HORIZONTAL); + final FlowLayout layoutHorizontal = new FlowLayout(activity); + //layoutHorizontal.setOrientation(LinearLayout.HORIZONTAL); final LinearLayout.LayoutParams paramsHorizontal = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); paramsHorizontal.setMargins(0, UiUtils.getPxForDpResource(activity, R.dimen.standard_margin), 0, 0);