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


Java Loader.getId方法代码示例

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


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

示例1: onLoadFinished

import android.support.v4.content.Loader; //导入方法依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
    try {
        if (loader.getId() == R.id.nav_energy_use_day) {
            data.setNotificationUri(getContentResolver(), OhaEnergyUseContract.CONTENT_URI_DAYS);
            this.floatingActionButton.setImageResource(R.drawable.ic_add_alert_white);
        } else if (loader.getId() == R.id.nav_energy_use_bill) {
            data.setNotificationUri(getContentResolver(), CONTENT_URI_BILL);
            this.floatingActionButton.setImageResource(R.drawable.ic_add_white);
        }
        this.ohaMainAdapter.swapCursor(data, loader.getId());
        Animation animation = AnimationUtils.loadAnimation(this, R.anim.fab_button);
        this.floatingActionButton.startAnimation(animation);
    } finally {
        this.swipeRefreshLayout.setRefreshing(false);
    }
}
 
开发者ID:brolam,项目名称:OpenHomeAnalysis,代码行数:18,代码来源:OhaMainActivity.java

示例2: onLoadFinished

import android.support.v4.content.Loader; //导入方法依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
    if (loader.getId() != LOADER_ID) {
        return;
    }

    whatsNewAdapter.setAppsCursor(cursor);

    if (whatsNewAdapter.getItemCount() == 0) {
        emptyState.setVisibility(View.VISIBLE);
        appList.setVisibility(View.GONE);
        explainEmptyStateToUser();
    } else {
        emptyState.setVisibility(View.GONE);
        appList.setVisibility(View.VISIBLE);
    }
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:18,代码来源:WhatsNewViewBinder.java

示例3: onLoadFinished

import android.support.v4.content.Loader; //导入方法依赖的package包/类
/**
 * Implement onLoadFinished(Loader loader, String s) from NetworkLoader.NetworkLoaderCallback
 *
 * @param loader Loader instance
 * @param s      responseString
 */
@Override
public void onLoadFinished(Loader loader, String s) {
    switch (loader.getId()) {
        case MOVIES_LOADER_ID:
            MoviesResult moviesResult = (s == null) ? null : gson.fromJson(s, MoviesResult.class);
            if (moviesResult == null || moviesResult.getResults() == null || moviesResult.getResults().isEmpty()) {
                // If the first request failed then show error message hiding the content
                // Otherwise stop loading further
                if (mPage == START_PAGE) {
                    mContentLoadingUitl.error();
                } else {
                    mAdapter.showLoading(false);
                    mAdapter.notifyDataSetChanged();
                }
            } else {
                // For the first request change visibility of recyclerview
                if (mPage == START_PAGE) {
                    mContentLoadingUitl.success();
                }
                this.mMediaList.addAll(moviesResult.getResults());
                mAdapter.setMediaList(mMediaList);
            }
            break;
    }
}
 
开发者ID:scaffeinate,项目名称:Inflix,代码行数:32,代码来源:MoviesFragment.java

示例4: onLoadFinished

import android.support.v4.content.Loader; //导入方法依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
    super.onLoadFinished(loader, cursor);
    if(loader.getId()==SHOW_LOADER_ID) {
        cursor.moveToFirst();
        TvshowCursorMapper mTvShowMapper = new TvshowCursorMapper();
        mTvShowMapper.bindColumns(cursor);
        Tvshow newShow = (Tvshow) mTvShowMapper.bind(cursor);
        if(needToReload(mShow, newShow)) {
            mShow = newShow;
            getArguments().putSerializable(EXTRA_SHOW_ITEM, mShow); //saving in arguments
            if (mTvShowAsyncTask != null)
                mTvShowAsyncTask.cancel(true);
            mTvShowAsyncTask = new TvShowAsyncTask().executeOnExecutor(mSerialExecutor,getPosterUri(),mShow);
            getActivity().invalidateOptionsMenu();
        }

    }
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:20,代码来源:BrowserWithShowHeader.java

