diff --git a/app/src/main/java/org/futo/circles/feature/people/PeopleFragment.kt b/app/src/main/java/org/futo/circles/feature/people/PeopleFragment.kt index b5421324d96372a387fe7dd9c5efba9faf53d370..cb70d40b111439c520c1b8f44448fc75028ab4f0 100644 --- a/app/src/main/java/org/futo/circles/feature/people/PeopleFragment.kt +++ b/app/src/main/java/org/futo/circles/feature/people/PeopleFragment.kt @@ -63,8 +63,7 @@ class PeopleFragment : BaseBindingFragment<FragmentPeopleBinding>(FragmentPeople }) adapter = peopleAdapter } - ivEditProfile.setOnClickListener { navigator.navigateToEditProfile() } - ivShareProfile.setOnClickListener { navigator.navigateToShareProfile(viewModel.getSharedCircleSpaceId()) } + btnEditProfile.setOnClickListener { navigator.navigateToEditProfile() } } } diff --git a/app/src/main/java/org/futo/circles/feature/people/PeopleNavigator.kt b/app/src/main/java/org/futo/circles/feature/people/PeopleNavigator.kt index 7621277e04b7b7e33b8047f9acf2710fae333e37..f048416a0c4b7dd5dfdc48b979e4e204a5f3e0f5 100644 --- a/app/src/main/java/org/futo/circles/feature/people/PeopleNavigator.kt +++ b/app/src/main/java/org/futo/circles/feature/people/PeopleNavigator.kt @@ -26,21 +26,4 @@ class PeopleNavigator(private val fragment: PeopleFragment) { .navigateSafe(PeopleFragmentDirections.toEditProfileDialogFragment()) } - fun navigateToShareProfile(sharedSpaceId: String?) { - sharedSpaceId ?: kotlin.run { - fragment.showError( - fragment.requireContext() - .getString(org.futo.circles.settings.R.string.shared_circles_space_not_found) - ) - return - } - fragment.findNavController().navigateSafe( - PeopleFragmentDirections.toShareProfileDialogFragment( - sharedSpaceId, - ShareUrlTypeArg.PROFILE - ) - ) - } - - } \ No newline at end of file diff --git a/app/src/main/java/org/futo/circles/feature/people/PeopleViewModel.kt b/app/src/main/java/org/futo/circles/feature/people/PeopleViewModel.kt index 149af643585cf3f01d3c590961966e4fabfa9e03..d17176a7ced539a39c63098cc15bfa53e51fae72 100644 --- a/app/src/main/java/org/futo/circles/feature/people/PeopleViewModel.kt +++ b/app/src/main/java/org/futo/circles/feature/people/PeopleViewModel.kt @@ -8,15 +8,13 @@ import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.flatMapLatest import org.futo.circles.core.extensions.launchBg import org.futo.circles.core.extensions.launchUi -import org.futo.circles.core.feature.workspace.SharedCircleDataSource import org.futo.circles.core.provider.MatrixSessionProvider import org.futo.circles.model.PeopleListItem import javax.inject.Inject @HiltViewModel class PeopleViewModel @Inject constructor( - private val peopleDataSource: PeopleDataSource, - private val sharedCircleDataSource: SharedCircleDataSource + private val peopleDataSource: PeopleDataSource ) : ViewModel() { private val session = MatrixSessionProvider.getSessionOrThrow() @@ -34,6 +32,4 @@ class PeopleViewModel @Inject constructor( .collectLatest { items -> peopleLiveData.postValue(items) } } } - - fun getSharedCircleSpaceId(): String? = sharedCircleDataSource.getSharedCirclesSpaceId() } \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_people.xml b/app/src/main/res/layout/fragment_people.xml index 08b654b92df09f8472d56e4afc4a7f330329670d..3434d1e70f944c2af3c97aa2f50d5aed18598672 100644 --- a/app/src/main/res/layout/fragment_people.xml +++ b/app/src/main/res/layout/fragment_people.xml @@ -23,23 +23,6 @@ app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.App.CornerSize50Percent" tools:src="@color/blue" /> - <com.google.android.material.button.MaterialButton - android:id="@+id/ivEditProfile" - style="@style/Widget.Material3.Button.TextButton" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/edit_profile" - android:textColor="@color/menu_icon_color" - android:textSize="13sp" - app:icon="@drawable/ic_edit" - app:iconGravity="top" - app:iconTint="@color/menu_icon_color" - app:layout_constraintBottom_toBottomOf="@id/ivProfile" - app:layout_constraintEnd_toStartOf="@id/ivProfile" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="@id/ivProfile" /> - - <TextView android:id="@+id/tvUserName" style="@style/title2" @@ -69,21 +52,18 @@ tools:text="texsdt" /> <com.google.android.material.button.MaterialButton - android:id="@+id/ivShareProfile" - style="@style/Widget.Material3.Button.TextButton" + android:id="@+id/btnEditProfile" + style="@style/NegativeButtonStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/share_profile" - android:textColor="@color/menu_icon_color" - android:textSize="13sp" - app:icon="@drawable/ic_qr" - app:iconGravity="top" - app:iconTint="@color/menu_icon_color" - app:layout_constraintBottom_toBottomOf="@id/ivProfile" + android:layout_marginTop="8dp" + android:maxHeight="40dp" + android:text="@string/edit_profile" + android:textSize="12sp" + app:icon="@drawable/ic_create" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toEndOf="@id/ivProfile" - app:layout_constraintTop_toTopOf="@id/ivProfile" - app:rippleColor="@color/highlight_color" /> + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/tvUserId" /> <View android:layout_width="match_parent" @@ -93,7 +73,7 @@ app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/tvUserId" /> + app:layout_constraintTop_toBottomOf="@id/btnEditProfile" /> </androidx.constraintlayout.widget.ConstraintLayout> diff --git a/app/src/main/res/navigation/people_nav_graph.xml b/app/src/main/res/navigation/people_nav_graph.xml index e214a35500fa77d2acf9b78b872696d1985cf0c9..1aa73eeb07d42f3d3da633bf5e07952693f0c9d8 100644 --- a/app/src/main/res/navigation/people_nav_graph.xml +++ b/app/src/main/res/navigation/people_nav_graph.xml @@ -34,21 +34,6 @@ <action android:id="@+id/to_editProfileDialogFragment" app:destination="@id/editProfileDialogFragment" /> - <action - android:id="@+id/to_shareProfileDialogFragment" - app:destination="@id/share_room_nav_graph"> - - <argument - android:name="roomId" - app:argType="string" - app:nullable="false" /> - - <argument - android:name="urlType" - app:argType="org.futo.circles.core.model.ShareUrlTypeArg" - app:nullable="false" /> - - </action> <action android:id="@+id/to_peopleCategoryDialogFragment" app:destination="@id/peopleCategoryDialogFragment"> @@ -63,8 +48,6 @@ <include app:graph="@navigation/invites_nav_graph" /> - <include app:graph="@navigation/share_room_nav_graph" /> - <include app:graph="@navigation/user_nav_graph" /> <dialog