当前位置: 首页>>代码示例>>Java>>正文


Java IDownloaderClient.STATE_PAUSED_WIFI_DISABLED_NEED_CELLULAR_PERMISSION属性代码示例

本文整理汇总了Java中com.google.android.vending.expansion.downloader.IDownloaderClient.STATE_PAUSED_WIFI_DISABLED_NEED_CELLULAR_PERMISSION属性的典型用法代码示例。如果您正苦于以下问题:Java IDownloaderClient.STATE_PAUSED_WIFI_DISABLED_NEED_CELLULAR_PERMISSION属性的具体用法?Java IDownloaderClient.STATE_PAUSED_WIFI_DISABLED_NEED_CELLULAR_PERMISSION怎么用?Java IDownloaderClient.STATE_PAUSED_WIFI_DISABLED_NEED_CELLULAR_PERMISSION使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.google.android.vending.expansion.downloader.IDownloaderClient的用法示例。


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

示例1: onDownloadStateChanged

@Override
public void onDownloadStateChanged(int newState) {
    Log.i("APKExpansionDownloader", "DownloadStateChanged: " + newState);
    switch (newState) {
    // Download success
    case IDownloaderClient.STATE_COMPLETED:
        mDownloadProgressDlg.success();
        break;
    // Download failure
    case IDownloaderClient.STATE_FAILED_CANCELED:
    case IDownloaderClient.STATE_FAILED_FETCHING_URL:
    case IDownloaderClient.STATE_FAILED_UNLICENSED:
    case IDownloaderClient.STATE_FAILED:
        mDownloadProgressDlg.failed();
        break;
    // Download paused
    case IDownloaderClient.STATE_PAUSED_NEED_CELLULAR_PERMISSION:
    case IDownloaderClient.STATE_PAUSED_WIFI_DISABLED_NEED_CELLULAR_PERMISSION:
    case IDownloaderClient.STATE_PAUSED_BY_REQUEST:
    case IDownloaderClient.STATE_PAUSED_ROAMING:
    case IDownloaderClient.STATE_PAUSED_SDCARD_UNAVAILABLE:
        mDownloadProgressDlg.paused();
        break;
    // Download resume (do nothing)
    case IDownloaderClient.STATE_IDLE:
    case IDownloaderClient.STATE_CONNECTING:
    case IDownloaderClient.STATE_FETCHING_URL:
    case IDownloaderClient.STATE_DOWNLOADING:
        break;
    // unknown state (do nothing)
    default:
        break;
    }
}
 
开发者ID:cclink,项目名称:ObbDownloadHelper,代码行数:34,代码来源:ObbDownloadHelper.java

示例2: onDownloadStateChanged

/**
 * The download state should trigger changes in the UI --- it may be useful
 * to show the state as being indeterminate at times. This sample can be
 * considered a guideline.
 */
@Override
public void onDownloadStateChanged(int newState) {
    setState(newState);
    boolean showDashboard = true;
    boolean showCellMessage = false;
    boolean paused;
    boolean indeterminate;
    switch (newState) {
        case IDownloaderClient.STATE_IDLE:
            // STATE_IDLE means the service is listening, so it's
            // safe to start making calls via mRemoteService.
            paused = false;
            indeterminate = true;
            break;
        case IDownloaderClient.STATE_CONNECTING:
        case IDownloaderClient.STATE_FETCHING_URL:
            showDashboard = true;
            paused = false;
            indeterminate = true;
            break;
        case IDownloaderClient.STATE_DOWNLOADING:
            paused = false;
            showDashboard = true;
            indeterminate = false;
            break;

        case IDownloaderClient.STATE_FAILED_CANCELED:
        case IDownloaderClient.STATE_FAILED:
        case IDownloaderClient.STATE_FAILED_FETCHING_URL:
        case IDownloaderClient.STATE_FAILED_UNLICENSED:
            paused = true;
            showDashboard = false;
            indeterminate = false;
            break;
        case IDownloaderClient.STATE_PAUSED_NEED_CELLULAR_PERMISSION:
        case IDownloaderClient.STATE_PAUSED_WIFI_DISABLED_NEED_CELLULAR_PERMISSION:
            showDashboard = false;
            paused = true;
            indeterminate = false;
            showCellMessage = true;
            break;

        case IDownloaderClient.STATE_PAUSED_BY_REQUEST:
            paused = true;
            indeterminate = false;
            break;
        case IDownloaderClient.STATE_PAUSED_ROAMING:
        case IDownloaderClient.STATE_PAUSED_SDCARD_UNAVAILABLE:
            paused = true;
            indeterminate = false;
            break;
        case IDownloaderClient.STATE_COMPLETED:
            showDashboard = false;
            paused = false;
            indeterminate = false;
            validateXAPKZipFiles();
            return;
        default:
            paused = true;
            indeterminate = true;
            showDashboard = true;
    }
    int newDashboardVisibility = showDashboard ? View.VISIBLE : View.GONE;
    if (mDashboard.getVisibility() != newDashboardVisibility) {
        mDashboard.setVisibility(newDashboardVisibility);
    }
    int cellMessageVisibility = showCellMessage ? View.VISIBLE : View.GONE;
    if (mCellMessage.getVisibility() != cellMessageVisibility) {
        mCellMessage.setVisibility(cellMessageVisibility);
    }

    mPB.setIndeterminate(indeterminate);
    setButtonPausedState(paused);
}
 
