mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
Added advanced query support in Nearby (#4714)
* Added feature for advanced query options in Nearby * Fix unit-tests coverage * wip-tests * Added log to identify if the nearby request is via an advanced query * Rolledback test-dependency updates * Fix tests * build fix * Added basic tests for relevant method in OkHttpJsonApiClient & NearbyController * Added NearbyParentFragmentPresenter Tests * Added AdvancedQueryFragment Unit Tests * Added more tests for NearbyParentFragmentPresenter * Reset ContributionsFragment with Upstream * Overload method loadNearbyPlaces for CustomQuery * Added more tests * Added more tests * Fixed tests for NearbyParentFragmentPresenter
This commit is contained in:
parent
bd00ce2071
commit
a0ff15cdc2
19 changed files with 823 additions and 47 deletions
7
app/src/main/res/drawable/advanced_query_border.xml
Normal file
7
app/src/main/res/drawable/advanced_query_border.xml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<stroke
|
||||
android:width="2dp"
|
||||
android:color="@color/divider_grey" />
|
||||
</shape>
|
||||
54
app/src/main/res/layout/fragment_advance_query.xml
Normal file
54
app/src/main/res/layout/fragment_advance_query.xml
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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:background="@color/white"
|
||||
android:padding="10dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/advanced_query_info_text"
|
||||
android:textColor="@color/secondaryTextColor"
|
||||
android:textStyle="bold"
|
||||
app:layout_constrainedHeight="true"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatEditText
|
||||
android:id="@+id/et_query"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/advanced_query_border"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/secondaryTextColor"
|
||||
app:layout_constrainedHeight="true"
|
||||
app:layout_constraintBottom_toTopOf="@id/btn_apply"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_title" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/btn_apply"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/apply"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constrainedHeight="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/btn_reset"
|
||||
style="@style/Widget.AppCompat.Button.Borderless"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/reset"
|
||||
android:textColor="@color/mapbox_blue"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/btn_apply" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
@ -6,6 +6,9 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
|
@ -129,6 +132,11 @@
|
|||
app:srcCompat="@drawable/ic_my_location_black_24dp"
|
||||
app:useCompatPadding="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_container_nearby_children"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
</RelativeLayout>
|
||||
|
||||
<include layout="@layout/bottom_sheet_nearby" />
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:elevation="@dimen/activity_margin_horizontal"
|
||||
android:background="@color/white">
|
||||
|
||||
|
|
@ -26,6 +26,15 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginVertical="@dimen/dimen_10"
|
||||
android:paddingBottom="48dp"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/btn_advanced_options"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/status_bar_blue"
|
||||
android:text="@string/advanced_options"
|
||||
android:textColor="@color/white"
|
||||
android:layout_marginTop="-48dp"
|
||||
android:layout_height="48dp"/>
|
||||
</LinearLayout>
|
||||
|
|
@ -326,6 +326,7 @@
|
|||
<string name="share_app_title">Share App</string>
|
||||
|
||||
<string name="error_fetching_nearby_places">Error fetching nearby places.</string>
|
||||
<string name="no_nearby_places_around">No nearby places around</string>
|
||||
<string name="error_fetching_nearby_monuments">Error fetching nearby monuments.</string>
|
||||
<string name="no_recent_searches">No recent searches</string>
|
||||
<string name="delete_recent_searches_dialog">Are you sure you want to clear your search history?</string>
|
||||
|
|
@ -673,4 +674,8 @@ Upload your first media by tapping on the add button.</string>
|
|||
<string name="contributions_of_user">Contributions of User: %s</string>
|
||||
<string name="achievements_of_user">Achievements of User: %s</string>
|
||||
<string name="menu_view_user_page">View user page</string>
|
||||
<string name="advanced_options">Advanced Options</string>
|
||||
<string name="advanced_query_info_text">You can customize the Nearby query. If you get errors, reset and apply.</string>
|
||||
<string name="apply">Apply</string>
|
||||
<string name="reset">Reset</string>
|
||||
</resources>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue