Skip to content

Commit

Permalink
Fixed scrolling on discover page.
Browse files Browse the repository at this point in the history
  • Loading branch information
nessup committed Oct 29, 2013
1 parent ac27cdf commit 40a75af
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
private void findViews(View view) {
this.view = (ViewGroup) view;

ViewGroup columnsContainer = (ViewGroup) this.view.findViewById(R.id.columnsContainer);
columns = new ArrayList<ViewGroup>();
for (int i = 0; i < this.view.getChildCount(); i++) {
columns.add((ViewGroup) this.view.getChildAt(i));
for (int i = 0; i < columnsContainer.getChildCount(); i++) {
columns.add((ViewGroup) columnsContainer.getChildAt(i));
}
}

Expand Down
41 changes: 24 additions & 17 deletions Workoutathome/src/main/res/layout/discover_fragment.xml
Original file line number Diff line number Diff line change
@@ -1,33 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/columnsContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:gravity="center_horizontal"
android:background="@color/fragment_background"
>

<LinearLayout
android:id="@+id/column1"
android:layout_height="wrap_content"
android:layout_width="320dp"
android:orientation="vertical"
android:layout_width="match_parent"
android:orientation="horizontal"
android:gravity="center_horizontal"
android:id="@+id/columnsContainer"
>

</LinearLayout>
<LinearLayout
android:id="@+id/column1"
android:layout_height="wrap_content"
android:layout_width="320dp"
android:orientation="vertical"
>

<LinearLayout
android:id="@+id/column2"
android:layout_height="wrap_content"
android:layout_width="320dp"
android:layout_marginLeft="20dp"
android:orientation="vertical"
android:layout_toRightOf="@id/column1"
>
</LinearLayout>

<LinearLayout
android:id="@+id/column2"
android:layout_height="wrap_content"
android:layout_width="320dp"
android:layout_marginLeft="20dp"
android:orientation="vertical"
android:layout_toRightOf="@id/column1"
>

</LinearLayout>

</LinearLayout>

</LinearLayout>
</ScrollView>

0 comments on commit 40a75af

Please sign in to comment.