Browse code

Initial commit (losing old history)

Dario Rodriguez authored on 08/04/2026 17:25:38
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,67 @@
1
+/*
2
+ * Copyright (c) 2023 Samson Achiaga
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ *     http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+package com.certified.audionote.features.settings
18
+
19
+import android.os.Bundle
20
+import android.view.LayoutInflater
21
+import android.view.View
22
+import android.view.ViewGroup
23
+import androidx.fragment.app.Fragment
24
+import androidx.navigation.NavController
25
+import androidx.navigation.Navigation
26
+import com.certified.audionote.R
27
+import com.certified.audionote.databinding.FragmentSettingsBinding
28
+import com.certified.audionote.utils.Extensions.flags
29
+import com.certified.audionote.utils.Extensions.safeNavigate
30
+
31
+class SettingsFragment : Fragment() {
32
+
33
+    private var _binding: FragmentSettingsBinding? = null
34
+    private val binding get() = _binding!!
35
+    private lateinit var navController: NavController
36
+
37
+    override fun onCreateView(
38
+        inflater: LayoutInflater,
39
+        container: ViewGroup?,
40
+        savedInstanceState: Bundle?
41
+    ): View {
42
+        // Inflate the layout for this fragment
43
+        _binding = FragmentSettingsBinding.inflate(inflater, container, false)
44
+        return binding.root
45
+    }
46
+
47
+    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
48
+        super.onViewCreated(view, savedInstanceState)
49
+
50
+        navController = Navigation.findNavController(view)
51
+
52
+        binding.apply {
53
+            btnBack.setOnClickListener { navController.safeNavigate(SettingsFragmentDirections.actionSettingsFragmentToHomeFragment()) }
54
+            groupAbout.setOnClickListener { navController.safeNavigate(SettingsFragmentDirections.actionSettingsFragmentToAboutFragment()) }
55
+        }
56
+    }
57
+
58
+    override fun onResume() {
59
+        super.onResume()
60
+        flags(R.color.fragment_background)
61
+    }
62
+
63
+    override fun onDestroyView() {
64
+        super.onDestroyView()
65
+        _binding = null
66
+    }
67
+}
0 68
\ No newline at end of file