Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:
- uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: 11
java-version: 17
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Build android
run: cd example && NODE_OPTIONS="--openssl-legacy-provider" pnpm build:android
run: cd example && pnpm build:android
- name: Build Android Example App and Library
run: cd example/android && ./gradlew clean assembleDebug
ios:
Expand All @@ -44,6 +44,6 @@ jobs:
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Build ios
run: cd example && NODE_OPTIONS="--openssl-legacy-provider" pnpm build:ios
run: cd example && pnpm build:ios
- name: Pod install
run: cd example && pod install --project-directory=ios
18 changes: 14 additions & 4 deletions example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,22 @@
*.xcworkspace/
*.zip
.DS_Store
.bundle/*
!.bundle/config
.gradle/
.idea/
.vs/
Pods/
build/
dist/
.watchman-*
.xcode.env
android/app/
android/build/
dist/*
!dist/.gitignore
ios/DerivedData/
ios/Pods/
ios/build/
local.properties
msbuild.binlog
macos/DerivedData/
macos/Pods/
macos/build/
node_modules/
2 changes: 1 addition & 1 deletion example/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{}
{}
4 changes: 2 additions & 2 deletions example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @flow
*/

import SegmentedControl from '..';
import SegmentedControl from '@react-native-segmented-control/segmented-control';
import React, {useEffect, useState} from 'react';
import {ScrollView, StyleSheet, Text, View, useColorScheme} from 'react-native';

Expand All @@ -31,7 +31,7 @@
<ScrollView
contentContainerStyle={[
styles.container,
{backgroundColor: colorScheme === 'dark' ? '#000' : '#FFF'},

Check warning on line 34 in example/App.js

View workflow job for this annotation

GitHub Actions / lint

Inline style: { backgroundColor: "colorScheme === 'dark' ? '#000' : '#FFF'" }
]}>
<View style={styles.segmentContainer}>
<Text style={[styles.text, {color: textColor}]}>
Expand All @@ -46,7 +46,7 @@
values={[
'One',
'Two',
require('../assets/images/user.png'),
require('./assets/images/user.png'),
'Three',
'Four',
'Five',
Expand Down Expand Up @@ -95,8 +95,8 @@
</View>
<View style={styles.segmentSection}>
<SegmentedControl
fontStyle={{color: '#ff00ff'}}

Check warning on line 98 in example/App.js

View workflow job for this annotation

GitHub Actions / lint

Inline style: { color: '#ff00ff' }
activeFontStyle={{color: 'blue'}}

Check warning on line 99 in example/App.js

View workflow job for this annotation

GitHub Actions / lint

Inline style: { color: 'blue' }
values={['One', 'Two']}
selectedIndex={1}
/>
Expand All @@ -108,15 +108,15 @@
<View style={styles.segmentContainer}>
<SegmentedControl
values={['One', 'Two']}
style={{height: 80}}

Check warning on line 111 in example/App.js

View workflow job for this annotation

GitHub Actions / lint

Inline style: { height: 80 }
fontStyle={styles.fontStyle}
/>
</View>
<SegmentedControl
values={['One', 'Two']}
tintColor="red"
style={{height: 80}}

Check warning on line 118 in example/App.js

View workflow job for this annotation

GitHub Actions / lint

Inline style: { height: 80 }
fontStyle={{

Check warning on line 119 in example/App.js

View workflow job for this annotation

GitHub Actions / lint

Inline style: { fontFamily: 'Optima', fontSize: 32 }
fontFamily: 'Optima',
fontSize: 32,
}}
Expand Down
37 changes: 12 additions & 25 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,36 +1,23 @@
buildscript {
def androidTestAppDir = new File(gradle.ext.resolvePackageDir("react-native-test-app"), "android")
apply(from: new File(androidTestAppDir, "dependencies.gradle"))
apply(from: {
def searchDir = rootDir.toPath()
do {
def p = searchDir.resolve("node_modules/react-native-test-app/android/dependencies.gradle")
if (p.toFile().exists()) {
return p.toRealPath().toString()
}
} while (searchDir = searchDir.getParent())
throw new GradleException("Could not find `react-native-test-app`");
}())

repositories {
mavenCentral()
google()
}

dependencies {
classpath "com.android.tools.build:gradle:$androidPluginVersion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}

allprojects {
repositories {
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url(new File(gradle.ext.resolvePackageDir("react-native"), "android"))
}
mavenCentral()
google()
}

// React Native 0.63 depends on Fresco 2.2.0, which was only ever published
// to JCenter (now shut down). 2.3.0 is the oldest release on Maven Central.
configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == "com.facebook.fresco" && details.requested.version == "2.2.0") {
details.useVersion("2.3.0")
details.because("Fresco 2.2.0 is not available on Maven Central")
}
getReactNativeDependencies().each { dependency ->
classpath(dependency)
}
}
}
47 changes: 36 additions & 11 deletions example/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,39 @@ org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryEr
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

# Version of Flipper to use with React Native. Default value is whatever React
# Native defaults to. To disable Flipper, set it to `false`.
#FLIPPER_VERSION=0.125.0

# Enable Fabric at runtime.
#USE_FABRIC=1

# Uncomment the line below if building react-native from source
#ANDROID_NDK_VERSION=21.4.7075529
#android.enableJetifier=true
# Jetifier randomly fails on these libraries
#android.jetifier.ignorelist=hermes-android,react-android

# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
# ./gradlew <task> -PreactNativeArchitectures=x86_64
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64

# Use this property to enable support to the new architecture.
# This will allow you to use TurboModules and the Fabric render in
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
# Note that this is incompatible with web debugging.
newArchEnabled=true
#bridgelessEnabled=true

# Uncomment the line below to build React Native from source.
#react.buildFromSource=true

# Version of Android NDK to build against.
#ANDROID_NDK_VERSION=26.1.10909125

# Version of Kotlin to build against.
#KOTLIN_VERSION=1.8.22

# Use this property to enable edge-to-edge display support.
# This allows your app to draw behind system bars for an immersive UI.
# Note: Only works with ReactActivity and should not be used with custom Activity.
edgeToEdgeEnabled=true

# Opt out of built-in kotlin and new DSL behavior that ships with AGP 9.
# Starting from AGP 10.x these opt outs will be removed.
android.builtInKotlin=false
android.newDsl=false
Binary file modified example/android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
50 changes: 32 additions & 18 deletions example/android/gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading