Coder Social home page Coder Social logo

prscx / react-native-shine-button Goto Github PK

View Code? Open in Web Editor NEW
356.0 356.0 37.0 4.86 MB

React Native: Native Shine Button - Effects like shining

License: Apache License 2.0

JavaScript 20.06% Java 36.60% Objective-C 23.62% Ruby 13.24% Starlark 6.47%
android ios react-native

react-native-shine-button's Introduction

Hey! Pranav here ๐Ÿ‘‹

  • ๐Ÿ”ญ Iโ€™m currently working as a Senior Technical Director at MetricStream
    • Building the next-generation of cross platform GRC Web & Mobile app experience
    • Focus on building generic and scalable infrastructure/platform which can be leveraged to build mobile apps using React Native
    • I open-source almost everything I develop and try to reply everyone needing help using my contributions
  • ๐Ÿ’ฌ Ask me about building scalable mobile apps, React/React Native
  • ๐Ÿ“ซ How to reach me: DMs on my GMAIL

react-native-shine-button's People

Contributors

codinger41 avatar prscms avatar prscx avatar takeerdevs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-shine-button's Issues

default value not start with correct color

Thank again for making this awesome library. Bellow is the shine button I made:

<RNShineButton shape={"heart"} color={"#ffffff"} fillColor={"#FF6C6C" } size={70} value={true}
  onChange={(isLike)=> this._Vibration(isLike)}/>

So, my default value of shine button are true , but the button are start with color of #ffffff, if the default value is true color should start with the fillColor #FF6C6C , hope can make this changes, thanks a lot

build failed after linked

Thank for making this library. But after I link the library, I get this error when build

Dex: Error converting bytecode to dex:WithDexForDebug
Cause: Dex cannot parse version 52 byte code.
This is caused by library dependencies that have been compiled using Java 8 or above.
If you are using the 'java' gradle plugin in a library submodule add
targetCompatibility = '1.7'
sourceCompatibility = '1.7'
to that submodule's build.gradle file.
    UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Exception parsing classes
      at com.android.dx.command.dexer.Main.processClass(Main.java:752)
       at com.android.dx.command.dexer.Main.processFileBytes(Main.java:718)
   at com.android.dx.command.dexer.Main.access$1200(Main.java:85)
 at com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1645)
        at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
   at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
       at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
  at com.android.dx.command.dexer.Main.processOne(Main.java:672)
 at com.android.dx.command.dexer.Main.processAllFiles(Main.java:574)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311)
 at com.android.dx.command.dexer.Main.run(Main.java:277)
        at com.android.dx.command.dexer.Main.main(Main.java:245)
       at com.android.dx.command.Main.main(Main.java:106)
Caused by: com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
   at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)
   at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
    at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
     at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
 at com.android.dx.command.dexer.Main.parseClass(Main.java:764)
 at com.android.dx.command.dexer.Main.access$1500(Main.java:85)
 at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684)
      at com.android.dx.command.dexer.Main.processClass(Main.java:749)
       ... 12 more

1 error; aborting
:app:transformClassesWithDexForDebug FAILED

Could not find com.github.prscX:ShineButton:0.2.1

Hello,
I am getting this error. Please help

  • What went wrong:
    Could not resolve all files for configuration ':app:debugCompileClasspath'.

Could not find com.github.prscX:ShineButton:0.2.1.
Searched in the following locations:
file:/C:/Android/sdk/extras/m2repository/com/github/prscX/ShineButton/0.2.1/ShineButton-0.2.1.pom
file:/C:/Android/sdk/extras/m2repository/com/github/prscX/ShineButton/0.2.1/ShineButton-0.2.1.jar
file:/C:/Android/sdk/extras/google/m2repository/com/github/prscX/ShineButton/0.2.1/ShineButton-0.2.1.pom
file:/C:/Android/sdk/extras/google/m2repository/com/github/prscX/ShineButton/0.2.1/ShineButton-0.2.1.jar
file:/C:/Android/sdk/extras/android/m2repository/com/github/prscX/ShineButton/0.2.1/ShineButton-0.2.1.pom
file:/C:/Android/sdk/extras/android/m2repository/com/github/prscX/ShineButton/0.2.1/ShineButton-0.2.1.jar

IOS custom Icon is not working.

Hello, Thanks for the nice component.

