Skip to content

Commit

Permalink
QuestionHelpFragment: Trying to use com.wefika.FlowLayout.
Browse files Browse the repository at this point in the history
However, the images appear vertically rather than horizontally.
  • Loading branch information
murraycu committed Dec 4, 2014
1 parent 156b529 commit 34e54e2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
<orderEntry type="library" exported="" scope="TEST" name="mockwebserver-2.0.0" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-21.0.2" level="project" />
<orderEntry type="library" exported="" name="picasso-2.4.0" level="project" />
<orderEntry type="library" exported="" name="flowlayout-0.3.4" level="project" />
<orderEntry type="library" exported="" name="library-1.0.8" level="project" />
</component>
<component name="org.twodividedbyzero.idea.findbugs">
Expand Down
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
import android.widget.TableRow;
import android.widget.TextView;

import com.wefika.flowlayout.FlowLayout;


/**
* A simple {@link Fragment} subclass.
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 34e54e2

Please sign in to comment.