Giter Site home page Giter Site logo

androidtabbeddialog's Introduction

Android Arsenal

AndroidTabbedDialog

Setup

Add jitpack to your project’s repositories.

repositories {
        // ...
        maven { url "https://jitpack.io" }
    }

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())
                        .setTitle("hello")
                        .setSubTitle("subtitle")
                        .setTabButtonText(new CharSequence[]{"Tab1", "Tab2"})
                        .setPositiveButtonText("Love")
                        .setNegativeButtonText("Hate")
                        .setNeutralButtonText("WTF?")
                        .setRequestCode(REQUEST_SIMPLE_DIALOG)
                        .show();

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

Simply implement interface ISimpleDialogListener in your Activity/Fragment. Listener's callbacks have requestCode 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 IFragmentListener in your Activity/Fragment. Listener's callbacks have:-

onFragmentViewCreated(Fragment fragment) onFragmentAttached(Fragment fragment) onFragmentDetached(Fragment fragment)

    @Override
    public void onFragmentViewCreated(Fragment fragment) {
        int selectedTabPosition = fragment.getArguments().getInt(PageFragment.ARG_DAY_INDEX, 0);
        View rootContainer = fragment.getView().findViewById(R.id.root_container);
        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(R.id.text_view);
                textView.setText("hello: tab1");
                break;
            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(R.id.text_view);
                textView1.setText("hello: tab2");
                break;
        }
    }

License

Copyright (c) 2016 Ashish Bhandari

Licensed under the Apache License, Version 2.0

androidtabbeddialog's People

Contributors

ashishbhandari avatar bryant1410 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

androidtabbeddialog's Issues

how to change dialog size?

how to change dialog size?

getDialog().getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);

Dismiss Dialog

how to dismiss Dialog without using any button
is there any method to dismiss dialog please let me know

Dynamically adding tabs

Hi, I need to add multiple tabs dynamically. How can I create tabs at run time with your library?

how to change dialog size?

how to change dialog size

this getDialog().getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);

not work

How to use

How to use this library?
please add build gradle dependencies code and say how can we use?

thanks a lot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.