Skip to content

Commit 4441c12

Browse files
committed
Add spinner when sending feedback (#4384)
1 parent 49b7671 commit 4441c12

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

firebase-appdistribution/src/main/java/com/google/firebase/appdistribution/impl/FeedbackActivity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
package com.google.firebase.appdistribution.impl;
1616

1717
import static android.view.View.GONE;
18-
import static android.view.View.INVISIBLE;
1918
import static android.view.View.VISIBLE;
2019

2120
import android.graphics.Bitmap;
@@ -147,13 +146,13 @@ private Bitmap readScreenshot() {
147146
}
148147

149148
public void submitFeedback(View view) {
149+
setSubmittingStateEnabled(true);
150150
if (releaseName == null) {
151151
// Don't actually send feedback in development-mode
152152
Toast.makeText(this, R.string.feedback_no_release, Toast.LENGTH_LONG).show();
153153
finish();
154154
return;
155155
}
156-
setSubmittingStateEnabled(true);
157156
EditText feedbackText = findViewById(R.id.feedbackText);
158157
CheckBox screenshotCheckBox = findViewById(R.id.screenshotCheckBox);
159158
feedbackSender
@@ -176,7 +175,8 @@ public void submitFeedback(View view) {
176175
}
177176

178177
public void setSubmittingStateEnabled(boolean loading) {
179-
findViewById(R.id.sendButton).setVisibility(loading ? INVISIBLE : VISIBLE);
178+
findViewById(R.id.sendButton).setVisibility(loading ? GONE : VISIBLE);
179+
findViewById(R.id.sendSpinner).setVisibility(loading ? VISIBLE : GONE);
180180
findViewById(R.id.feedbackText).setEnabled(!loading);
181181
findViewById(R.id.feedbackText).setFocusable(!loading);
182182
}

firebase-appdistribution/src/main/res/layout/activity_feedback.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@
4949
android:minHeight="48dp"
5050
app:srcCompat="@drawable/ic_baseline_send_24" />
5151

52+
<ProgressBar
53+
android:id="@+id/sendSpinner"
54+
android:layout_width="wrap_content"
55+
android:layout_height="wrap_content"
56+
android:layout_gravity="center"
57+
android:layout_weight="0"
58+
android:minWidth="48dp"
59+
android:minHeight="48dp"
60+
android:visibility="gone"/>
61+
5262
</LinearLayout>
5363

5464
<View
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<resources xmlns:tools="http://schemas.android.com/tools">
2-
<style name="FeedbackTheme" parent="Theme.AppCompat.Light.NoActionBar" />
2+
<style name="FeedbackTheme" parent="Theme.AppCompat.Light.NoActionBar">
3+
<item name="colorAccent">#000000</item>
4+
</style>
35
</resources>

0 commit comments

Comments
 (0)