Skip to content

Commit fc37542

Browse files
committed
new: Rounded group is finally working
1 parent f7c7e9c commit fc37542

35 files changed

+11607
-3794
lines changed

example/.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Windows files
2+
[*.bat]
3+
end_of_line = crlf

example/.flowconfig

Lines changed: 0 additions & 73 deletions
This file was deleted.

example/.gitattributes

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
*.pbxproj -text
1+
# Windows files should use crlf line endings
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
*.bat text eol=crlf

example/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ build/
2828
.gradle
2929
local.properties
3030
*.iml
31+
*.hprof
3132

3233
# node.js
3334
#

example/.prettierrc.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module.exports = {
2-
bracketSpacing: false,
3-
jsxBracketSameLine: true,
4-
singleQuote: true,
5-
trailingComma: 'all',
2+
bracketSpacing: true,
3+
jsxBracketSameLine: false,
4+
singleQuote: false,
5+
trailingComma: "all",
6+
tabWidth: 2,
7+
semi: true,
68
};

example/App.js

Lines changed: 0 additions & 114 deletions
This file was deleted.

example/App.tsx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import React from "react";
2+
import { SafeAreaView, StyleSheet } from "react-native";
3+
import RoundedCheckboxGroup, {
4+
ICheckboxButton,
5+
} from "./lib/RoundedCheckboxGroup";
6+
7+
const styles = {
8+
outerStyle: { height: 75, width: 75, borderRadius: 75 },
9+
innerStyle: { height: 60, width: 60, borderRadius: 75 },
10+
};
11+
12+
const staticData: ICheckboxButton[] = [
13+
{
14+
id: 0,
15+
checkedColor: "red",
16+
outerStyle: styles.outerStyle,
17+
innerStyle: styles.innerStyle,
18+
},
19+
{ id: 1 },
20+
{ id: 2 },
21+
{ id: 3 },
22+
];
23+
24+
const App = () => {
25+
return (
26+
<SafeAreaView
27+
style={{ flex: 1, alignItems: "center", justifyContent: "center" }}
28+
>
29+
<RoundedCheckboxGroup
30+
data={staticData}
31+
initial={2}
32+
onChange={(selectedItem: ICheckboxButton) => {
33+
console.log(JSON.stringify(selectedItem));
34+
}}
35+
/>
36+
</SafeAreaView>
37+
);
38+
};
39+
40+
export default App;
File renamed without changes.

example/android/app/build.gradle

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,15 @@ def jscFlavor = 'org.webkit:android-jsc:+'
120120
*/
121121
def enableHermes = project.ext.react.get("enableHermes", false);
122122

123+
/**
124+
* Architectures to build native code for in debug.
125+
*/
126+
def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures")
127+
123128
android {
124-
compileSdkVersion rootProject.ext.compileSdkVersion
129+
ndkVersion rootProject.ext.ndkVersion
125130

126-
compileOptions {
127-
sourceCompatibility JavaVersion.VERSION_1_8
128-
targetCompatibility JavaVersion.VERSION_1_8
129-
}
131+
compileSdkVersion rootProject.ext.compileSdkVersion
130132

131133
defaultConfig {
132134
applicationId "com.example"
@@ -154,6 +156,11 @@ android {
154156
buildTypes {
155157
debug {
156158
signingConfig signingConfigs.debug
159+
if (nativeArchitectures) {
160+
ndk {
161+
abiFilters nativeArchitectures.split(',')
162+
}
163+
}
157164
}
158165
release {
159166
// Caution! In production, you need to generate your own keystore file.
@@ -169,11 +176,12 @@ android {
169176
variant.outputs.each { output ->
170177
// For each separate APK per architecture, set a unique version code as described here:
171178
// https://developer.android.com/studio/build/configure-apk-splits.html
179+
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
172180
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
173181
def abi = output.getFilter(OutputFile.ABI)
174182
if (abi != null) { // null for the universal-debug, universal-release variants
175183
output.versionCodeOverride =
176-
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
184+
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
177185
}
178186

179187
}
@@ -188,7 +196,7 @@ dependencies {
188196
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
189197

190198
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
191-
exclude group:'com.facebook.fbjni'
199+
exclude group:'com.facebook.fbjni'
192200
}
193201

194202
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
@@ -212,7 +220,7 @@ dependencies {
212220
// Run this once to be able to run the application with BUCK
213221
// puts all compile dependencies into folder libs for BUCK to use
214222
task copyDownloadableDepsToLibs(type: Copy) {
215-
from configurations.compile
223+
from configurations.implementation
216224
into 'libs'
217225
}
218226

example/android/app/src/debug/AndroidManifest.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,10 @@
44

55
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
66

7-
<application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" />
7+
<application
8+
android:usesCleartextTraffic="true"
9+
tools:targetApi="28"
10+
tools:ignore="GoogleAppIndexingWarning">
11+
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
12+
</application>
813
</manifest>

0 commit comments

Comments
 (0)