Skip to content

Commit 85a8c9e

Browse files
committed
updated docs with user widget (button that opens the form)
1 parent df25460 commit 85a8c9e

File tree

2 files changed

+69
-6
lines changed

2 files changed

+69
-6
lines changed

docs/platforms/android/user-feedback/configuration/index.mdx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ description: "Learn about general User Feedback configuration fields."
77
## User Feedback Widget
88

99
The User Feedback Widget offers many customization options, and if the available options are insufficient, you can [use your own UI](#bring-your-own-widget).
10+
The widget is a custom button that opens the form, a custom AlertDialog that allows users to submit feedback.
1011

1112
### General
1213

@@ -48,6 +49,45 @@ SentryAndroid.init(this) { options ->
4849
}
4950
```
5051

52+
### Widget
53+
54+
The widget is a custom button that opens the feedback form. As such, you can treat it like any View, customizing it through its XML attributes or programmatically.
55+
The default attributes of the widget are:
56+
57+
| Attribute | Default Value |
58+
| -------------------------- | ------------------------------------------- |
59+
| `android:drawablePadding` | `4dp` |
60+
| `android:drawableStart` | `@drawable/baseline_campaign_24` |
61+
| `android:textAllCaps` | `false` |
62+
| `android:background` | `@drawable/oval_button_ripple_background` |
63+
| `android:padding` | `12dp` |
64+
| `android:textColor` | `?android:attr/colorForeground` |
65+
| `android:text` | `"Report a Bug"` |
66+
67+
Example:
68+
```xml {filename:myLayout.xml}
69+
<?xml version="1.0" encoding="utf-8"?>
70+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
71+
android:layout_width="match_parent"
72+
android:layout_height="match_parent"
73+
android:orientation="vertical">
74+
75+
<io.sentry.android.core.SentryUserFeedbackWidget
76+
android:layout_width="wrap_content"
77+
android:layout_height="wrap_content"/>
78+
</LinearLayout>
79+
```
80+
```java
81+
import io.sentry.android.core.SentryUserFeedbackWidget;
82+
83+
SentryUserFeedbackWidget widget = new SentryUserFeedbackWidget(context);
84+
```
85+
```kotlin
86+
import io.sentry.android.core.SentryUserFeedbackWidget
87+
88+
val widget = SentryUserFeedbackWidget(context)
89+
```
90+
5191
### Form Configuration
5292

5393
You can customize which form elements are shown, whether they are required, and even prefill some info, in `SentryOptions.SentryFeedbackOptions`:

docs/platforms/android/user-feedback/index.mdx

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,40 @@ The User Feedback feature allows you to collect user feedback from anywhere insi
99

1010
<Alert>
1111
If you're using a self-hosted Sentry instance, you'll need to be on version 24.4.2 or higher in order to use the full functionality of the User Feedback feature. Lower versions may have limited functionality.
12-
Ensure you are using the Android SDK version 8.13.0 or above of the SDK to access the latest features.
12+
Ensure you are using the Android SDK version 8.14.0 or above of the SDK to access the latest features.
1313
</Alert>
1414

15-
## User Feedback Widget
15+
## Widget
1616

17-
The User Feedback widget allows users to submit feedback from anywhere inside your application.
17+
The widget is a custom button that opens the feedback form. You can use it directly in your layout XML or instantiate it programmatically.
1818

19-
### Set Up
19+
```xml {filename:myLayout.xml}
20+
<?xml version="1.0" encoding="utf-8"?>
21+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
22+
android:layout_width="match_parent"
23+
android:layout_height="match_parent"
24+
android:orientation="vertical">
2025

21-
To start using the User Feedback widget in your Android application, just start the SDK.
22-
A `SentryUserFeedbackDialog` will be available to be used in your app.
26+
<io.sentry.android.core.SentryUserFeedbackWidget
27+
android:layout_width="wrap_content"
28+
android:layout_height="wrap_content"/>
29+
</LinearLayout>
30+
```
31+
```java
32+
import io.sentry.android.core.SentryUserFeedbackWidget;
33+
34+
SentryUserFeedbackWidget widget = new SentryUserFeedbackWidget(context);
35+
```
36+
```kotlin
37+
import io.sentry.android.core.SentryUserFeedbackWidget
38+
39+
val widget = SentryUserFeedbackWidget(context)
40+
```
41+
42+
43+
## User Feedback Form
44+
45+
The User Feedback form allows users to submit feedback from anywhere inside your application.
2346
For the configuration options, please refer to the <PlatformLink to="/user-feedback/configuration/">User Feedback Widget Configuration</PlatformLink>.
2447

2548
```java

0 commit comments

Comments
 (0)