Skip to content

Support auto link for Android #682

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ReactNativeUiLib.podspec

This file was deleted.

10 changes: 2 additions & 8 deletions android/app/src/main/java/com/rnuilib/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
import com.reactnativenavigation.NavigationApplication;
import com.reactnativenavigation.react.NavigationReactNativeHost;
import com.reactnativenavigation.react.ReactGateway;
import com.wix.reactnativeuilib.highlighterview.HighlighterViewPackage;
import com.wix.reactnativeuilib.keyboardinput.KeyboardInputPackage;
import com.wix.reactnativeuilib.textinput.TextInputDelKeyHandlerPackage;
import com.wix.reactnativeuilib.wheelpicker.WheelPickerPackage;
import com.wix.reactnativeuilib.UiLibPackageList;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to remove this, but it still doesn't work.


import java.util.Arrays;
import java.util.List;
Expand Down Expand Up @@ -45,10 +42,7 @@ protected List<ReactPackage> getPackages() {
public List<ReactPackage> createAdditionalReactPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
packages.add(new HighlighterViewPackage());
packages.add(new WheelPickerPackage());
packages.add(new TextInputDelKeyHandlerPackage());
packages.add(new KeyboardInputPackage(this));
packages.addAll(new UiLibPackageList(this).getPackageList());
return packages;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.wix.reactnativeuilib;

import android.app.Application;
import com.facebook.react.ReactPackage;

import com.wix.reactnativeuilib.highlighterview.HighlighterViewPackage;
import com.wix.reactnativeuilib.keyboardinput.KeyboardInputPackage;
import com.wix.reactnativeuilib.textinput.TextInputDelKeyHandlerPackage;
import com.wix.reactnativeuilib.wheelpicker.WheelPickerPackage;

import java.util.Arrays;
import java.util.List;

public class UiLibPackageList {

private final Application application;

public UiLibPackageList(Application application) {
this.application = application;
}

public List<ReactPackage> getPackageList() {
return Arrays.asList(
new HighlighterViewPackage(),
new WheelPickerPackage(),
new TextInputDelKeyHandlerPackage(),
new KeyboardInputPackage(application)
);
}
}
17 changes: 17 additions & 0 deletions react-native.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
dependency: {
platforms: {
ios: {
project: './lib/ios/'
},
android: {
sourceDir: './lib/android/',
packageImportPath: `
import com.wix.reactnativeuilib.highlighterview.HighlighterViewPackage;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe the auto-link for Android doesn't work because you need to add this instead
com.wix.reactnativeuilib.UiLibPackageList ?

import com.wix.reactnativeuilib.keyboardinput.KeyboardInputPackage;
import com.wix.reactnativeuilib.textinput.TextInputDelKeyHandlerPackage;
import com.wix.reactnativeuilib.wheelpicker.WheelPickerPackage;`
}
}
}
};