diff options
author | Marcin Zelent <zelent.marcin@gmail.com> | 2018-04-23 17:19:58 +0200 |
---|---|---|
committer | Marcin Zelent <zelent.marcin@gmail.com> | 2018-04-23 17:19:58 +0200 |
commit | e2f49fe23b2ae1a910ab7015167e5ed9a5e4988a (patch) | |
tree | bbc450ed3480593480efcba5a5a58dcd63fa51c1 /app/src/main/res/layout | |
parent | 2cf7ca569e50caa8d33d4045977d69d1f10771c2 (diff) |
Added proper new observation layout with geolocation and bird choosing,
added swipe refreshing.
Diffstat (limited to 'app/src/main/res/layout')
-rw-r--r-- | app/src/main/res/layout/activity_new_observation.xml | 137 | ||||
-rw-r--r-- | app/src/main/res/layout/activity_observation_details.xml | 14 | ||||
-rw-r--r-- | app/src/main/res/layout/birds_list_item.xml | 26 | ||||
-rw-r--r-- | app/src/main/res/layout/observations_list.xml | 14 |
4 files changed, 170 insertions, 21 deletions
diff --git a/app/src/main/res/layout/activity_new_observation.xml b/app/src/main/res/layout/activity_new_observation.xml index 1160131..0f3b10f 100644 --- a/app/src/main/res/layout/activity_new_observation.xml +++ b/app/src/main/res/layout/activity_new_observation.xml @@ -6,14 +6,139 @@ android:layout_height="match_parent" tools:context=".NewObservationActivity"> - <Button - android:id="@+id/button" - android:layout_width="wrap_content" + <Spinner + android:id="@+id/new_birds" + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_marginEnd="16dp" + android:layout_marginLeft="16dp" + android:layout_marginRight="16dp" + android:layout_marginStart="16dp" + android:layout_marginTop="16dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <EditText + android:id="@+id/new_population" + android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_marginLeft="8dp" + android:layout_marginEnd="8dp" + android:layout_marginLeft="16dp" + android:layout_marginRight="16dp" android:layout_marginStart="8dp" android:layout_marginTop="8dp" - android:text="Button" + android:ems="10" + android:hint="@string/population" + android:inputType="textPersonName" + app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toBottomOf="@+id/new_birds" /> + + <EditText + android:id="@+id/new_place" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginEnd="8dp" + android:layout_marginLeft="16dp" + android:layout_marginRight="16dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + android:ems="10" + android:hint="@string/place" + android:inputType="textPersonName" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/new_population" /> + + <EditText + android:id="@+id/new_longitude" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginEnd="8dp" + android:layout_marginLeft="16dp" + android:layout_marginRight="16dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + android:ems="10" + android:hint="@string/longitude" + android:inputType="textPersonName" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/new_place" /> + + <EditText + android:id="@+id/new_latitude" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginEnd="8dp" + android:layout_marginLeft="16dp" + android:layout_marginRight="16dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + android:ems="10" + android:hint="@string/latitude" + android:inputType="textPersonName" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/new_longitude" /> + + <EditText + android:id="@+id/new_comment" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_marginBottom="8dp" + android:layout_marginEnd="8dp" + android:layout_marginLeft="16dp" + android:layout_marginRight="16dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + android:ems="10" + android:gravity="top" + android:hint="@string/comment" + android:inputType="textMultiLine" + app:layout_constraintBottom_toTopOf="@+id/linearLayout" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/new_latitude" /> + + <LinearLayout + android:id="@+id/linearLayout" + style="?android:attr/buttonBarStyle" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginBottom="8dp" + android:layout_marginEnd="8dp" + android:layout_marginLeft="16dp" + android:layout_marginRight="16dp" + android:layout_marginStart="8dp" + android:orientation="horizontal" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="parent"> + + <Button + android:id="@+id/new_cancel" + style="?android:attr/buttonBarButtonStyle" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_weight="1" + android:text="@string/cancel" /> + + <Button + android:id="@+id/new_add" + style="?android:attr/buttonBarButtonStyle" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginEnd="8dp" + android:layout_marginRight="8dp" + android:layout_weight="1" + android:text="@string/add" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" /> + </LinearLayout> + </android.support.constraint.ConstraintLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/activity_observation_details.xml b/app/src/main/res/layout/activity_observation_details.xml index 4372b9a..7d0fd80 100644 --- a/app/src/main/res/layout/activity_observation_details.xml +++ b/app/src/main/res/layout/activity_observation_details.xml @@ -61,7 +61,7 @@ android:layout_height="wrap_content" android:layout_weight="1" android:minLines="1" - android:text="@string/created" + android:text="@string/created2" android:textStyle="bold" /> <TextView @@ -85,7 +85,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:ellipsize="none" - android:text="@string/author" + android:text="@string/author2" android:textStyle="bold" /> <TextView @@ -109,7 +109,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" - android:text="@string/population" + android:text="@string/population2" android:textStyle="bold" /> <TextView @@ -132,7 +132,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" - android:text="@string/place" + android:text="@string/place2" android:textStyle="bold" /> <TextView @@ -155,7 +155,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" - android:text="@string/longitude" + android:text="@string/longitude2" android:textStyle="bold" /> <TextView @@ -178,7 +178,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" - android:text="@string/latitude" + android:text="@string/latitude2" android:textStyle="bold" /> <TextView @@ -201,7 +201,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" - android:text="@string/comment" + android:text="@string/comment2" android:textStyle="bold" /> <TextView diff --git a/app/src/main/res/layout/birds_list_item.xml b/app/src/main/res/layout/birds_list_item.xml new file mode 100644 index 0000000..7f928ab --- /dev/null +++ b/app/src/main/res/layout/birds_list_item.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:padding="8dp"> + + <ImageView + android:id="@+id/bli_photo" + app:srcCompat="@drawable/ic_launcher_background" + android:layout_width="40dp" + android:layout_height="40dp" /> + + <TextView + android:id="@+id/bli_name" + android:textSize="20sp" + android:layout_marginTop="6dp" + android:maxLines="1" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignParentTop="true" + android:layout_toRightOf="@+id/bli_photo" + android:layout_toEndOf="@+id/bli_photo" + android:layout_marginLeft="12dp" + android:layout_marginStart="12dp" /> +</RelativeLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/observations_list.xml b/app/src/main/res/layout/observations_list.xml index 8be21a1..9e04484 100644 --- a/app/src/main/res/layout/observations_list.xml +++ b/app/src/main/res/layout/observations_list.xml @@ -1,16 +1,14 @@ <?xml version="1.0" encoding="utf-8"?> -<android.support.constraint.ConstraintLayout +<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/swiperefresh" android:layout_width="match_parent" android:layout_height="match_parent"> + <ListView android:id="@+id/observations_list_view" android:layout_width="match_parent" - android:layout_height="match_parent" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" /> -</android.support.constraint.ConstraintLayout>
\ No newline at end of file + android:layout_height="match_parent"/> + +</android.support.v4.widget.SwipeRefreshLayout>
\ No newline at end of file |