use of com.microsoft.appcenter.sasquatch.fragments.TypedPropertyFragment in project mobile-center-sdk-android by Microsoft.
the class EventActivity method send.
@Override
public void send(View view) {
AnalyticsTransmissionTarget target = getSelectedTarget();
PersistenceFlag persistenceFlag = PersistenceFlag.values()[mPersistenceFlagSpinner.getSelectedItemPosition()];
int flags = getFlags(persistenceFlag);
String name = mName.getText().toString();
Map<String, String> properties = null;
EventProperties typedProperties = null;
if (mProperties.size() > 0) {
if (onlyStringProperties()) {
properties = readStringProperties();
} else {
typedProperties = new EventProperties();
for (TypedPropertyFragment fragment : mProperties) {
fragment.set(typedProperties);
}
}
}
/* First item is always empty as it's default value which means either AppCenter, one collector or both. */
for (int i = 0; i < getNumberOfLogs(); i++) {
boolean useExplicitFlags = persistenceFlag != PersistenceFlag.DEFAULT;
if (target == null) {
if (properties != null) {
if (useExplicitFlags) {
Analytics.trackEvent(name, properties, flags);
} else {
Analytics.trackEvent(name, properties);
}
} else if (typedProperties != null || useExplicitFlags) {
if (useExplicitFlags) {
Analytics.trackEvent(name, typedProperties, flags);
} else {
Analytics.trackEvent(name, typedProperties);
}
} else {
Analytics.trackEvent(name);
}
} else {
if (properties != null) {
if (useExplicitFlags) {
target.trackEvent(name, properties, flags);
} else {
target.trackEvent(name, properties);
}
} else if (typedProperties != null || useExplicitFlags) {
if (useExplicitFlags) {
target.trackEvent(name, typedProperties, flags);
} else {
target.trackEvent(name, typedProperties);
}
} else {
target.trackEvent(name);
}
}
}
}
use of com.microsoft.appcenter.sasquatch.fragments.TypedPropertyFragment in project mobile-center-sdk-android by Microsoft.
the class PropertyActivity method addProperty.
private void addProperty() {
TypedPropertyFragment fragment = new TypedPropertyFragment();
Bundle bundle = new Bundle();
bundle.putBoolean(TypedPropertyFragment.STRING_TYPE_ONLY_KEY, isStringTypeOnly());
fragment.setArguments(bundle);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.add(R.id.list, fragment).commit();
mProperties.add(fragment);
}
Aggregations