Skip to content

Commit 27bf624

Browse files
committed
init
0 parents  commit 27bf624

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+3369
-0
lines changed

.eslintrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native-community',
4+
parser: '@typescript-eslint/parser',
5+
plugins: ['@typescript-eslint'],
6+
indent: ["error", "tab"]
7+
};

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.pbxproj -text

.gitignore

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# Xcode
6+
#
7+
build/
8+
*.pbxuser
9+
!default.pbxuser
10+
*.mode1v3
11+
!default.mode1v3
12+
*.mode2v3
13+
!default.mode2v3
14+
*.perspectivev3
15+
!default.perspectivev3
16+
xcuserdata
17+
*.xccheckout
18+
*.moved-aside
19+
DerivedData
20+
*.hmap
21+
*.ipa
22+
*.xcuserstate
23+
24+
# Android/IntelliJ
25+
#
26+
build/
27+
.idea
28+
.gradle
29+
local.properties
30+
*.iml
31+
32+
# Visual Studio Code
33+
#
34+
.vscode/
35+
36+
# node.js
37+
#
38+
node_modules/
39+
npm-debug.log
40+
yarn-error.log
41+
yarn.lock
42+
43+
# BUCK
44+
buck-out/
45+
\.buckd/
46+
*.keystore
47+
!debug.keystore
48+
49+
# fastlane
50+
#
51+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
52+
# screenshots whenever they are needed.
53+
# For more information about the recommended setup visit:
54+
# https://docs.fastlane.tools/best-practices/source-control/
55+
56+
*/fastlane/report.xml
57+
*/fastlane/Preview.html
58+
*/fastlane/screenshots
59+
60+
# Bundle artifact
61+
*.jsbundle
62+
63+
# CocoaPods
64+
/ios/Pods/

.prettierrc.js

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

.watchmanconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

App.tsx

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
/**
2+
* Sample React Native App
3+
* https://github.com/facebook/react-native
4+
*
5+
* Generated with the TypeScript template
6+
* https://github.com/react-native-community/react-native-template-typescript
7+
*
8+
* @format
9+
*/
10+
11+
import React from 'react';
12+
import {
13+
SafeAreaView,
14+
StyleSheet,
15+
ScrollView,
16+
View,
17+
Text,
18+
Dimensions,
19+
} from 'react-native';
20+
21+
import ScrollIndicator from "./src";
22+
23+
const width = Dimensions.get("screen").width;
24+
const margin = 3;
25+
const itemWidth = width / 3 - margin * 2;
26+
27+
class App extends React.PureComponent {
28+
29+
30+
Item = () => <View style={[styles.item, { backgroundColor: "#" + new Array(7).join(Math.floor(Math.random() * 10) + "") }]}></View>;
31+
32+
render() {
33+
return (
34+
<SafeAreaView>
35+
<ScrollView>
36+
<ScrollIndicator
37+
viewBoxStyle={{
38+
alignItems: "center",
39+
marginTop: 60
40+
}}
41+
indicatorBackgroundStyle={{
42+
height: 4,
43+
width: 40,
44+
borderRadius: 5
45+
}} indicatorStyle={{
46+
height: 2,
47+
width: 40,
48+
borderRadius: 4
49+
}} indicatorBoxStyle={{
50+
marginTop: 10,
51+
justifyContent: "center",
52+
alignItems: "center"
53+
}} scrollViewBoxStyle={{
54+
borderWidth: 2,
55+
width: 300,
56+
borderColor: "red"
57+
}}>
58+
<this.Item />
59+
<this.Item />
60+
<this.Item />
61+
<this.Item />
62+
<this.Item />
63+
<this.Item />
64+
</ScrollIndicator>
65+
66+
67+
<ScrollIndicator
68+
indicatorBgPadding={6}
69+
viewBoxStyle={{
70+
alignItems: "center",
71+
marginTop: 60
72+
}} scrollViewBoxStyle={{
73+
width,
74+
}}>
75+
<this.Item />
76+
<this.Item />
77+
<this.Item />
78+
<this.Item />
79+
<this.Item />
80+
<this.Item />
81+
</ScrollIndicator>
82+
</ScrollView>
83+
</SafeAreaView>
84+
);
85+
}
86+
}
87+
88+
const styles = StyleSheet.create({
89+
item: {
90+
width: itemWidth,
91+
height: 140,
92+
marginHorizontal: margin
93+
}
94+
95+
});
96+
97+
export default App;

__tests__/App-test.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* @format
3+
*/
4+
5+
import 'react-native';
6+
import React from 'react';
7+
import App from '../App';
8+
9+
// Note: test renderer must be required after react-native.
10+
import renderer from 'react-test-renderer';
11+
12+
it('renders correctly', () => {
13+
renderer.create(<App />);
14+
});

android/app/_BUCK

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# To learn about Buck see [Docs](https://buckbuild.com/).
2+
# To run your application with Buck:
3+
# - install Buck
4+
# - `npm start` - to start the packager
5+
# - `cd android`
6+
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
7+
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
8+
# - `buck install -r android/app` - compile, install and run application
9+
#
10+
11+
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12+
13+
lib_deps = []
14+
15+
create_aar_targets(glob(["libs/*.aar"]))
16+
17+
create_jar_targets(glob(["libs/*.jar"]))
18+
19+
android_library(
20+
name = "all-libs",
21+
exported_deps = lib_deps,
22+
)
23+
24+
android_library(
25+
name = "app-code",
26+
srcs = glob([
27+
"src/main/java/**/*.java",
28+
]),
29+
deps = [
30+
":all-libs",
31+
":build_config",
32+
":res",
33+
],
34+
)
35+
36+
android_build_config(
37+
name = "build_config",
38+
package = "com.scroll_bar",
39+
)
40+
41+
android_resource(
42+
name = "res",
43+
package = "com.scroll_bar",
44+
res = "src/main/res",
45+
)
46+
47+
android_binary(
48+
name = "app",
49+
keystore = "//android/keystores:debug",
50+
manifest = "src/main/AndroidManifest.xml",
51+
package_type = "debug",
52+
deps = [
53+
":app-code",
54+
],
55+
)

0 commit comments

Comments
 (0)