From de386ca329b42ce3511965e90ea46ee48470d8a3 Mon Sep 17 00:00:00 2001
From: Salma ElTarzi
Date: Sun, 4 Feb 2018 12:02:11 +0200
Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Java=20module=20code=20refactore?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../RNInstabugReactnativeModule.java | 63 +++++++++----------
1 file changed, 30 insertions(+), 33 deletions(-)
diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java
index 9c82bfd..7458258 100644
--- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java
+++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java
@@ -235,7 +235,7 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
/**
* Change Locale of Instabug UI elements(defaults to English)
*
- * @param String instabugLocale
+ * @param instabugLocale
*/
@ReactMethod
public void changeLocale(String instabugLocale) {
@@ -337,7 +337,7 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
/**
* Set the primary color that the SDK will use to tint certain UI elements in the SDK
*
- * @param primaryColorValue The value of the primary color ,
+ * @param primaryColor The value of the primary color ,
* whatever this color was parsed from a resource color or hex color
* or RGB color values
*/
@@ -372,12 +372,8 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
/**
* Appends a log message to Instabug internal log
- *
* These logs are then sent along the next uploaded report. All log messages are timestamped
- *
* Logs aren't cleared per single application run. If you wish to reset the logs, use
- * {@link #clearLog()}
- *
* Note: logs passed to this method are NOT printed to Logcat
*
* @param message log message
@@ -394,7 +390,7 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
/**
* Gets tags.
*
- * @return all tags added using {@link #addTags(String...)}
+ * @return all tags added
* @see #resetTags()
*/
@ReactMethod
@@ -417,8 +413,8 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
* Set the user identity.
* Instabug will pre-fill the user email in reports.
*
- * @param username Username.
- * @param email User's default email
+ * @param userName Username.
+ * @param userEmail User's default email
*/
@ReactMethod
public void identifyUser(String userName, String userEmail) {
@@ -430,7 +426,7 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
}
/**
- * Reset ALL tags added using {@link #addTags(String...)}
+ * Reset ALL tags added
*/
@ReactMethod
public void resetTags() {
@@ -586,7 +582,9 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
/**
* Report a caught exception to Instabug dashboard
*
- * @param throwable the exception to be reported
+ * @param stack the exception to be reported
+ * @param message the message of the exception to be reported
+ * @param errorIdentifier used to group issues manually reported
*/
@ReactMethod
public void reportJsException(ReadableArray stack, String message, String errorIdentifier) {
@@ -625,7 +623,6 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
*
* Note: logs passed to this method are NOT printed to Logcat
*
- * @param logMessage The message you would like logged
* @param level the level
* @param message the message
*/
@@ -774,7 +771,7 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
* shows up on your Instabug dashboard as a tag to make filtering
* through issues easier.
*
- * @param reportCategories the report categories list which is a list of ReportCategory model
+ * @param categoriesTitles the report categories list which is a list of ReportCategory model
*/
@ReactMethod
public void setReportCategories(ReadableArray categoriesTitles) {
@@ -798,7 +795,7 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
* sending reports.
* Defaults to YES.
*
- * @param {boolean} isEmailFieldRequired A boolean to indicate whether email
+ * @param isEmailFieldRequired A boolean to indicate whether email
* field is required or not.
*/
@ReactMethod
@@ -814,7 +811,7 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
* Sets whether users are required to enter a comment or not when sending reports.
* Defaults to NO.
*
- * @param {boolean} isCommentFieldRequired A boolean to indicate whether comment
+ * @param isCommentFieldRequired A boolean to indicate whether comment
* field is required or not.
*/
@ReactMethod
@@ -830,8 +827,8 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
* Overrides any of the strings shown in the SDK with custom ones.
* Allows you to customize any of the strings shown to users in the SDK.
*
- * @param {string} string String value to override the default one.
- * @param {strings} key Key of string to override.
+ * @param string String value to override the default one.
+ * @param key Key of string to override.
*/
@ReactMethod
public void setString(String string, String key) {
@@ -863,7 +860,7 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
* By default, screenshot view is shown when reporting a bug, but not when
* sending feedback.
*
- * @param {boolean} willSkipScreenshotAnnotation sets whether screenshot view is
+ * @param willSkipScreenshotAnnotation sets whether screenshot view is
* shown or not. Passing YES will show screenshot view for both feedback and
* bug reporting, while passing NO will disable it for both.
*/
@@ -880,7 +877,7 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
* Logs a user event that happens through the lifecycle of the application.
* Logged user events are going to be sent with each report, as well as at the end of a session.
*
- * @param {string} name Event name.
+ * @param name Event name.
*/
@ReactMethod
public void logUserEventWithName(String name) {
@@ -896,8 +893,8 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
* Logged user events are going to be sent with each report, as well as at the end of a
* session.
*
- * @param {string} name Event name.
- * @param {ReadableMap} params An optional ReadableMap to be associated with the event.
+ * @param name Event name.
+ * @param params An optional ReadableMap to be associated with the event.
*/
@ReactMethod
public void logUserEventWithNameAndParams(String name, ReadableMap params) {
@@ -924,7 +921,7 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
* This block is executed on the UI thread. Could be used for performing any
* UI changes before the SDK's UI is shown.
*
- * @param {preInvocationHandler} preInvocationHandler - A callback that gets executed before
+ * @param preInvocationHandler - A callback that gets executed before
* invoking the SDK
*/
@ReactMethod
@@ -947,7 +944,7 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
* This block is executed in the background before sending each report. Could
* be used for attaching logs and extra data to reports.
*
- * @param {preSendingHandler} preSendingHandler - A callback that gets executed before
+ * @param preSendingHandler - A callback that gets executed before
* sending each bug
* report.
*/
@@ -971,7 +968,7 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
* This block is executed on the UI thread. Could be used for performing any
* UI changes after the SDK's UI is dismissed.
*
- * @param {postInvocationHandler} postInvocationHandler - A callback to get executed after
+ * @param postInvocationHandler - A callback to get executed after
* dismissing the SDK.
*/
@ReactMethod
@@ -996,7 +993,7 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
/**
* Show any valid survey if exist
*
- * @return return true if a valid survey was shown otherwise false
+ * @return true if a valid survey was shown otherwise false
*/
@ReactMethod
public void showSurveysIfAvailable() {
@@ -1010,7 +1007,7 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
/**
* Show any valid survey if exist
*
- * @return return true if a valid survey was shown otherwise false
+ * @return true if a valid survey was shown otherwise false
*/
@ReactMethod
public void setSurveysEnabled(boolean surveysEnabled) {
@@ -1040,7 +1037,7 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
* WARNING: This runs on your application's main UI thread. Please do not include
* any blocking operations to avoid ANRs.
*
- * @param preShowingSurveyRunnable to run on the UI thread before showing any valid survey
+ * @param willShowSurveyHandler to run on the UI thread before showing any valid survey
*/
@ReactMethod
public void setWillShowSurveyHandler(final Callback willShowSurveyHandler) {
@@ -1062,7 +1059,7 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
* WARNING: This runs on your application's main UI thread. Please do not include
* any blocking operations to avoid ANRs.
*
- * @param afterShowingSurveyRunnable to run on the UI thread after showing any valid survey
+ * @param didDismissSurveyHandler to run on the UI thread after showing any valid survey
*/
@ReactMethod
public void setDidDismissSurveyHandler(final Callback didDismissSurveyHandler) {
@@ -1086,9 +1083,9 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
* none is enabled, Bug
* reporting becomes the default invocation option.
*
- * @param {boolean} chat weather Talk to us is enable or not
- * @param {boolean} bug weather Report a Problem is enable or not
- * @param {boolean} feedback weather General Feedback is enable or not
+ * @param chat weather Talk to us is enable or not
+ * @param bug weather Report a Problem is enable or not
+ * @param feedback weather General Feedback is enable or not
*/
@ReactMethod
public void setPromptOptionsEnabled(boolean chat, boolean bug, boolean feedback) {
@@ -1118,7 +1115,7 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
* you could increase the shaking difficulty level by
* increasing the `350` value and vice versa.
*
- * @param {number} androidThreshold Threshold for android devices.
+ * @param androidThreshold Threshold for android devices.
*/
@ReactMethod
public void setShakingThresholdForAndroid(int androidThreshold) {
@@ -1132,7 +1129,7 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
/**
* Sets a block of code that gets executed when a new message is received.
*
- * @param {onNewMessageHandler} onNewMessageHandler - A callback that gets
+ * @param onNewMessageHandler - A callback that gets
* executed when a new message is received.
*/
@ReactMethod