Git Product home page Git Product logo

Comments (3)

SpecialCyCi avatar SpecialCyCi commented on June 4, 2024

What's your meaning of write name of Fragment?

from androidresidemenu.

19rs39 avatar 19rs39 commented on June 4, 2024

Like your project has 4 menu items Home, Profile, Calendar, Settings. So when I click on these items fragment is replaced. I want to display these item names as title on fragment clicking respective item.
Clicking home item should set title Home, clicking Calendar should set title Calendar. Now it is "Reside Menu Demo" for each fragment title.

from androidresidemenu.

SpecialCyCi avatar SpecialCyCi commented on June 4, 2024
Give a ID to title view.

ResideMenuDemo / res / layout / main.xml

<TextView
    ...
   android:id="@+id/title"
   android:text="RESideMenu DEMO"/>
Find this view in code.

ResideMenuDemo / src / com / special / ResideMenuDemo / MenuActivity.java

private TextView title;
title = findViewById(R.id.title);
Set this view's text in method changeFragment

ResideMenuDemo / src / com / special / ResideMenuDemo / MenuActivity.java

    private void changeFragment(Fragment targetFragment){
        title.setText("Your title.");
        resideMenu.clearIgnoredViewList();
        getSupportFragmentManager()
                .beginTransaction()
                .replace(R.id.main_fragment, targetFragment, "fragment")
                .setTransitionStyle(FragmentTransaction.TRANSIT_FRAGMENT_FADE)
                .commit();
    }

from androidresidemenu.

Related Issues (20)

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.