Skip to content

Commit 0b98788

Browse files
Background changer project
1 parent 4fae14a commit 0b98788

Some content is hidden

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

59 files changed

+28739
-0
lines changed

bgChanger04/.bundle/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_FORCE_RUBY_PLATFORM: 1

bgChanger04/.eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native-community',
4+
};

bgChanger04/.gitignore

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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+
ios/.xcode.env.local
24+
25+
# Android/IntelliJ
26+
#
27+
build/
28+
.idea
29+
.gradle
30+
local.properties
31+
*.iml
32+
*.hprof
33+
.cxx/
34+
*.keystore
35+
!debug.keystore
36+
37+
# node.js
38+
#
39+
node_modules/
40+
npm-debug.log
41+
yarn-error.log
42+
43+
# fastlane
44+
#
45+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
46+
# screenshots whenever they are needed.
47+
# For more information about the recommended setup visit:
48+
# https://docs.fastlane.tools/best-practices/source-control/
49+
50+
**/fastlane/report.xml
51+
**/fastlane/Preview.html
52+
**/fastlane/screenshots
53+
**/fastlane/test_output
54+
55+
# Bundle artifact
56+
*.jsbundle
57+
58+
# Ruby / CocoaPods
59+
/ios/Pods/
60+
/vendor/bundle/
61+
62+
# Temporary files created by Metro to check the health of the file watcher
63+
.metro-health-check*

bgChanger04/.node-version

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

bgChanger04/.prettierrc.js

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

bgChanger04/.ruby-version

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

bgChanger04/.watchmanconfig

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

bgChanger04/App.tsx

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
2+
import React, { useState } from 'react';
3+
4+
import {
5+
6+
StatusBar,
7+
StyleSheet,
8+
Text,
9+
TouchableOpacity,
10+
11+
View,
12+
} from 'react-native';
13+
14+
15+
16+
function App(): JSX.Element {
17+
const [randomBackground, setRandomBackground] = useState("#ffffff");
18+
19+
const generateColor = () => {
20+
const hexRange = "0123456789ABCDEF"
21+
let color = "#"
22+
23+
for (let i = 0; i < 6; i++) {
24+
color += hexRange[Math.floor(Math.random() * 16)]
25+
26+
}
27+
setRandomBackground(color)
28+
}
29+
30+
return (
31+
<>
32+
<StatusBar backgroundColor={randomBackground}/>
33+
<View style={[styles.container, {backgroundColor: randomBackground}] }>
34+
<TouchableOpacity onPress={generateColor}>
35+
<View style={styles.actionBtn}>
36+
<Text style={styles.actionBtnTxt}>Press me</Text>
37+
</View>
38+
</TouchableOpacity>
39+
</View>
40+
</>
41+
);
42+
}
43+
44+
const styles = StyleSheet.create({
45+
container:{
46+
flex:1,
47+
alignItems: "center",
48+
justifyContent: "center"
49+
},
50+
actionBtn: {
51+
borderRadius: 12,
52+
backgroundColor: "#6A1B4D",
53+
paddingVertical: 10,
54+
paddingHorizontal: 40
55+
},
56+
actionBtnTxt: {
57+
fontSize: 24,
58+
color: "#FFFFFF",
59+
textTransform: "uppercase"
60+
}
61+
});
62+
63+
export default App;

bgChanger04/Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
source 'https://rubygems.org'
2+
3+
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4+
ruby File.read(File.join(__dir__, '.ruby-version')).strip
5+
6+
gem 'cocoapods', '~> 1.11', '>= 1.11.3'

bgChanger04/__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+
});

0 commit comments

Comments
 (0)