• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java FlurryAdNativeListener类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中com.flurry.android.ads.FlurryAdNativeListener的典型用法代码示例。如果您正苦于以下问题:Java FlurryAdNativeListener类的具体用法?Java FlurryAdNativeListener怎么用?Java FlurryAdNativeListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

FlurryAdNativeListener类属于com.flurry.android.ads包,在下文中一共展示了FlurryAdNativeListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onFetched

点赞 3

import com.flurry.android.ads.FlurryAdNativeListener; //导入依赖的package包/类
@Override
public void onFetched(FlurryAdNative flurryAdNative) {
    if (isAdUsable(flurryAdNative)) {
        AD_QUEUE.addLast(flurryAdNative);
        mFetchFailCount = 0;
        mFetchSucceedCount += 1;

        /*
         Inform the fetch listener that an ad has been fetched so it can get the
         ad from FlurryNativeAdFetcher#popLoadedAd() whenever it wants.
         */
        if (mFetchListener != null) {
            mFetchListener.onAdFetched();
        }

        for (FlurryAdNativeListener listener : mExternalListeners) {
            listener.onFetched(flurryAdNative);
        }
    } else {
        flurryAdNative.destroy();
    }

    // Replenish immediately
    replenishAdQueue();
}
 

开发者ID:flurry,
项目名称:StreamAds-Android,
代码行数:26,
代码来源:FlurryNativeAdFetcher.java

示例2: onError

点赞 2

import com.flurry.android.ads.FlurryAdNativeListener; //导入依赖的package包/类
@Override
public void onError(FlurryAdNative flurryAdNative, FlurryAdErrorType flurryAdErrorType,
                    int errorCode) {
    if (flurryAdErrorType == FlurryAdErrorType.FETCH) {
        mFetchFailCount++;
        flurryAdNative.destroy();
    }
    // Retry after some delay
    RETRY_FETCH_HANDLER.postDelayed(RETRY_FETCH_RUNNABLE, RETRY_TIME_MILLI);
    for (FlurryAdNativeListener listener : mExternalListeners) {
        listener.onError(flurryAdNative, flurryAdErrorType, errorCode);
    }

    Log.w(TAG, "onError. Error code: " + errorCode);
}
 

开发者ID:flurry,
项目名称:StreamAds-Android,
代码行数:16,
代码来源:FlurryNativeAdFetcher.java

示例3: onShowFullscreen

点赞 2

import com.flurry.android.ads.FlurryAdNativeListener; //导入依赖的package包/类
@Override
public void onShowFullscreen(FlurryAdNative flurryAdNative) {
    for (FlurryAdNativeListener listener : mExternalListeners) {
        listener.onShowFullscreen(flurryAdNative);
    }
}
 

开发者ID:flurry,
项目名称:StreamAds-Android,
代码行数:7,
代码来源:FlurryNativeAdFetcher.java

示例4: onCloseFullscreen

点赞 2

import com.flurry.android.ads.FlurryAdNativeListener; //导入依赖的package包/类
@Override
public void onCloseFullscreen(FlurryAdNative flurryAdNative) {
    for (FlurryAdNativeListener listener : mExternalListeners) {
        listener.onCloseFullscreen(flurryAdNative);
    }
}
 

开发者ID:flurry,
项目名称:StreamAds-Android,
代码行数:7,
代码来源:FlurryNativeAdFetcher.java

示例5: onAppExit

点赞 2

import com.flurry.android.ads.FlurryAdNativeListener; //导入依赖的package包/类
@Override
public void onAppExit(FlurryAdNative flurryAdNative) {
    for (FlurryAdNativeListener listener : mExternalListeners) {
        listener.onAppExit(flurryAdNative);
    }
}
 

开发者ID:flurry,
项目名称:StreamAds-Android,
代码行数:7,
代码来源:FlurryNativeAdFetcher.java

示例6: onClicked

点赞 2

import com.flurry.android.ads.FlurryAdNativeListener; //导入依赖的package包/类
@Override
public void onClicked(FlurryAdNative flurryAdNative) {
    for (FlurryAdNativeListener listener : mExternalListeners) {
        listener.onClicked(flurryAdNative);
    }
}
 

开发者ID:flurry,
项目名称:StreamAds-Android,
代码行数:7,
代码来源:FlurryNativeAdFetcher.java

示例7: onImpressionLogged

点赞 2

import com.flurry.android.ads.FlurryAdNativeListener; //导入依赖的package包/类
@Override
public void onImpressionLogged(FlurryAdNative flurryAdNative) {
    for (FlurryAdNativeListener listener : mExternalListeners) {
        listener.onImpressionLogged(flurryAdNative);
    }
}
 

