Skip to content

Commit

Permalink
set different layout
Browse files Browse the repository at this point in the history
  • Loading branch information
westnordost committed Aug 15, 2018
1 parent 449dc00 commit 23973aa
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package de.westnordost.streetcomplete.quests.segregated;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import de.westnordost.streetcomplete.R;
import de.westnordost.streetcomplete.quests.ImageListQuestAnswerFragment;
import de.westnordost.streetcomplete.view.Item;
Expand All @@ -13,5 +17,11 @@ public class AddCyclewaySegregationForm extends ImageListQuestAnswerFragment {
};
}

@Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState)
{
super.onViewCreated(view, savedInstanceState);
imageSelector.setCellLayout(R.layout.cell_labeled_icon_select_right);
}

@Override protected int getItemsPerRow() { return 2; }
}
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_path_segregated.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="128dp"
android:height="128dp"
android:width="64dp"
android:height="64dp"
android:viewportWidth="128"
android:viewportHeight="128">
<path
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_path_segregated_l.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="128dp"
android:height="128dp"
android:width="64dp"
android:height="64dp"
android:viewportWidth="128"
android:viewportHeight="128">
<path
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_path_segregated_no.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="128dp"
android:height="128dp"
android:width="64dp"
android:height="64dp"
android:viewportWidth="128"
android:viewportHeight="128">
<path
Expand Down
31 changes: 31 additions & 0 deletions app/src/main/res/layout/cell_labeled_icon_select_right.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:layout_width="180dp"
android:padding="6dp"
android:background="@drawable/image_select_cell">

<ImageView
android:id="@+id/imageView"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="6dp"
android:scaleType="fitCenter"
tools:src="@drawable/ic_path_segregated_no"
/>

<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/imageView"
android:layout_centerVertical="true"
style="@style/ImageSelectDescription"
tools:text="@string/quest_segregated_mixed" />

</RelativeLayout>

0 comments on commit 23973aa

Please sign in to comment.