feat: Add button to manage categories on main bar

This commit is contained in:
Peter Vacho 2025-01-05 00:09:38 +01:00
parent 03e7021c1a
commit cc38fe5484
Signed by: school
GPG key ID: 8CFC3837052871B4
3 changed files with 18 additions and 0 deletions

View file

@ -9,6 +9,7 @@ import android.widget.ImageButton
import androidx.fragment.app.Fragment
import com.google.android.material.textview.MaterialTextView
import com.p_vacho.neat_calendar.R
import com.p_vacho.neat_calendar.activities.CategoriesActivity
import com.p_vacho.neat_calendar.activities.NotificationsActivity
import com.p_vacho.neat_calendar.activities.SettingsActivity
@ -29,6 +30,11 @@ class MainBarFragment : Fragment() {
startActivity(Intent(requireContext(), SettingsActivity::class.java))
}
val btnCategories = view.findViewById<ImageButton>(R.id.btnCategories)
btnCategories.setOnClickListener {
startActivity(Intent(requireContext(), CategoriesActivity::class.java))
}
val btnNotifications = view.findViewById<ImageButton>(R.id.btnNotifications)
btnNotifications.setOnClickListener {
startActivity(Intent(requireContext(), NotificationsActivity::class.java))

View file

@ -42,6 +42,17 @@
android:padding="8dp"
app:tint="?attr/colorOnPrimary" />
<!-- Categories Icon -->
<ImageButton
android:id="@+id/btnCategories"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/open_categories"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_tag"
android:padding="8dp"
app:tint="?attr/colorOnPrimary" />
<!-- Settings Icon -->
<ImageButton
android:id="@+id/btnSettings"

View file

@ -86,4 +86,5 @@
<string name="delete_category">Delete category</string>
<string name="event_details">Event Details</string>
<string name="category_name">Category Name</string>
<string name="open_categories">Open category management</string>
</resources>