Граф коммитов

4 Коммитов

Автор SHA1 Сообщение Дата
Adalbert Gorecki 6d1277065d Show the right error message in the console
Summary:
Just a small update to fix the error message in `Alert.js`.

In my app, I'm using https://github.com/zo0r/react-native-push-notification to show local notifications. When the notification is tapped, I'm trying to show an alert with the notification text, but this results in an error (which is not the problem I'm addressing here). Unfortunately the wrong parameter was passed to the `console.warn`, so you couldn't see what the error message was.

Before:
<img width="416" alt="bildschirmfoto 2016-07-18 um 10 50 35" src="https://cloud.githubusercontent.com/assets/666322/16910168/7b45c7ac-4cd7-11e6-8d3e-3861d2fc648c.png">
<img width="416" alt="bildschirmfoto 2016-07-18 um 10 50 43" src="https://cloud.githubusercontent.com/assets/666322/16910173/854fc0ea-4cd7-11e6-956f-93ee68a09bd6.png">

After fix:
<img width="416" alt="bildschirmfoto 2016-07-18 um 10 50 35" src="https://cloud.githubusercontent.com/assets/666322/16910168/7b45c7ac-4cd7-11e6-8d3e-3861d2fc648c.png">
<img width="416" alt="bildschirmfoto 2016
Closes https://github.com/facebook/react-native/pull/8861

Differential Revision: D3586453

fbshipit-source-id: bf81e42bd4450ef15a301e7367e94355379c442e
2016-07-19 07:28:34 -07:00
Kyle Corbitt ba4101dc4a Simplified AlertIOS
Summary:
Ok, so this started as fixing #5273 but ended up getting a little more complicated. 😄

Currently, AlertIOS has the following API:

* `alert(title, message, buttons, type)`
* `prompt(title, defaultValue, buttons, callback)`

I've changed the API to look like the following:

* `alert(title, message, callbackOrButtons)`
* `prompt(title, message, callbackOrButtons, type, defaultValue)`

I know that breaking changes are a big deal, but I find the current alert API to be fairly inconsistent and unnecessarily confusing. I'll try to justify my changes one by one:

1. Currently `type` is an optional parameter of `alert`. However, the only reason to change the alert type from the default is in order to create one of the input dialogs (text, password or username/password). So we're in a weird state where if you want a normal text input, you use `prompt`, but if you want a password input you use `alert` with the 'secure-text' type. I've moved `type` to `prompt` so all text input is now done with `pro
Closes https://github.com/facebook/react-native/pull/5286

Reviewed By: svcscm

Differential Revision: D2850400

Pulled By: androidtrunkagent

fb-gh-sync-id: 2986cfa2266225df7e4dcd703fce1e322c12b816
2016-01-21 10:57:26 -08:00
Martin Konicek 920f71da57 Alert docs
Reviewed By: bestander

Differential Revision: D2773540

fb-gh-sync-id: 8baf08aa6a50955c5c9c806e8b93230086b504af
2015-12-18 06:10:31 -08:00
Martin Konicek 3a3af8a385 Open souce the Android Dialog module
Summary:
public

The `DialogModule` requires `android.support.v4.app.FragmentManager` which means
every app that wants to use Dialogs would need to have its Activity extend the legacy
`android.support.v4.app.FragmentActivity`.

This diff makes the `DialogModule` work with both the Support `FragmentManager`
(for AdsManager & potentially other fb apps) and the `android.app.FragmentManager`
(for new apps with no legacy dependencies).

Also wrap the native module in the same `Alert` API that we have on iOS and provide
a cross-platform example. In my opinion the iOS Alert API is quite nice and easy to use.

We still keep `AlertIOS` around because of its `prompt` function which is iOS-specific
and also for backwards compatibility.

Reviewed By: foghina

Differential Revision: D2647000

fb-gh-sync-id: e2280451890bff58bd9c933ab53cd99055403858
2015-12-17 11:11:13 -08:00