|
7 | 7 | import com.instabug.bug.invocation.Option;
|
8 | 8 | import com.instabug.library.InstabugColorTheme;
|
9 | 9 | import com.instabug.library.InstabugCustomTextPlaceHolder;
|
| 10 | +import com.instabug.library.extendedbugreport.ExtendedBugReport; |
10 | 11 |
|
11 | 12 | import java.util.HashMap;
|
12 | 13 | import java.util.Locale;
|
@@ -57,6 +58,8 @@ final class ArgsRegistry {
|
57 | 58 | registerInvocationModeArgs(ARGS);
|
58 | 59 | registerInvocationOptionsArgs(ARGS);
|
59 | 60 | registerCustomTextPlaceHolderKeysArgs(ARGS);
|
| 61 | + registerInstabugReportTypesArgs(ARGS); |
| 62 | + registerInstabugExtendedBugReportModeArgs(ARGS); |
60 | 63 | }
|
61 | 64 |
|
62 | 65 | /**
|
@@ -125,77 +128,90 @@ static void registerColorThemeArgs(Map<String, Object> args) {
|
125 | 128 |
|
126 | 129 | @VisibleForTesting
|
127 | 130 | static void registerInvocationModeArgs(Map<String, Object> args) {
|
128 |
| - args.put("InvocationMode.BUG", BugReporting.ReportType.BUG); |
129 |
| - args.put("InvocationMode.FEEDBACK", BugReporting.ReportType.FEEDBACK); |
| 131 | + args.put("InvocationMode.bug", BugReporting.ReportType.BUG); |
| 132 | + args.put("InvocationMode.feedback", BugReporting.ReportType.FEEDBACK); |
130 | 133 | }
|
131 | 134 |
|
132 | 135 | @VisibleForTesting
|
133 | 136 | static void registerInvocationOptionsArgs(Map<String, Object> args) {
|
134 |
| - args.put("InvocationOption.COMMENT_FIELD_REQUIRED", Option.COMMENT_FIELD_REQUIRED); |
135 |
| - args.put("InvocationOption.DISABLE_POST_SENDING_DIALOG", Option.DISABLE_POST_SENDING_DIALOG); |
136 |
| - args.put("InvocationOption.EMAIL_FIELD_HIDDEN", Option.EMAIL_FIELD_HIDDEN); |
137 |
| - args.put("InvocationOption.EMAIL_FIELD_OPTIONAL", Option.EMAIL_FIELD_OPTIONAL); |
| 137 | + args.put("InvocationOption.commentFieldRequired", Option.COMMENT_FIELD_REQUIRED); |
| 138 | + args.put("InvocationOption.disablePostSendingDialog", Option.DISABLE_POST_SENDING_DIALOG); |
| 139 | + args.put("InvocationOption.emailFieldHidden", Option.EMAIL_FIELD_HIDDEN); |
| 140 | + args.put("InvocationOption.emailFieldOptional", Option.EMAIL_FIELD_OPTIONAL); |
138 | 141 | }
|
139 | 142 |
|
140 | 143 | @VisibleForTesting
|
141 | 144 | static void registerLocaleArgs(Map<String, Object> args) {
|
142 |
| - args.put("Locale.ChineseTraditional", new Locale(TRADITIONAL_CHINESE.getCode(), TRADITIONAL_CHINESE.getCountry())); |
143 |
| - args.put("Locale.PortuguesePortugal", new Locale(PORTUGUESE_PORTUGAL.getCode(), PORTUGUESE_PORTUGAL.getCountry())); |
144 |
| - args.put("Locale.ChineseSimplified", new Locale(SIMPLIFIED_CHINESE.getCode(), SIMPLIFIED_CHINESE.getCountry())); |
145 |
| - args.put("Locale.PortugueseBrazil", new Locale(PORTUGUESE_BRAZIL.getCode(), PORTUGUESE_BRAZIL.getCountry())); |
146 |
| - args.put("Locale.Indonesian", new Locale(INDONESIAN.getCode(), INDONESIAN.getCountry())); |
147 |
| - args.put("Locale.Dutch", new Locale(NETHERLANDS.getCode(), NETHERLANDS.getCountry())); |
148 |
| - args.put("Locale.Norwegian", new Locale(NORWEGIAN.getCode(), NORWEGIAN.getCountry())); |
149 |
| - args.put("Locale.Japanese", new Locale(JAPANESE.getCode(), JAPANESE.getCountry())); |
150 |
| - args.put("Locale.English", new Locale(ENGLISH.getCode(), ENGLISH.getCountry())); |
151 |
| - args.put("Locale.Italian", new Locale(ITALIAN.getCode(), ITALIAN.getCountry())); |
152 |
| - args.put("Locale.Russian", new Locale(RUSSIAN.getCode(), RUSSIAN.getCountry())); |
153 |
| - args.put("Locale.Spanish", new Locale(SPANISH.getCode(), SPANISH.getCountry())); |
154 |
| - args.put("Locale.Swedish", new Locale(SWEDISH.getCode(), SWEDISH.getCountry())); |
155 |
| - args.put("Locale.Turkish", new Locale(TURKISH.getCode(), TURKISH.getCountry())); |
156 |
| - args.put("Locale.Arabic", new Locale(ARABIC.getCode(), ARABIC.getCountry())); |
157 |
| - args.put("Locale.Danish", new Locale(DANISH.getCode(), DANISH.getCountry())); |
158 |
| - args.put("Locale.French", new Locale(FRENCH.getCode(), FRENCH.getCountry())); |
159 |
| - args.put("Locale.German", new Locale(GERMAN.getCode(), GERMAN.getCountry())); |
160 |
| - args.put("Locale.Korean", new Locale(KOREAN.getCode(), KOREAN.getCountry())); |
161 |
| - args.put("Locale.Polish", new Locale(POLISH.getCode(), POLISH.getCountry())); |
162 |
| - args.put("Locale.Slovak", new Locale(SLOVAK.getCode(), SLOVAK.getCountry())); |
163 |
| - args.put("Locale.Czech", new Locale(CZECH.getCode(), CZECH.getCountry())); |
| 145 | + args.put("Locale.chineseTraditional", new Locale(TRADITIONAL_CHINESE.getCode(), TRADITIONAL_CHINESE.getCountry())); |
| 146 | + args.put("Locale.portuguesePortugal", new Locale(PORTUGUESE_PORTUGAL.getCode(), PORTUGUESE_PORTUGAL.getCountry())); |
| 147 | + args.put("Locale.chineseSimplified", new Locale(SIMPLIFIED_CHINESE.getCode(), SIMPLIFIED_CHINESE.getCountry())); |
| 148 | + args.put("Locale.portugueseBrazil", new Locale(PORTUGUESE_BRAZIL.getCode(), PORTUGUESE_BRAZIL.getCountry())); |
| 149 | + args.put("Locale.indonesian", new Locale(INDONESIAN.getCode(), INDONESIAN.getCountry())); |
| 150 | + args.put("Locale.dutch", new Locale(NETHERLANDS.getCode(), NETHERLANDS.getCountry())); |
| 151 | + args.put("Locale.norwegian", new Locale(NORWEGIAN.getCode(), NORWEGIAN.getCountry())); |
| 152 | + args.put("Locale.japanese", new Locale(JAPANESE.getCode(), JAPANESE.getCountry())); |
| 153 | + args.put("Locale.english", new Locale(ENGLISH.getCode(), ENGLISH.getCountry())); |
| 154 | + args.put("Locale.italian", new Locale(ITALIAN.getCode(), ITALIAN.getCountry())); |
| 155 | + args.put("Locale.russian", new Locale(RUSSIAN.getCode(), RUSSIAN.getCountry())); |
| 156 | + args.put("Locale.spanish", new Locale(SPANISH.getCode(), SPANISH.getCountry())); |
| 157 | + args.put("Locale.swedish", new Locale(SWEDISH.getCode(), SWEDISH.getCountry())); |
| 158 | + args.put("Locale.turkish", new Locale(TURKISH.getCode(), TURKISH.getCountry())); |
| 159 | + args.put("Locale.arabic", new Locale(ARABIC.getCode(), ARABIC.getCountry())); |
| 160 | + args.put("Locale.danish", new Locale(DANISH.getCode(), DANISH.getCountry())); |
| 161 | + args.put("Locale.french", new Locale(FRENCH.getCode(), FRENCH.getCountry())); |
| 162 | + args.put("Locale.german", new Locale(GERMAN.getCode(), GERMAN.getCountry())); |
| 163 | + args.put("Locale.korean", new Locale(KOREAN.getCode(), KOREAN.getCountry())); |
| 164 | + args.put("Locale.polish", new Locale(POLISH.getCode(), POLISH.getCountry())); |
| 165 | + args.put("Locale.slovak", new Locale(SLOVAK.getCode(), SLOVAK.getCountry())); |
| 166 | + args.put("Locale.czech", new Locale(CZECH.getCode(), CZECH.getCountry())); |
164 | 167 | }
|
165 | 168 |
|
166 | 169 | @VisibleForTesting
|
167 | 170 | static void registerCustomTextPlaceHolderKeysArgs(Map<String, Object> args) {
|
168 |
| - args.put("IBGCustomTextPlaceHolderKey.SHAKE_HINT", InstabugCustomTextPlaceHolder.Key.SHAKE_HINT); |
169 |
| - args.put("IBGCustomTextPlaceHolderKey.SWIPE_HINT", InstabugCustomTextPlaceHolder.Key.SWIPE_HINT); |
170 |
| - args.put("IBGCustomTextPlaceHolderKey.INVALID_EMAIL_MESSAGE", InstabugCustomTextPlaceHolder.Key.INVALID_EMAIL_MESSAGE); |
171 |
| - args.put("IBGCustomTextPlaceHolderKey.INVALID_COMMENT_MESSAGE", InstabugCustomTextPlaceHolder.Key.INVALID_COMMENT_MESSAGE); |
172 |
| - args.put("IBGCustomTextPlaceHolderKey.INVOCATION_HEADER", InstabugCustomTextPlaceHolder.Key.INVOCATION_HEADER); |
173 |
| - args.put("IBGCustomTextPlaceHolderKey.START_CHATS", InstabugCustomTextPlaceHolder.Key.START_CHATS); |
174 |
| - args.put("IBGCustomTextPlaceHolderKey.REPORT_BUG", InstabugCustomTextPlaceHolder.Key.REPORT_BUG); |
175 |
| - args.put("IBGCustomTextPlaceHolderKey.REPORT_FEEDBACK", InstabugCustomTextPlaceHolder.Key.REPORT_FEEDBACK); |
176 |
| - args.put("IBGCustomTextPlaceHolderKey.EMAIL_FIELD_HINT", InstabugCustomTextPlaceHolder.Key.EMAIL_FIELD_HINT); |
177 |
| - args.put("IBGCustomTextPlaceHolderKey.COMMENT_FIELD_HINT_FOR_BUG_REPORT", InstabugCustomTextPlaceHolder.Key.COMMENT_FIELD_HINT_FOR_BUG_REPORT); |
178 |
| - args.put("IBGCustomTextPlaceHolderKey.COMMENT_FIELD_HINT_FOR_FEEDBACK", InstabugCustomTextPlaceHolder.Key.COMMENT_FIELD_HINT_FOR_FEEDBACK); |
179 |
| - args.put("IBGCustomTextPlaceHolderKey.ADD_VOICE_MESSAGE", InstabugCustomTextPlaceHolder.Key.ADD_VOICE_MESSAGE); |
180 |
| - args.put("IBGCustomTextPlaceHolderKey.ADD_IMAGE_FROM_GALLERY", InstabugCustomTextPlaceHolder.Key.ADD_IMAGE_FROM_GALLERY); |
181 |
| - args.put("IBGCustomTextPlaceHolderKey.ADD_EXTRA_SCREENSHOT", InstabugCustomTextPlaceHolder.Key.ADD_EXTRA_SCREENSHOT); |
182 |
| - args.put("IBGCustomTextPlaceHolderKey.CONVERSATIONS_LIST_TITLE", InstabugCustomTextPlaceHolder.Key.CONVERSATIONS_LIST_TITLE); |
183 |
| - args.put("IBGCustomTextPlaceHolderKey.AUDIO_RECORDING_PERMISSION_DENIED", InstabugCustomTextPlaceHolder.Key.AUDIO_RECORDING_PERMISSION_DENIED); |
184 |
| - args.put("IBGCustomTextPlaceHolderKey.CONVERSATION_TEXT_FIELD_HINT", InstabugCustomTextPlaceHolder.Key.CONVERSATION_TEXT_FIELD_HINT); |
185 |
| - args.put("IBGCustomTextPlaceHolderKey.BUG_REPORT_HEADER", InstabugCustomTextPlaceHolder.Key.BUG_REPORT_HEADER); |
186 |
| - args.put("IBGCustomTextPlaceHolderKey.FEEDBACK_REPORT_HEADER", InstabugCustomTextPlaceHolder.Key.FEEDBACK_REPORT_HEADER); |
187 |
| - args.put("IBGCustomTextPlaceHolderKey.VOICE_MESSAGE_PRESS_AND_HOLD_TO_RECORD", InstabugCustomTextPlaceHolder.Key.VOICE_MESSAGE_PRESS_AND_HOLD_TO_RECORD); |
188 |
| - args.put("IBGCustomTextPlaceHolderKey.VOICE_MESSAGE_RELEASE_TO_ATTACH", InstabugCustomTextPlaceHolder.Key.VOICE_MESSAGE_RELEASE_TO_ATTACH); |
189 |
| - args.put("IBGCustomTextPlaceHolderKey.REPORT_SUCCESSFULLY_SENT", InstabugCustomTextPlaceHolder.Key.REPORT_SUCCESSFULLY_SENT); |
190 |
| - args.put("IBGCustomTextPlaceHolderKey.SUCCESS_DIALOG_HEADER", InstabugCustomTextPlaceHolder.Key.SUCCESS_DIALOG_HEADER); |
191 |
| - args.put("IBGCustomTextPlaceHolderKey.ADD_VIDEO", InstabugCustomTextPlaceHolder.Key.ADD_VIDEO); |
192 |
| - args.put("IBGCustomTextPlaceHolderKey.BETA_WELCOME_MESSAGE_WELCOME_STEP_TITLE", InstabugCustomTextPlaceHolder.Key.BETA_WELCOME_MESSAGE_WELCOME_STEP_TITLE); |
193 |
| - args.put("IBGCustomTextPlaceHolderKey.BETA_WELCOME_MESSAGE_WELCOME_STEP_CONTENT", InstabugCustomTextPlaceHolder.Key.BETA_WELCOME_MESSAGE_WELCOME_STEP_CONTENT); |
194 |
| - args.put("IBGCustomTextPlaceHolderKey.BETA_WELCOME_MESSAGE_HOW_TO_REPORT_STEP_TITLE", InstabugCustomTextPlaceHolder.Key.BETA_WELCOME_MESSAGE_HOW_TO_REPORT_STEP_TITLE); |
195 |
| - args.put("IBGCustomTextPlaceHolderKey.BETA_WELCOME_MESSAGE_HOW_TO_REPORT_STEP_CONTENT", InstabugCustomTextPlaceHolder.Key.BETA_WELCOME_MESSAGE_HOW_TO_REPORT_STEP_CONTENT); |
196 |
| - args.put("IBGCustomTextPlaceHolderKey.BETA_WELCOME_MESSAGE_FINISH_STEP_TITLE", InstabugCustomTextPlaceHolder.Key.BETA_WELCOME_MESSAGE_FINISH_STEP_TITLE); |
197 |
| - args.put("IBGCustomTextPlaceHolderKey.BETA_WELCOME_MESSAGE_FINISH_STEP_CONTENT", InstabugCustomTextPlaceHolder.Key.BETA_WELCOME_MESSAGE_FINISH_STEP_CONTENT); |
198 |
| - args.put("IBGCustomTextPlaceHolderKey.LIVE_WELCOME_MESSAGE_TITLE", InstabugCustomTextPlaceHolder.Key.LIVE_WELCOME_MESSAGE_TITLE); |
199 |
| - args.put("IBGCustomTextPlaceHolderKey.LIVE_WELCOME_MESSAGE_CONTENT", InstabugCustomTextPlaceHolder.Key.LIVE_WELCOME_MESSAGE_CONTENT); |
| 171 | + args.put("IBGCustomTextPlaceHolderKey.shakeHint", InstabugCustomTextPlaceHolder.Key.SHAKE_HINT); |
| 172 | + args.put("IBGCustomTextPlaceHolderKey.swipeHint", InstabugCustomTextPlaceHolder.Key.SWIPE_HINT); |
| 173 | + args.put("IBGCustomTextPlaceHolderKey.invalidEmailMessage", InstabugCustomTextPlaceHolder.Key.INVALID_EMAIL_MESSAGE); |
| 174 | + args.put("IBGCustomTextPlaceHolderKey.invalidCommentMessage", InstabugCustomTextPlaceHolder.Key.INVALID_COMMENT_MESSAGE); |
| 175 | + args.put("IBGCustomTextPlaceHolderKey.invocationHeader", InstabugCustomTextPlaceHolder.Key.INVOCATION_HEADER); |
| 176 | + args.put("IBGCustomTextPlaceHolderKey.startChats", InstabugCustomTextPlaceHolder.Key.START_CHATS); |
| 177 | + args.put("IBGCustomTextPlaceHolderKey.reportBug", InstabugCustomTextPlaceHolder.Key.REPORT_BUG); |
| 178 | + args.put("IBGCustomTextPlaceHolderKey.reportFeedback", InstabugCustomTextPlaceHolder.Key.REPORT_FEEDBACK); |
| 179 | + args.put("IBGCustomTextPlaceHolderKey.emailFieldHint", InstabugCustomTextPlaceHolder.Key.EMAIL_FIELD_HINT); |
| 180 | + args.put("IBGCustomTextPlaceHolderKey.commentFieldHintForBugReport", InstabugCustomTextPlaceHolder.Key.COMMENT_FIELD_HINT_FOR_BUG_REPORT); |
| 181 | + args.put("IBGCustomTextPlaceHolderKey.commentFieldHintForFeedback", InstabugCustomTextPlaceHolder.Key.COMMENT_FIELD_HINT_FOR_FEEDBACK); |
| 182 | + args.put("IBGCustomTextPlaceHolderKey.addVoiceMessage", InstabugCustomTextPlaceHolder.Key.ADD_VOICE_MESSAGE); |
| 183 | + args.put("IBGCustomTextPlaceHolderKey.addImageFromGallery", InstabugCustomTextPlaceHolder.Key.ADD_IMAGE_FROM_GALLERY); |
| 184 | + args.put("IBGCustomTextPlaceHolderKey.addExtraScreenshot", InstabugCustomTextPlaceHolder.Key.ADD_EXTRA_SCREENSHOT); |
| 185 | + args.put("IBGCustomTextPlaceHolderKey.conversationsListTitle", InstabugCustomTextPlaceHolder.Key.CONVERSATIONS_LIST_TITLE); |
| 186 | + args.put("IBGCustomTextPlaceHolderKey.audioRecordingPermissionDenied", InstabugCustomTextPlaceHolder.Key.AUDIO_RECORDING_PERMISSION_DENIED); |
| 187 | + args.put("IBGCustomTextPlaceHolderKey.conversationTextFieldHint", InstabugCustomTextPlaceHolder.Key.CONVERSATION_TEXT_FIELD_HINT); |
| 188 | + args.put("IBGCustomTextPlaceHolderKey.bugReportHeader", InstabugCustomTextPlaceHolder.Key.BUG_REPORT_HEADER); |
| 189 | + args.put("IBGCustomTextPlaceHolderKey.feedbackReportHeader", InstabugCustomTextPlaceHolder.Key.FEEDBACK_REPORT_HEADER); |
| 190 | + args.put("IBGCustomTextPlaceHolderKey.voiceMessagePressAndHoldToRecord", InstabugCustomTextPlaceHolder.Key.VOICE_MESSAGE_PRESS_AND_HOLD_TO_RECORD); |
| 191 | + args.put("IBGCustomTextPlaceHolderKey.voiceMessageReleaseToAttach", InstabugCustomTextPlaceHolder.Key.VOICE_MESSAGE_RELEASE_TO_ATTACH); |
| 192 | + args.put("IBGCustomTextPlaceHolderKey.reportSuccessfullySent", InstabugCustomTextPlaceHolder.Key.REPORT_SUCCESSFULLY_SENT); |
| 193 | + args.put("IBGCustomTextPlaceHolderKey.successDialogHeader", InstabugCustomTextPlaceHolder.Key.SUCCESS_DIALOG_HEADER); |
| 194 | + args.put("IBGCustomTextPlaceHolderKey.addVideo", InstabugCustomTextPlaceHolder.Key.ADD_VIDEO); |
| 195 | + args.put("IBGCustomTextPlaceHolderKey.betaWelcomeMessageWelcomeStepTitle", InstabugCustomTextPlaceHolder.Key.BETA_WELCOME_MESSAGE_WELCOME_STEP_TITLE); |
| 196 | + args.put("IBGCustomTextPlaceHolderKey.betaWelcomeMessageWelcomeStepContent", InstabugCustomTextPlaceHolder.Key.BETA_WELCOME_MESSAGE_WELCOME_STEP_CONTENT); |
| 197 | + args.put("IBGCustomTextPlaceHolderKey.betaWelcomeMessageHowToReportStepTitle", InstabugCustomTextPlaceHolder.Key.BETA_WELCOME_MESSAGE_HOW_TO_REPORT_STEP_TITLE); |
| 198 | + args.put("IBGCustomTextPlaceHolderKey.betaWelcomeMessageHowToReportStepContent", InstabugCustomTextPlaceHolder.Key.BETA_WELCOME_MESSAGE_HOW_TO_REPORT_STEP_CONTENT); |
| 199 | + args.put("IBGCustomTextPlaceHolderKey.betaWelcomeMessageFinishStepTitle", InstabugCustomTextPlaceHolder.Key.BETA_WELCOME_MESSAGE_FINISH_STEP_TITLE); |
| 200 | + args.put("IBGCustomTextPlaceHolderKey.betaWelcomeMessageFinishStepContent", InstabugCustomTextPlaceHolder.Key.BETA_WELCOME_MESSAGE_FINISH_STEP_CONTENT); |
| 201 | + args.put("IBGCustomTextPlaceHolderKey.liveWelcomeMessageTitle", InstabugCustomTextPlaceHolder.Key.LIVE_WELCOME_MESSAGE_TITLE); |
| 202 | + args.put("IBGCustomTextPlaceHolderKey.liveWelcomeMessageContent", InstabugCustomTextPlaceHolder.Key.LIVE_WELCOME_MESSAGE_CONTENT); |
| 203 | + } |
| 204 | + |
| 205 | + @VisibleForTesting |
| 206 | + static void registerInstabugReportTypesArgs(Map<String, Object> args) { |
| 207 | + args.put("ReportType.bug", BugReporting.ReportType.BUG); |
| 208 | + args.put("ReportType.feedback", BugReporting.ReportType.FEEDBACK); |
| 209 | + } |
| 210 | + |
| 211 | + @VisibleForTesting |
| 212 | + static void registerInstabugExtendedBugReportModeArgs(Map<String, Object> args) { |
| 213 | + args.put("ExtendedBugReportMode.enabledWithRequiredFields", ExtendedBugReport.State.ENABLED_WITH_REQUIRED_FIELDS); |
| 214 | + args.put("ExtendedBugReportMode.enabledWithOptionalFields", ExtendedBugReport.State.ENABLED_WITH_OPTIONAL_FIELDS); |
| 215 | + args.put("ExtendedBugReportMode.disabled",ExtendedBugReport.State.DISABLED); |
200 | 216 | }
|
201 | 217 | }
|
0 commit comments