Skip to content

Commit a4d376e

Browse files
committed
chore: refactoring
1 parent 2790b1b commit a4d376e

7 files changed

Lines changed: 18 additions & 35 deletions

File tree

android/build.gradle

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,4 @@ dependencies {
103103
}
104104

105105

106-
// if(isNewArchitectureEnabled()){
107-
// react {
108-
// jsRootDir = file("$projectDir/../src")
109-
// libraryName = "AutoSkeletonView"
110-
// codegenJavaPackageName = "com.autoskeleton"
111-
// }
112-
// sourceSets {
113-
// main { java.srcDirs += ["build/generated/source/codegen/java"] }
114-
// }
115-
// }
116106

example/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,7 @@ PODS:
12381238
- React-jsiexecutor
12391239
- React-RCTFBReactNativeSpec
12401240
- ReactCommon/turbomodule/core
1241-
- react-native-auto-skeleton (0.1.18):
1241+
- react-native-auto-skeleton (0.1.28):
12421242
- DoubleConversion
12431243
- glog
12441244
- hermes-engine
@@ -1799,7 +1799,7 @@ SPEC CHECKSUMS:
17991799
React-logger: 74ddb793d36b48bba176328c7af75e5e656fd405
18001800
React-Mapbuffer: 39e87693178fd6483bb5ca8b851fae362d49409a
18011801
React-microtasksnativemodule: b740ebae7fad70aa78bc24cc0dfc15ac9637b6eb
1802-
react-native-auto-skeleton: f673e1d3dad6ed3d815dbbfbc797a9ff1b6ca583
1802+
react-native-auto-skeleton: 77f1f2e3567ddc6bf92fa8fe5b5a3582e2f5c65f
18031803
React-NativeModulesApple: af0571ac115d09c9a669ed45ce6a4ca960598a2d
18041804
React-perflogger: 26d07766b033f84559bd520e949453dba8bf1cd8
18051805
React-performancetimeline: 0f3e0b6e2152951257bd8c90f95d527cf4316fa8

ios/React/AutoSkeletonIgnoreView.mm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#import "AutoSkeletonIgnoreView.h"
22

3-
#import "../generated/RNAutoSkeletonViewSpec/ComponentDescriptors.h"
4-
#import "../generated/RNAutoSkeletonViewSpec/EventEmitters.h"
5-
#import "../generated/RNAutoSkeletonViewSpec/Props.h"
6-
#import "../generated/RNAutoSkeletonViewSpec/RCTComponentViewHelpers.h"
3+
#import "react/renderer/components/RNAutoSkeletonViewSpec/ComponentDescriptors.h"
4+
#import "react/renderer/components/RNAutoSkeletonViewSpec/EventEmitters.h"
5+
#import "react/renderer/components/RNAutoSkeletonViewSpec/Props.h"
6+
#import "react/renderer/components/RNAutoSkeletonViewSpec/RCTComponentViewHelpers.h"
77

88
#import "RCTFabricComponentsPlugins.h"
99

ios/React/AutoSkeletonView.mm

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#import "AutoSkeletonView.h"
22

3-
#import "../generated/RNAutoSkeletonViewSpec/ComponentDescriptors.h"
4-
#import "../generated/RNAutoSkeletonViewSpec/EventEmitters.h"
5-
#import "../generated/RNAutoSkeletonViewSpec/Props.h"
6-
#import "../generated/RNAutoSkeletonViewSpec/RCTComponentViewHelpers.h"
3+
#import "react/renderer/components/RNAutoSkeletonViewSpec/ComponentDescriptors.h"
4+
#import "react/renderer/components/RNAutoSkeletonViewSpec/EventEmitters.h"
5+
#import "react/renderer/components/RNAutoSkeletonViewSpec/Props.h"
6+
#import "react/renderer/components/RNAutoSkeletonViewSpec/RCTComponentViewHelpers.h"
77

88
#import "RCTFabricComponentsPlugins.h"
99
#if __has_include(<react_native_auto_skeleton/react_native_auto_skeleton-Swift.h>)
@@ -33,15 +33,6 @@ + (ComponentDescriptorProvider)componentDescriptorProvider {
3333
AutoSkeletonViewComponentDescriptor>();
3434
}
3535

36-
- (instancetype)init {
37-
if (self = [super init]) {
38-
_view = [SkeletonViewFabric new];
39-
_view.userInteractionEnabled = NO;
40-
41-
self.contentView = _view;
42-
}
43-
return self;
44-
}
4536

4637
- (instancetype)initWithFrame:(CGRect)frame {
4738
if (self = [super initWithFrame:frame]) {
@@ -52,8 +43,6 @@ - (instancetype)initWithFrame:(CGRect)frame {
5243
_view = [SkeletonViewFabric new];
5344
_view.userInteractionEnabled = NO;
5445

55-
[_view initOriginalViewsWithSubviews:self.subviews];
56-
5746
self.contentView = _view;
5847
}
5948

ios/SkeletonView/SkeletonCore.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,11 @@ public class SkeletonCore: UIView, PlaceholderMaskDelegate, SkeletonAnimatableDe
128128
views.removeAll()
129129

130130
views = subviews.filter {
131-
if $0.accessibilityIdentifier == Constants.IGNORE_VIEW_NAME {
131+
if $0.accessibilityIdentifier == Constants.IGNORE_VIEW_NAME || ($0 is SkeletonCore) {
132132
return false
133133
}
134134

135-
if $0.backgroundColor != nil && $0.backgroundColor != .clear && !($0 is SkeletonCore) {
135+
if hasBGColor($0) {
136136
return true
137137
}
138138

@@ -164,4 +164,9 @@ public class SkeletonCore: UIView, PlaceholderMaskDelegate, SkeletonAnimatableDe
164164
self.animator.stop()
165165
})
166166
}
167+
168+
@inline(__always)
169+
private func hasBGColor(_ view: UIView) -> Bool {
170+
return view.backgroundColor != nil && view.backgroundColor != .clear
171+
}
167172
}

react-native-auto-skeleton.podspec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Pod::Spec.new do |s|
1717
s.swift_version = "5.0"
1818
s.module_name = "react_native_auto_skeleton"
1919
s.source_files = "ios/**/*.{m,mm,cpp,swift}"
20-
s.private_header_files = "ios/generated/**/*.h"
2120

2221
s.pod_target_xcconfig = {
2322
"DEFINES_MODULE" => "YES",

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12326,7 +12326,7 @@ __metadata:
1232612326

1232712327
"typescript@patch:typescript@^5.2.2#~builtin<compat/typescript>":
1232812328
version: 5.8.2
12329-
resolution: "typescript@patch:typescript@npm%3A5.8.2#~builtin<compat/typescript>::version=5.8.2&hash=29ae49"
12329+
resolution: "typescript@patch:typescript@npm%3A5.8.2#~builtin<compat/typescript>::version=5.8.2&hash=14eedb"
1233012330
bin:
1233112331
tsc: bin/tsc
1233212332
tsserver: bin/tsserver

0 commit comments

Comments
 (0)