From ab861366949c7cdde827e75abc124879c812d449 Mon Sep 17 00:00:00 2001
From: Taras Smakula <tarassmakula@gmail.com>
Date: Mon, 5 Jun 2023 14:22:35 +0300
Subject: [PATCH] Fix all duplicates and add all missing res

---
 .../timeline/post/emoji/EmojiBottomSheet.kt        |  2 +-
 .../markdown/style_bar/StyleBarOptionViewHolder.kt |  3 ++-
 .../java/org/futo/circles/view/MarkdownEditText.kt |  7 ++++++-
 app/src/main/res/values-night/colors.xml           |  3 ---
 app/src/main/res/values/colors.xml                 |  3 ---
 app/src/main/res/values/strings.xml                | 12 ------------
 app/src/main/res/values/styles.xml                 |  3 ---
 .../main/res/drawable/add_image_placeholder.xml    |  0
 .../src/main/res/drawable/ic_add_photo.xml         |  0
 {app => core}/src/main/res/drawable/ic_delete.xml  |  0
 .../src/main/res/drawable/ic_download.xml          |  0
 core/src/main/res/drawable/ic_info.xml             | 10 ++++++++++
 .../src/main/res/drawable/ic_settings.xml          |  0
 {app => core}/src/main/res/drawable/ic_share.xml   |  0
 core/src/main/res/values-night/colors.xml          |  6 ++++++
 .../src/main/res/drawable/ic_backup.xml            |  0
 .../src/main/res/drawable/ic_play_round.xml        |  0
 gallery/src/main/res/drawable/ic_unselected.xml    |  2 +-
 .../res/layout/dialog_fragment_media_preview.xml   |  2 +-
 gallery/src/main/res/layout/fragment_gallery.xml   |  2 +-
 gallery/src/main/res/values/colors.xml             |  4 ++++
 gallery/src/main/res/values/dimens.xml             |  4 ++++
 gallery/src/main/res/values/strings.xml            | 14 ++++++++++++++
 gallery/src/main/res/values/styles.xml             |  8 ++++++++
 24 files changed, 58 insertions(+), 27 deletions(-)
 rename {auth => core}/src/main/res/drawable/add_image_placeholder.xml (100%)
 rename {auth => core}/src/main/res/drawable/ic_add_photo.xml (100%)
 rename {app => core}/src/main/res/drawable/ic_delete.xml (100%)
 rename {app => core}/src/main/res/drawable/ic_download.xml (100%)
 create mode 100644 core/src/main/res/drawable/ic_info.xml
 rename {app => core}/src/main/res/drawable/ic_settings.xml (100%)
 rename {app => core}/src/main/res/drawable/ic_share.xml (100%)
 create mode 100644 core/src/main/res/values-night/colors.xml
 rename {app => gallery}/src/main/res/drawable/ic_backup.xml (100%)
 rename {app => gallery}/src/main/res/drawable/ic_play_round.xml (100%)
 create mode 100644 gallery/src/main/res/values/colors.xml
 create mode 100644 gallery/src/main/res/values/dimens.xml
 create mode 100644 gallery/src/main/res/values/styles.xml

