Skip to content

Commit de386ca

Browse files
committed
📝 Java module code refactore
1 parent 9efccdf commit de386ca

File tree

1 file changed

+30
-33
lines changed

1 file changed

+30
-33
lines changed

android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public void appendTags(ReadableArray tags) {
235235
/**
236236
* Change Locale of Instabug UI elements(defaults to English)
237237
*
238-
* @param String instabugLocale
238+
* @param instabugLocale
239239
*/
240240
@ReactMethod
241241
public void changeLocale(String instabugLocale) {
@@ -337,7 +337,7 @@ public void showIntroMessage() {
337337
/**
338338
* Set the primary color that the SDK will use to tint certain UI elements in the SDK
339339
*
340-
* @param primaryColorValue The value of the primary color ,
340+
* @param primaryColor The value of the primary color ,
341341
* whatever this color was parsed from a resource color or hex color
342342
* or RGB color values
343343
*/
@@ -372,12 +372,8 @@ public void setAttachmentTypesEnabled(boolean screenshot, boolean extraScreensho
372372

373373
/**
374374
* Appends a log message to Instabug internal log
375-
* <p>
376375
* These logs are then sent along the next uploaded report. All log messages are timestamped
377-
* <br/>
378376
* Logs aren't cleared per single application run. If you wish to reset the logs, use
379-
* {@link #clearLog()}
380-
* </p>
381377
* Note: logs passed to this method are <b>NOT</b> printed to Logcat
382378
*
383379
* @param message log message
@@ -394,7 +390,7 @@ public void IBGLog(String message) {
394390
/**
395391
* Gets tags.
396392
*
397-
* @return all tags added using {@link #addTags(String...)}
393+
* @return all tags added
398394
* @see #resetTags()
399395
*/
400396
@ReactMethod
@@ -417,8 +413,8 @@ public void getTags(Callback tagsCallback) {
417413
* Set the user identity.
418414
* Instabug will pre-fill the user email in reports.
419415
*
420-
* @param username Username.
421-
* @param email User's default email
416+
* @param userName Username.
417+
* @param userEmail User's default email
422418
*/
423419
@ReactMethod
424420
public void identifyUser(String userName, String userEmail) {
@@ -430,7 +426,7 @@ public void identifyUser(String userName, String userEmail) {
430426
}
431427

432428
/**
433-
* Reset ALL tags added using {@link #addTags(String...)}
429+
* Reset ALL tags added
434430
*/
435431
@ReactMethod
436432
public void resetTags() {
@@ -586,7 +582,9 @@ public void setDebugEnabled(boolean isDebugEnabled) {
586582
/**
587583
* Report a caught exception to Instabug dashboard
588584
*
589-
* @param throwable the exception to be reported
585+
* @param stack the exception to be reported
586+
* @param message the message of the exception to be reported
587+
* @param errorIdentifier used to group issues manually reported
590588
*/
591589
@ReactMethod
592590
public void reportJsException(ReadableArray stack, String message, String errorIdentifier) {
@@ -625,7 +623,6 @@ public void reportJsException(ReadableArray stack, String message, String errorI
625623
* </p>
626624
* Note: logs passed to this method are <b>NOT</b> printed to Logcat
627625
*
628-
* @param logMessage The message you would like logged
629626
* @param level the level
630627
* @param message the message
631628
*/
@@ -774,7 +771,7 @@ public void setColorTheme(String theme) {
774771
* shows up on your Instabug dashboard as a tag to make filtering
775772
* through issues easier.
776773
*
777-
* @param reportCategories the report categories list which is a list of ReportCategory model
774+
* @param categoriesTitles the report categories list which is a list of ReportCategory model
778775
*/
779776
@ReactMethod
780777
public void setReportCategories(ReadableArray categoriesTitles) {
@@ -798,7 +795,7 @@ public void setReportCategories(ReadableArray categoriesTitles) {
798795
* sending reports.
799796
* Defaults to YES.
800797
*
801-
* @param {boolean} isEmailFieldRequired A boolean to indicate whether email
798+
* @param isEmailFieldRequired A boolean to indicate whether email
802799
* field is required or not.
803800
*/
804801
@ReactMethod
@@ -814,7 +811,7 @@ public void setEmailFieldRequired(boolean isEmailFieldRequired) {
814811
* Sets whether users are required to enter a comment or not when sending reports.
815812
* Defaults to NO.
816813
*
817-
* @param {boolean} isCommentFieldRequired A boolean to indicate whether comment
814+
* @param isCommentFieldRequired A boolean to indicate whether comment
818815
* field is required or not.
819816
*/
820817
@ReactMethod
@@ -830,8 +827,8 @@ public void setCommentFieldRequired(boolean isCommentFieldRequired) {
830827
* Overrides any of the strings shown in the SDK with custom ones.
831828
* Allows you to customize any of the strings shown to users in the SDK.
832829
*
833-
* @param {string} string String value to override the default one.
834-
* @param {strings} key Key of string to override.
830+
* @param string String value to override the default one.
831+
* @param key Key of string to override.
835832
*/
836833
@ReactMethod
837834
public void setString(String string, String key) {
@@ -863,7 +860,7 @@ public void logOut() {
863860
* By default, screenshot view is shown when reporting a bug, but not when
864861
* sending feedback.
865862
*
866-
* @param {boolean} willSkipScreenshotAnnotation sets whether screenshot view is
863+
* @param willSkipScreenshotAnnotation sets whether screenshot view is
867864
* shown or not. Passing YES will show screenshot view for both feedback and
868865
* bug reporting, while passing NO will disable it for both.
869866
*/
@@ -880,7 +877,7 @@ public void setWillSkipScreenshotAnnotation(boolean willSkipScreenshotAnnotation
880877
* Logs a user event that happens through the lifecycle of the application.
881878
* Logged user events are going to be sent with each report, as well as at the end of a session.
882879
*
883-
* @param {string} name Event name.
880+
* @param name Event name.
884881
*/
885882
@ReactMethod
886883
public void logUserEventWithName(String name) {
@@ -896,8 +893,8 @@ public void logUserEventWithName(String name) {
896893
* Logged user events are going to be sent with each report, as well as at the end of a
897894
* session.
898895
*
899-
* @param {string} name Event name.
900-
* @param {ReadableMap} params An optional ReadableMap to be associated with the event.
896+
* @param name Event name.
897+
* @param params An optional ReadableMap to be associated with the event.
901898
*/
902899
@ReactMethod
903900
public void logUserEventWithNameAndParams(String name, ReadableMap params) {
@@ -924,7 +921,7 @@ public void logUserEventWithNameAndParams(String name, ReadableMap params) {
924921
* This block is executed on the UI thread. Could be used for performing any
925922
* UI changes before the SDK's UI is shown.
926923
*
927-
* @param {preInvocationHandler} preInvocationHandler - A callback that gets executed before
924+
* @param preInvocationHandler - A callback that gets executed before
928925
* invoking the SDK
929926
*/
930927
@ReactMethod
@@ -947,7 +944,7 @@ public void run() {
947944
* This block is executed in the background before sending each report. Could
948945
* be used for attaching logs and extra data to reports.
949946
*
950-
* @param {preSendingHandler} preSendingHandler - A callback that gets executed before
947+
* @param preSendingHandler - A callback that gets executed before
951948
* sending each bug
952949
* report.
953950
*/
@@ -971,7 +968,7 @@ public void run() {
971968
* This block is executed on the UI thread. Could be used for performing any
972969
* UI changes after the SDK's UI is dismissed.
973970
*
974-
* @param {postInvocationHandler} postInvocationHandler - A callback to get executed after
971+
* @param postInvocationHandler - A callback to get executed after
975972
* dismissing the SDK.
976973
*/
977974
@ReactMethod
@@ -996,7 +993,7 @@ public void onSdkDismissed(DismissType issueState, Bug.Type bugType) {
996993
/**
997994
* Show any valid survey if exist
998995
*
999-
* @return return true if a valid survey was shown otherwise false
996+
* @return true if a valid survey was shown otherwise false
1000997
*/
1001998
@ReactMethod
1002999
public void showSurveysIfAvailable() {
@@ -1010,7 +1007,7 @@ public void showSurveysIfAvailable() {
10101007
/**
10111008
* Show any valid survey if exist
10121009
*
1013-
* @return return true if a valid survey was shown otherwise false
1010+
* @return true if a valid survey was shown otherwise false
10141011
*/
10151012
@ReactMethod
10161013
public void setSurveysEnabled(boolean surveysEnabled) {
@@ -1040,7 +1037,7 @@ public void setIntroMessageEnabled(boolean enabled) {
10401037
* WARNING: This runs on your application's main UI thread. Please do not include
10411038
* any blocking operations to avoid ANRs.
10421039
*
1043-
* @param preShowingSurveyRunnable to run on the UI thread before showing any valid survey
1040+
* @param willShowSurveyHandler to run on the UI thread before showing any valid survey
10441041
*/
10451042
@ReactMethod
10461043
public void setWillShowSurveyHandler(final Callback willShowSurveyHandler) {
@@ -1062,7 +1059,7 @@ public void run() {
10621059
* WARNING: This runs on your application's main UI thread. Please do not include
10631060
* any blocking operations to avoid ANRs.
10641061
*
1065-
* @param afterShowingSurveyRunnable to run on the UI thread after showing any valid survey
1062+
* @param didDismissSurveyHandler to run on the UI thread after showing any valid survey
10661063
*/
10671064
@ReactMethod
10681065
public void setDidDismissSurveyHandler(final Callback didDismissSurveyHandler) {
@@ -1086,9 +1083,9 @@ public void run() {
10861083
* none is enabled, Bug
10871084
* reporting becomes the default invocation option.
10881085
*
1089-
* @param {boolean} chat weather Talk to us is enable or not
1090-
* @param {boolean} bug weather Report a Problem is enable or not
1091-
* @param {boolean} feedback weather General Feedback is enable or not
1086+
* @param chat weather Talk to us is enable or not
1087+
* @param bug weather Report a Problem is enable or not
1088+
* @param feedback weather General Feedback is enable or not
10921089
*/
10931090
@ReactMethod
10941091
public void setPromptOptionsEnabled(boolean chat, boolean bug, boolean feedback) {
@@ -1118,7 +1115,7 @@ public void clearFileAttachment() {
11181115
* you could increase the shaking difficulty level by
11191116
* increasing the `350` value and vice versa.
11201117
*
1121-
* @param {number} androidThreshold Threshold for android devices.
1118+
* @param androidThreshold Threshold for android devices.
11221119
*/
11231120
@ReactMethod
11241121
public void setShakingThresholdForAndroid(int androidThreshold) {
@@ -1132,7 +1129,7 @@ public void setShakingThresholdForAndroid(int androidThreshold) {
11321129
/**
11331130
* Sets a block of code that gets executed when a new message is received.
11341131
*
1135-
* @param {onNewMessageHandler} onNewMessageHandler - A callback that gets
1132+
* @param onNewMessageHandler - A callback that gets
11361133
* executed when a new message is received.
11371134
*/
11381135
@ReactMethod

0 commit comments

Comments
 (0)