Search in sources :

Example 1 with CollapsingToolbarLayout

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();
}
Also used : CollapsingToolbarLayout(android.support.design.widget.CollapsingToolbarLayout) Intent(android.content.Intent) Toolbar(android.support.v7.widget.Toolbar)

Example 2 with CollapsingToolbarLayout

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();
}
Also used : PrimaryDrawerItem(com.mikepenz.materialdrawer.model.PrimaryDrawerItem) SectionDrawerItem(com.mikepenz.materialdrawer.model.SectionDrawerItem) CollapsingToolbarLayout(android.support.design.widget.CollapsingToolbarLayout) AccountHeaderBuilder(com.mikepenz.materialdrawer.AccountHeaderBuilder) DrawerBuilder(com.mikepenz.materialdrawer.DrawerBuilder) SecondaryDrawerItem(com.mikepenz.materialdrawer.model.SecondaryDrawerItem) Toolbar(android.support.v7.widget.Toolbar)

Example 3 with CollapsingToolbarLayout

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);
        }
    }
}
Also used : Activity(android.app.Activity) CollapsingToolbarLayout(android.support.design.widget.CollapsingToolbarLayout)

Example 4 with CollapsingToolbarLayout

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();
    }
}
Also used : NetworkInfo(android.net.NetworkInfo) ConnectivityManager(android.net.ConnectivityManager) Activity(android.app.Activity) CollapsingToolbarLayout(android.support.design.widget.CollapsingToolbarLayout)

Example 5 with CollapsingToolbarLayout

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();
}
Also used : CollapsingToolbarLayout(android.support.design.widget.CollapsingToolbarLayout) TextView(android.widget.TextView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) Toolbar(android.support.v7.widget.Toolbar)

Aggregations

CollapsingToolbarLayout (android.support.design.widget.CollapsingToolbarLayout)34 Toolbar (android.support.v7.widget.Toolbar)17 View (android.view.View)14 ImageView (android.widget.ImageView)12 TextView (android.widget.TextView)9 Intent (android.content.Intent)8 AppBarLayout (android.support.design.widget.AppBarLayout)8 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)6 Activity (android.app.Activity)5 RecyclerView (android.support.v7.widget.RecyclerView)5 Context (android.content.Context)3 FloatingActionButton (android.support.design.widget.FloatingActionButton)3 TabLayout (android.support.design.widget.TabLayout)3 ViewPager (android.support.v4.view.ViewPager)3 AdapterView (android.widget.AdapterView)3 ListView (android.widget.ListView)3 DialogInterface (android.content.DialogInterface)2 Bitmap (android.graphics.Bitmap)2 Drawable (android.graphics.drawable.Drawable)2 Bundle (android.os.Bundle)2