diff --git a/app/src/main/java/org/futo/circles/feature/timeline/post/emoji/EmojiBottomSheet.kt b/app/src/main/java/org/futo/circles/feature/timeline/post/emoji/EmojiBottomSheet.kt
index 3cb80b032..091ac893a 100644
--- a/app/src/main/java/org/futo/circles/feature/timeline/post/emoji/EmojiBottomSheet.kt
+++ b/app/src/main/java/org/futo/circles/feature/timeline/post/emoji/EmojiBottomSheet.kt
@@ -73,7 +73,7 @@ class EmojiBottomSheet : BottomSheetDialogFragment() {
                         secondaryColor = Color.RED,
                         dividerColor = ContextCompat.getColor(
                             requireContext(),
-                            R.color.divider_color
+                            org.futo.circles.core.R.color.divider_color
                         ),
                         textColor = ContextCompat.getColor(
                             requireContext(),
diff --git a/app/src/main/java/org/futo/circles/feature/timeline/post/markdown/style_bar/StyleBarOptionViewHolder.kt b/app/src/main/java/org/futo/circles/feature/timeline/post/markdown/style_bar/StyleBarOptionViewHolder.kt
index 3a1128537..9ded7ae02 100644
--- a/app/src/main/java/org/futo/circles/feature/timeline/post/markdown/style_bar/StyleBarOptionViewHolder.kt
+++ b/app/src/main/java/org/futo/circles/feature/timeline/post/markdown/style_bar/StyleBarOptionViewHolder.kt
@@ -27,7 +27,8 @@ class StyleBarOptionViewHolder(
         binding.ivIcon.setImageResource(data.iconResId)
         binding.cvOption.setCardBackgroundColor(
             ContextCompat.getColor(
-                context, if (data.isSelected) R.color.blue else R.color.post_card_background_color
+                context, if (data.isSelected) R.color.blue else
+                    org.futo.circles.core.R.color.post_card_background_color
             )
         )
     }
diff --git a/app/src/main/java/org/futo/circles/view/MarkdownEditText.kt b/app/src/main/java/org/futo/circles/view/MarkdownEditText.kt
index ec1072139..72760f9b4 100644
--- a/app/src/main/java/org/futo/circles/view/MarkdownEditText.kt
+++ b/app/src/main/java/org/futo/circles/view/MarkdownEditText.kt
@@ -96,7 +96,12 @@ class MarkdownEditText(
             .with(CharPolicy('@', true))
             .with(MentionsPresenter(context, roomId))
             .with(
-                ColorDrawable(ContextCompat.getColor(context, R.color.post_card_background_color))
+                ColorDrawable(
+                    ContextCompat.getColor(
+                        context,
+                        org.futo.circles.core.R.color.post_card_background_color
+                    )
+                )
             )
             .with(object : AutocompleteCallback<UserListItem> {
                 override fun onPopupItemClicked(editable: Editable, item: UserListItem): Boolean {
diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml
index eea1b4485..b8e73a6cb 100644
--- a/app/src/main/res/values-night/colors.xml
+++ b/app/src/main/res/values-night/colors.xml
@@ -1,9 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-    <color name="divider_color">#333333</color>
-    <color name="menu_icon_color">#ABABAB</color>
     <color name="list_item_icon_color">@color/menu_icon_color</color>
-    <color name="post_card_background_color">#2D2D2D</color>
     <color name="qr_color">@color/white</color>
     <color name="qr_background">#121212</color>
 </resources>
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index a1a48ba2e..15639ec4d 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -15,16 +15,13 @@
     <color name="orange">#FF9500</color>
     <color name="red">#FF3B30</color>
     <color name="pink">#FF2D55</color>
-    <color name="divider_color">#ddd</color>
     <color name="gray">#8E8E93</color>
     <color name="close_background">#80000000</color>
-    <color name="menu_icon_color">#99000000</color>
     <color name="list_item_icon_color">@color/black</color>
     <color name="highlight_color">#330E7AFE</color>
     <color name="chip_selected_color">#800E7AFE</color>
     <color name="launcher_background_color">#00008b</color>
     <color name="transparent">#00000000</color>
-    <color name="post_card_background_color">@color/white</color>
     <color name="qr_color">@color/black</color>
     <color name="qr_background">@color/white</color>
 </resources>
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 47ec5da23..26db88f31 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -36,18 +36,15 @@
     <string name="leave_group">Leave group</string>
     <string name="create_new_group">Create new group</string>
     <string name="create_new_circle">Create new circle</string>
-    <string name="create_new_gallery">Create new gallery</string>
     <string name="create">Create</string>
     <string name="group_name">Group name</string>
     <string name="circle_name">Circle name</string>
-    <string name="gallery_name">Gallery name</string>
     <string name="group_topic_optional">Group topic (optional)</string>
     <string name="group_topic">Group topic</string>
     <string name="group_updated">Group updated</string>
     <string name="circle_updated">Circle updated</string>
     <string name="setup_circles">Setup Circles</string>
     <string name="circle_encryption_warning">NOTE: Circle name and cover image are not encrypted</string>
-    <string name="gallery_encryption_warning">NOTE: Gallery name and cover image are not encrypted</string>
     <string name="friends">Friends</string>
     <string name="family">Family</string>
     <string name="community">Community</string>
@@ -79,7 +76,6 @@
     <string name="unban_user_message">Are you sure you want to unban this user?\n\nUser will be able to join again.</string>
     <string name="set_access_level">Set access level</string>
     <string name="configure_group">Configure group</string>
-    <string name="change_icon">Change icon</string>
     <string name="group_encryption_warning">NOTE: Group name, topic and cover image are not encrypted</string>
     <string name="create_post">Create post</string>
     <string name="create_poll">Create poll</string>
@@ -122,7 +118,6 @@
     <string name="severity_formatter">Severity: %d</string>
     <string name="add_reaction">Add reaction</string>
     <string name="configure_circle">Configure circle</string>
-    <string name="configure_gallery">Configure gallery</string>
     <string name="delete_circle">Delete circle</string>
     <string name="delete_group">Delete group</string>
     <string name="my_followers">My followers</string>
@@ -300,15 +295,8 @@
     <string name="unmute_notifications">Unmute notifications</string>
     <string name="shortcut_disabled">Shortcut disabled</string>
     <string name="shared_circles_space_not_found">Shared Circles space not found</string>
-    <string name="media_backup">Media backup</string>
-    <string name="backup">Backup</string>
-    <string name="backup_photos_and_videos_from_this_device_to_your_gallery">Backup photos and videos from this device to your Gallery</string>
-    <string name="backup_device_folders">Backup device folders</string>
-    <string name="backup_folders_hint">Choose folders to backup and view in your Gallery:</string>
     <string name="notification_method">Notification method</string>
     <string name="unifiedpush_distributors_dialog_title">Choose how to receive notifications</string>
-    <string name="backup_over_wifi_only">Backup over WiFi only</string>
-    <string name="compress_before_sending">Compress before sending</string>
     <string name="thread_format">%s (thread)</string>
     <string name="unexpected_error">Something went wrong</string>
     <string name="configuring_workspace">Configuring workspace</string>
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index f0e1d913a..784f6ed80 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -35,7 +35,4 @@
         <item name="cornerFamilyTopRight">rounded</item>
     </style>
 
-    <style name="WhiteMenuToolbar" parent="ThemeOverlay.MaterialComponents.Toolbar.Primary">
-        <item name="colorOnPrimary">@color/white</item>
-    </style>
 </resources>
\ No newline at end of file
diff --git a/auth/src/main/res/drawable/add_image_placeholder.xml b/core/src/main/res/drawable/add_image_placeholder.xml
similarity index 100%
rename from auth/src/main/res/drawable/add_image_placeholder.xml
rename to core/src/main/res/drawable/add_image_placeholder.xml
diff --git a/auth/src/main/res/drawable/ic_add_photo.xml b/core/src/main/res/drawable/ic_add_photo.xml
similarity index 100%
rename from auth/src/main/res/drawable/ic_add_photo.xml
rename to core/src/main/res/drawable/ic_add_photo.xml
diff --git a/app/src/main/res/drawable/ic_delete.xml b/core/src/main/res/drawable/ic_delete.xml
similarity index 100%
rename from app/src/main/res/drawable/ic_delete.xml
rename to core/src/main/res/drawable/ic_delete.xml
diff --git a/app/src/main/res/drawable/ic_download.xml b/core/src/main/res/drawable/ic_download.xml
similarity index 100%
rename from app/src/main/res/drawable/ic_download.xml
rename to core/src/main/res/drawable/ic_download.xml
diff --git a/core/src/main/res/drawable/ic_info.xml b/core/src/main/res/drawable/ic_info.xml
new file mode 100644
index 000000000..636062189
--- /dev/null
+++ b/core/src/main/res/drawable/ic_info.xml
@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:tint="@color/menu_icon_color"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+    <path
+        android:fillColor="@android:color/white"
+        android:pathData="M11,7h2v2h-2zM11,11h2v6h-2zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z" />
+</vector>
diff --git a/app/src/main/res/drawable/ic_settings.xml b/core/src/main/res/drawable/ic_settings.xml
similarity index 100%
rename from app/src/main/res/drawable/ic_settings.xml
rename to core/src/main/res/drawable/ic_settings.xml
diff --git a/app/src/main/res/drawable/ic_share.xml b/core/src/main/res/drawable/ic_share.xml
similarity index 100%
rename from app/src/main/res/drawable/ic_share.xml
rename to core/src/main/res/drawable/ic_share.xml
diff --git a/core/src/main/res/values-night/colors.xml b/core/src/main/res/values-night/colors.xml
new file mode 100644
index 000000000..5b2d9293f
--- /dev/null
+++ b/core/src/main/res/values-night/colors.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <color name="divider_color">#333333</color>
+    <color name="menu_icon_color">#ABABAB</color>
+    <color name="post_card_background_color">#2D2D2D</color>
+</resources>
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_backup.xml b/gallery/src/main/res/drawable/ic_backup.xml
similarity index 100%
rename from app/src/main/res/drawable/ic_backup.xml
rename to gallery/src/main/res/drawable/ic_backup.xml
diff --git a/app/src/main/res/drawable/ic_play_round.xml b/gallery/src/main/res/drawable/ic_play_round.xml
similarity index 100%
rename from app/src/main/res/drawable/ic_play_round.xml
rename to gallery/src/main/res/drawable/ic_play_round.xml
diff --git a/gallery/src/main/res/drawable/ic_unselected.xml b/gallery/src/main/res/drawable/ic_unselected.xml
index c9c57c654..17e596d56 100644
--- a/gallery/src/main/res/drawable/ic_unselected.xml
+++ b/gallery/src/main/res/drawable/ic_unselected.xml
@@ -3,7 +3,7 @@
     android:shape="oval">
     <stroke
         android:width="2dp"
-        android:color="@color/chip_selected_color" />
+        android:color="#800E7AFE" />
     <size
         android:width="24dp"
         android:height="24dp" />
diff --git a/gallery/src/main/res/layout/dialog_fragment_media_preview.xml b/gallery/src/main/res/layout/dialog_fragment_media_preview.xml
index 2ce5dcc09..68e28a505 100644
--- a/gallery/src/main/res/layout/dialog_fragment_media_preview.xml
+++ b/gallery/src/main/res/layout/dialog_fragment_media_preview.xml
@@ -21,7 +21,7 @@
         android:soundEffectsEnabled="true"
         app:keep_content_on_player_reset="true"
         app:resize_mode="fit"
-        app:shutter_background_color="@color/transparent"
+        app:shutter_background_color="@android:color/transparent"
         app:surface_type="texture_view"
         app:use_controller="true" />
 
diff --git a/gallery/src/main/res/layout/fragment_gallery.xml b/gallery/src/main/res/layout/fragment_gallery.xml
index 7f8f03783..3fb1d7f7b 100644
--- a/gallery/src/main/res/layout/fragment_gallery.xml
+++ b/gallery/src/main/res/layout/fragment_gallery.xml
@@ -20,7 +20,7 @@
         android:layout_gravity="bottom|end"
         android:layout_margin="16dp"
         app:fabSize="normal"
-        app:layout_anchor="@id/rvTimeline"
+        app:layout_anchor="@id/rvGallery"
         app:srcCompat="@drawable/ic_add_photo"
         app:tint="@color/white"
         tools:ignore="ContentDescription" />
diff --git a/gallery/src/main/res/values/colors.xml b/gallery/src/main/res/values/colors.xml
new file mode 100644
index 000000000..040133d0d
--- /dev/null
+++ b/gallery/src/main/res/values/colors.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <color name="yellow">#FFCC00</color>
+</resources>
\ No newline at end of file
diff --git a/gallery/src/main/res/values/dimens.xml b/gallery/src/main/res/values/dimens.xml
new file mode 100644
index 000000000..92c35a6c9
--- /dev/null
+++ b/gallery/src/main/res/values/dimens.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <dimen name="group_icon_size">120dp</dimen>
+</resources>
\ No newline at end of file
diff --git a/gallery/src/main/res/values/strings.xml b/gallery/src/main/res/values/strings.xml
index 0a0733c72..0f979f908 100644
--- a/gallery/src/main/res/values/strings.xml
+++ b/gallery/src/main/res/values/strings.xml
@@ -13,4 +13,18 @@
     <string name="upload_to_gallery">Upload to gallery</string>
     <string name="save_to_gallery">Save to gallery</string>
     <string name="photo_galleries">Photo Galleries</string>
+    <string name="media_backup">Media backup</string>
+    <string name="backup">Backup</string>
+    <string name="backup_photos_and_videos_from_this_device_to_your_gallery">Backup photos and videos from this device to your Gallery</string>
+    <string name="backup_over_wifi_only">Backup over WiFi only</string>
+    <string name="compress_before_sending">Compress before sending</string>
+    <string name="backup_device_folders">Backup device folders</string>
+    <string name="backup_folders_hint">Choose folders to backup and view in your Gallery:</string>
+    <string name="configure_gallery">Configure gallery</string>
+    <string name="change_icon">Change icon</string>
+    <string name="gallery_name">Gallery name</string>
+    <string name="gallery_encryption_warning">NOTE: Gallery name and cover image are not encrypted</string>
+    <string name="create_new_gallery">Create new gallery</string>
+    <string name="create">Create</string>
+
 </resources>
\ No newline at end of file
diff --git a/gallery/src/main/res/values/styles.xml b/gallery/src/main/res/values/styles.xml
new file mode 100644
index 000000000..876275c4d
--- /dev/null
+++ b/gallery/src/main/res/values/styles.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+    <style name="WhiteMenuToolbar" parent="ThemeOverlay.MaterialComponents.Toolbar.Primary">
+        <item name="colorOnPrimary">@color/white</item>
+    </style>
+
+</resources>
\ No newline at end of file
-- 
GitLab