Refactor uploads (#2981)

* Feature/refractor uploads [WIP] (#2887)

* Fix duplicate param information (#2515)

* Bug fix issue #2476 (#2526)

* Added wikidataEntityID in all db versions, handled db.execSql via method runQuery

* Versioning and changelog for v2.10.2 (#2531)

* Update changelog.md

* Versioning for v2.10.2

* Update changelog.md

* Bugfix/issue 2580 (#2584)

* Corrected string placedholders in certain string files

* Corrected string placedholders in certain string files[Bug fix #2580]

* Bug Fix #2585 (#2647)

* Bug Fix #2585
* Added null checks on view in SearchImageFragment when updating views from external sources
* Disposed the disposables in SearchActivity and SearchImageFragment when no longer in active lifecycle

* use FragmentUtils to verify fragment active state

* Bug Fix issue #2648 (#2678)

* Bug Fix issue #2648
* Handled external storage permission before file download

* * Removed redudant check for permission in MediaDetailPagerFragment (Dexter already does that)
* Removed duplicate code in PermissionUtil$checkPermissionsAndPerformAction, used the existing function with conditional extra parameters

* string name typo correction

* BugFix issue #2652 (#2706)

* Addded null check on bookmark before operating on it

* BugFix issue #2711 (#2712)

* Added null checks in OkHttpJsonApiClient$searchImages MwQueryResponse

* BugFix #2718 (#2719)

* Handled null auth cookies

* Fix #2791: NPE when nominating for deletion and leaving screen (#2792)

* Bug Fix issue #2789 (#2790)

* Handled Illegal State Exception for non existent appropriate view parents in ViewUtils$showShortSnackbar

* BugFix #2720 (#2831)

BugFix deprecated licenes #2720

* ui fixes, wip, upload

* *Issue #2886, BugFix #2832[wip]
* updated UploadActivity code
* modified ui
* Updated UploadPresenterTest

* * updated interfaces names to follow names suffixed with Contract
* added test cases

* card view elevation

* view pager disabled swipe

* bug fix, duplicate image

* used existing non-swipable view pager

* Avoid image view resize with keyboard, added adjustPan and stateVisible as softinputMode for UploadActivity

* retain UploadBaseFragment instances on orientation changes

* * Added test cases for UploadMediaPresenter
* Injected io and main thread schedulers

* categories presenter test cased wip

* Added CategoriesPresenter test

* * Added the logic to show open map (with to be uploaded image's coordinates while uploading image)

* codacy suggested changes * added java docs

* Added travis_wait fot android-wait-for-emulator

* ranamed interface onResponseCallback to Callback

* * Added api to delete picture in UploadModel
* cleanUp in UploadModel. once upload has been initiated
* Removed unused methods from UploadModel and the corresponding test class

* * Added tests for UploadPresenter
* Travis suggested changes
* Addded copy previous title and description

* * Made the upload add descriptions visible when keyboard visible
* add description request focus only when user manually requests it

* Added JavaDocs, review suggested changes

* Fix dagger injection

* use DialogUtil to show info in descriptions

* use activity context for DialogUtil

* Minor changes

* Bug fix, reduced the add description edit text clickable bound (#2973)

* Bugfix/uploads (#3000)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Fix memory leak (#3001)

* Bugfix/uploads (#3002)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Bugfix/uploads (#3011)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Avoid memory leak, free the adpater in MediaLicenseFragment.onDestroyView

* bugfix/uploads (#3012)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Avoid memory leak, free the adpater in MediaLicenseFragment.onDestroyView

* BugFix Illegal State Exception in ViewpPagerAdapter

* Remove irrelevant comment

* merge conflict with strings (#3016)
This commit is contained in:
Ashish Kumar 2019-06-14 01:09:41 +05:30 committed by Vivek Maskara
parent 04b051b37a
commit 7a5dc77057
68 changed files with 3753 additions and 2086 deletions

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/thumbnail_selected"
android:state_pressed="true"/>
<item android:drawable="@drawable/thumbnail_selected"
android:state_focused="true"/>
<item android:state_selected="true" android:drawable="@drawable/thumbnail_selected"/>
<item android:drawable="@drawable/thumbnail_not_selected"/>
</selector>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/white"></solid>
</shape>

View file

@ -0,0 +1,11 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke
android:color="@color/primaryDarkColor"
android:width="2dp"/>
<solid android:color="#F8F7F5"/>
<padding
android:bottom="2dp"
android:left="2dp"
android:right="2dp"
android:top="2dp"/>
</shape>

View file

@ -1,34 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/upload_root_layout"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/upload_root_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.github.chrisbanes.photoview.PhotoView
android:id="@+id/backgroundImage"
android:layout_height="match_parent"
>
<fr.free.nrw.commons.contributions.UnswipableViewPager
android:id="@+id/vp_upload"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/commons_app_blue_dark"
/>
<androidx.cardview.widget.CardView
android:id="@+id/cv_container_top_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
android:elevation="@dimen/cardview_default_elevation"
>
<LinearLayout
android:id="@+id/ll_container_top_card"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/toolbar"
android:background="@color/commons_app_blue_dark"
app:actualImageScaleType="fitCenter" />
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/standard_gap"
>
<ViewFlipper
android:id="@+id/view_flipper"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
android:measureAllChildren="false">
<RelativeLayout
android:id="@+id/rl_container_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TextView
android:id="@+id/tv_top_card_title"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_marginTop="@dimen/small_gap"
android:textSize="@dimen/normal_text"
android:textStyle="bold"
tools:text="4 Uploads"
/>
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/ib_toggle_top_card"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginBottom="@dimen/small_gap"
android:layout_marginEnd="@dimen/small_gap"
android:layout_marginStart="@dimen/small_gap"
android:clickable="false"
android:focusable="false"
app:srcCompat="@drawable/ic_expand_less_black_24dp"
style="@style/Widget.AppCompat.Button.Borderless"
/>
<include
layout="@layout/activity_upload_bottom_card"
android:visibility="visible" />
</RelativeLayout>
<include layout="@layout/activity_upload_categories" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_thumbnails"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/small_gap"
/>
<include layout="@layout/activity_upload_license" />
<include layout="@layout/activity_upload_please_wait" />
</ViewFlipper>
</LinearLayout>
</androidx.cardview.widget.CardView>
</RelativeLayout>

View file

@ -1,199 +0,0 @@
<?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:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.cardview.widget.CardView
android:id="@+id/top_card"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:elevation="@dimen/cardview_default_elevation"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="UnusedAttribute"
tools:showIn="@layout/activity_upload">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/top_card_title"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginStart="@dimen/small_gap"
android:layout_marginTop="@dimen/small_gap"
android:layout_marginEnd="@dimen/small_gap"
android:layout_marginBottom="@dimen/small_gap"
android:gravity="center_vertical"
android:textSize="@dimen/normal_text"
android:textStyle="bold"
tools:text="4 Uploads" />
<ImageButton
android:id="@+id/top_card_expand_button"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginStart="@dimen/small_gap"
android:layout_marginTop="@dimen/small_gap"
android:layout_marginEnd="@dimen/small_gap"
android:layout_marginBottom="@dimen/small_gap"
android:padding="0dp"
app:srcCompat="@drawable/ic_expand_less_black_24dp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/top_card_thumbnails"
android:layout_width="match_parent"
android:layout_height="90dp"
android:layout_below="@id/top_card_title"
android:layout_marginBottom="@dimen/small_gap" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/bottom_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="@dimen/cardview_default_elevation"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
tools:ignore="UnusedAttribute"
tools:showIn="@layout/activity_upload">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/relativeLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/small_gap">
<TextView
android:id="@+id/bottom_card_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:textSize="@dimen/normal_text"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Step 1 of 15" />
<TextView
android:id="@+id/bottom_card_subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:textSize="@dimen/subtitle_text"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/bottom_card_title"
tools:text="1st image" />
<ImageButton
android:id="@+id/right_card_map_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:visibility="visible"
app:layout_constraintEnd_toStartOf="@+id/bottom_card_expand_button"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_map_white_24dp" />
<ImageButton
android:id="@+id/bottom_card_expand_button"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="24dp"
android:layout_height="24dp"
android:padding="0dp"
android:rotation="180"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_expand_less_black_24dp" />
<fr.free.nrw.commons.widget.HeightLimitedRecyclerView
android:id="@+id/rv_descriptions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="20dp"
app:layout_constraintBottom_toTopOf="@+id/prev_title_desc"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/bottom_card_subtitle"
tools:visibility="gone" />
<Button
android:id="@+id/prev_title_desc"
android:layout_width="match_parent"
android:layout_height="25dp"
android:background="@color/white"
android:text="@string/previous_image_title_description"
android:textColor="@color/button_blue"
android:layout_marginBottom="15dp"
android:layout_marginEnd="3.5dp"
android:gravity="center"
style="@style/Widget.AppCompat.Button.Borderless"
app:layout_constraintBottom_toTopOf="@id/bottom_card_previous"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/rv_descriptions" />
<Button
android:id="@+id/bottom_card_next"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/next"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<Button
android:id="@+id/bottom_card_previous"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:text="@string/previous"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/bottom_card_next"
app:layout_constraintRight_toLeftOf="@id/bottom_card_next" />
<Button
android:id="@+id/bottom_card_add_desc"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="48dp"
android:text="+"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,127 +0,0 @@
<?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="match_parent"
android:layout_marginBottom="8dp"
android:orientation="vertical"
tools:showIn="@layout/activity_upload">
<TextView
android:id="@+id/categories_title"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:layout_marginStart="@dimen/standard_gap"
android:layout_marginLeft="@dimen/standard_gap"
android:layout_marginTop="@dimen/standard_gap"
android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:gravity="center_vertical"
android:textSize="@dimen/normal_text"
android:textStyle="bold"
tools:text="Step 1 of 15" />
<TextView
android:id="@+id/categories_subtitle"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:layout_marginStart="@dimen/standard_gap"
android:layout_marginLeft="@dimen/standard_gap"
android:layout_marginTop="@dimen/tiny_gap"
android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:layout_alignParentLeft="true"
android:gravity="center_vertical"
android:textSize="@dimen/subtitle_text"
android:text="@string/upload_flow_all_images_in_set"
android:layout_below="@+id/categories_title"
android:visibility="gone" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="@+id/category_search_layout"
android:layout_marginStart="@dimen/standard_gap"
android:layout_marginLeft="@dimen/standard_gap"
android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:layout_below="@id/categories_subtitle">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/category_search_container"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/category_search"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/categories_search_text_hint"
android:imeOptions="actionSearch"
android:inputType="text"
android:maxLines="1" />
</com.google.android.material.textfield.TextInputLayout>
<ProgressBar
android:id="@+id/categoriesSearchInProgress"
style="?android:progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/tiny_gap"
android:layout_marginRight="@dimen/tiny_gap"
android:layout_gravity="center_vertical|end"
android:indeterminate="true"
android:indeterminateOnly="true"
android:visibility="gone"
tools:visibility="visible" />
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/categories"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/standard_gap"
android:layout_marginLeft="@dimen/standard_gap"
android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:layout_above="@+id/button_divider"
android:layout_below="@id/category_search_layout" />
<View
android:id="@+id/button_divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_above="@+id/category_next"
android:background="@color/divider_grey" />
<Button
android:id="@+id/category_next"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="24dp"
android:layout_marginRight="24dp"
android:layout_marginBottom="24dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:text="@string/next" />
<Button
android:id="@+id/category_previous"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:layout_marginBottom="24dp"
android:layout_toStartOf="@id/category_next"
android:layout_toLeftOf="@id/category_next"
android:layout_alignParentBottom="true"
android:text="@string/previous" />
</RelativeLayout>

View file

@ -1,116 +0,0 @@
<?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="match_parent"
android:orientation="vertical"
android:layout_marginBottom="8dp"
tools:showIn="@layout/activity_upload">
<TextView
android:id="@+id/license_title"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:layout_marginStart="@dimen/standard_gap"
android:layout_marginLeft="@dimen/standard_gap"
android:layout_marginTop="@dimen/standard_gap"
android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:gravity="center_vertical"
android:textSize="@dimen/normal_text"
android:textStyle="bold"
tools:text="Step 1 of 15" />
<TextView
android:id="@+id/license_subtitle"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:layout_marginStart="@dimen/standard_gap"
android:layout_marginLeft="@dimen/standard_gap"
android:layout_marginTop="@dimen/tiny_gap"
android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:layout_alignParentLeft="true"
android:gravity="center_vertical"
android:textSize="@dimen/subtitle_text"
android:text="@string/upload_flow_all_images_in_set"
android:layout_below="@+id/license_title"
android:visibility="gone" />
<Spinner
android:id="@+id/license_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/standard_gap"
android:layout_marginLeft="@dimen/standard_gap"
android:layout_marginTop="@dimen/standard_gap"
android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:layout_below="@id/license_subtitle"
tools:visibility="gone"/>
<fr.free.nrw.commons.ui.widget.HtmlTextView
android:id="@+id/share_license_summary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/standard_gap"
android:layout_marginLeft="@dimen/standard_gap"
android:layout_marginTop="@dimen/standard_gap"
android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:layout_below="@id/license_list"
android:text="@plurals/share_license_summary" />
<fr.free.nrw.commons.ui.widget.HtmlTextView
android:id="@+id/media_upload_policy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/standard_gap"
android:layout_marginLeft="@dimen/standard_gap"
android:layout_marginTop="@dimen/standard_gap"
android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:layout_marginBottom="@dimen/standard_gap"
android:layout_above="@+id/button_divider"
android:gravity="start"
android:text="@string/media_upload_policy" />
<View
android:id="@+id/button_divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_above="@+id/submit"
android:background="@color/divider_grey" />
<Button
android:id="@+id/submit"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="24dp"
android:layout_marginRight="24dp"
android:layout_marginBottom="24dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:text="@string/submit" />
<Button
android:id="@+id/license_previous"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:layout_marginBottom="24dp"
android:layout_toStartOf="@id/submit"
android:layout_toLeftOf="@id/submit"
android:layout_alignParentBottom="true"
android:text="@string/previous" />
</RelativeLayout>

View file

@ -1,29 +0,0 @@
<?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="match_parent"
android:layout_marginTop="@dimen/standard_gap"
android:layout_marginBottom="8dp"
android:gravity="center"
android:orientation="vertical">
<ProgressBar
android:id="@+id/shareInProgress"
style="?android:progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true"
android:indeterminateOnly="true" />
<TextView
android:id="@+id/please_wait_text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/standard_gap"
android:layout_marginLeft="@dimen/standard_gap"
android:layout_marginTop="@dimen/standard_gap"
android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:gravity="center" />
</LinearLayout>

View file

@ -0,0 +1,102 @@
<?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="match_parent"
android:layout_marginBottom="8dp"
android:padding="@dimen/standard_gap"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/ll_container_license_desc"
android:orientation="vertical">
<TextView
android:id="@+id/tv_title"
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:gravity="center_vertical"
android:textSize="@dimen/normal_text"
tools:text="Step 1 of 15"/>
<TextView
android:id="@+id/tv_subtitle"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:layout_marginTop="@dimen/tiny_gap"
android:gravity="center_vertical"
android:text="@string/upload_flow_all_images_in_set"
android:textSize="@dimen/subtitle_text"
android:visibility="visible"
tools:visibility="visible"/>
<Spinner
android:id="@+id/spinner_license_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/standard_gap"
android:padding="0dp"
tools:visibility="visible"/>
<TextView
android:id="@+id/tv_share_license_summary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/standard_gap"
android:text="@plurals/share_license_summary"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_container_license_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical">
<fr.free.nrw.commons.ui.widget.HtmlTextView
android:id="@+id/tv_media_upload_policy"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/standard_gap"
android:gravity="start"
android:text="@string/media_upload_policy"/>
<View
android:id="@+id/button_divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="16dp"
android:background="@color/divider_grey"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:orientation="horizontal"
>
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_previous"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/previous"/>
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_submit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/submit"
android:textColor="@android:color/white"/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>

View file

@ -0,0 +1,161 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.github.chrisbanes.photoview.PhotoView
android:id="@+id/backgroundImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:actualImageScaleType="fitXY" />
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_margin="10dp"
android:elevation="@dimen/cardview_default_elevation">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/rl_container_title"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:gravity="center_vertical"
android:textSize="@dimen/normal_text"
android:textStyle="bold"
tools:text="Step 1 of 15" />
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/ib_map"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:layout_toLeftOf="@id/ib_expand_collapse"
android:visibility="gone"
app:srcCompat="@drawable/ic_map_white_24dp"
tools:visibility="visible" />
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/ib_expand_collapse"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginStart="@dimen/small_gap"
android:layout_marginEnd="@dimen/small_gap"
android:layout_marginBottom="@dimen/small_gap"
android:clickable="false"
android:focusable="false"
android:padding="12dp"
app:srcCompat="@drawable/ic_expand_less_black_24dp" />
</RelativeLayout>
<LinearLayout
android:id="@+id/ll_container_media_detail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/standard_gap"
android:orientation="vertical">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/til_container_title"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/et_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/share_title_hint"
android:imeOptions="actionNext"
android:drawableEnd="@drawable/mapbox_info_icon_default"
android:inputType="text"
android:maxLines="1" />
</com.google.android.material.textfield.TextInputLayout>
<fr.free.nrw.commons.widget.HeightLimitedRecyclerView
android:id="@+id/rv_descriptions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
tools:visibility="visible" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_copy_prev_title_desc"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/previous_image_title_description"
android:padding="2dp"
android:textAlignment="textEnd"
android:textColor="@color/button_blue"
android:visibility="gone"
tools:visibility="visible" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_add_description"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="48dp"
android:text="+" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="@string/next"
android:textColor="@android:color/white" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_previous"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:layout_toLeftOf="@+id/btn_next"
android:text="@string/previous" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</androidx.cardview.widget.CardView>
</RelativeLayout>

View file

@ -1,37 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:fresco="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="90dp"
android:layout_height="90dp"
android:id="@+id/rl_container"
android:background="@drawable/thumbnail_not_selected"
android:orientation="horizontal">
<LinearLayout xmlns:fresco="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/iv_thumbnail"
android:layout_width="90dp"
android:layout_height="90dp"
fresco:actualImageScaleType="fitCenter"/>
<androidx.legacy.widget.Space
android:id="@+id/left_space"
android:layout_width="8dp"
android:layout_height="90dp" />
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/thumbnail"
android:layout_width="90dp"
android:layout_height="90dp"
fresco:actualImageScaleType="fitCenter" />
<androidx.legacy.widget.Space
android:id="@+id/right_space"
android:layout_width="8dp"
android:layout_height="90dp" />
</LinearLayout>
<ImageView
android:id="@+id/error"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="end"
android:visibility="gone"
app:srcCompat="@drawable/ic_error_red_24dp" />
</FrameLayout>
<ImageView
android:id="@+id/iv_error"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_gravity="end"
android:visibility="gone"
app:srcCompat="@drawable/ic_error_red_24dp"
tools:visibility="visible"/>
</RelativeLayout>

View file

@ -19,7 +19,7 @@
android:layout_height="wrap_content"
android:layout_weight="8">
<EditText
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/description_item_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"

View file

@ -7,7 +7,7 @@
android:layout_height="wrap_content"
tools:showIn="@layout/activity_upload">
<EditText
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/description_item_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"

View file

@ -0,0 +1,114 @@
<?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:id="@+id/rl_container_categories"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/button_divider"
android:orientation="vertical">
<TextView
android:id="@+id/tv_title"
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:gravity="center_vertical"
android:textSize="@dimen/normal_text"
tools:text="Step 1 of 15"/>
<TextView
android:id="@+id/tv_subtitle"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:layout_marginTop="@dimen/tiny_gap"
android:gravity="center_vertical"
android:text="@string/upload_flow_all_images_in_set"
android:textSize="@dimen/subtitle_text"
android:visibility="visible"
tools:visibility="visible"/>
<FrameLayout
android:id="@+id/category_search_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/standard_gap"
>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/til_container_search"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/et_search"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/categories_search_text_hint"
android:imeOptions="actionSearch"
android:inputType="text"
android:maxLines="1"/>
</com.google.android.material.textfield.TextInputLayout>
<ProgressBar
android:id="@+id/pb_categories"
style="?android:progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/tiny_gap"
android:layout_marginRight="@dimen/tiny_gap"
android:layout_gravity="center_vertical|end"
android:indeterminate="true"
android:indeterminateOnly="true"
android:visibility="gone"
tools:visibility="visible"/>
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_categories"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/button_divider"
android:layout_below="@id/category_search_layout"/>
</LinearLayout>
<View
android:id="@+id/button_divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_above="@+id/ll_container_buttons"
android:background="@color/divider_grey"/>
<LinearLayout
android:id="@+id/ll_container_buttons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:padding="16dp"
android:orientation="horizontal"
>
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_previous"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/previous"/>
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/next"
android:textColor="@android:color/white"/>
</LinearLayout>
</RelativeLayout>

View file

@ -373,7 +373,7 @@
<string name="write_storage_permission_rationale_for_image_share">Avem nevoie de permisiunea dvs. pentru a accesa spațiul de stocare extern al dispozitivului dvs. pentru a încărca imagini.</string>
<string name="nearby_notification_dismiss_message">Nu veți vedea cel mai apropiat loc care are nevoie de imagini. Cu toate acestea, puteți reactiva această notificare în Setări, dacă doriți.</string>
<string name="step_count">Pasul %1$d din %2$d</string>
<string name="image_in_set_label">Imaginea% %1$d în set</string>
<string name="image_in_set_label">Imaginea %1$d în set</string>
<string name="next">Următor</string>
<string name="previous">Precedent</string>
<string name="submit">Trimite</string>

View file

@ -67,6 +67,7 @@
<color name="black">#000000</color>
<color name="swipe_red" tools:ignore="MissingDefaultResource">#FF0000</color>
<color name="color_error">#FF0000</color>
<color name="yes_button_color">#B22222</color>
<color name="no_button_color">#006400</color>
</resources>

View file

@ -409,7 +409,7 @@
<string name="next">Next</string>
<string name="previous">Previous</string>
<string name="submit">Submit</string>
<string name="upload_title_duplicate">A file with the file name %1$s exists. Are you sure you want to proceed?</string>
<string name="upload_title_duplicate" formatted="true">A file with the file name %1$s exists. Are you sure you want to proceed?</string>
<string name="map_application_missing">No compatible map application could be found on your device. Please install a map application to use this feature.</string>
<plurals name="upload_count_title">
<item quantity="one">%1$d Upload</item>
@ -554,5 +554,8 @@ Upload your first media by tapping on the add button.</string>
<string name="share_text">Upload photos to Wikimedia Commons on your phone Download the Commons app: %1$s</string>
<string name="share_via">Share app via...</string>
<string name="image_info">Image Info</string>
<string name="no_categories_found">No Categories found</string>
<string name="upload_cancelled">Cancelled Upload</string>
<string name="previous_image_title_description_not_found">There is no data for previous image\'s title or description</string>
<string name="dialog_box_text_nomination">Why should %1$s be deleted?</string>
</resources>