Skip to content

Commit

Permalink
refactor(Android): rename FabricEnabledHeaderSubviewGroup -> `Fabri…
Browse files Browse the repository at this point in the history
…cEnabledHeaderSubviewViewGroup` + fix arch-consistency check (software-mansion#2622)

- **Add FabricEnabledHeaderSubviewViewGroup to arch-check balcklist**
- **Fix naming**

## Description

<!--
Description and motivation for this PR.

Include Fixes #<number> if this is fixing some issue.

Fixes # .
-->

## Changes

<!--
Please describe things you've changed here, make a **high level**
overview, if change is simple you can omit this section.

For example:

- Updated `about.md` docs

-->

<!--

## Screenshots / GIFs

Here you can add screenshots / GIFs documenting your change.

You can add before / after section if you're changing some behavior.

### Before

### After

-->

## Test code and steps to reproduce

<!--
Please include code that can be used to test this change and short
description how this example should work.
This snippet should be as minimal as possible and ready to be pasted
into editor (don't exclude exports or remove "not important" parts of
reproduction example)
-->

## Checklist

- [ ] Included code example that can be used to test this change
- [ ] Updated TS types
- [ ] Updated documentation: <!-- For adding new props to native-stack
-->
- [ ]
https://github.com/software-mansion/react-native-screens/blob/main/guides/GUIDE_FOR_LIBRARY_AUTHORS.md
- [ ]
https://github.com/software-mansion/react-native-screens/blob/main/native-stack/README.md
- [ ]
https://github.com/software-mansion/react-native-screens/blob/main/src/types.tsx
- [ ]
https://github.com/software-mansion/react-native-screens/blob/main/src/native-stack/types.tsx
- [ ] Ensured that CI passes
  • Loading branch information
kkafar authored Jan 16, 2025
1 parent 7dc6916 commit c07e9b6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import com.facebook.react.bridge.WritableNativeMap
import com.facebook.react.uimanager.PixelUtil
import com.facebook.react.uimanager.StateWrapper

abstract class FabricEnabledHeaderSubviewGroup(
abstract class FabricEnabledHeaderSubviewViewGroup(
context: Context?,
) : ViewGroup(context) {
private var mStateWrapper: StateWrapper? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ package com.swmansion.rnscreens
import android.annotation.SuppressLint
import android.view.View
import com.facebook.react.bridge.ReactContext
import com.facebook.react.views.view.ReactViewGroup

@SuppressLint("ViewConstructor")
class ScreenStackHeaderSubview(
context: ReactContext?,
) : FabricEnabledHeaderSubviewGroup(context) {
) : FabricEnabledHeaderSubviewViewGroup(context) {
private var reactWidth = 0
private var reactHeight = 0
var type = Type.RIGHT
Expand Down Expand Up @@ -42,11 +41,11 @@ class ScreenStackHeaderSubview(
r: Int,
b: Int,
) {
if (changed && BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
val width = r - l;
val height = b - t;
updateSubviewFrameState(width, height, l, t)
}
if (changed && BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
val width = r - l
val height = b - t
updateSubviewFrameState(width, height, l, t)
}
}

enum class Type {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import android.content.Context
import android.view.ViewGroup
import com.facebook.react.uimanager.StateWrapper

abstract class FabricEnabledHeaderSubviewGroup(context: Context?): ViewGroup(context) {
abstract class FabricEnabledHeaderSubviewViewGroup(context: Context?): ViewGroup(context) {

fun setStateWrapper(wrapper: StateWrapper?) = Unit

Expand Down
1 change: 1 addition & 0 deletions scripts/codegen-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const BLACKLISTED_FILES = new Set([
'FabricEnabledViewGroup.kt',
'NativeProxy.kt',
'FabricEnabledHeaderConfigViewGroup.kt',
'FabricEnabledHeaderSubviewViewGroup.kt',
]);


Expand Down

0 comments on commit c07e9b6

Please sign in to comment.