From 054a5cf5e5d8756f8dead961aebb63d56d563ec8 Mon Sep 17 00:00:00 2001
From: Taras Smakula <tarassmakula@gmail.com>
Date: Mon, 17 Jul 2023 15:01:59 +0300
Subject: [PATCH] Profile to auth

---
 app/src/main/res/navigation/settings_nav_graph.xml          | 2 +-
 app/src/main/res/values/strings.xml                         | 1 -
 .../auth/feature/profile/edit}/EditProfileDialogFragment.kt | 6 +++---
 .../auth/feature/profile/edit}/EditProfileViewModel.kt      | 4 ++--
 .../setup}/SetupProfileDataSource.kt                        | 2 +-
 .../setup_profile => profile/setup}/SetupProfileFragment.kt | 3 ++-
 .../setup}/SetupProfileViewModel.kt                         | 2 +-
 .../src/main/res/layout/dialog_fragment_edit_profile.xml    | 0
 auth/src/main/res/navigation/nav_graph_auth.xml             | 2 +-
 auth/src/main/res/values/strings.xml                        | 1 +
 10 files changed, 12 insertions(+), 11 deletions(-)
 rename {app/src/main/java/org/futo/circles/feature/settings/edit_profile => auth/src/main/java/org/futo/circles/auth/feature/profile/edit}/EditProfileDialogFragment.kt (95%)
 rename {app/src/main/java/org/futo/circles/feature/settings/edit_profile => auth/src/main/java/org/futo/circles/auth/feature/profile/edit}/EditProfileViewModel.kt (91%)
 rename auth/src/main/java/org/futo/circles/auth/feature/{sign_up/setup_profile => profile/setup}/SetupProfileDataSource.kt (95%)
 rename auth/src/main/java/org/futo/circles/auth/feature/{sign_up/setup_profile => profile/setup}/SetupProfileFragment.kt (95%)
 rename auth/src/main/java/org/futo/circles/auth/feature/{sign_up/setup_profile => profile/setup}/SetupProfileViewModel.kt (94%)
 rename {app => auth}/src/main/res/layout/dialog_fragment_edit_profile.xml (100%)

diff --git a/app/src/main/res/navigation/settings_nav_graph.xml b/app/src/main/res/navigation/settings_nav_graph.xml
index f0cea5e28..28898b304 100644
--- a/app/src/main/res/navigation/settings_nav_graph.xml
+++ b/app/src/main/res/navigation/settings_nav_graph.xml
@@ -60,7 +60,7 @@
 
     <dialog
         android:id="@+id/editProfileDialogFragment"
-        android:name="org.futo.circles.feature.settings.edit_profile.EditProfileDialogFragment"
+        android:name="org.futo.circles.auth.feature.profile.edit.EditProfileDialogFragment"
         android:label="ProfileDialogFragment"
         tools:layout="@layout/dialog_fragment_edit_profile" />
     <dialog
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index e04d79f95..34d5ae3e6 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -282,7 +282,6 @@
     <string name="send_request_to_follow_user">Send request to follow this user</string>
     <string name="resend">Resend</string>
     <string name="unable_to_parse_url">Unable to parse url</string>
-    <string name="profile_updated">Profile updated</string>
     <string name="version_format">Version %s</string>
     <string name="developer_mode_enabled">Developer mode is enabled</string>
     <string name="developer_mode_disabled">Developer mode is disabled</string>
diff --git a/app/src/main/java/org/futo/circles/feature/settings/edit_profile/EditProfileDialogFragment.kt b/auth/src/main/java/org/futo/circles/auth/feature/profile/edit/EditProfileDialogFragment.kt
similarity index 95%
rename from app/src/main/java/org/futo/circles/feature/settings/edit_profile/EditProfileDialogFragment.kt
rename to auth/src/main/java/org/futo/circles/auth/feature/profile/edit/EditProfileDialogFragment.kt
index 6569c5653..6ce72025c 100644
--- a/app/src/main/java/org/futo/circles/feature/settings/edit_profile/EditProfileDialogFragment.kt
+++ b/auth/src/main/java/org/futo/circles/auth/feature/profile/edit/EditProfileDialogFragment.kt
@@ -1,4 +1,4 @@
-package org.futo.circles.feature.settings.edit_profile
+package org.futo.circles.auth.feature.profile.edit
 
 import android.os.Bundle
 import android.view.View
