by ashishbhandari

ashishbhandari /AndroidTabbedDialog

Android Tabbed Dialog containing fragments

130 Stars 41 Forks Last release: over 4 years ago (1.1) Apache License 2.0 20 Commits 3 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

Android Arsenal



Add jitpack to your project’s repositories.

repositories {
        // ...
        maven { url "" }

Then add Tabbed dialog to your Module’s dependencies

dependencies {
             compile 'com.github.ashishbhandari:AndroidTabbedDialog:v1.1'

How to create tab dialogs:

TabDialogFragment.createBuilder(MainActivity.this, getSupportFragmentManager())
                        .setTabButtonText(new CharSequence[]{"Tab1", "Tab2"})

How to react on button press in your Activity/Fragment:

Simply implement interface

in your Activity/Fragment. Listener's callbacks have
parameter - you can use it if you have more dialogs in one Activity/Fragment.

How to render tab view inside your dialog:

Simply implement interface

in your Activity/Fragment. Listener's callbacks have:-

onFragmentViewCreated(Fragment fragment)
onFragmentAttached(Fragment fragment)
onFragmentDetached(Fragment fragment)
    public void onFragmentViewCreated(Fragment fragment) {
        int selectedTabPosition = fragment.getArguments().getInt(PageFragment.ARG_DAY_INDEX, 0);
        View rootContainer = fragment.getView().findViewById(;
        Log.i(TAG, "Position: " + selectedTabPosition);

    switch (selectedTabPosition) {
        case 0:
            // add view in container for first tab
            View tabProductDetailLayout = getLayoutInflater().inflate(R.layout.tab_one_layout, (ViewGroup) rootContainer);

            TextView textView = (TextView) tabProductDetailLayout.findViewById(;
            textView.setText("hello: tab1");
        case 1:
            // add view in container for second tab
            View tabProductDetailLayout2 = getLayoutInflater().inflate(R.layout.tab_one_layout, (ViewGroup) rootContainer);

            TextView textView1 = (TextView) tabProductDetailLayout2.findViewById(;
            textView1.setText("hello: tab2");


Copyright (c) 2016 Ashish Bhandari

Licensed under the Apache License, Version 2.0

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.