* Fixes #3303
* Refactor Nearby to alig lifecycle methods

* Pass updated place list to listfragment

* Added default zoom rate to mapbox

* Removed NearbyListFragmet and added the ui login to handle the same in NearbyParentFragment

* More code refactor
* Make BottomSheetList hideable
* onFragmentHide, hide the bottom sheets

* BigFix, Fragmet visibility, register/un-register camera move based on fragments lifecycke

* More code refactor
* Let the ExecutorUtil have non-ui thread
* Add Location Marker on non-ui thread (the non-ui stuffs)

* BugFixes
* Removed configchanges "orientation" from MainActivity in Manifest (That was messing with the fragment lifecycle)
* Some null checks
* Initialise lastknown location in onMapReady

* UI Fixes
* Adjusted UI to support dark and no-dark themes both (in nearby)
* Do not update map on Location Slightly changed

* Fix failing test case, let TestCommonsApplication extend Application instead of CommonsApplication

* start map view when nearby is visible

* start the map when NearbyFragmet is visible

* More bugfixes
* Added DUMMY view for NearbyPresenter's onDetach State
* Added a wrapper frame layout parent for MapView to preven it from drawing above other views

* More bugfixes (Fixes #3287)
* Gray out the un-selected markers from the nearby filter list

* BugFix, search this area should search the nearby places for the current camera position

* More BugFixes
* Handle null primitives with proxy
* Current location marker flow via permission flow

* onCameraMove should have null-check on NearbyController.latestSearchLocation instead of currentLocation

* Search for places around last focus location

* Handle location updates
* If the user is browsing the map, donot update the map with current location
This commit is contained in:
Ashish Kumar 2020-02-04 14:35:29 +05:30 committed by GitHub
parent a6d2523588
commit 05e98307be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 915 additions and 1254 deletions

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.navigation.NavigationView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/navigation_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:elevation="2dp"
app:headerLayout="@layout/drawer_header"
app:menu="@menu/drawer" />

View file

@ -8,7 +8,7 @@
app:layout_behavior="@string/bottom_sheet_behavior"
app:behavior_peekHeight="72dp"
app:behavior_hideable="true"
android:visibility="gone"
android:visibility="visible"
>

View file

@ -1,51 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="480dp"
android:id="@+id/bottom_sheet"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/bottom_sheet"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="?attr/mainBackground"
app:layout_behavior="@string/bottom_sheet_behavior"
app:behavior_peekHeight="0dp"
app:behavior_hideable="true"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/loading_nearby_list"
android:visibility="visible"
app:layout_behavior="@string/bottom_sheet_behavior"
android:background="@android:color/white">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_nearby_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible">
<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginTop="10dp"
android:textSize="20sp"
app:layout_constraintTop_toBottomOf="@+id/progress_bar"
android:text="Loading..."
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<FrameLayout
android:id="@+id/container_sheet"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusableInTouchMode="true"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:visibility="gone" />
</LinearLayout>
android:layout_height="match_parent" />
</RelativeLayout>

View file

@ -5,5 +5,6 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:elevation="2dp"
app:headerLayout="@layout/drawer_header"
app:menu="@menu/drawer" />

View file

@ -2,6 +2,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:visibility="gone"
>
<androidx.recyclerview.widget.RecyclerView

View file

@ -10,11 +10,6 @@
android:layout_height="match_parent"
android:background="@color/status_bar_blue"
android:id="@+id/map_layout">
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:focusableInTouchMode="true"/>
<include
layout="@layout/nearby_filter_all_items"
@ -27,11 +22,25 @@
android:layout_width="160dp"
android:layout_alignParentEnd="true"/>
<!-- I have done this intentionally, the mapview because of some elevation or something,
sometimes hangs over the drawer layout and sometimes draws its onPaused state over the contributions, this seems to be the probable fix -->
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/nearby_filter"/>
android:layout_below="@id/nearby_filter">
<com.mapbox.mapboxsdk.maps.MapView
android:id="@+id/map_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent" />
</FrameLayout>
<Button
@ -54,7 +63,6 @@
android:id="@+id/transparentView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/toolbar"
android:layout_alignParentLeft="true"
android:background="#aa969696"
android:visibility="gone"

View file

@ -1,21 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/search_list_item"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="25dp"
>
android:orientation="horizontal"
android:padding="4dp">
<ImageView
android:id="@+id/place_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</ImageView>
android:layout_height="wrap_content" />
<TextView
android:id="@+id/place_text"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</TextView>
android:layout_height="wrap_content"></TextView>
</LinearLayout>

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/search_list_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="4dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/place_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/place_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white"></TextView>
</LinearLayout>

View file

@ -277,7 +277,7 @@
<string name="wikicode_copied">The wikitext was copied to the clipboard</string>
<string name="nearby_location_has_not_changed">Location has not changed.</string>
<string name="nearby_location_not_available">Location not available.</string>
<string name="nearby_location_not_available">Nearby might not work properly, Location not available.</string>
<string name="location_permission_rationale_nearby">Permission required to display a list of nearby places</string>
<string name="get_directions">Get directions</string>
<string name="read_article">Read article</string>