Commit 53df690c authored by Amit Davidi's avatar Amit Davidi

Add the (unprotected) VIBRATE permission on Android to support vibration on old devices

parent a83c578c
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
android:protectionLevel="signature" /> android:protectionLevel="signature" />
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" /> <uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />
<!-- Ref: http://stackoverflow.com/questions/13602190/java-lang-securityexception-requires-vibrate-permission-on-jelly-bean-4-2 -->
<uses-permission android:name="android.permission.VIBRATE" android:maxSdkVersion="18" />
<application> <application>
<!-- <!--
......
...@@ -24,10 +24,13 @@ public class MainActivity extends ReactActivity { ...@@ -24,10 +24,13 @@ public class MainActivity extends ReactActivity {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
final ViewGroup layout = (ViewGroup) getLayoutInflater().inflate(R.layout.activity_main, null); ViewGroup layout;
if (SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { if (SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
layout = (ViewGroup) getLayoutInflater().inflate(R.layout.activity_main, null);
Toolbar toolbar = (Toolbar) layout.findViewById(R.id.toolbar); Toolbar toolbar = (Toolbar) layout.findViewById(R.id.toolbar);
setActionBar(toolbar); setActionBar(toolbar);
} else {
layout = (ViewGroup) getLayoutInflater().inflate(R.layout.activity_main_prelollipop, null);
} }
mReactRootView = new ReactRootView(this); mReactRootView = new ReactRootView(this);
layout.addView(mReactRootView); layout.addView(mReactRootView);
......
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
<android.support.design.widget.AppBarLayout <android.support.design.widget.AppBarLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay"> android:theme="@style/AppTheme.AppBarOverlay"
>
<android.widget.Toolbar <android.widget.Toolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
......
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.wix.reactnativenotifications.app.MainActivity">
</android.support.design.widget.CoordinatorLayout>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment