Skip to content

Commit 3510e54

Browse files
committed
separate prompt & indicator
1 parent b719400 commit 3510e54

File tree

39 files changed

+2082
-324
lines changed

39 files changed

+2082
-324
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 23
5+
buildToolsVersion "23.0.1"
6+
7+
defaultConfig {
8+
applicationId "com.listviewreactnative"
9+
minSdkVersion 16
10+
targetSdkVersion 22
11+
versionCode 1
12+
versionName "1.0"
13+
ndk {
14+
abiFilters "armeabi-v7a", "x86"
15+
}
16+
}
17+
buildTypes {
18+
release {
19+
minifyEnabled false // Set this to true to enable Proguard
20+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21+
}
22+
}
23+
}
24+
25+
dependencies {
26+
compile fileTree(dir: 'libs', include: ['*.jar'])
27+
compile 'com.android.support:appcompat-v7:23.0.1'
28+
compile 'com.facebook.react:react-native:0.13.+'
29+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
18+
19+
# Disabling obfuscation is useful if you collect stack traces from production crashes
20+
# (unless you are using a system that supports de-obfuscate the stack traces).
21+
-dontobfuscate
22+
23+
# React Native
24+
25+
# Keep our interfaces so they can be used by other ProGuard rules.
26+
# See http://sourceforge.net/p/proguard/bugs/466/
27+
-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
28+
-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
29+
30+
# Do not strip any method/class that is annotated with @DoNotStrip
31+
-keep @com.facebook.proguard.annotations.DoNotStrip class *
32+
-keepclassmembers class * {
33+
@com.facebook.proguard.annotations.DoNotStrip *;
34+
}
35+
36+
-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
37+
void set*(***);
38+
*** get*();
39+
}
40+
41+
-keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
42+
-keep class * extends com.facebook.react.bridge.NativeModule { *; }
43+
-keepclassmembers class * { @com.facebook.react.uimanager.UIProp <fields>; }
44+
-keepclassmembers class * { @com.facebook.react.uimanager.ReactProp <methods>; }
45+
-keepclassmembers class * { @com.facebook.react.uimanager.ReactPropGroup <methods>; }
46+
47+
# okhttp
48+
49+
-keepattributes Signature
50+
-keepattributes *Annotation*
51+
-keep class com.squareup.okhttp.** { *; }
52+
-keep interface com.squareup.okhttp.** { *; }
53+
-dontwarn com.squareup.okhttp.**
54+
55+
# okio
56+
57+
-keep class sun.misc.Unsafe { *; }
58+
-dontwarn java.nio.file.*
59+
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
60+
-dontwarn okio.**
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.listviewreactnative">
3+
4+
<uses-permission android:name="android.permission.INTERNET" />
5+
6+
<application
7+
android:allowBackup="true"
8+
android:label="@string/app_name"
9+
android:icon="@mipmap/ic_launcher"
10+
android:theme="@style/AppTheme">
11+
<activity
12+
android:name=".MainActivity"
13+
android:label="@string/app_name">
14+
<intent-filter>
15+
<action android:name="android.intent.action.MAIN" />
16+
<category android:name="android.intent.category.LAUNCHER" />
17+
</intent-filter>
18+
</activity>
19+
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
20+
</application>
21+
22+
</manifest>
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
package com.listviewreactnative;
2+
3+
import android.app.Activity;
4+
import android.os.Bundle;
5+
import android.view.KeyEvent;
6+
7+
import com.facebook.react.LifecycleState;
8+
import com.facebook.react.ReactInstanceManager;
9+
import com.facebook.react.ReactRootView;
10+
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
11+
import com.facebook.react.shell.MainReactPackage;
12+
import com.facebook.soloader.SoLoader;
13+
14+
public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {
15+
16+
private ReactInstanceManager mReactInstanceManager;
17+
private ReactRootView mReactRootView;
18+
19+
@Override
20+
protected void onCreate(Bundle savedInstanceState) {
21+
super.onCreate(savedInstanceState);
22+
mReactRootView = new ReactRootView(this);
23+
24+
mReactInstanceManager = ReactInstanceManager.builder()
25+
.setApplication(getApplication())
26+
.setBundleAssetName("index.android.bundle")
27+
.setJSMainModuleName("index.android")
28+
.addPackage(new MainReactPackage())
29+
.setUseDeveloperSupport(BuildConfig.DEBUG)
30+
.setInitialLifecycleState(LifecycleState.RESUMED)
31+
.build();
32+
33+
mReactRootView.startReactApplication(mReactInstanceManager, "listviewReactNative", null);
34+
35+
setContentView(mReactRootView);
36+
}
37+
38+
@Override
39+
public boolean onKeyUp(int keyCode, KeyEvent event) {
40+
if (keyCode == KeyEvent.KEYCODE_MENU && mReactInstanceManager != null) {
41+
mReactInstanceManager.showDevOptionsDialog();
42+
return true;
43+
}
44+
return super.onKeyUp(keyCode, event);
45+
}
46+
47+
@Override
48+
public void onBackPressed() {
49+
if (mReactInstanceManager != null) {
50+
mReactInstanceManager.onBackPressed();
51+
} else {
52+
super.onBackPressed();
53+
}
54+
}
55+
56+
@Override
57+
public void invokeDefaultOnBackPressed() {
58+
super.onBackPressed();
59+
}
60+
61+
@Override
62+
protected void onPause() {
63+
super.onPause();
64+
65+
if (mReactInstanceManager != null) {
66+
mReactInstanceManager.onPause();
67+
}
68+
}
69+
70+
@Override
71+
protected void onResume() {
72+
super.onResume();
73+
74+
if (mReactInstanceManager != null) {
75+
mReactInstanceManager.onResume(this);
76+
}
77+
}
78+
}
Loading
Loading
Loading
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<resources>
2+
<string name="app_name">listviewReactNative</string>
3+
</resources>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<resources>
2+
3+
<!-- Base application theme. -->
4+
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
5+
<!-- Customize your theme here. -->
6+
</style>
7+
8+
</resources>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
3+
buildscript {
4+
repositories {
5+
jcenter()
6+
}
7+
dependencies {
8+
classpath 'com.android.tools.build:gradle:1.3.1'
9+
10+
// NOTE: Do not place your application dependencies here; they belong
11+
// in the individual module build.gradle files
12+
}
13+
}
14+
15+
allprojects {
16+
repositories {
17+
mavenLocal()
18+
jcenter()
19+
}
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Project-wide Gradle settings.
2+
3+
# IDE (e.g. Android Studio) users:
4+
# Gradle settings configured through the IDE *will override*
5+
# any settings specified in this file.
6+
7+
# For more details on how to configure your build environment visit
8+
# http://www.gradle.org/docs/current/userguide/build_environment.html
9+
10+
# Specifies the JVM arguments used for the daemon process.
11+
# The setting is particularly useful for tweaking memory settings.
12+
# Default value: -Xmx10248m -XX:MaxPermSize=256m
13+
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14+
15+
# When configured, Gradle will run in incubating parallel mode.
16+
# This option should only be used with decoupled projects. More details, visit
17+
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18+
# org.gradle.parallel=true
19+
20+
android.useDeprecatedNdk=true
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
zipStoreBase=GRADLE_USER_HOME
4+
zipStorePath=wrapper/dists
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip

0 commit comments

Comments
 (0)