Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

Commit

Permalink
fix(android): adding support for AndroidX (#17)
Browse files Browse the repository at this point in the history
- Support for androidx instead of v4.
- Implementation instead of compile warning fix.
- Cleanup not used imports.
  • Loading branch information
organom authored Jul 10, 2020
1 parent 106e67f commit f4ce47e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ repositories {
}

dependencies {
compile 'com.facebook.react:react-native:+'
implementation 'com.facebook.react:react-native:+'
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.content.pm.PackageManager;
import android.support.v4.content.ContextCompat;
import androidx.core.content.ContextCompat;

public final class BluetoothUtils {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package de.patwoz.rn.bluetoothstatemanager;

import android.support.annotation.StringDef;
import androidx.annotation.StringDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
Expand All @@ -25,4 +25,4 @@ public class Constants {
String POWERED_OFF = "PoweredOff";
String POWERED_ON = "PoweredOn";
}
}
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@

package de.patwoz.rn.bluetoothstatemanager;

import android.Manifest;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.util.Log;

import androidx.annotation.Nullable;

import com.facebook.react.bridge.ActivityEventListener;
import com.facebook.react.bridge.BaseActivityEventListener;
import com.facebook.react.bridge.Promise;
Expand Down Expand Up @@ -250,4 +248,4 @@ private Activity handleCurrentActivity(Promise promise) {
return currentActivity;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ public List<Class<? extends JavaScriptModule>> createJSModules() {
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
return Collections.emptyList();
}
}
}

0 comments on commit f4ce47e

Please sign in to comment.