Android library providing bread crumbs to the support library fragments.

Overview

Hansel And Gretel

Android library providing bread crumbs for compatibility fragments.

Usage

For a working implementation of this project see the sample/ folder.

  1. Include the widget in your view. This should usually be placed directly above the container in which the associated fragments will be displayed.

    <android.support.v4.app.FragmentBreadCrumbs
        android:id="@+id/breadcrumbs"
        android:layout_width="fill_parent"
        android:layout_height="40dp" />
    
  2. In your onCreate method, bind the widget to the activity.

    FragmentBreadCrumbs crumbs = (FragmentBreadCrumbs)findViewById(R.id.breadcrumbs);
    crumbs.setActivity(this);
    
  3. Add the required style attributes to your theme.

    <item name="hagDividerVertical">@drawable/hag__divider_dark</item>
    <item name="hagSelectableItemBackground">@drawable/hag__background_dark</item>
    

    or

    <item name="hagDividerVertical">@drawable/hag__divider_dark</item>
    <item name="hagSelectableItemBackground">@drawable/hag__background_dark</item>
    

    or specify your own drawables for the divider and background.

  4. (Optional) Set the title of the initial view. This can be useful when the initial activity view has a default fragment.

    //continued from above
    crumbs.setTitle("Settings", null);
    

Including In Your Project

The HanselAndGretel library is presented as an Android library project. A standalone JAR is not possible due to the theming capabilities offered by the widget.