开发者ID:flurry,
项目名称:StreamAds-Android,
代码行数:7,
代码来源:FlurryNativeAdFetcher.java

示例8: onCollapsed

点赞 2

import com.flurry.android.ads.FlurryAdNativeListener; //导入依赖的package包/类
@Override
public void onCollapsed(FlurryAdNative flurryAdNative) {
    for (FlurryAdNativeListener listener : mExternalListeners) {
        listener.onCollapsed(flurryAdNative);
    }
}
 

开发者ID:flurry,
项目名称:StreamAds-Android,
代码行数:7,
代码来源:FlurryNativeAdFetcher.java

示例9: onExpanded

点赞 2

import com.flurry.android.ads.FlurryAdNativeListener; //导入依赖的package包/类
@Override
public void onExpanded(FlurryAdNative flurryAdNative) {
    for (FlurryAdNativeListener listener : mExternalListeners) {
        listener.onExpanded(flurryAdNative);
    }
}
 

开发者ID:flurry,
项目名称:StreamAds-Android,
代码行数:7,
代码来源:FlurryNativeAdFetcher.java

示例10: onActivityCreated

点赞 2

import com.flurry.android.ads.FlurryAdNativeListener; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    Integer data[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
    BaseAdapter dataAdapter = new ArrayAdapter<>(getActivity(), R.layout.list_item_sample,
            R.id.sample_data_text, data);
    NativeAdViewBinder.ViewBinderBuilder viewBinderBuilder = new NativeAdViewBinder.ViewBinderBuilder();

    NativeAdViewBinder viewBinder = viewBinderBuilder.setAdLayoutId(R.layout.list_item_ad)
            .setHeadlineTextId(R.id.ad_headline)
            .setDescriptionTextId(R.id.ad_description)
            .setSourceTextId(R.id.ad_source)
            .setBrandingLogoImageId(R.id.sponsored_image)
            .setAppStarRatingImageId(R.id.app_rating_image)
            .setAdImageId(R.id.ad_image)
            .setCallToActionViewId(R.id.ad_cta_btn)
            .setAdCollapseViewId(R.id.ad_collapse_btn)
            .build();

    FlurryAdNativeListener adStateListener = new StubFlurryAdNativeListener() {
        @Override
        public void onError(FlurryAdNative flurryAdNative,
                            FlurryAdErrorType flurryAdErrorType, int errorCode) {
            Log.e(TAG, "Ad could not load. Error code: " + errorCode);
        }
    };

    FlurryAdListAdapter adListAdapter = FlurryAdListAdapter
            .from(getActivity(), dataAdapter,  viewBinder, AD_SPACE)
            .setAdPositioner(new LinearIntervalAdPositioner(3, 4))
            .setFlurryAdNativeListener(adStateListener)
            .setAutoDestroy(false)
            .setExpandableAdMode(NativeAdAdapter.EXPANDABLE_AD_MODE_COLLAPSED)
            .build();

    adListAdapter.addAdRenderListener(this);
    adListAdapter.setRetryFailedAdPositions(false);

    setListAdapter(adListAdapter);

    ((FlurryAdListAdapter)getListAdapter()).refreshAds();
}
 

开发者ID:flurry,
项目名称:StreamAds-Android,
代码行数:44,
代码来源:SampleListFragment.java

示例11: onActivityCreated

点赞 2

import com.flurry.android.ads.FlurryAdNativeListener; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    int data[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
    SimpleArrayAdapter adapter = new SimpleArrayAdapter(data);

    NativeAdViewBinder.ViewBinderBuilder viewBinderBuilder = new NativeAdViewBinder.ViewBinderBuilder();

    NativeAdViewBinder viewBinder = viewBinderBuilder.setAdLayoutId(R.layout.list_item_ad)
            .setHeadlineTextId(R.id.ad_headline)
            .setDescriptionTextId(R.id.ad_description)
            .setSourceTextId(R.id.ad_source)
            .setBrandingLogoImageId(R.id.sponsored_image)
            .setAppStarRatingImageId(R.id.app_rating_image)
            .setAdImageId(R.id.ad_image)
            .build();

    FlurryAdTargeting flurryAdTargeting = new FlurryAdTargeting();
    flurryAdTargeting.setEnableTestAds(true);

    FlurryAdNativeListener adStateListener = new StubFlurryAdNativeListener() {
        @Override
        public void onError(FlurryAdNative flurryAdNative,
                            FlurryAdErrorType flurryAdErrorType, int errorCode) {
            Log.e(TAG, "Ad could not load. Error code: " + errorCode);
        }
    };

    FlurryAdRecyclerAdapter adsAdapter = FlurryAdRecyclerAdapter.from(getActivity(), adapter,
            viewBinder, AD_SPACE)
            .setAdPositioner(new LinearIntervalAdPositioner(3, 4))
            .setTargeting(flurryAdTargeting)
            .setFlurryAdNativeListener(adStateListener)
            .setAutoDestroy(false)
            .build();

    mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity(),
            LinearLayoutManager.VERTICAL, false));
    mRecyclerView.setAdapter(adsAdapter);
}
 