@@ -6,7 +6,8 @@ import androidx.core.widget.doAfterTextChanged
 import androidx.fragment.app.Fragment
 import androidx.fragment.app.viewModels
 import dagger.hilt.android.AndroidEntryPoint
-import org.futo.circles.R
+import org.futo.circles.auth.R
+import org.futo.circles.auth.databinding.DialogFragmentEditProfileBinding
 import org.futo.circles.core.extensions.getText
 import org.futo.circles.core.extensions.loadProfileIcon
 import org.futo.circles.core.extensions.notEmptyDisplayName
@@ -16,7 +17,6 @@ import org.futo.circles.core.extensions.onBackPressed
 import org.futo.circles.core.extensions.showSuccess
 import org.futo.circles.core.fragment.BaseFullscreenDialogFragment
 import org.futo.circles.core.fragment.HasLoadingState
-import org.futo.circles.databinding.DialogFragmentEditProfileBinding
 import org.futo.circles.gallery.feature.pick.AllMediaPickerHelper
 import org.matrix.android.sdk.api.session.user.model.User
 
diff --git a/app/src/main/java/org/futo/circles/feature/settings/edit_profile/EditProfileViewModel.kt b/auth/src/main/java/org/futo/circles/auth/feature/profile/edit/EditProfileViewModel.kt
similarity index 91%
rename from app/src/main/java/org/futo/circles/feature/settings/edit_profile/EditProfileViewModel.kt
rename to auth/src/main/java/org/futo/circles/auth/feature/profile/edit/EditProfileViewModel.kt
index b1eec4aaa..4810e6b21 100644
--- a/app/src/main/java/org/futo/circles/feature/settings/edit_profile/EditProfileViewModel.kt
+++ b/auth/src/main/java/org/futo/circles/auth/feature/profile/edit/EditProfileViewModel.kt
@@ -1,10 +1,10 @@
-package org.futo.circles.feature.settings.edit_profile
+package org.futo.circles.auth.feature.profile.edit
 
 import android.net.Uri
 import androidx.lifecycle.MutableLiveData
 import androidx.lifecycle.ViewModel
 import dagger.hilt.android.lifecycle.HiltViewModel
-import org.futo.circles.auth.feature.sign_up.setup_profile.SetupProfileDataSource
+import org.futo.circles.auth.feature.profile.setup.SetupProfileDataSource
 import org.futo.circles.core.SingleEventLiveData
 import org.futo.circles.core.extensions.Response
 import org.futo.circles.core.extensions.launchBg
diff --git a/auth/src/main/java/org/futo/circles/auth/feature/sign_up/setup_profile/SetupProfileDataSource.kt b/auth/src/main/java/org/futo/circles/auth/feature/profile/setup/SetupProfileDataSource.kt
similarity index 95%
rename from auth/src/main/java/org/futo/circles/auth/feature/sign_up/setup_profile/SetupProfileDataSource.kt
rename to auth/src/main/java/org/futo/circles/auth/feature/profile/setup/SetupProfileDataSource.kt
index 2006f36f8..d0497fdef 100644
--- a/auth/src/main/java/org/futo/circles/auth/feature/sign_up/setup_profile/SetupProfileDataSource.kt
+++ b/auth/src/main/java/org/futo/circles/auth/feature/profile/setup/SetupProfileDataSource.kt
@@ -1,4 +1,4 @@
-package org.futo.circles.auth.feature.sign_up.setup_profile
+package org.futo.circles.auth.feature.profile.setup
 
 import android.content.Context
 import android.net.Uri
