Skip to content

Commit

Permalink
Merged in release/16.0.0 (pull request #71)
Browse files Browse the repository at this point in the history
release/16.0.0
  • Loading branch information
mstanic-shake committed Apr 18, 2023
2 parents f6cf4b1 + 53ec1e0 commit 5ceb9fb
Show file tree
Hide file tree
Showing 54 changed files with 31,608 additions and 18,310 deletions.
3 changes: 0 additions & 3 deletions .editorconfig

This file was deleted.

1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

26 changes: 20 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,32 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate
ios/.xcode.env.local
project.xcworkspace

# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml

# BUCK
buck-out/
\.buckd/
*.keystore
*.hprof
.cxx/
*.keystore
!debug.keystore

# Fastlane
**/fastlane/report.xml
**/fastlane/Preview.html
**/fastlane/screenshots
**/fastlane/test_output

# Bundle artifact
*.jsbundle

# Ruby / CocoaPods
/ios/Pods/
/vendor/bundle/

# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*
5 changes: 3 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ buildscript {
if (project == rootProject) {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.android.tools.build:gradle:7.3.1'
}
}
}
Expand Down Expand Up @@ -75,5 +76,5 @@ repositories {
dependencies {
//noinspection GradleDynamicVersion
implementation 'com.facebook.react:react-native:+' // From node_modules
api "$System.env.ANDROID_DEPENDENCY:15.3.+"
api "$System.env.ANDROID_DEPENDENCY:16.0.+"
}
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
4 changes: 2 additions & 2 deletions android/gradlew
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env sh
#!/bin/sh

#
# Copyright 2015 the original author or authors.
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
98 changes: 19 additions & 79 deletions android/src/main/java/com/shakebugs/react/ShakeModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
import com.shakebugs.shake.ShakeReportConfiguration;
import com.shakebugs.shake.ShakeScreen;
import com.shakebugs.shake.chat.UnreadChatMessagesListener;
import com.shakebugs.shake.form.ShakeForm;
import com.shakebugs.shake.internal.domain.models.NetworkRequest;
import com.shakebugs.shake.internal.domain.models.NotificationEvent;
import com.shakebugs.shake.privacy.NotificationEventEditor;
import com.shakebugs.shake.privacy.NotificationEventsFilter;
import com.shakebugs.shake.report.FeedbackType;
import com.shakebugs.shake.report.ShakeFile;
import com.shakebugs.shake.report.ShakeReportData;

Expand Down Expand Up @@ -97,6 +97,24 @@ public void run() {
});
}

@ReactMethod
public void getShakeForm(Promise promise) {
ShakeForm shakeForm = Shake.getReportConfiguration().getShakeForm();
WritableMap shakeFormMap = mapper.mapShakeFormToMap(shakeForm);
promise.resolve(shakeFormMap);
}

@ReactMethod
public void setShakeForm(final ReadableMap shakeFormMap) {
runOnUiThread(new Runnable() {
@Override
public void run() {
ShakeForm shakeForm = mapper.mapMapToShakeForm(shakeFormMap);
Shake.getReportConfiguration().setShakeForm(shakeForm);
}
});
}

@ReactMethod
public void isUserFeedbackEnabled(Promise promise) {
promise.resolve(Shake.isUserFeedbackEnabled());
Expand Down Expand Up @@ -142,21 +160,6 @@ public void run() {
});
}

@ReactMethod
public void isEnableInspectScreen(Promise promise) {
promise.resolve(Shake.getReportConfiguration().isEnableInspectScreen());
}

@ReactMethod
public void setEnableInspectScreen(final boolean enableInspectScreen) {
runOnUiThread(new Runnable() {
@Override
public void run() {
Shake.getReportConfiguration().setEnableInspectScreen(enableInspectScreen);
}
});
}

@ReactMethod
public void isShowFloatingReportButton(Promise promise) {
promise.resolve(Shake.getReportConfiguration().isShowFloatingReportButton());
Expand Down Expand Up @@ -251,69 +254,6 @@ public void run() {
});
}

@ReactMethod
public void getEmailField(Promise promise) {
promise.resolve(Shake.getReportConfiguration().getEmailField());
}

@ReactMethod
public void setEmailField(final String emailField) {
runOnUiThread(new Runnable() {
@Override
public void run() {
Shake.getReportConfiguration().setEmailField(emailField);
}
});
}

@ReactMethod
public void isEnableEmailField(Promise promise) {
promise.resolve(Shake.getReportConfiguration().isEnableEmailField());
}

@ReactMethod
public void setEnableEmailField(final boolean enableEmailField) {
runOnUiThread(new Runnable() {
@Override
public void run() {
Shake.getReportConfiguration().setEnableEmailField(enableEmailField);
}
});
}

@ReactMethod
public void isFeedbackTypeEnabled(Promise promise) {
promise.resolve(Shake.getReportConfiguration().isFeedbackTypeEnabled());
}

@ReactMethod
public void setFeedbackTypeEnabled(final boolean feedbackTypeEnabled) {
runOnUiThread(new Runnable() {
@Override
public void run() {
Shake.getReportConfiguration().setFeedbackTypeEnabled(feedbackTypeEnabled);
}
});
}

@ReactMethod
public void getFeedbackTypes(Promise promise) {
List<FeedbackType> feedbackTypes = Shake.getReportConfiguration().getFeedbackTypes();
WritableArray feedbackTypesArray = mapper.mapFeedbackTypesToArray(feedbackTypes);
promise.resolve(feedbackTypesArray);
}

@ReactMethod
public void setFeedbackTypes(final ReadableArray feedbackTypesArray) {
runOnUiThread(new Runnable() {
@Override
public void run() {
List<FeedbackType> feedbackTypes = mapper.mapArrayToFeedbackTypes(feedbackTypesArray);
Shake.getReportConfiguration().setFeedbackTypes(feedbackTypes);
}
});
}

@ReactMethod
public void getShowIntroMessage(Promise promise) {
promise.resolve(Shake.getShowIntroMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
public class Constants {
public static final String PLATFORM = "ReactNative";
public static final String VERSION_CODE = "1";
public static final String VERSION_NAME = "15.0.0";
public static final String VERSION_NAME = "16.0.0";
}
26 changes: 26 additions & 0 deletions android/src/main/java/com/shakebugs/react/utils/Converter.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.shakebugs.react.utils;

import android.annotation.SuppressLint;
import android.content.Context;

public class Converter {
public static int stringToInt(String string) {
int result = 0;
Expand All @@ -12,4 +15,27 @@ public static int stringToInt(String string) {

return result;
}

public static String resToString(Context context, Integer resourceId) {
if (resourceId == null) return null;

String icon = null;
try {
icon = context.getResources().getResourceEntryName(resourceId);
} catch (Exception ignore) {
}
return icon;
}

@SuppressLint("DiscouragedApi")
public static Integer stringToRes(Context context, String resName, String type) {
if (resName == null) return null;

Integer iconRes = null;
try {
iconRes = context.getResources().getIdentifier(resName, type, context.getPackageName());
} catch (Exception ignore) {
}
return iconRes;
}
}
Loading

0 comments on commit 5ceb9fb

Please sign in to comment.