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


Java CollapsingToolbarLayout.setContentScrimResource方法代码示例

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


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

示例1: initCollapsingToolbar

import android.support.design.widget.CollapsingToolbarLayout; //导入方法依赖的package包/类
@Override
protected void initCollapsingToolbar(CollapsingToolbarLayout layout) {
    layout.setTitle(getString(R.string.column_one_article));
    layout.setContentScrimResource(R.color.colorPrimary);
    layout.setExpandedTitleTextAppearance(R.style.ToolbarTextAppearance_DoubanDetailExpanded);
    layout.setExpandedTitleColor(getContext().getResources().getColor(R.color.transparent));
}
 
开发者ID:Mindjet,项目名称:LiteReader,代码行数:8,代码来源:OneArticleDetailViewModel.java

示例2: initCollapsingToolbar

import android.support.design.widget.CollapsingToolbarLayout; //导入方法依赖的package包/类
@Override
protected void initCollapsingToolbar(CollapsingToolbarLayout layout) {
    layout.setTitle(title);
    layout.setContentScrimResource(R.color.colorPrimary);
    layout.setExpandedTitleTextAppearance(R.style.ToolbarTextAppearance_DoubanDetailExpanded);
    layout.setExpandedTitleMarginStart((int) getContext().getResources().getDimension(R.dimen.douban_movie_detail_expanded_title_margin_start));
    layout.setExpandedTitleMarginBottom((int) getContext().getResources().getDimension(R.dimen.douban_movie_detail_expanded_title_margin_bottom));
}
 
开发者ID:Mindjet,项目名称:LiteReader,代码行数:9,代码来源:DoubanMovieDetailViewModel.java

示例3: onResponse

import android.support.design.widget.CollapsingToolbarLayout; //导入方法依赖的package包/类
@Override
public void onResponse(String response) {
    // Hide icon
    findViewById(R.id.noNetwork).setVisibility(View.INVISIBLE);

    Document doc = Jsoup.parse(response);

    // If article was loaded from an external App, no image was passed from MainActivity,
    // so it must be fetched in the Collapsing Toolbar
    if (Intent.ACTION_VIEW.equals(getIntent().getAction())) {
        Elements image = doc.select("meta[property=og:image]");
        if (atLeastOneChild(image)) {
            Picasso.with(ArticleActivity.this)
                    .load(image.first().attr("content"))
                    .into((ImageView) findViewById(R.id.imageArticle));
        }
    }

    // Article is from a hosted blog
    List<Model> items;
    Element content = doc.getElementById("content");
    if (content != null) {
        items = extractBlogArticle(content);
        setTagInHeader(R.string.blog_article, R.color.accent_complementary, Color.WHITE);
    } else {
        Elements category = doc.select("div.tt_rubrique_ombrelle");
        if (atLeastOneChild(category)) {
            Log.d(TAG, "Cat: " + category.text());
            setTitle(category.text());
        }
        Elements articles = doc.getElementsByTag("article");
        Element largeFormat = doc.getElementById("hors_format");
        if (largeFormat != null) {
            items = new ArrayList<>();
            setTagInHeader(R.string.large_article, R.color.primary_dark, Color.WHITE);
        } else if (articles.isEmpty()) {
            // Video
            items = extractVideo(doc);
            setTagInHeader(R.string.video_article, R.color.accent_complementary, Color.WHITE);
        } else {
            // Standard article
            items = extractStandardArticle(articles);
            // Full article is restricted to paid members
            if (doc.getElementById("teaser_article") != null) {
                if (menu != null) {
                    MenuItem menuItem = menu.findItem(R.id.action_share);
                    if (menuItem != null) {
                        menuItem.setIcon(getResources().getDrawable(R.drawable.ic_share_black));
                    }
                } else {
                    Log.e(TAG, "menu should not be null at this point!");
                }

                CollapsingToolbarLayout collapsingToolbar = findViewById(R.id.collapsing_toolbar);
                collapsingToolbar.setContentScrimResource(R.color.accent);
                setTagInHeader(R.string.paid_article, R.color.accent, Color.BLACK);

                if (getSupportActionBar() != null) {
                    final Drawable upArrow = getResources().getDrawable(R.drawable.ic_arrow_back_black_24dp);
                    getSupportActionBar().setHomeAsUpIndicator(upArrow);
                }
            }
            // After parsing the article, start a new request for comments
            Element react = doc.getElementById("liste_reactions");
            if (react != null) {
                Elements dataAjURI = react.select("[^data-aj-uri]");
                if (atLeastOneChild(dataAjURI)) {
                    String commentPreviewURI = Constants.BASE_URL2 + dataAjURI.first().attr("data-aj-uri");
                    REQUEST_QUEUE.add(new StringRequest(Request.Method.GET, commentPreviewURI, commentsReceived, errorResponse));
                }
            }
        }
    }
    articleAdapter.insertItems(items);
    findViewById(R.id.articleLoader).setVisibility(View.GONE);
}
 
开发者ID:MBach,项目名称:LeMondeRssReader,代码行数:77,代码来源:ArticleActivity.java

示例4: initCollapsingToolbar

import android.support.design.widget.CollapsingToolbarLayout; //导入方法依赖的package包/类
@Override
protected void initCollapsingToolbar(CollapsingToolbarLayout layout) {
    layout.setTitle(getContext().getResources().getString(R.string.home));
    layout.setContentScrimResource(R.color.colorPrimary);
    layout.setExpandedTitleColor(getContext().getResources().getColor(R.color.transparent));
}
 
开发者ID:Mindjet,项目名称:LiteReader,代码行数:7,代码来源:ZhihuStoryDetailViewModel.java

示例5: initCollapsingToolbar

import android.support.design.widget.CollapsingToolbarLayout; //导入方法依赖的package包/类
@Override
protected void initCollapsingToolbar(CollapsingToolbarLayout layout) {
    layout.setTitle(getString(R.string.column_one_review));
    layout.setContentScrimResource(R.color.colorPrimary);
    layout.setExpandedTitleColor(getContext().getResources().getColor(R.color.transparent));
}
 
开发者ID:Mindjet,项目名称:LiteReader,代码行数:7,代码来源:OneReviewDetailViewModel.java


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