Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove processColor #1367

Merged
merged 1 commit into from
Mar 23, 2022
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
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
package com.swmansion.rnscreens

import androidx.annotation.NonNull
import androidx.annotation.Nullable
import com.facebook.react.bridge.JSApplicationIllegalArgumentException
import com.facebook.react.common.MapBuilder
import com.facebook.react.module.annotations.ReactModule
import com.facebook.react.uimanager.ReactStylesDiffMap
import com.facebook.react.uimanager.StateWrapper
import com.facebook.react.uimanager.ThemedReactContext
import com.facebook.react.uimanager.ViewGroupManager
import com.facebook.react.uimanager.ViewManagerDelegate
Expand Down Expand Up @@ -105,7 +101,7 @@ class ScreenViewManager : ViewGroupManager<Screen>(), RNSScreenManagerInterface<
view.isStatusBarAnimated = animated
}

@ReactProp(name = "statusBarColor")
@ReactProp(name = "statusBarColor", customType = "Color")
override fun setStatusBarColor(view: Screen, statusBarColor: Int?) {
view.statusBarColor = statusBarColor
}
Expand Down
7 changes: 0 additions & 7 deletions src/index.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ import {
ViewProps,
} from 'react-native';
import { Freeze } from 'react-freeze';
// @ts-ignore Getting private component
// eslint-disable-next-line import/default
import processColor from 'react-native/Libraries/StyleSheet/processColor';
import { version } from 'react-native/package.json';

import TransitionProgressContext from './TransitionProgressContext';
Expand Down Expand Up @@ -251,7 +248,6 @@ class Screen extends React.Component<ScreenProps> {
activityState,
children,
isNativeStack,
statusBarColor,
...props
} = rest;

Expand All @@ -262,8 +258,6 @@ class Screen extends React.Component<ScreenProps> {
activityState = active !== 0 ? 2 : 0; // in the new version, we need one of the screens to have value of 2 after the transition
}

const processedColor = processColor(statusBarColor);

const handleRef = (ref: ViewConfig) => {
if (!ENABLE_FABRIC) {
if (ref?.viewConfig?.validAttributes?.style) {
Expand All @@ -280,7 +274,6 @@ class Screen extends React.Component<ScreenProps> {
<MaybeFreeze freeze={activityState === 0}>
<AnimatedNativeScreen
{...props}
statusBarColor={processedColor}
activityState={activityState}
// This prevents showing blank screen when navigating between multiple screens with freezing
// https://github.com/software-mansion/react-native-screens/pull/1208
Expand Down