mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
* Add bookmark star images * Add bookmark item in navigation menu * Add Activity for bookmarks * Implement bookmarks viewpager * Bookmark object and bookmarkDao * Implement Bookmark Picture Fragment and Controller * Implement image detail bookmark menu action UI * contentProvider + config + dao rework * Fix Dao and Content Provider crashes * Link bookmark controllers and dao * Implement bookmark location fragment, controller * Add bookmark icon to location items * Add empty bookmark list behavior and refactoring * bookmarkLocation dao and contentProvider * Fix bookmarks location crashes * Rename and refactor classes * Implement location list refresh * Fix picture list update When user come back from detail picture fragment, it solve the refresh bug. * full test coverage * Refactor bookmarks classes * Fix bookmarks pictures loading * Fix bookmark locations list display * Java Documetation * Fix Code review quality * Fix DB version update * Remove forgotten todo * Update bookmark activity base class Change from AuthenticatedActivity to BaseNavigationActivity
This commit is contained in:
parent
89d2d0cfe0
commit
80a9c94653
42 changed files with 2361 additions and 12 deletions
9
app/src/main/res/drawable/ic_round_star_border_24px.xml
Normal file
9
app/src/main/res/drawable/ic_round_star_border_24px.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@color/white"
|
||||
android:pathData="M19.65,9.04l-4.84,-0.42 -1.89,-4.45c-0.34,-0.81 -1.5,-0.81 -1.84,0L9.19,8.63l-4.83,0.41c-0.88,0.07 -1.24,1.17 -0.57,1.75l3.67,3.18 -1.1,4.72c-0.2,0.86 0.73,1.54 1.49,1.08l4.15,-2.5 4.15,2.51c0.76,0.46 1.69,-0.22 1.49,-1.08l-1.1,-4.73 3.67,-3.18c0.67,-0.58 0.32,-1.68 -0.56,-1.75zM12,15.4l-3.76,2.27 1,-4.28 -3.32,-2.88 4.38,-0.38L12,6.1l1.71,4.04 4.38,0.38 -3.32,2.88 1,4.28L12,15.4z"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/ic_round_star_filled_24px.xml
Normal file
9
app/src/main/res/drawable/ic_round_star_filled_24px.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@color/white"
|
||||
android:pathData="M19.65,9.04l-4.84,-0.42 -1.89,-4.45c-0.34,-0.81 -1.5,-0.81 -1.84,0L9.19,8.63l-4.83,0.41c-0.88,0.07 -1.24,1.17 -0.57,1.75l3.67,3.18 -1.1,4.72c-0.2,0.86 0.73,1.54 1.49,1.08l4.15,-2.5 4.15,2.51c0.76,0.46 1.69,-0.22 1.49,-1.08l-1.1,-4.73 3.67,-3.18c0.67,-0.58 0.32,-1.68 -0.56,-1.75z"/>
|
||||
</vector>
|
||||
58
app/src/main/res/layout/activity_bookmarks.xml
Normal file
58
app/src/main/res/layout/activity_bookmarks.xml
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<android.support.constraint.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<include
|
||||
android:id="@+id/toolbar"
|
||||
layout="@layout/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_scrollFlags="scroll" />
|
||||
|
||||
<android.support.design.widget.TabLayout
|
||||
android:id="@+id/tabLayoutBookmarks"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/toolbar" />
|
||||
|
||||
<android.support.v4.view.ViewPager
|
||||
android:id="@+id/viewPagerBookmarks"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tabLayoutBookmarks" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fragmentContainer"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/toolbar"/>
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
||||
|
||||
<android.support.design.widget.NavigationView
|
||||
android:id="@+id/navigation_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
app:headerLayout="@layout/drawer_header"
|
||||
app:menu="@menu/drawer" />
|
||||
|
||||
</android.support.v4.widget.DrawerLayout>
|
||||
|
|
@ -61,6 +61,34 @@
|
|||
android:orientation="horizontal"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/bookmarkButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:padding="16dp"
|
||||
android:clickable="true"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/button_background_selector"
|
||||
>
|
||||
<ImageView
|
||||
android:id="@+id/bookmarkButtonImage"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
app:srcCompat="@drawable/ic_round_star_border_24px"
|
||||
android:tint="@color/button_blue"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/bookmarkButtonText"
|
||||
android:paddingTop="8dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="CAMERA"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/directionsButton"
|
||||
android:layout_width="0dp"
|
||||
|
|
|
|||
32
app/src/main/res/layout/fragment_bookmarks_locations.xml
Normal file
32
app/src/main/res/layout/fragment_bookmarks_locations.xml
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?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/parentLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/statusMessage"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/waiting_first_sync"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/loadingImagesProgressBar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:visibility="gone" />
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/listView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
37
app/src/main/res/layout/fragment_bookmarks_pictures.xml
Normal file
37
app/src/main/res/layout/fragment_bookmarks_pictures.xml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?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/parentLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/statusMessage"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/waiting_first_sync"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/loadingImagesProgressBar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:visibility="gone" />
|
||||
|
||||
<GridView
|
||||
android:id="@+id/bookmarkedPicturesList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:columnWidth="240dp"
|
||||
android:fadingEdge="none"
|
||||
android:fastScrollEnabled="true"
|
||||
android:listSelector="@null"
|
||||
android:numColumns="auto_fit"
|
||||
android:stretchMode="columnWidth" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
@ -10,6 +10,34 @@
|
|||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/bookmarkButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:padding="16dp"
|
||||
android:clickable="true"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/button_background_selector"
|
||||
>
|
||||
<ImageView
|
||||
android:id="@+id/bookmarkButtonImage"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
app:srcCompat="@drawable/ic_round_star_border_24px"
|
||||
android:tint="@color/button_blue"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/bookmarkButtonText"
|
||||
android:paddingTop="8dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="CAMERA"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/cameraButton"
|
||||
android:layout_width="0dp"
|
||||
|
|
|
|||
|
|
@ -22,6 +22,11 @@
|
|||
android:icon="@drawable/ic_explore_24dp"
|
||||
android:title="@string/navigation_item_explore"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_bookmarks"
|
||||
android:icon="@drawable/ic_round_star_filled_24px"
|
||||
android:title="@string/navigation_item_bookmarks"/>
|
||||
|
||||
</group>
|
||||
<group android:id="@+id/drawer_account">
|
||||
<item
|
||||
|
|
|
|||
|
|
@ -2,11 +2,16 @@
|
|||
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/menu_bookmark_current_image"
|
||||
android:icon="@drawable/ic_round_star_border_24px"
|
||||
android:title="@string/menu_bookmark"
|
||||
app:showAsAction="always" />
|
||||
<item
|
||||
android:id="@+id/menu_share_current_image"
|
||||
android:icon="@drawable/ic_share_black_24dp"
|
||||
android:title="@string/menu_share"
|
||||
app:showAsAction="ifRoom" />
|
||||
app:showAsAction="always" />
|
||||
<item
|
||||
android:id="@+id/menu_browser_current_image"
|
||||
android:title="@string/menu_open_in_browser"
|
||||
|
|
|
|||
|
|
@ -361,6 +361,8 @@
|
|||
<string name="notifications_channel_name_all">Notification de Commons</string>
|
||||
<string name="storage_permission">Droit de stockage</string>
|
||||
<string name="write_storage_permission_rationale_for_image_share">Nous avons besoin de votre autorisation pour accéder au stockage externe de votre appareil, afin de téléverser des images.</string>
|
||||
<string name="navigation_item_bookmarks">Favoris</string>
|
||||
<string name="title_activity_bookmarks">Favoris</string>
|
||||
<string name="log_collection_started">Enregistrement dans le journal, commencé. Veuillez REDEMARRER l\'application, exécutez l\'action que vous souhaitez tracer, et cliquez de nouveau sur \'Envoyer les journaux\'</string>
|
||||
<string name="no_uploads">Bienvenue sur Commons !\n\nTéléversez votre premier média en cliquant sur l’icône de l’appareil photo ou sur la galerie ci-dessus.</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -77,8 +77,8 @@
|
|||
<item quantity="other">Starting %1$d uploads</item>
|
||||
</plurals>
|
||||
<plurals name="multiple_uploads_title">
|
||||
<item quantity="one">%1$d upload</item>
|
||||
<item quantity="other">%1$d uploads</item>
|
||||
<item quantity="one">%1$d upload</item>
|
||||
<item quantity="other">%1$d uploads</item>
|
||||
</plurals>
|
||||
<string name="categories_not_found">No categories matching %1$s found</string>
|
||||
<string name="categories_skip_explanation">Add categories to make your images more discoverable on Wikimedia Commons.\nStart typing to add categories.</string>
|
||||
|
|
@ -192,7 +192,7 @@
|
|||
<string name="maximum_limit_alert">Unable to display more than 500</string>
|
||||
<string name="set_limit">Set Recent Upload Limit</string>
|
||||
<string name="login_failed_2fa_not_supported">Two factor authentication is currently not supported.</string>
|
||||
<string name="logout_verification">Do you really want to logout?</string>
|
||||
<string name="logout_verification">Do you really want to logout?</string>
|
||||
<string name="commons_logo">Commons Logo</string>
|
||||
<string name="commons_website">Commons Website</string>
|
||||
<string name="commons_facebook">Commons Facebook Page</string>
|
||||
|
|
@ -356,7 +356,14 @@
|
|||
<string name="notifications_channel_name_all">Commons Notification</string>
|
||||
<string name="storage_permission">Storage Permission</string>
|
||||
<string name="write_storage_permission_rationale_for_image_share">We need your permission to access the external storage of your device in order to upload images.</string>
|
||||
|
||||
<string name="navigation_item_bookmarks">Bookmarks</string>
|
||||
<string name="title_activity_bookmarks">Bookmarks</string>
|
||||
<string name="title_page_bookmarks_pictures">Pictures</string>
|
||||
<string name="title_page_bookmarks_locations">Locations</string>
|
||||
<string name="menu_bookmark">Add/Remove to bookmarks</string>
|
||||
<string name="provider_bookmarks">Bookmarks</string>
|
||||
<string name="bookmark_empty">You haven\'t added any bookmarks</string>
|
||||
<string name="provider_bookmarks_location">Bookmarks</string>
|
||||
<string name="log_collection_started">Log collection started. Please RESTART the app, perform action that you wish to log, and then tap \'Send log file\' again</string>
|
||||
<string name="no_uploads">Welcome to Commons!\n
|
||||
Upload your first media by touching the camera or gallery icon above.</string>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue