-1

I have my ProfileFragment class and another EditProfileFragment class where you as you can guess can edit your profile information like age, photo, sport which you like and gender. Next I want this EditProfileFragment to be visible in 1/3 of ProfileFragment like some kind of box which changes when you edit something in EditProfileFragment. So what do I need to create and use to transfer my information to this box? Something like on the photo below .

enter image description here

And second thing, I want to create the way to login/sign in in my app and also make possibilities to change Password, Name and E-mail, so if you are logged in via Facebook you can only change Name, if you logged in via created account you can change everything. Should I make 2 different classes and activate one of them where you are logged in? And how to check by what you are logged in ?

Sorry for my lack of knowledge but I'm new in this and wanna learn something for the feature.

dzikovskyy
  • 5,027
  • 3
  • 32
  • 43
Kertuj
  • 33
  • 5

1 Answers1

0

Inside your ProfileFragment layout, take another Framelayout & host your EditProfileFragment on that frame.

You can easily communicate with two fragments via listeners. Inside your EditProfileFragment, fire a listener when user changed something. Listen to changeListener from ProfileFragment & update UI accordingly.

Fahim Ahmed
  • 779
  • 3
  • 12
  • 25
  • I should do this by FragmentTransaction or how ? – Kertuj Oct 23 '17 at 08:43
  • Could you show me some samples ? As I said Im new in this or Documeation – Kertuj Oct 23 '17 at 08:44
  • Yes, you have to use FragmentTransaction to attach a fragment on framelayout. – Fahim Ahmed Oct 23 '17 at 08:44
  • Follow this: https://stackoverflow.com/questions/6672066/fragment-inside-fragment – Fahim Ahmed Oct 23 '17 at 08:46
  • You mean to follow this https://developer.android.com/about/versions/android-4.2.html#NestedFragments ? – Kertuj Oct 23 '17 at 09:01
  • Okay, i got it, but its not exactly what i want, I just want Edit it in EditProfileFragment and here just have somethin like screen of changes wich would be editiet when I take FragmentTrasaction i got whole Fragment in another Framgnet – Kertuj Oct 23 '17 at 09:07
  • I has to have shorter version of EditProfileFragment, like here Just photo, Name,age location and sport from chosen list – Kertuj Oct 23 '17 at 09:20