Skip to content

Commit

Permalink
Add: Logout button to profile
Browse files Browse the repository at this point in the history
  • Loading branch information
omerarslnn committed Jan 4, 2022
1 parent 2bf1040 commit 8c302c6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentTransaction
import com.bounswe.findsportevents.R
import com.bounswe.findsportevents.databinding.FragmentProfileBinding
import com.bounswe.findsportevents.extensions.startActivity
import com.bounswe.findsportevents.login.LoginActivity
import com.bounswe.findsportevents.main.MainActivity
import com.bounswe.findsportevents.network.ReboundAPI
import com.bounswe.findsportevents.network.modalz.requests.UpdateProfileRequest
Expand Down Expand Up @@ -164,6 +166,11 @@ class FragmentProfile : Fragment(), DialogManager {
transaction.replace(R.id.container_main,FragmentViewBadges.newInstance(token, badgeArrayList)).addToBackStack("myEvents")
transaction.commit()
}
binding.btnLogout.setOnClickListener {
val intent = Intent (activity, LoginActivity::class.java)
requireActivity().startActivity(intent)
requireActivity().finish()
}
}

interface FragmentProfileListener {
Expand Down
11 changes: 9 additions & 2 deletions FindSportEvents/app/src/main/res/layout/fragment_profile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,15 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/space_xx_large"
android:text="ADD AN EQUIPMENT"
/>
android:text="ADD AN EQUIPMENT" />

<Button
android:id="@+id/btn_logout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/space_xx_large"
android:backgroundTint="#FF5722"
android:text="LOGOUT" />



Expand Down

0 comments on commit 8c302c6

Please sign in to comment.