What are the available options for LayoutAnimation.Types - react-native

I have a custom layout animation taken from here.
var CustomLayoutAnimation = {
duration: 200,
create: {
type: LayoutAnimation.Types.linear,
property: LayoutAnimation.Properties.opacity,
},
update: {
type: LayoutAnimation.Types.curveEaseInEaseOut,
},
};
When running the code i get the following warning
Warning: Failed config type: The config config.update.type is marked
as required in LayoutAnimation.configureNext, but its value is
undefined.
The code has an entry for update.type, yet the warning says it's undefined. I'm guessing that the permitted values have been updated since the gist was written.
I tried to find out the list of available permitted entries but they are not listed in the React Native LayoutAnimation documentation.
I'd like to know :
Is the syntax no longer correct?
Is there a webpage somewhere that details the list of availble Types?

Whenever I run into an issue like this, I go to the source code. Here's the file for LayoutAnimation.js from the react-native source code. Based on this, I see a TypesEnum const declaration at line 25 looking like this:
const TypesEnum = {
spring: true,
linear: true,
easeInEaseOut: true,
easeIn: true,
easeOut: true,
keyboard: true,
};
I suspect that's why you are erring out - curveEaseInEaseOut is not a supported type. Choose one from the list above and I think you should be good to go. Hope this helps!

Related

How to configure gtm to track OrderPlacedEvent in SAP-Spartacus?

I am using Spartacus 4.2 and i am tracking a bunch of events via GTM.
I have configured gtm to track some custom and standard events but when i try to add the OrderPlacedEvent i get the following error:
Type 'TmsConfig' has no properties in common with type 'Config'
The import for OrderPlacedEvent looks like this:
import { OrderPlacedEvent } from '#spartacus/checkout/root';
GTM-Configuration:
provideConfig({
tagManager: {
gtm: {
dynamicConfiguration: true,
// TODO: Add events for tracking here
events: [
NavigationEvent,
OrderPlacedEvent,
//... (custom Events)
],
debug: true,
},
},
} as TmsConfig),
Does anybody know what im doing wrong?
I've faced a similar problem. The reason was that some feature module was referenced before the #spartacus/core and it messed up the Config type augmentation.
You need to check if some feature module doesn't get imported before #spartacus/core. For instance in app.module.ts.

I'm trying to use react-call-detection to detect a missed call number but something is not working

Hey there to everyone!
I'm posting my first question so I'll try to be as clear as possible!
I'm building a native android app using react-native(0.61.5), I'm using setState hook instead of the classic state and I want to use the react-native-call-detection library(1.8.2).
What is the problem?
function startListenerTapped() {
console.log('start');
callDetector = new CallDetectorManager((event, number) => {
console.log(event);
console.log('inside call detector');
if (event === 'Missed') {
console.log(event);
console.log(number);
setMissedCaller(number);
}
},
true,
() => { console.error('access denied') },
{
title: 'Phone State Permission',
message: 'This app needs access to your phone state in order to react and/or to adapt to incoming calls.'
}
)
}
I run this function when my component mounts, callDetector is set as undefined, I get the 'start' log but when I simulate a call on my AVD nothing happens.
From what I understood the CallDetectorManager works like an event listener, right?
Or do I need to start it every time a call happens?
Another thing I've had a problem with was when I was trying to run a build for the app. I have Gradle 6.0 and I had an error with the react-native-call-detection:
Attribute application#allowBackup value=(false) from AndroidManifest.xml:13:7-34
is also present at [:react-native-call-detection] AndroidManifest.xml:21:9-35 value=(true).
Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at
AndroidManifest.xml:7:5-117 to override.
I couldn't really understand what this meant, and the only thing that I've found that solved it was to create a react-native.config.js file with this line of code in it:
module.exports = { dependencies: { 'react-native-call-detection': { platforms: { android: null, }, }, }, };
Another thing that I've only noticed now is that I have a problem with the module of the library.
Could not find a declaration file for module 'react-native-call-detection'.
'c:/folders/projectName/node_modules/react-native-call-detection/index.js' implicitly has an 'any' type.
Try `npm install #types/react-native-call-detection` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-native-call-detection';`
Does anybody knows what that means?!
I think I start to think that it means that I need to find an alternative to this library... AHAHA!
Any kind of help or solution would be more than welcome!
Thanks in advance for everything!

Agile Central Basic App Settings

I'm implementing a simple app based on the UserIterationCapacity using a Rally.app.TimeboxScopedApp.
Now I want to specify a couple of settings as App settings and found the developer tutorial for this: https://help.rallydev.com/apps/2.1/doc/#!/guide/settings
But I just cant get it working. Whenever I try to fetch a setting my code stops without any warnings.
I've implemented the following:
config: {
defaultSettings: {
hoursPerSp: 6,
decimalsOnHoursPerSp: 1
}
},
getSettingsFields: function() {
return [
{
name: 'hoursPerSp',
xtype: 'rallynumberfield'
},
{
name: 'decimalsOnHoursPerSp',
xtype: 'rallynumberfield'
}
];
},
Now I'm trying to use
this.getSettings('hoursPerSp');
but unfortunately it is not working.
Thank you in advance
Problem solved.
I needed to keep track of my scope, i.e., I needed to pass in the this variable to my renders.

Extjs 4.1, Making JSON array for Store sync

When I sync for edited grid, extjs pass JSON data to Server by AJAX.
If I edit multiple row, and sync then it make JSON array. But if I edit just single row,
it will pass just a JSON data.
So I have some problem with receiving the parameter because the parameter type is vary.
My question is,
Is it possible to make JSON array date even for single edited grid?
If so, how should I do? anybody know please please advice me.
[Single]
[Multiple]
And this is part of grid store,
proxy: {
type: "ajax",
api: {
update: 'Order/ItemUpdate',
read: 'Order/ItemList',
create: undefined,
destroy: undefined
}
}
Just set the allowSingle config of Ext.data.writer.Json to false. As covered here in the docs.
I am pretty sure that this can be done from your proxy config, e.g.:
proxy: {
type: 'ajax',
writer: {
type: 'json',
allowSingle: false
},
api: {
update: 'Order/ItemUpdate',
read: 'Order/ItemList',
create: undefined,
destroy: undefined
}
}

Sencha touch 2.0 : Store loading, first availability

I'm trying to figure out when a store is ready to be used within my app.
I figured from the doc that if I want to display information from my store, I should listen to the 'refresh' event of my store to get notified when it has been changed (and thus also when it is first loaded).
However, using the following example:
Ext.define('MyApp.store.Config', {
extend: 'Ext.data.Store',
config: {
autoLoad: true,
autoSync: true,
model: 'MyApp.model.Config',
listeners: {
refresh: function() {
console.log(Ext.StoreManager.get('Config').getAt(0))
}
}
} });
the 'console.log' gets called twice at startup, and it fails the first time (it seems that the Store is not loaded yet). My model uses a proxy (type ajax, and a json reader).
Could someone tell me how I should proceed to avoid this error?
Thanks!
I found the reason...
I was declaring the 'stores:['Config']' property both in my app.js and in on of my controllers.
Quite hard to spot but my mistake...