Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bradmartin/nativescript-twitterbang
:heartbeat: NativeScript plugin for Twitter's exploding heart animation.
https://github.com/bradmartin/nativescript-twitterbang
android animation nativescript-plugin twitter typescript
Last synced: 10 days ago
JSON representation
:heartbeat: NativeScript plugin for Twitter's exploding heart animation.
- Host: GitHub
- URL: https://github.com/bradmartin/nativescript-twitterbang
- Owner: bradmartin
- Created: 2016-02-08T19:26:52.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-04-16T04:40:30.000Z (over 6 years ago)
- Last Synced: 2024-12-26T16:36:14.226Z (15 days ago)
- Topics: android, animation, nativescript-plugin, twitter, typescript
- Language: TypeScript
- Homepage:
- Size: 2.39 MB
- Stars: 12
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
NativeScript plugin for Android to use native Twitter animation for the exploding heart. This library uses SmallBang by hanks-zyh for the native animation.
Do you need assistance on your project or plugin? Contact the nStudio team anytime at [email protected] to get up to speed with the best practices in mobile and web app development.
---
### TwitterBang Usage
![TwitterBang](images/twitterBang.gif)
## Installation
`tns plugin add nativescript-twitterbang`
## Notice
As of version 2.0.0, the native library has been updated and the plugin, the API is brand new and breaking.
The `TwitterBang` is not a layout container, similar to `StackLayout, GridLayout` so you can place some UI inside the `TwitterBang` layout. You have to be careful with the layout sizing/position or the animation will be 'jumpy' because of the actual layout size. See the demo markup, usually some alignment of the inner content will solve any 'jumpy' animation by centering the inner content.## Usage
### XML:
```XML
```
### TS:
```typescript
import { TwitterBang } from 'nativescript-twitterbang';// args.object is the View/component that triggered the tap event
public bangThis(args) {
const tb = args.object as TwitterBang;
tb.bang().then(() => {
console.log('do something after the effect');
})
}
```### JS:
```javascript
// args.object is the View/component that triggered the tap event
export function bangThis(args) {
const x = args.object;
x.bang().then(function() {
console.log('after the bang');
});
}
```