Anonymní profil Elipso – Programujte.com
 x   TIP: Přetáhni ikonu na hlavní panel pro připnutí webu

Anonymní profil Elipso – Programujte.comAnonymní profil Elipso – Programujte.com

 

Příspěvky odeslané z IP adresy 62.197.209.–

Elipso
Java › Android - Layout
22. 11. 2013   #184236

Ahojte, potrebujem pomoc s zmenou layout-u pri každom zobrazení NavigationDrawer-u

@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.fragment_main);
        mNavigationDrawerFragment = (NavigationDrawerFragment)
                getSupportFragmentManager().findFragmentById(R.id.navigation_drawer);
        mTitle = getTitle();

        // Set up the drawer.
        mNavigationDrawerFragment.setUp(
                R.id.navigation_drawer,
                (DrawerLayout) findViewById(R.id.drawer_layout));
    }

    @Override
    public void onNavigationDrawerItemSelected(int position) {
        // update the main content by replacing fragments
        FragmentManager fragmentManager = getSupportFragmentManager();
        fragmentManager.beginTransaction()
                .replace(R.id.container, PlaceholderFragment.newInstance(position + 1))
                .commit();

    }

    public void onSectionAttached(int number) {
        switch (number) {
            case 1:
                mTitle = getString(R.string.title_section1);
                break;
            case 2:
                mTitle = getString(R.string.title_section2);
                break;
            case 3:
                mTitle = getString(R.string.title_section3);
                break;
            case 4:
                mTitle = getString(R.string.title_section4);
                break;
            case 5:
                mTitle = getString(R.string.title_section5);
                break;
            case 6:
                mTitle = getString(R.string.title_section6);
                break;
            case 7:
                mTitle = getString(R.string.title_section7);
                break;
            case 8:
                mTitle = getString(R.string.title_section8);
                break;
            case 9:
                mTitle = getString(R.string.title_section9);
                break;
            case 10:
                mTitle = getString(R.string.title_section10);
                break;
            case 11:
                mTitle = getString(R.string.title_section11);
                break;
            case 12:
                mTitle = getString(R.string.title_section12);
                break;
            case 13:
                mTitle = getString(R.string.title_section13);
                break;
            case 14:
                mTitle = getString(R.string.title_section14);
                break;
            case 15:
                mTitle = getString(R.string.title_section15);
                break;
            case 16:
                mTitle = getString(R.string.title_section16);
                break;
            case 17:
                mTitle = getString(R.string.title_section17);
                break;
            case 18:
                mTitle = getString(R.string.title_section18);
                break;
            case 19:
                mTitle = getString(R.string.title_section19);
                break;
            case 20:
                mTitle = getString(R.string.title_section20);
                break;
            case 21:
                mTitle = getString(R.string.title_section21);
                break;
            case 22:
                mTitle = getString(R.string.title_section22);
                break;
            case 23:
                mTitle = getString(R.string.title_section23);
                break;
            case 24:
                mTitle = getString(R.string.title_section24);
                break;
            case 25:
                mTitle = getString(R.string.title_section25);
                break;
            case 26:
                mTitle = getString(R.string.title_section26);
                break;
            case 27:
                mTitle = getString(R.string.title_section27);
                break;
            case 28:
                mTitle = getString(R.string.title_section28);
                break;
            case 29:
                mTitle = getString(R.string.title_section29);
                break;
        }
    }

 

 

Hostujeme u Českého hostingu       ISSN 1801-1586       ⇡ Nahoru Webtea.cz logo © 20032024 Programujte.com
Zasadilo a pěstuje Webtea.cz, šéfredaktor Lukáš Churý