mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-06 07:06:11 +00:00
feat: format project and change in test example default component (#2350)
# Summary Format the whole project.
This commit is contained in:
@@ -35,7 +35,6 @@ import com.facebook.react.uimanager.events.EventDispatcher;
|
|||||||
import com.facebook.react.views.imagehelper.ImageSource;
|
import com.facebook.react.views.imagehelper.ImageSource;
|
||||||
import com.facebook.react.views.imagehelper.ResourceDrawableIdHelper;
|
import com.facebook.react.views.imagehelper.ResourceDrawableIdHelper;
|
||||||
import com.horcrux.svg.events.SvgLoadEvent;
|
import com.horcrux.svg.events.SvgLoadEvent;
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
@@ -143,7 +142,8 @@ class ImageView extends RenderableView {
|
|||||||
public void onNewResultImpl(Bitmap bitmap) {
|
public void onNewResultImpl(Bitmap bitmap) {
|
||||||
final EventDispatcher mEventDispatcher =
|
final EventDispatcher mEventDispatcher =
|
||||||
UIManagerHelper.getEventDispatcherForReactTag(mContext, getId());
|
UIManagerHelper.getEventDispatcherForReactTag(mContext, getId());
|
||||||
mEventDispatcher.dispatchEvent(new SvgLoadEvent(
|
mEventDispatcher.dispatchEvent(
|
||||||
|
new SvgLoadEvent(
|
||||||
UIManagerHelper.getSurfaceId(ImageView.this),
|
UIManagerHelper.getSurfaceId(ImageView.this),
|
||||||
getId(),
|
getId(),
|
||||||
mContext,
|
mContext,
|
||||||
|
|||||||
@@ -395,7 +395,7 @@ public abstract class RenderableView extends VirtualView implements ReactHitSlop
|
|||||||
Paint luminancePaint = new Paint();
|
Paint luminancePaint = new Paint();
|
||||||
ColorMatrix luminanceToAlpha =
|
ColorMatrix luminanceToAlpha =
|
||||||
new ColorMatrix(
|
new ColorMatrix(
|
||||||
new float[]{
|
new float[] {
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2125f, 0.7154f, 0.0721f, 0, 0
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2125f, 0.7154f, 0.0721f, 0, 0
|
||||||
});
|
});
|
||||||
luminancePaint.setColorFilter(new ColorMatrixColorFilter(luminanceToAlpha));
|
luminancePaint.setColorFilter(new ColorMatrixColorFilter(luminanceToAlpha));
|
||||||
|
|||||||
@@ -14,10 +14,16 @@ public class SvgLoadEvent extends Event<SvgLoadEvent> {
|
|||||||
private final float height;
|
private final float height;
|
||||||
private final String uri;
|
private final String uri;
|
||||||
|
|
||||||
public SvgLoadEvent(int surfaceId, int viewId, ReactContext mContext, String uriString, float width, float height) {
|
public SvgLoadEvent(
|
||||||
|
int surfaceId,
|
||||||
|
int viewId,
|
||||||
|
ReactContext mContext,
|
||||||
|
String uriString,
|
||||||
|
float width,
|
||||||
|
float height) {
|
||||||
super(surfaceId, viewId);
|
super(surfaceId, viewId);
|
||||||
ImageSource imageSource = new ImageSource(mContext, uriString);
|
ImageSource imageSource = new ImageSource(mContext, uriString);
|
||||||
this.uri = imageSource.getSource();;
|
this.uri = imageSource.getSource();
|
||||||
this.width = width;
|
this.width = width;
|
||||||
this.height = height;
|
this.height = height;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,5 +24,5 @@ import Test2276 from './src/Test2276';
|
|||||||
import Test2327 from './src/Test2327';
|
import Test2327 from './src/Test2327';
|
||||||
|
|
||||||
export default function App() {
|
export default function App() {
|
||||||
return <Test1790 />;
|
return <ColorTest />;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,9 +12,9 @@
|
|||||||
#include <react/renderer/imagemanager/primitives.h>
|
#include <react/renderer/imagemanager/primitives.h>
|
||||||
|
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
|
#include <folly/dynamic.h>
|
||||||
#include <react/renderer/mapbuffer/MapBuffer.h>
|
#include <react/renderer/mapbuffer/MapBuffer.h>
|
||||||
#include <react/renderer/mapbuffer/MapBufferBuilder.h>
|
#include <react/renderer/mapbuffer/MapBufferBuilder.h>
|
||||||
#include <folly/dynamic.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import React from 'react';
|
|||||||
import App from '../App';
|
import App from '../App';
|
||||||
|
|
||||||
// Note: import explicitly to use the types shipped with jest.
|
// Note: import explicitly to use the types shipped with jest.
|
||||||
import {it} from '@jest/globals';
|
import { it } from '@jest/globals';
|
||||||
|
|
||||||
// Note: test renderer must be required after react-native.
|
// Note: test renderer must be required after react-native.
|
||||||
import renderer from 'react-test-renderer';
|
import renderer from 'react-test-renderer';
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import React from 'react';
|
|||||||
import App from '../App';
|
import App from '../App';
|
||||||
|
|
||||||
// Note: import explicitly to use the types shipped with jest.
|
// Note: import explicitly to use the types shipped with jest.
|
||||||
import {it} from '@jest/globals';
|
import { it } from '@jest/globals';
|
||||||
|
|
||||||
// Note: test renderer must be required after react-native.
|
// Note: test renderer must be required after react-native.
|
||||||
import renderer from 'react-test-renderer';
|
import renderer from 'react-test-renderer';
|
||||||
|
|||||||
Reference in New Issue
Block a user