當前位置: 首頁>>代碼示例>>Java>>正文


Java CollapsingToolbarLayout.setCollapsedTitleTextAppearance方法代碼示例

本文整理匯總了Java中android.support.design.widget.CollapsingToolbarLayout.setCollapsedTitleTextAppearance方法的典型用法代碼示例。如果您正苦於以下問題:Java CollapsingToolbarLayout.setCollapsedTitleTextAppearance方法的具體用法?Java CollapsingToolbarLayout.setCollapsedTitleTextAppearance怎麽用?Java CollapsingToolbarLayout.setCollapsedTitleTextAppearance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.design.widget.CollapsingToolbarLayout的用法示例。


在下文中一共展示了CollapsingToolbarLayout.setCollapsedTitleTextAppearance方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initToolBar

import android.support.design.widget.CollapsingToolbarLayout; //導入方法依賴的package包/類
private void initToolBar() {
    mToolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.collapsing_tool_bar);
    mToolbar = (Toolbar) findViewById(R.id.tool_bar);
    setSupportActionBar(mToolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    mToolbarLayout.setCollapsedTitleTextAppearance(R.style.ToolbarTitileCollapsed);
    mToolbarLayout.setCollapsedTitleTypeface(Typeface.createFromAsset(getAssets(), getString(R.string.DB1FontPath)));

    mBackground = (ImageView) findViewById(R.id.background);

    mCategoryName = (TextView) findViewById(R.id.category_name);
    mCategoryName.setTypeface(Typeface.createFromAsset(getAssets(), getString(R.string.DB1FontPath)));

    mDescription = (TextView) findViewById(R.id.description);
    mDescription.setTypeface(Typeface.createFromAsset(getAssets(), getString(R.string.LFontPath)));
}
 
開發者ID:KnowledgeBegger,項目名稱:MyEyepetizer,代碼行數:17,代碼來源:CategoryDetailActivity.java

示例2: onCreate

import android.support.design.widget.CollapsingToolbarLayout; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_food_detail);

    //Firebase
    database = FirebaseDatabase.getInstance().getInstance();
    foods=database.getReference("Foods");

    //init view
    numberButton = (ElegantNumberButton)findViewById(R.id.number_button);
    btnCart = (FloatingActionButton) findViewById(R.id.btnCart);

    food_description = (TextView)findViewById(R.id.food_description);
    food_name = (TextView) findViewById(R.id.food_name);
    food_price = (TextView) findViewById(R.id.food_price);
    food_image = (ImageView) findViewById(R.id.img_food);

    collapsingToolbarLayout = (CollapsingToolbarLayout)findViewById(R.id.collapsing);
    collapsingToolbarLayout.setExpandedTitleTextAppearance(R.style.ExpandedAppbar);
    collapsingToolbarLayout.setCollapsedTitleTextAppearance(R.style.CollapsedAppbar);

    //Get Food Id from Intent
    if(getIntent()!=null){
        foodId = getIntent().getStringExtra("FoodId");
    }
    if(!foodId.isEmpty()){
        getDetailFood(foodId);
    }
}
 
開發者ID:8155220,項目名稱:eatit,代碼行數:31,代碼來源:FoodDetail.java

示例3: setToolbar

import android.support.design.widget.CollapsingToolbarLayout; //導入方法依賴的package包/類
public void setToolbar() {
    CollapsingToolbarLayout collapsingToolbar = (CollapsingToolbarLayout)findViewById(R.id.collapsing_toolbar);
    collapsingToolbar.setContentScrimColor(ContextCompat.getColor(this, R.color.colorPrimary));
    collapsingToolbar.setTitle(getString(R.string.movie_details));
    collapsingToolbar.setCollapsedTitleTextAppearance(R.style.CollapsedToolbar);
    collapsingToolbar.setExpandedTitleTextAppearance(R.style.ExpandedToolbar);
    collapsingToolbar.setTitleEnabled(true);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
}
 
開發者ID:boyangyuu,項目名稱:ILoveMovie,代碼行數:13,代碼來源:MovieDetailsActivity.java

示例4: onCreateView

import android.support.design.widget.CollapsingToolbarLayout; //導入方法依賴的package包/類
@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        mRootView = inflater.inflate(R.layout.fragment_article_detail, container, false);
//        mDrawInsetsFrameLayout = (FrameLayout)
//                mRootView.findViewById(R.id.draw_insets_frame_layout);
//        mDrawInsetsFrameLayout.setOnInsetsCallback(new DrawInsetsFrameLayout.OnInsetsCallback() {
//            @Override
//            public void onInsetsChanged(Rect insets) {
//                mTopInset = insets.top;
//            }
//        });

        mScrollView = (NestedScrollView) mRootView.findViewById(R.id.scrollview);
//        mScrollView.setCallbacks(new ObservableScrollView.Callbacks() {
//            @Override
//            public void onScrollChanged() {
//                mScrollY = mScrollView.getScrollY();
//                getActivityCast().onUpButtonFloorChanged(mItemId, ArticleDetailFragment.this);
//                mPhotoContainerView.setTranslationY((int) (mScrollY - mScrollY / PARALLAX_FACTOR));
//                updateStatusBar();
//            }
//        });

        mPhotoView = (ImageView) mRootView.findViewById(R.id.photo);
        mPhotoContainerView = mRootView.findViewById(R.id.photo_container);

        collapsingToolbarLayout = (CollapsingToolbarLayout) mRootView.findViewById(R.id.photo_container);

        collapsingToolbarLayout.setCollapsedTitleTextAppearance(R.style.appBarCollapsed);
        collapsingToolbarLayout.setExpandedTitleTextAppearance(R.style.appBarExpanded);

        mStatusBarColorDrawable = new ColorDrawable(0);

        mRootView.findViewById(R.id.share_fab).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(Intent.createChooser(ShareCompat.IntentBuilder.from(getActivity())
                        .setType("text/plain")
                        .setText("Some sample text")
                        .getIntent(), getString(R.string.action_share)));
            }
        });

        bindViews();
        updateStatusBar();
        return mRootView;
    }
 
開發者ID:rashikaranpuria,項目名稱:xyz-reader-2,代碼行數:49,代碼來源:ArticleDetailFragment.java


注:本文中的android.support.design.widget.CollapsingToolbarLayout.setCollapsedTitleTextAppearance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。