本文整理匯總了Java中android.support.design.widget.CollapsingToolbarLayout.setExpandedTitleColor方法的典型用法代碼示例。如果您正苦於以下問題:Java CollapsingToolbarLayout.setExpandedTitleColor方法的具體用法?Java CollapsingToolbarLayout.setExpandedTitleColor怎麽用?Java CollapsingToolbarLayout.setExpandedTitleColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.design.widget.CollapsingToolbarLayout
的用法示例。
在下文中一共展示了CollapsingToolbarLayout.setExpandedTitleColor方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initView
import android.support.design.widget.CollapsingToolbarLayout; //導入方法依賴的package包/類
@Override
public void initView(Bundle savedInstanceState, View view) {
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
View fakeStatusBar = findViewById(R.id.fake_status_bar);
CollapsingToolbarLayout ctl = (CollapsingToolbarLayout) findViewById(R.id.ctl);
ctl.setExpandedTitleColor(Color.parseColor("#00FFFFFF"));
setSupportActionBar(toolbar);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this,
rootLayout,
toolbar,
R.string.navigation_drawer_open,
R.string.navigation_drawer_close);
rootLayout.addDrawerListener(toggle);
toggle.syncState();
BarUtils.setStatusBarAlpha4Drawer(this, rootLayout, fakeStatusBar, 0, false);
BarUtils.addMarginTopEqualStatusBarHeight(toolbar);
}
示例2: onCreate
import android.support.design.widget.CollapsingToolbarLayout; //導入方法依賴的package包/類
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
typeface=Typeface.createFromAsset(getAssets(),"canaro_extra_bold.otf");
setContentView(R.layout.activity_event_item);
LogSaver.appendLog(TAG);
collapsingToolbarLayout= (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
collapsingToolbarLayout.setExpandedTitleTypeface(typeface);
collapsingToolbarLayout.setExpandedTitleColor(Color.parseColor("#FFFFFF"));
iv_bg=(ImageView) findViewById(R.id.event_bg);
Picasso.with(this).load(Config.EVENT_BG).placeholder(R.drawable.backsplash).into(iv_bg);
toolbar=(Toolbar) findViewById(R.id.toolbar_event);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
tabLayout= (TabLayout) findViewById(R.id.tabs);
viewPager= (ViewPager) findViewById(R.id.viewpager_event);
setupViewPager(viewPager);
tabLayout.setupWithViewPager(viewPager);
}
示例3: showCountryDetail
import android.support.design.widget.CollapsingToolbarLayout; //導入方法依賴的package包/類
@SuppressWarnings("deprecation")
private void showCountryDetail(@NonNull Country country) {
CollapsingToolbarLayout toolbarLayout =
(CollapsingToolbarLayout) findViewById(R.id.toolbar_layout);
toolbarLayout.setTitle(country.getCountryName());
toolbarLayout.setExpandedTitleColor(ContextCompat.getColor(this, android.R.color.white));
if (getSupportActionBar() != null) {
getSupportActionBar().setTitle(country.getCountryName());
}
if (imageView != null ) {
String flagUri = BuildConfig.GEONAME_ICON_URL +"x/" +
country.getCountryCode().toLowerCase() + ".gif";
imageView.setImageURI(Uri.parse(flagUri));
}
tvCapital.setText(getString(R.string.format_country_capital,country.getCapital()));
tvContinent.setText(getString(R.string.format_country_continent,country.getContinentName()));
tvCode.setText(getString(R.string.format_country_code,country.getCountryCode()));
tvArea.setText(Html.fromHtml(getString(R.string.format_country_area,country.getAreaInSqKm())));
tvPopulation.setText(getString(R.string.format_country_population,country.getPopulation()));
tvSouth.setText(getString(R.string.format_country_south,country.getSouth()));
tvEast.setText(getString(R.string.format_country_east,country.getEast()));
tvNorth.setText(getString(R.string.format_country_north,country.getNorth()));
tvWest.setText(getString(R.string.format_country_west,country.getWest()));
}
示例4: setupCollapsingImage
import android.support.design.widget.CollapsingToolbarLayout; //導入方法依賴的package包/類
private void setupCollapsingImage() {
appBarLayout = (AppBarLayout) findViewById(R.id.app_bar_layout);
//Fade out CollapsingToolbarLayout title ...from white to transparent
collapsingToolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
Typeface type = Typeface.createFromAsset(getAssets(), "fonts/open_sans/OpenSans-Light.ttf");
collapsingToolbarLayout.setExpandedTitleTypeface(type);//fonts
collapsingToolbarLayout.setCollapsedTitleTypeface(type);
collapsingToolbarLayout.setTitle(getString(R.string.pod));
collapsingToolbarLayout.setExpandedTitleColor(getResources().getColor(R.color.white_opacity));
collapsingToolbarLayout.setCollapsedTitleTextColor(getResources().getColor(R.color.white_opacity_king));
//Set Picture of the day to collapsing ImageView
collapsingImageView = (ImageView) findViewById(R.id.collapsing_ImageView);
pictureOfTheDayList = storage.retrieveRSS_Feed(MediaType.PICTURE);
if (pictureOfTheDayList != null &&
pictureOfTheDayList.size() > 0 &&
pictureOfTheDayList.get(0) != null &&
pictureOfTheDayList.get(0).getMediaLink() != null)
Glide.with(this)
.load(pictureOfTheDayList.get(0).getMediaLink())
.centerCrop()
.into(collapsingImageView);
}
示例5: 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));
}
示例6: onCreate
import android.support.design.widget.CollapsingToolbarLayout; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_profile);
//prevent keybaord from popping up
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
editMode = getIntent().getBooleanExtra(getString(R.string.pref_key_edit_mode),false);
rootLayout = findViewById(R.id.profile_root_layout);
toolbar = findViewById(R.id.toolbar);
profileImage = findViewById(R.id.profile_pic_fab);
nameText = findViewById(R.id.full_name_text);
sexText = findViewById(R.id.sex_text);
svvText = findViewById(R.id.svv_email_text);
emailText = findViewById(R.id.personal_email_text);
phoneText = findViewById(R.id.phone_number_text);
saveProfileBtn = findViewById(R.id.profile_save_btn);
Glide.with(this)
.load(getResources().getDrawable(R.drawable.bg_csi_poster))
.into((ImageView)findViewById(R.id.coverImageView));
CollapsingToolbarLayout collapsingToolbar = findViewById(R.id.profile_collapsing_toolbar);
collapsingToolbar.setExpandedTitleColor(getResources().getColor(R.color.fui_transparent));
setSupportActionBar(toolbar);
final Drawable uparrow = getResources().getDrawable(R.drawable.ic_arrow_back_white_24dp);
getSupportActionBar().setHomeAsUpIndicator(uparrow);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
}
示例7: 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));
}
示例8: 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));
}
示例9: onCreate
import android.support.design.widget.CollapsingToolbarLayout; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//DemoApplication.setMainActivity(this);
imageUrl = setImageUrl(); //獲取圖片url
toolbar = (Toolbar) findViewById(R.id.toolbar);
collapsingToolbar = (CollapsingToolbarLayout) findViewById(R.id.main_collapsingToolbar);
collapsingToolbar.setExpandedTitleColor(ContextCompat.getColor(MainActivity.this,R.color.colorAccent)); //設置toolbar背景色
setSupportActionBar(toolbar); //設置ActionBar
mDrawerLayout = (DrawerLayout) findViewById(R.id.dl_menu);
nvMenu = (NavigationView) findViewById(R.id.nv_menu);
nvHeardImage = (ImageView) nvMenu.getHeaderView(0).findViewById(R.id.nv_heard_image);
nvMenu.setNavigationItemSelectedListener(this);
swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_refresh);
swipeRefreshLayout.setColorSchemeResources(R.color.colorAccent);
appBarLayout = (AppBarLayout) findViewById(R.id.app_bar);
appBarLayout.addOnOffsetChangedListener(this);
animationPageCardview = (CardView) findViewById(R.id.animation_pageCard);
comicPageCardview = (CardView) findViewById(R.id.comic_pageCard);
mainactivityToolbarImageview = (ImageView) findViewById(R.id.animation_toobarImage);
setToolbarImage(); //設置ToolBarImage
setAnimationTitle(); //設置Title
setNvHeardImage(); //設置NavigationView的heard圖片
setToolBarNavigation();
animationFragment = new AnimationFragment(); //設置AnimationFragment
comicFragment = new ComicFragment(); //設置comicFragment
animationPageSet(animationFragment); //初始化為animationFragment
isInternetOk(); //判斷網絡是否打開
setPayAuthor();
animationPageCardview.setOnClickListener(this);
comicPageCardview.setOnClickListener(this);
swipeRefreshLayout.setOnRefreshListener(this);
floatingActionButton = (FloatingActionButton) findViewById(R.id.animation_search);
floatingActionButton.setOnClickListener(this);
}