diff --git a/auth/src/main/java/org/futo/circles/auth/feature/sign_up/setup_profile/SetupProfileFragment.kt b/auth/src/main/java/org/futo/circles/auth/feature/profile/setup/SetupProfileFragment.kt
similarity index 95%
rename from auth/src/main/java/org/futo/circles/auth/feature/sign_up/setup_profile/SetupProfileFragment.kt
rename to auth/src/main/java/org/futo/circles/auth/feature/profile/setup/SetupProfileFragment.kt
index f8b465137..588250fc1 100644
--- a/auth/src/main/java/org/futo/circles/auth/feature/sign_up/setup_profile/SetupProfileFragment.kt
+++ b/auth/src/main/java/org/futo/circles/auth/feature/profile/setup/SetupProfileFragment.kt
@@ -1,4 +1,4 @@
-package org.futo.circles.auth.feature.sign_up.setup_profile
+package org.futo.circles.auth.feature.profile.setup
 
 import android.os.Bundle
 import android.view.View
@@ -10,6 +10,7 @@ import by.kirich1409.viewbindingdelegate.viewBinding
 import dagger.hilt.android.AndroidEntryPoint
 import org.futo.circles.auth.R
 import org.futo.circles.auth.databinding.FragmentSetupProfileBinding
+import org.futo.circles.auth.feature.sign_up.setup_profile.SetupProfileFragmentDirections
 import org.futo.circles.core.CirclesAppConfig
 import org.futo.circles.core.extensions.getText
 import org.futo.circles.core.extensions.navigateSafe
diff --git a/auth/src/main/java/org/futo/circles/auth/feature/sign_up/setup_profile/SetupProfileViewModel.kt b/auth/src/main/java/org/futo/circles/auth/feature/profile/setup/SetupProfileViewModel.kt
similarity index 94%
rename from auth/src/main/java/org/futo/circles/auth/feature/sign_up/setup_profile/SetupProfileViewModel.kt
rename to auth/src/main/java/org/futo/circles/auth/feature/profile/setup/SetupProfileViewModel.kt
index 27d801221..dda34c926 100644
--- a/auth/src/main/java/org/futo/circles/auth/feature/sign_up/setup_profile/SetupProfileViewModel.kt
+++ b/auth/src/main/java/org/futo/circles/auth/feature/profile/setup/SetupProfileViewModel.kt
@@ -1,4 +1,4 @@
-package org.futo.circles.auth.feature.sign_up.setup_profile
+package org.futo.circles.auth.feature.profile.setup
 
 import android.net.Uri
 import androidx.lifecycle.MutableLiveData
diff --git a/app/src/main/res/layout/dialog_fragment_edit_profile.xml b/auth/src/main/res/layout/dialog_fragment_edit_profile.xml
similarity index 100%
rename from app/src/main/res/layout/dialog_fragment_edit_profile.xml
rename to auth/src/main/res/layout/dialog_fragment_edit_profile.xml
diff --git a/auth/src/main/res/navigation/nav_graph_auth.xml b/auth/src/main/res/navigation/nav_graph_auth.xml
index f3ca8a361..130ebbc31 100644
--- a/auth/src/main/res/navigation/nav_graph_auth.xml
+++ b/auth/src/main/res/navigation/nav_graph_auth.xml
@@ -51,7 +51,7 @@
     </fragment>
     <fragment
         android:id="@+id/setupProfileFragment"
-        android:name="org.futo.circles.auth.feature.sign_up.setup_profile.SetupProfileFragment"
+        android:name="org.futo.circles.auth.feature.profile.setup.SetupProfileFragment"
         android:label="SetupProfileFragment"
         tools:layout="@layout/fragment_setup_profile">
         <action
diff --git a/auth/src/main/res/values/strings.xml b/auth/src/main/res/values/strings.xml
index fa168e1ee..8099aca55 100644
--- a/auth/src/main/res/values/strings.xml
+++ b/auth/src/main/res/values/strings.xml
@@ -120,6 +120,7 @@
     <string name="active_login_sessions">Active login sessions</string>
     <string name="verify_session">Verify session</string>
     <string name="scan_qr_code">Scan QR code</string>
+    <string name="profile_updated">Profile updated</string>
 
     <plurals name="days">
         <item quantity="one">%1$d day</item>
-- 
GitLab