Material Community Icons works well Android but IOS is not.
I think because of the font name system on IOS.

In my case, the font filename is "materialcommunityicons.ttf" but the actual name is "Material Design Icons".

So I modified RNVectorHelper class at RNVectorHelper.js file.
And finally, it worked.

62: case "Material-Design-Icons":   // Added this line.
63: case "MaterialCommunityIcons":

After that, I changed my code to work on both platform Android and IOS.

thanks.

Could not find method google() for arguments [] on repository container.

after install plugin I get this error

Could not find method google() for arguments [] on repository container.

my build.gradle android

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
                google()
        maven { url "https://jitpack.io" }

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        jcenter()
                google()

        maven {
                   url "https://jitpack.io"

            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}

Android icon size

Passing the size in dpi as common in react-native, on android the wrapper sets the container size correctly, but the native button sets the dpi size prop as pixel as LayoutParams.
This way the container size is fine, but the icon in very small.

In RNShinebutton.java

public void setSize(FrameLayout shineButtonFrame, int size) {
float density = shineButtonFrame.getContext().getResources().getDisplayMetrics().density;
int dpSize = Math.round(size * density);
ShineButton shineButton = (ShineButton) shineButtonFrame.getChildAt(0);
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(dpSize, dpSize);
shineButton.setLayoutParams(layoutParams);
}

I multiplied the size for the density in order to get the pixel size intended.
Is it correct?

Ios pod file library not getting specified and specifying manually showing error

Hi when i am executing react-native link react-native-shine-button ,Library is not getting added in pod file and when i am adding manually like

pod 'react-native-shine-button', :path =>'../node_modules/react-native-shine-button/ios/RNShineButton.podspec'.

It's giving me the error as below.

`node_modules/react-native-shine-button/ios/RNShineButton.podspec:3

-------------------------------------------

package = JSON.parse(File.read(File.join(dir, 'package.json')))

-------------------------------------------`

onChange returning wrong value

onChange is always returning false.
Looked into the JS code,found this

_onChange = event => {
   let value = false;
   if (event.nativeEvent.value === "YES") value = true;

   this.props.onChange && this.props.onChange(value);

   this._shineButton.setNativeProps({ on: event.nativeEvent.value });
 };

After debugging, I found out that event.nativeEvent.value returns boolean 'true' or 'false' according to the action performed. But because of the above condition, value is always set to 'false'

Loading state?

I was trying to get this to bounce around in the middle state, while my action is "loading", is it possible to get this ability without much work? An awesome awesome thansk for the immense open source work you provide the community with!!

dyld: Library not loaded: @rpath/libswiftCore.dylib Referenced from: /Users/stathis/Library/Developer/Xcode/DerivedData/zzzzxxxdddd-gxpbgcpggospzxavpqtfdhnkuaez/Build/Products/Debug-iphonesimulator/WCLShineButton.framework/WCLShineButton Reason: image not found (lldb)

I followed the installation instructions but i get this error:

dyld: Library not loaded: @rpath/libswiftCore.dylib
  Referenced from: /Users/stathis/Library/Developer/Xcode/DerivedData/christian_tete-gxpbgcpggospzxavpqtfdhnkuaez/Build/Products/Debug-iphonesimulator/WCLShineButton.framework/WCLShineButton
  Reason: image not found
(lldb) 

Xcode version 9.2 (9C40b), iOS 11.2, iPhone 8 simulator, iPhone 7 real device

dot animation

giphy

Dot animation wont show if shine button are inside react-native-modal

app:processDebugManifest FAILED

Task :app:processDebugManifest FAILED
/Users/admin/....../android/app/src/main/AndroidManifest.xml:11:7-34 Error:
Attribute application@allowBackup value=(false) from AndroidManifest.xml:11:7-34
is also present at [com.github.prscX:ShineButton:0.2.1] AndroidManifest.xml:12:9-35 value=(true).
Suggestion: add 'tools:replace="android:allowBackup"' to element at AndroidManifest.xml:7:5-24:19 to override.

SWIFT_VERSION

  • WCLShineButton does not specify a Swift version and none of the targets (RNShineButton) integrating it have the SWIFT_VERSION attribute set. Please contact the author or set the SWIFT_VERSION attribute in at least one of the targets that integrate this pod.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.