diff --git a/app/app.iml b/app/app.iml index b03b2e65..d6200a9a 100644 --- a/app/app.iml +++ b/app/app.iml @@ -92,6 +92,7 @@ + diff --git a/app/build.gradle b/app/build.gradle index ec40854d..f5dfac5d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -31,5 +31,6 @@ dependencies { compile 'com.android.support:recyclerview-v7:21.0.0' compile 'com.mcxiaoke.volley:library:1.0.8' compile 'com.squareup.picasso:picasso:2.4.0' + compile 'com.wefika:flowlayout:0.3.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 5f63e0d2..55b9b0ce 100644 --- a/app/src/main/java/com/murrayc/galaxyzoo/app/QuestionHelpFragment.java +++ b/app/src/main/java/com/murrayc/galaxyzoo/app/QuestionHelpFragment.java @@ -38,6 +38,8 @@ import android.widget.TableRow; import android.widget.TextView; +import com.wefika.flowlayout.FlowLayout; + /** * A simple {@link Fragment} subclass. @@ -124,8 +126,8 @@ private void addRowForAnswer(Activity activity, TableLayout tableLayout, Decisio layoutVertical.addView(textViewAnswer, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); - 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.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); paramsHorizontal.setMargins(0, UiUtils.getPxForDpResource(activity, R.dimen.standard_margin), 0, 0); @@ -152,8 +154,8 @@ private void addRowForAnswer(Activity activity, TableLayout tableLayout, Decisio //which uses the same name in fragment_subject.xml ViewCompat.setTransitionName(imageExample, getString(R.string.transition_subject_image)); - final LinearLayout.LayoutParams paramsImage = new LinearLayout.LayoutParams( - LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); + final FlowLayout.LayoutParams paramsImage = new FlowLayout.LayoutParams( + FlowLayout.LayoutParams.WRAP_CONTENT, FlowLayout.LayoutParams.WRAP_CONTENT); //This requires API level 17: paramsImage.setMarginStart(getPxForDp(activity, MARGIN_MEDIUM_DP)); //imageExample.setLayoutParams(paramsImage);