开发者ID:flurry,
项目名称:StreamAds-Android,
代码行数:42,
代码来源:SampleRecyclerFragment.java

示例12: addFlurryAdNativeListener

点赞 1

import com.flurry.android.ads.FlurryAdNativeListener; //导入依赖的package包/类
/**
 * Adds a new {@link FlurryAdNativeListener} to be notified of native ad state events.
 *
 * @param flurryAdNativeListener the listener to add
 */
void addFlurryAdNativeListener(FlurryAdNativeListener flurryAdNativeListener) {
    mNativeAdFetcher.addFlurryAdNativeListener(flurryAdNativeListener);
}
 

开发者ID:flurry,
项目名称:StreamAds-Android,
代码行数:9,
代码来源:FlurryBaseAdAdapter.java

示例13: addFlurryAdNativeListener

点赞 1

import com.flurry.android.ads.FlurryAdNativeListener; //导入依赖的package包/类
/**
 * <p>Adds a FlurryAdNativeListener that can be notified during the entire life-cycle of a
 * {@link FlurryAdNative}.</p>
 *
 * <p>If you care about just the fact that a new ad has been fetched, use
 * {@link FlurryNativeAdFetcher#setFetchListener(FetchListener)}, in collaboration with
 * {@link FlurryNativeAdFetcher#popLoadedAd()} instead.</p>
 * @param adNativeListener the listener to be notified during all life-cycle events of a
 *                         {@link FlurryAdNative}
 */
void addFlurryAdNativeListener(@NonNull FlurryAdNativeListener adNativeListener) {
    mExternalListeners.add(adNativeListener);
}
 

开发者ID:flurry,
项目名称:StreamAds-Android,
代码行数:14,
代码来源:FlurryNativeAdFetcher.java

示例14: setFlurryAdNativeListener

点赞 1

import com.flurry.android.ads.FlurryAdNativeListener; //导入依赖的package包/类
/**
 * <p>Sets an optional {@link FlurryAdNativeListener} if you also want to listen for ad events
 * for analytics or tracking purposes. Note that setting this listener will <b>not</b>
 * notify you about changes in the ads shown in {@link FlurryAdRecyclerAdapter}.</p>
 *
 * <p>If you are just interested in getting notifications for changes in ads shown in
 * {@link FlurryAdRecyclerAdapter}, use {@link FlurryAdRecyclerAdapter#addAdRenderListener(
 *NativeAdRenderListener)} instead.</p>
 *
 * @param listener the listener to set
 * @return a {@link FlurryAdRecyclerAdapter.Builder} instance
 *
 * @see StubFlurryAdNativeListener
 * @see FlurryAdRecyclerAdapter#addAdRenderListener(NativeAdRenderListener)
 */
public Builder setFlurryAdNativeListener(@NonNull FlurryAdNativeListener listener) {
    mFlurryRecyclerAdapter.mBaseAdAdapter.addFlurryAdNativeListener(listener);
    return this;
}
 

开发者ID:flurry,
项目名称:StreamAds-Android,
代码行数:20,
代码来源:FlurryAdRecyclerAdapter.java

示例15: setFlurryAdNativeListener

点赞 1

import com.flurry.android.ads.FlurryAdNativeListener; //导入依赖的package包/类
/**
 * <p>Sets an optional {@link FlurryAdNativeListener} if you also want to listen for ad events
 * for analytics or tracking purposes. Note that setting this listener will <b>not</b>
 * notify you about changes in the ads shown in {@link FlurryAdListAdapter}.</p>
 *
 * <p>If you are just interested in getting notifications for changes in ads shown in
 * {@link FlurryAdListAdapter}, use {@link FlurryAdListAdapter#addAdRenderListener(
 *NativeAdRenderListener)} instead.</p>
 *
 * @param listener the listener to set
 * @return a {@link FlurryAdListAdapter.Builder} instance
 *
 * @see StubFlurryAdNativeListener
 * @see FlurryAdListAdapter#addAdRenderListener(NativeAdRenderListener)
 */
public Builder setFlurryAdNativeListener(@NonNull FlurryAdNativeListener listener) {
    mFlurryAdapter.mBaseAdAdapter.addFlurryAdNativeListener(listener);
    return this;
}
 

开发者ID:flurry,
项目名称:StreamAds-Android,
代码行数:20,
代码来源:FlurryAdListAdapter.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)