示例5: onLoadFinished

import android.support.v4.content.Loader; //导入方法依赖的package包/类
@Override
public void onLoadFinished(Loader loader, Cursor cursor) {
    if (cursor == null || !cursor.moveToFirst()) {
        HTTPLoaderUtil.with(mContext).tryCall(new HTTPLoaderUtil.HTTPBlock() {
            @Override
            public void run() {
                loadFromNetwork(URIBuilderUtils.buildMovieDetailsURL(String.valueOf(mResourceId)), MOVIE_DETAILS_LOADER_ID);
            }
        }).onNoNetwork(new HTTPLoaderUtil.HTTPBlock() {
            @Override
            public void run() {
                DisplayUtils.setNoNetworkConnectionMessage(mContext, mBinding.textViewErrorMessage);
                mContentLoadingUtil.error();
                mCallbacks.hideFavBtn();
            }
        }).execute();

    } else {
        switch (loader.getId()) {
            case LOCAL_MOVIE_DETAILS_LOADER_ID:
                mMovieDetail = MovieDetail.fromCursor(cursor);
                updateContent();
                break;
        }
    }
}
 
开发者ID:scaffeinate,项目名称:Inflix,代码行数:27,代码来源:MovieDetailsFragment.java

示例6: onLoadFinished

import android.support.v4.content.Loader; //导入方法依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
    if (BuildConfig.LOG_DEBUG) LogUtils.d(TAG, loader, cursor);

    if (mListAdapter == null) {
        if (BuildConfig.LOG_DEBUG) LogUtils.d(TAG, "adapter is null, view is destroyed?");
        return;
    }

    switch (loader.getId()) {
        case Loaders.DRAWER_FILTERS:
            updateFromFiltersCursor(cursor);
            updateAdapter();
            break;

        case Loaders.DRAWER_BOOKS:
            updateFromBooksCursor(cursor);
            updateAdapter();
            break;
    }
}
 
开发者ID:orgzly,项目名称:orgzly-android,代码行数:22,代码来源:DrawerFragment.java

示例7: onLoadFinished

import android.support.v4.content.Loader; //导入方法依赖的package包/类
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
    if (loader.getId() == 1) {
        if (this.mListView.getVisibility() == 8) {
            this.mListView.setVisibility(0);
        }
        if (this.mDownloadAdapter != null) {
            this.mDownloadAdapter.changeCursor(data);
        }
        if (this.myDownloadActivity != null) {
            this.myDownloadActivity.updateStoreSpace();
        }
        checkAdapterEmpty(data);
        if (!(this.mDownloadAdapter == null || !this.mDownloadAdapter.isEmpty() || this.myDownloadActivity == null || this.myDownloadActivity.isFinishing())) {
            this.myDownloadActivity.updateEditViewState();
        }
        int mNewDownloadingNum = this.mDownloadAdapter.getCount();
        if (this.mOldDownloadingNum != mNewDownloadingNum) {
            this.myDownloadActivity.showDownloadingNum(mNewDownloadingNum);
        }
        this.mOldDownloadingNum = mNewDownloadingNum;
        traversalAllDownloading();
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:24,代码来源:MyDownloadingFragment.java

示例8: onLoadFinished

import android.support.v4.content.Loader; //导入方法依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
    switch (loader.getId()) {
        case LOADER_CAN_UPDATE:
            onCanUpdateLoadFinished(cursor);
            break;

        case LOADER_KNOWN_VULN:
            onKnownVulnLoadFinished(cursor);
            break;
    }

    populateItems();
    notifyDataSetChanged();
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:16,代码来源:UpdatesAdapter.java

示例9: onLoadFinished

import android.support.v4.content.Loader; //导入方法依赖的package包/类
@Override
public void onLoadFinished(Loader loader, String s) {
    switch (loader.getId()) {
        case MOVIE_REVIEWS_LOADER_ID:
            MovieReviewsResult movieReviewsResult = (s == null) ? null : gson.fromJson(s, MovieReviewsResult.class);
            List<MovieReview> movieReviewList = (movieReviewsResult == null) ? null : movieReviewsResult.getResults();
            updateReviewsUI(movieReviewList);
            break;
    }
}
 
开发者ID:scaffeinate,项目名称:Inflix,代码行数:11,代码来源:UserReviewsFragment.java

示例10: onLoadFinished

import android.support.v4.content.Loader; //导入方法依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
    if (loader.getId() == channelId) {
        if (data != null && isAdded()) {
            mAdapter.setCursor(data);
            if (emptyListView != null ) {
                emptyListView.setVisibility(data.getCount() == 0 ? View.VISIBLE : View.GONE);
            }
            if (swipeRefreshLayout != null) {
                swipeRefreshLayout.setRefreshing(false);
            }
        }

    }
}
 
