本文整理汇总了Java中com.crashlytics.android.answers.ContentViewEvent类的典型用法代码示例。如果您正苦于以下问题:Java ContentViewEvent类的具体用法?Java ContentViewEvent怎么用?Java ContentViewEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ContentViewEvent类属于com.crashlytics.android.answers包,在下文中一共展示了ContentViewEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.crashlytics.android.answers.ContentViewEvent; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
Log.d(TAG, "onCreate");
super.onCreate(savedInstanceState);
Intent intent = getActivity().getIntent();
mPlaylistId = intent.getStringExtra(PlaylistActivity.ARG_PLAYLIST_ID);
mUserId = intent.getStringExtra(PlaylistActivity.ARG_USER_ID);
loadPlaylist();
Answers.getInstance().logContentView(new ContentViewEvent()
.putContentName(Constants.ANSWERS_CONTENT_NAME)
.putContentType(Constants.ANSWERS_CONTENT_TYPE)
.putContentId(mPlaylistId));
}
示例2: onCreate
import com.crashlytics.android.answers.ContentViewEvent; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
Log.d(TAG, "onCreate");
super.onCreate(savedInstanceState);
Intent intent = getActivity().getIntent();
mAlbumId = intent.getStringExtra(AlbumActivity.ARG_ALBUM_ID);
loadAlbum();
Answers.getInstance().logContentView(new ContentViewEvent()
.putContentName(Constants.ANSWERS_CONTENT_ALBUM)
.putContentType(Constants.ANSWERS_CONTENT_TYPE)
.putContentId(mAlbumId));
}
示例3: onCreateView
import com.crashlytics.android.answers.ContentViewEvent; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_recent, container, false);
ButterKnife.bind(this, view);
mRecyclerView.setLayoutManager(new AnimatedLayoutManager(this.getActivity(), 1));
adapter = new WorkoutListViewAdapter(this.getActivity(), cacheReceiver.getCursor());
adapter.setHasStableIds(true);
adapter.setOnItemClickListener(this);
mRecyclerView.setItemAnimator(new ItemAnimator());
mRecyclerView.setAdapter(adapter);
if(Answers.getInstance() != null) {
Answers.getInstance().logContentView(new ContentViewEvent()
.putContentName("Historical activity data")
.putContentType("View")
.putContentId("RecentFragment"));
}
return view;
}
示例4: logGuide
import com.crashlytics.android.answers.ContentViewEvent; //导入依赖的package包/类
public static void logGuide(String type, String installer) {
try {
Answers.getInstance().logContentView(new ContentViewEvent()
.putContentName("Guide")
.putContentType(type)
.putContentId("guide-" + type)
.putCustomAttribute("installer", installer));
} catch (IllegalStateException e) { // NOSONAR
// do nothing
}
}
示例5: sendScreenView
import com.crashlytics.android.answers.ContentViewEvent; //导入依赖的package包/类
@Override
public void sendScreenView(String screenName) {
tracker.setScreenName(screenName);
tracker.send(new HitBuilders.ScreenViewBuilder().build());
answers.logContentView(new ContentViewEvent().putContentName(screenName));
}
示例6: sendView
import com.crashlytics.android.answers.ContentViewEvent; //导入依赖的package包/类
@Override
public void sendView(String name, String type) {
ContentViewEvent contentViewEvent = new ContentViewEvent();
contentViewEvent.putContentName(name);
contentViewEvent.putContentType(type);
Answers.getInstance().logContentView(contentViewEvent);
}
示例7: onCreate
import com.crashlytics.android.answers.ContentViewEvent; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
if (mShouldShowLeftMenu) {
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
if (toolbar != null) {
setSupportActionBar(toolbar);
if (drawer != null) {
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.setDrawerListener(toggle);
toggle.syncState();
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
if (navigationView != null)
navigationView.setVisibility(View.VISIBLE);
}
}
}
// Create a record that user has visited the current activity
Answers.getInstance().logContentView(new ContentViewEvent()
.putContentId(getClass().getName()));
}
示例8: logSpecificEvent
import com.crashlytics.android.answers.ContentViewEvent; //导入依赖的package包/类
@Override
public void logSpecificEvent(@NonNull AnalyticsEvent event)
{
ContentViewEvent contentViewEvent = buildAnswersContentViewEvent(event);
answers.logContentView(contentViewEvent);
}
示例9: test_buildAnswersContentViewEvent
import com.crashlytics.android.answers.ContentViewEvent; //导入依赖的package包/类
@Test
public void test_buildAnswersContentViewEvent()
{
ContentViewEvent result = logger.buildAnswersContentViewEvent(contentViewEvent);
Map<String, Object> predefinedAttributes = PackageScopeWrappedCalls.getPredefinedAttributes(result);
assertThat(predefinedAttributes.size()).isEqualTo(3);
assertThat(predefinedAttributes).containsKey(Attributes.ContentView.CONTENT_NAME);
assertThat(predefinedAttributes).containsKey(Attributes.ContentView.CONTENT_TYPE);
assertThat(predefinedAttributes).containsKey(Attributes.ContentView.CONTENT_ID);
Map<String, Object> customAttributes = PackageScopeWrappedCalls.getCustomAttributes(result);
assertThat(customAttributes.size()).isEqualTo(1);
assertThat(customAttributes).containsKey(CUSTOM_KEY);
}
示例10: onCreate
import com.crashlytics.android.answers.ContentViewEvent; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
mToolbar.setTitle(R.string.about);
setHomeButtonEnabled(true);
CryptogramApp.getInstance().getFirebaseAnalytics().setCurrentScreen(this, CryptogramApp.CONTENT_ABOUT, null);
Answers.getInstance().logContentView(new ContentViewEvent().putContentName(CryptogramApp.CONTENT_ABOUT));
}
示例11: onCreate
import com.crashlytics.android.answers.ContentViewEvent; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_how_to_play);
mToolbar.setTitle(R.string.how_to_play);
setHomeButtonEnabled(true);
CryptogramApp.getInstance().getFirebaseAnalytics().setCurrentScreen(this, CryptogramApp.CONTENT_HOW_TO_PLAY, null);
Answers.getInstance().logContentView(new ContentViewEvent().putContentName(CryptogramApp.CONTENT_HOW_TO_PLAY));
}
示例12: onCreate
import com.crashlytics.android.answers.ContentViewEvent; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_settings);
mToolbar.setTitle(R.string.settings);
setHomeButtonEnabled(true);
CryptogramApp.getInstance().getFirebaseAnalytics().setCurrentScreen(this, CryptogramApp.CONTENT_SETTINGS, null);
Answers.getInstance().logContentView(new ContentViewEvent().putContentName(CryptogramApp.CONTENT_SETTINGS));
}
示例13: onBookEvent
import com.crashlytics.android.answers.ContentViewEvent; //导入依赖的package包/类
public void onBookEvent(String bookTitle, String bookId) {
onBookEvent = new ContentViewEvent()
.putContentId(bookId)
.putContentType("Book")
.putContentName(bookTitle);
Answers.getInstance().logContentView(onBookEvent);
}
示例14: sendContentView
import com.crashlytics.android.answers.ContentViewEvent; //导入依赖的package包/类
public void sendContentView(final JSONArray data, final CallbackContext context) {
final JSONObject obj = data.optJSONObject(0);
this.cordova.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
ContentViewEvent evt = new ContentViewEvent();
evt.putContentName(obj.optString("name"));
evt.putContentType(obj.optString("type"));
evt.putContentId(obj.optString("id"));
if( obj.has("attributes") ) {
JSONObject json = obj.optJSONObject("attributes");
Iterator<String> keys = json.keys();
while(keys.hasNext()){
String key = keys.next();
try {
evt.putCustomAttribute(key, json.getString(key));
} catch(Exception e) {}
}
}
Answers.getInstance().logContentView(evt);
}
});
}
示例15: appIndexStart
import com.crashlytics.android.answers.ContentViewEvent; //导入依赖的package包/类
private void appIndexStart(@NonNull String routeNo) {
if (TextUtils.isEmpty(routeNo)) return;
FirebaseUserActions.getInstance().start(getIndexApiAction(routeNo))
.addOnCompleteListener(this, task -> {
if (task.isSuccessful()) {
Timber.d("App Indexing: Recorded start successfully");
} else {
Timber.d("App Indexing: fail");
}
});
Answers.getInstance().logContentView(new ContentViewEvent()
.putContentName("search")
.putContentType("route")
.putCustomAttribute("route Nno", routeNo));
}