Skip to content

Commit

Permalink
add shimo style for android
Browse files Browse the repository at this point in the history
  • Loading branch information
greedbell committed Jun 30, 2017
1 parent 7c79884 commit 9746650
Show file tree
Hide file tree
Showing 13 changed files with 4,012 additions and 25 deletions.
1 change: 0 additions & 1 deletion Example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ android {

dependencies {
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
compile project(':react-native-prompt')
}
Expand Down
58 changes: 41 additions & 17 deletions Example/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React, { Component } from 'react';
import { Platform } from 'react-native';

import {
AppRegistry,
StyleSheet,
Expand All @@ -18,23 +20,45 @@ export default class PromptAndroid extends Component {
};

_prompt() {
prompt(
'Enter password',
'Enter your password to claim your $1.5B in lottery winnings',
[
{text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},
{text: 'OK', onPress: password => {
this.setState({ password });
console.log('OK Pressed, password: ' + password);
}},
],
{
type: 'secure-text',
cancelable: false,
defaultValue: 'test',
placeholder: 'placeholder'
}
);
if (Platform.OS === 'android') {
prompt(
'Enter password',
'Enter your password to claim your $1.5B in lottery winnings',
[
{text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},
{text: 'OK', onPress: password => {
this.setState({ password });
console.log('OK Pressed, password: ' + password);
}},
],
{
type: 'secure-text',
cancelable: false,
defaultValue: 'test',
placeholder: 'placeholder',
style: 'shimo'
}
);
} else {
prompt(
'Enter password',
'Enter your password to claim your $1.5B in lottery winnings',
[
{text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},
{text: 'OK', onPress: password => {
this.setState({ password });
console.log('OK Pressed, password: ' + password);
}},
],
{
type: 'secure-text',
cancelable: false,
defaultValue: 'test',
placeholder: 'placeholder'
}
);
}

};

render() {
Expand Down
Loading

0 comments on commit 9746650

Please sign in to comment.