Fix adding reviews via personal accounts
This commit is contained in:
@@ -287,7 +287,7 @@ class AppDetailsFragment : BaseFragment(R.layout.fragment_details) {
|
|||||||
|
|
||||||
viewLifecycleOwner.lifecycleScope.launch {
|
viewLifecycleOwner.lifecycleScope.launch {
|
||||||
viewModel.userReview.collect {
|
viewModel.userReview.collect {
|
||||||
if (it.timeStamp == 0L) {
|
if (it.commentId.isNotEmpty()) {
|
||||||
binding.layoutDetailsReview.userStars.rating = it.rating.toFloat()
|
binding.layoutDetailsReview.userStars.rating = it.rating.toFloat()
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
requireContext(),
|
requireContext(),
|
||||||
@@ -1029,7 +1029,7 @@ class AppDetailsFragment : BaseFragment(R.layout.fragment_details) {
|
|||||||
toast(R.string.toast_anonymous_restriction)
|
toast(R.string.toast_anonymous_restriction)
|
||||||
} else {
|
} else {
|
||||||
addOrUpdateReview(app, Review().apply {
|
addOrUpdateReview(app, Review().apply {
|
||||||
title = authData.userProfile!!.name
|
title = B.inputTitle.text.toString()
|
||||||
rating = B.userStars.rating.toInt()
|
rating = B.userStars.rating.toInt()
|
||||||
comment = B.inputReview.text.toString()
|
comment = B.inputReview.text.toString()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -52,20 +52,32 @@
|
|||||||
android:scaleY=".75"
|
android:scaleY=".75"
|
||||||
android:stepSize="1" />
|
android:stepSize="1" />
|
||||||
|
|
||||||
<RelativeLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginBottom="@dimen/margin_normal"
|
android:layout_marginBottom="@dimen/margin_normal"
|
||||||
|
android:orientation="vertical"
|
||||||
android:divider="@drawable/divider"
|
android:divider="@drawable/divider"
|
||||||
android:orientation="horizontal"
|
|
||||||
android:showDividers="middle">
|
android:showDividers="middle">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
android:id="@+id/input_title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="42dp"
|
||||||
|
android:background="@drawable/bg_search"
|
||||||
|
android:gravity="center_vertical|center_horizontal"
|
||||||
|
android:hint="@string/details_ratings_title_hint"
|
||||||
|
android:imeOptions="flagNoExtractUi|actionDone"
|
||||||
|
android:inputType="text"
|
||||||
|
android:paddingStart="@dimen/padding_large"
|
||||||
|
android:paddingEnd="@dimen/padding_normal"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textAppearance="@style/TextAppearance.Aurora.Line2" />
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/input_review"
|
android:id="@+id/input_review"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="42dp"
|
android:layout_height="42dp"
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_toStartOf="@id/btn_post_review"
|
|
||||||
android:background="@drawable/bg_search"
|
android:background="@drawable/bg_search"
|
||||||
android:gravity="center_vertical|center_horizontal"
|
android:gravity="center_vertical|center_horizontal"
|
||||||
android:hint="@string/details_think_this_app"
|
android:hint="@string/details_think_this_app"
|
||||||
@@ -78,15 +90,13 @@
|
|||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/btn_post_review"
|
android:id="@+id/btn_post_review"
|
||||||
style="@style/Widget.MaterialComponents.Button.TextButton.Dialog.Flush"
|
style="@style/Widget.Material3.Button.OutlinedButton"
|
||||||
android:layout_width="wrap_content"
|
app:cornerRadius="@dimen/margin_small"
|
||||||
android:layout_height="42dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginStart="@dimen/margin_xsmall"
|
|
||||||
android:text="@string/action_post" />
|
android:text="@string/action_post" />
|
||||||
</RelativeLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|||||||
@@ -124,6 +124,7 @@
|
|||||||
<string name="details_permission">"Permission"</string>
|
<string name="details_permission">"Permission"</string>
|
||||||
<string name="details_privacy">"Privacy"</string>
|
<string name="details_privacy">"Privacy"</string>
|
||||||
<string name="details_ratings">"Rating and reviews"</string>
|
<string name="details_ratings">"Rating and reviews"</string>
|
||||||
|
<string name="details_ratings_title_hint">"Review title"</string>
|
||||||
<string name="details_think_this_app">"What do you think about this app?"</string>
|
<string name="details_think_this_app">"What do you think about this app?"</string>
|
||||||
<string name="download_cancel_all">"Cancel all"</string>
|
<string name="download_cancel_all">"Cancel all"</string>
|
||||||
<string name="download_canceled">"Cancelled"</string>
|
<string name="download_canceled">"Cancelled"</string>
|
||||||
@@ -310,7 +311,7 @@
|
|||||||
<string name="toast_manual_unavailable">"The version code you are requesting is unavailable."</string>
|
<string name="toast_manual_unavailable">"The version code you are requesting is unavailable."</string>
|
||||||
<string name="toast_manual_available">"Congrats, requested version code is available, downloading now."</string>
|
<string name="toast_manual_available">"Congrats, requested version code is available, downloading now."</string>
|
||||||
<string name="toast_page_unavailable">Browse page unavailable</string>
|
<string name="toast_page_unavailable">Browse page unavailable</string>
|
||||||
<string name="toast_rated_success">Rated</string>
|
<string name="toast_rated_success">Rated, it may take a while to show</string>
|
||||||
<string name="toast_rated_failed">Could not submit rating</string>
|
<string name="toast_rated_failed">Could not submit rating</string>
|
||||||
<string name="toast_aas_token_failed">Could not generate AAS Token</string>
|
<string name="toast_aas_token_failed">Could not generate AAS Token</string>
|
||||||
<string name="toast_export_success">Device config exported</string>
|
<string name="toast_export_success">Device config exported</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user