开发者ID:FallingUpGame,项目名称:FallingUp,代码行数:79,代码来源:DownloaderActivity.java

示例3: onDownloadStateChanged

@Override
public void onDownloadStateChanged(int newState) {
       setState(newState);
       boolean showDashboard = true;
       boolean showCellMessage = false;
       boolean paused;
       boolean indeterminate;
       switch (newState) {
           case IDownloaderClient.STATE_IDLE:
               // STATE_IDLE means the service is listening, so it's
               // safe to start making calls via mRemoteService.
               paused = false;
               indeterminate = true;
               break;
           case IDownloaderClient.STATE_CONNECTING:
           case IDownloaderClient.STATE_FETCHING_URL:
               showDashboard = true;
               paused = false;
               indeterminate = true;
               break;
           case IDownloaderClient.STATE_DOWNLOADING:
               paused = false;
               showDashboard = true;
               indeterminate = false;
               break;

           case IDownloaderClient.STATE_FAILED_CANCELED:
           case IDownloaderClient.STATE_FAILED:
           case IDownloaderClient.STATE_FAILED_FETCHING_URL:
           case IDownloaderClient.STATE_FAILED_UNLICENSED:
               paused = true;
               showDashboard = false;
               indeterminate = false;
               break;
           case IDownloaderClient.STATE_PAUSED_NEED_CELLULAR_PERMISSION:
           case IDownloaderClient.STATE_PAUSED_WIFI_DISABLED_NEED_CELLULAR_PERMISSION:
               showDashboard = false;
               paused = true;
               indeterminate = false;
               showCellMessage = true;
               break;

           case IDownloaderClient.STATE_PAUSED_BY_REQUEST:
               paused = true;
               indeterminate = false;
               break;
           case IDownloaderClient.STATE_PAUSED_ROAMING:
           case IDownloaderClient.STATE_PAUSED_SDCARD_UNAVAILABLE:
               paused = true;
               indeterminate = false;
               break;
           case IDownloaderClient.STATE_COMPLETED:
               showDashboard = false;
               paused = false;
               indeterminate = false;
               validateXAPKZipFiles();
               return;
           default:
               paused = true;
               indeterminate = true;
               showDashboard = true;
       }
       int newDashboardVisibility = showDashboard ? View.VISIBLE : View.GONE;
       if (mDashboard.getVisibility() != newDashboardVisibility) {
           mDashboard.setVisibility(newDashboardVisibility);
       }
       int cellMessageVisibility = showCellMessage ? View.VISIBLE : View.GONE;
       if (mCellMessage.getVisibility() != cellMessageVisibility) {
           mCellMessage.setVisibility(cellMessageVisibility);
       }

       mPB.setIndeterminate(indeterminate);
       setButtonPausedState(paused);
}
 
开发者ID:museumsvictoria,项目名称:mv-fieldguide-android,代码行数:74,代码来源:SplashActivity.java


注:本文中的com.google.android.vending.expansion.downloader.IDownloaderClient.STATE_PAUSED_WIFI_DISABLED_NEED_CELLULAR_PERMISSION属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。