You can include this project by [referencing it as a library project1 in Eclipse or ant.

If you are a Maven user you can easily include the library by specifying it as a dependency:

<dependency>
  <groupId>com.jakewharton</groupId>
  <artifactId>hanselandgretel</artifactId>
  <version>1.0.2</version>
  <type>apklib</type>
</dependency>

This project depends on the Fragment classes which are available in the Android Support Library.

Developed By

License

Copyright 2012 Jake Wharton

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You might also like...
TourGuide is an Android library that aims to provide an easy way to add pointers with animations over a desired Android View

TourGuide TourGuide is an Android library. It lets you add pointer, overlay and tooltip easily, guiding users on how to use your app. Refer to the exa

Bubbles for Android is an Android library to provide chat heads capabilities on your apps. With a fast way to integrate with your development.
Bubbles for Android is an Android library to provide chat heads capabilities on your apps. With a fast way to integrate with your development.

Bubbles for Android Bubbles for Android is an Android library to provide chat heads capabilities on your apps. With a fast way to integrate with your

Wizard Pager is a library that provides an example implementation of a Wizard UI on Android, it's based of Roman Nurik's wizard pager (https://github.com/romannurik/android-wizardpager)
Wizard Pager is a library that provides an example implementation of a Wizard UI on Android, it's based of Roman Nurik's wizard pager (https://github.com/romannurik/android-wizardpager)

Wizard Pager Wizard Pager is a library that provides an example implementation of a Wizard UI on Android, it's based of Roman Nurik's wizard pager (ht

Make your native android Toasts Fancy. A library that takes the standard Android toast to the next level with a variety of styling options. Style your toast from code.
Make your native android Toasts Fancy. A library that takes the standard Android toast to the next level with a variety of styling options. Style your toast from code.

FancyToast-Android Prerequisites Add this in your root build.gradle file (not your module build.gradle file): allprojects { repositories { ... ma

Make your native android Dialog Fancy. A library that takes the standard Android Dialog to the next level with a variety of styling options. Style your dialog from code.
Make your native android Dialog Fancy. A library that takes the standard Android Dialog to the next level with a variety of styling options. Style your dialog from code.

FancyAlertDialog-Android Prerequisites Add this in your root build.gradle file (not your module build.gradle file): allprojects { repositories { ..

A Tinder-like Android library to create the swipe cards effect. You can swipe left or right to like or dislike the content.

Swipecards Travis master: A Tinder-like cards effect as of August 2014. You can swipe left or right to like or dislike the content. The library create

A Material design Android pincode library. Supports Fingerprint.
A Material design Android pincode library. Supports Fingerprint.

LolliPin A Lollipop material design styled android pincode library (API 14+) To include in your project, add this to your build.gradle file: //Loll

Android Library to implement simple touch/tap/swipe gestures
Android Library to implement simple touch/tap/swipe gestures

SimpleFingerGestures An android library to implement simple 1 or 2 finger gestures easily Example Library The library is inside the libSFG folder Samp

Useful library to use custom fonts in your android app
Useful library to use custom fonts in your android app

EasyFonts A simple and useful android library to use custom fonts in android apps without adding fonts into asset/resource folder.Also by using this l

Comments
  • Nested Fragments support

    Nested Fragments support

    Hello,

    here is a little modification regarding nested fragment. The previous version was using the FragmentManager from the FragmentActivity. With nested fragments, there is a child FragmentManager available per fragment. Instead of passing the FragmentActivity, I'm passing the FragmentManager on which the breadcrumbs needs to be attached.

    opened by rno 2
  • More simple usage without manual call setActivity()

    More simple usage without manual call setActivity()

    I think that call this manually

    FragmentBreadCrumbs crumbs = (FragmentBreadCrumbs)findViewById(R.id.breadcrumbs);
    crumbs.setActivity(this);
    

    is anoying and better solution is obtain host activity from context in onAttachedToWindow() What do you think?

    opened by tprochazka 1
Owner
Jake Wharton
Jake Wharton
Fragments: Advanced Reusable Interfaces on Android

LIVE #016 - Fragments: Interfaces reutilizáveis avançadas no Android (Atualizado com Jetpack) Código fonte do projeto criado na live #016, ensinando c

Kaique Ocanha 6 Oct 3, 2022
An Android library containing a simple TableView and an advanced SortableTableView providing a lot of customisation possibilities to fit all needs.

SortableTableView for Android An Android library providing a TableView and a SortableTableView. Minimum SDK-Version: 11 | Compile SDK-Version: 25 | La

Ingo Schwarz 1.1k Dec 5, 2022
A simple library to add Emoji support to your Android Application

Emoji A library to add Emoji support to your Android app. Emojis can be picked in a PopupWindow. In order to edit and display text with Emojis this li

Niklas Baudy 1.4k Jan 4, 2023
Android SegmentedControl + multi row support

Android SegmentedControl + multi row support + multi selection minSdk API 14+ Demo App, Play store link Or try demo App online ! Segmented control for

Robert 152 Dec 29, 2022
This is a picker view for android , support linkage effect, timepicker and optionspicker.(时间选择器、省市区三级联动)

Android-PickerView English Document 注意事项、详请使用方式、更新日志等,请查看 Wiki文档 Wiki文档,Wiki文档,Wiki文档 !~ 重要的事情说三遍 对于使用上有任何疑问或优化建议等,欢迎加入QQ群讨论交流技术问题。 交流群1: 387051294(推荐

Bigkoo 13.2k Jan 6, 2023
Extend From VLayout, and it will support Android X

XVLayout Extend From VLayout, and it will support Android X 从VLayout库克隆,支持Android X的RecyclerView 详细使用说明,参考:https://github.com/alibaba/vlayout Main Fea

null 1 Dec 8, 2021
Have a look at Job Allocation app build with SQLite database and Kotlin support

Job Allocation Overview Do you remember or forget sometimes to whom you allocated a task ?? Have a look at Job Allocation app build with SQLite databa

null 0 Dec 13, 2021
A new canvas drawing library for Android. Aims to be the Fabric.js for Android. Supports text, images, and hand/stylus drawing input. The library has a website and API docs, check it out

FabricView - A new canvas drawing library for Android. The library was born as part of a project in SD Hacks (www.sdhacks.io) on October 3rd. It is cu

Antwan Gaggi 1k Dec 13, 2022
Android StackBlur is a library that can perform a blurry effect on a Bitmap based on a gradient or radius, and return the result. The library is based on the code of Mario Klingemann.

Android StackBlur Android StackBlur is a library that can perform a blurry effect on a Bitmap based on a gradient or radius, and return the result. Th

Enrique López Mañas 3.6k Dec 29, 2022
Android library used to create an awesome Android UI based on a draggable element similar to the last YouTube graphic component.

Draggable Panel DEPRECATED. This project is not maintained anymore. Draggable Panel is an Android library created to build a draggable user interface

Pedro Vicente Gómez Sánchez 3k Dec 6, 2022