本文整理匯總了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)));
}
示例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);
}
}
示例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);
}
示例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;
}