Added a feature for editing coordinates (#4418)
* not * Place Picker added * Pick location and API call linked * minor warnings resolved * Code conventions followed * issue fixed * Wikitext edited properly * minor modification * Location Picker added * Bottom sheet removed * Location picker fully implemented * credit added * credit added * issues fixed * issues fixed * minor issue fixed
BIN
app/src/main/res/drawable-hdpi/map_default_map_marker.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
app/src/main/res/drawable-hdpi/map_default_map_marker_shadow.png
Normal file
|
After Width: | Height: | Size: 778 B |
BIN
app/src/main/res/drawable-hdpi/mapbox_logo_icon.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
app/src/main/res/drawable-mdpi/map_default_map_marker.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
app/src/main/res/drawable-mdpi/map_default_map_marker_shadow.png
Normal file
|
After Width: | Height: | Size: 474 B |
BIN
app/src/main/res/drawable-mdpi/mapbox_logo_icon.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
app/src/main/res/drawable-xhdpi/map_default_map_marker.png
Normal file
|
After Width: | Height: | Size: 6 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
BIN
app/src/main/res/drawable-xhdpi/mapbox_logo_icon.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
BIN
app/src/main/res/drawable-xxhdpi/map_default_map_marker.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
BIN
app/src/main/res/drawable-xxhdpi/mapbox_logo_icon.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/map_default_map_marker.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/mapbox_logo_icon.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
20
app/src/main/res/layout/activity_location_picker.xml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".LocationPicker.LocationPickerActivity">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/location_picker_app_bar_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<include layout="@layout/toolbar_location_picker"/>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<include layout="@layout/content_location_picker"/>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
35
app/src/main/res/layout/bottom_container_location_picker.xml
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?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:layout_gravity="bottom">
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/location_chosen_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:tint="@color/white"
|
||||
app:backgroundTint="@color/wikimedia_green"
|
||||
app:elevation="3dp"
|
||||
app:layout_anchorGravity="top|end"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:srcCompat="@drawable/ic_check_black_24dp"
|
||||
android:contentDescription="@string/select_location_location_picker" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_attribution"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:text="@string/map_attribution"
|
||||
android:textAlignment="center"
|
||||
android:textSize="10sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
49
app/src/main/res/layout/content_location_picker.xml
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?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"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/location_picker_image_view_marker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:elevation="2dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/map_default_map_marker"
|
||||
android:contentDescription="@string/location_picker_image_view" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/location_picker_image_view_shadow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:elevation="1dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/map_view"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/location_picker_image_view_marker"
|
||||
app:layout_constraintVertical_bias="0.0"
|
||||
app:srcCompat="@drawable/map_default_map_marker_shadow"
|
||||
android:contentDescription="@string/location_picker_image_view_shadow" />
|
||||
|
||||
<com.mapbox.mapboxsdk.maps.MapView
|
||||
android:id="@+id/map_view"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:mapbox_uiLogo="false"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
</com.mapbox.mapboxsdk.maps.MapView>
|
||||
|
||||
<include layout="@layout/bottom_container_location_picker"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
@ -249,6 +249,16 @@
|
|||
android:drawablePadding="@dimen/tiny_gap"
|
||||
android:drawableStart="?attr/iconMap24"
|
||||
tools:text="Coordinates link" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/coordinate_edit"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginTop="@dimen/standard_gap"
|
||||
android:layout_marginBottom="@dimen/standard_gap"
|
||||
android:layout_gravity="end"
|
||||
android:background="@drawable/ic_baseline_edit_24" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
|
|
|||
50
app/src/main/res/layout/toolbar_location_picker.xml
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/location_picker_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="78dp"
|
||||
tools:background="@color/primaryColor">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/location_picker_toolbar_primary_text_view"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="72dp"
|
||||
android:text="@string/choose_a_location"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toTopOf="@+id/location_picker_toolbar_secondary_text_view"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/location_picker_toolbar_secondary_text_view"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="72dp"
|
||||
android:text="@string/pan_and_zoom_to_adjust"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="normal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/location_picker_toolbar_primary_text_view"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/mapbox_place_picker_toolbar_back_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:contentDescription="@string/exit_location_picker"
|
||||
android:tint="@color/white"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_arrow_back_white"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
@ -513,6 +513,13 @@ Upload your first media by tapping on the add button.</string>
|
|||
<string name="category_edit_helper_edit_message_else">Could not add categories.</string>
|
||||
<string name="category_edit_button_text">Update categories</string>
|
||||
|
||||
<string name="coordinates_edit_helper_make_edit_toast">Trying to update coordinates.</string>
|
||||
<string name="coordinates_edit_helper_show_edit_title">Coordinates update</string>
|
||||
<string name="coordinates_edit_helper_show_edit_title_success">Success</string>
|
||||
<string name="coordinates_edit_helper_show_edit_message">Coordinates %1$s are added.</string>
|
||||
<string name="coordinates_edit_helper_edit_message_else">Could not add coordinates.</string>
|
||||
<string name="coordinates_picking_unsuccessful">Unable to get coordinates.</string>
|
||||
|
||||
<string name="share_image_via">Share image via</string>
|
||||
<string name="no_achievements_yet">You haven\'t made any contributions yet</string>
|
||||
<string name="account_created">Account created!</string>
|
||||
|
|
@ -615,5 +622,11 @@ Upload your first media by tapping on the add button.</string>
|
|||
<string name="app_ui_language">App user interface language</string>
|
||||
<string name="remove">Removes a caption and description</string>
|
||||
<string name="read_help_link">Read more</string>
|
||||
<string name="choose_a_location">Choose a location</string>
|
||||
<string name="pan_and_zoom_to_adjust">Pan and zoom to adjust</string>
|
||||
<string name="exit_location_picker">Exit location picker</string>
|
||||
<string name="select_location_location_picker">Select location</string>
|
||||
<string name="location_picker_image_view">Location picker image view</string>
|
||||
<string name="location_picker_image_view_shadow">Location picker_image_view_shadow</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
|||