开发者ID:graviton57,项目名称:TVGuide,代码行数:16,代码来源:ProgramFragment.java

示例11: onLoadFinished

import android.support.v4.content.Loader; //导入方法依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
    if (loader.getId() == CATEGORIES_LOADER) {
        if (data != null && isAdded()) {
            mAdapter.setCursor(data);
            if (emptyListView != null ) {
                emptyListView.setVisibility(data.getCount() == 0 ? View.VISIBLE : View.GONE);
            }
        }
    }
}
 
开发者ID:graviton57,项目名称:TVGuide,代码行数:12,代码来源:CategoryFragment.java

示例12: onLoadFinished

import android.support.v4.content.Loader; //导入方法依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
    if (loader.getId() == FAVORITE_LOADER) {
        if (data != null && isAdded()) {
            if (emptyListView != null ) {
                emptyListView.setVisibility(data.getCount() == 0 ? View.VISIBLE : View.GONE);
                emptyListView.setText(getString(R.string.empty_favorites_list));
            }
            mAdapter.setCursor(data);
        }
    }
}
 
开发者ID:graviton57,项目名称:TVGuide,代码行数:13,代码来源:FavoriteFragment.java

示例13: onLoadFinished

import android.support.v4.content.Loader; //导入方法依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {


    if(loader.getId() == LOADER_RESULT) {
        Utils.logD(LOG_TAG,"onLoadFinished_LOADER_RESULT");
        Utils.logD(LOG_TAG,data.toString());

        new Thread() {
            @Override
            public void run() {
                bindView(data);

            }
        }.start();
    }
    if(loader.getId() == LOADER_QUICK_SEARCH) {
        Utils.logD(LOG_TAG,"onLoadFinished_LOADER_QUICK_SEARCH");
        new Thread() {
            @Override
            public void run() {
                bindViewQuickSearch(data);

            }
        }.start();

    }
}
 
开发者ID:cahergil,项目名称:Farmacias,代码行数:29,代码来源:FindPresenter.java

示例14: onLoaderReset

import android.support.v4.content.Loader; //导入方法依赖的package包/类
@Override
public void onLoaderReset(Loader<Cursor> cursorLoader) {
    if (BuildConfig.LOG_DEBUG) LogUtils.d(TAG, cursorLoader);

    if (mIsViewCreated) {
        if (cursorLoader.getId() == Loaders.BOOK_FRAGMENT_NOTES) {
            mListAdapter.changeCursor(null);

        } else if (cursorLoader.getId() == Loaders.BOOK_FRAGMENT_BOOK) {
            /* Nothing holds the cursor. */
        }
    }
}
 
开发者ID:orgzly,项目名称:orgzly-android,代码行数:14,代码来源:BookFragment.java

示例15: onLoadFinished

import android.support.v4.content.Loader; //导入方法依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
    switch (loader.getId()) {
        case LOADER_CHEESES:
            mCheeseAdapter.setCheeses(data);
            break;
    }
}
 
开发者ID:googlesamples,项目名称:android-architecture-components,代码行数:9,代码来源:MainActivity.java


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