diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 7a22ab3d..3a72b824 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -221,6 +221,10 @@ + + (R.id.imageButton) + + navBar = binding.inboxNavBar + navBar.updateLayoutParams { bottomMargin = navBarHeight } + + val activityTab = navBar.createTab(R.drawable.inbox_filled, "Activity") + val notificationTab = + navBar.createTab(R.drawable.ic_round_notifications_active_24, "Notification") + navBar.addTab(activityTab) + navBar.addTab(notificationTab) + + navBar.visibility = View.GONE + + navBar.setOnTabSelectListener(object : AnimatedBottomBar.OnTabSelectListener { + override fun onTabSelected( + lastIndex: Int, + lastTab: AnimatedBottomBar.Tab?, + newIndex: Int, + newTab: AnimatedBottomBar.Tab + ) { + selected = newIndex + + val fragmentTransaction = supportFragmentManager.beginTransaction() + when (newIndex) { + 0 -> fragmentTransaction.replace(R.id.container, FeedFragment()) + 1 -> fragmentTransaction.replace(R.id.container, NotifsFragment()) + } + fragmentTransaction.commit() + } + }) + + navBar.selectTabAt(selected) + navBar.visibility = View.VISIBLE + } + } diff --git a/app/src/main/java/ani/dantotsu/inbox/NotifsFragment.kt b/app/src/main/java/ani/dantotsu/inbox/NotifsFragment.kt new file mode 100644 index 00000000..d6e256c9 --- /dev/null +++ b/app/src/main/java/ani/dantotsu/inbox/NotifsFragment.kt @@ -0,0 +1,8 @@ +package ani.dantotsu.inbox + +import androidx.fragment.app.Fragment +import ani.dantotsu.R + +class NotifsFragment : Fragment(R.layout.fragment_notifs) { + // testing rn +} \ No newline at end of file diff --git a/app/src/main/res/drawable/inbox_empty.xml b/app/src/main/res/drawable/inbox_empty.xml new file mode 100644 index 00000000..bb6540aa --- /dev/null +++ b/app/src/main/res/drawable/inbox_empty.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/app/src/main/res/drawable/inbox_filled.xml b/app/src/main/res/drawable/inbox_filled.xml new file mode 100644 index 00000000..08ad4bf1 --- /dev/null +++ b/app/src/main/res/drawable/inbox_filled.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/app/src/main/res/layout/activity_inbox.xml b/app/src/main/res/layout/activity_inbox.xml new file mode 100644 index 00000000..1677b0d3 --- /dev/null +++ b/app/src/main/res/layout/activity_inbox.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + diff --git a/app/src/main/res/layout/fragment_feed.xml b/app/src/main/res/layout/fragment_feed.xml new file mode 100644 index 00000000..77d9ef65 --- /dev/null +++ b/app/src/main/res/layout/fragment_feed.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index f8279ae2..a2eea4d8 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -135,6 +135,18 @@ + + + + + \ No newline at end of file