use of android.support.design.widget.CollapsingToolbarLayout in project cheesesquare by chrisbanes.
the class CheeseDetailActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail);
Intent intent = getIntent();
final String cheeseName = intent.getStringExtra(EXTRA_NAME);
final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
CollapsingToolbarLayout collapsingToolbar = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
collapsingToolbar.setTitle(cheeseName);
loadBackdrop();
}
use of android.support.design.widget.CollapsingToolbarLayout in project MaterialDrawer by mikepenz.
the class CollapsingToolbarActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sample_collapsing_toolbar);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
CollapsingToolbarLayout collapsingToolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
collapsingToolbarLayout.setTitle(getString(R.string.drawer_item_collapsing_toolbar_drawer));
headerResult = new AccountHeaderBuilder().withActivity(this).withCompactStyle(false).withHeaderBackground(R.drawable.header).withSavedInstance(savedInstanceState).build();
result = new DrawerBuilder().withActivity(this).withAccountHeader(headerResult).withToolbar(toolbar).withFullscreen(true).addDrawerItems(new PrimaryDrawerItem().withName(R.string.drawer_item_home).withIcon(FontAwesome.Icon.faw_home).withIdentifier(1), new PrimaryDrawerItem().withName(R.string.drawer_item_free_play).withIcon(FontAwesome.Icon.faw_gamepad), new PrimaryDrawerItem().withName(R.string.drawer_item_custom).withIcon(FontAwesome.Icon.faw_eye), new SectionDrawerItem().withName(R.string.drawer_item_section_header), new SecondaryDrawerItem().withName(R.string.drawer_item_settings).withIcon(FontAwesome.Icon.faw_cog), new SecondaryDrawerItem().withName(R.string.drawer_item_help).withIcon(FontAwesome.Icon.faw_question).withEnabled(false), new SecondaryDrawerItem().withName(R.string.drawer_item_open_source).withIcon(FontAwesome.Icon.faw_github), new SecondaryDrawerItem().withName(R.string.drawer_item_contact).withIcon(FontAwesome.Icon.faw_bullhorn)).withSavedInstance(savedInstanceState).build();
fillFab();
loadBackdrop();
}
use of android.support.design.widget.CollapsingToolbarLayout in project Synthese_2BIN by TheYoungSensei.
the class ItemDetailFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments().containsKey(ARG_ITEM_ID)) {
// Load the dummy content specified by the fragment
// arguments. In a real-world scenario, use a Loader
// to load content from a content provider.
mItem = ArtistContent.ITEM_MAP.get(getArguments().getString(ARG_ITEM_ID));
Activity activity = this.getActivity();
CollapsingToolbarLayout appBarLayout = (CollapsingToolbarLayout) activity.findViewById(R.id.toolbar_layout);
if (appBarLayout != null) {
appBarLayout.setTitle(mItem.content);
}
}
}
use of android.support.design.widget.CollapsingToolbarLayout in project Synthese_2BIN by TheYoungSensei.
the class BusinessDayDetailFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments().containsKey(ARG_ITEM_ID)) {
// Load the dummy content specified by the fragment
// arguments. In a real-world scenario, use a Loader
// to load content from a content provider.
mItem = DetailsContent.ITEM_MAP.get(getArguments().getString(ARG_ITEM_ID));
Activity activity = this.getActivity();
CollapsingToolbarLayout appBarLayout = (CollapsingToolbarLayout) activity.findViewById(R.id.toolbar_layout);
if (appBarLayout != null) {
appBarLayout.setTitle(mItem.content);
}
}
this.model = ((Builder) this.getContext().getApplicationContext()).getModel();
model.registerCompaniesObserver(this);
ConnectivityManager connMgr = (ConnectivityManager) this.getContext().getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
ShowMyCompaniesTask task = new ShowMyCompaniesTask();
if (networkInfo != null && networkInfo.isConnected()) {
task.execute();
}
}
use of android.support.design.widget.CollapsingToolbarLayout in project xabber-android by redsolution.
the class AboutViewer method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.about_viewer);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_default);
toolbar.setNavigationIcon(R.drawable.ic_arrow_left_white_24dp);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
NavUtils.navigateUpFromSameTask(AboutViewer.this);
}
});
findViewById(R.id.about_github).setOnClickListener(this);
findViewById(R.id.about_twitter).setOnClickListener(this);
findViewById(R.id.about_redsolution).setOnClickListener(this);
findViewById(R.id.about_text_xmpp_protocol).setOnClickListener(this);
((TextView) findViewById(R.id.about_text_developers)).setMovementMethod(LinkMovementMethod.getInstance());
((TextView) findViewById(R.id.about_text_translators)).setMovementMethod(LinkMovementMethod.getInstance());
((TextView) findViewById(R.id.about_text_license)).setMovementMethod(LinkMovementMethod.getInstance());
CollapsingToolbarLayout collapsingToolbar = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
collapsingToolbar.setTitle(getString(R.string.application_title_short));
((TextView) findViewById(R.id.about_version)).setText(getVersionName());
loadBackdrop();
}
Aggregations