Compare commits

8 Commits

Author SHA1 Message Date
9e54bbc978 added a LayoutManager to fragment_shoppinglist_shoplist.xml
added a ShoppinglistShoplistAdapter.kt for the shoplist RecyclerView
added a data class for the ShoppinglistShoplistAdapter.kt
modified the layout of the fragment_shoppinglist_shoplist_item.xml
refactored the ShoplistFragment.kt
added samplecode for the RecyclerView to the ShoplistFragment.kt
2024-06-02 16:55:41 +02:00
a355301d68 added a RecyclerView to 'fragmnet_shoppinglist_shoplist'
added 'fragment_shoppinglist_shoplist_item'
added some colors to the colors.xml for the shoplist-item fragment
2024-06-02 14:18:15 +02:00
ddc218f4cc added package 'shoppinglist'
renamed 'ShoppinglistFragment' to 'ShoplistFragment'
removed unused code inside 'ShoplistFragment'
renamed 'fragment_shoppinglist' to 'fragment_shoppinglist_shoplist'
2024-06-01 19:22:11 +02:00
083b2982b1 fixed bug: app crashed when switching to another fragment and back again via the hamburger menu 2024-06-01 17:46:16 +02:00
f9570806f9 added a ViewPager2 to switch between page fragments
added a PagerAdapter (FragmentStateAdapter) to provide the fragments for the ViewPager2
added the necessary fragments
added the necessary listeners for the TabLayout and the ViewPager2
2024-05-31 20:16:39 +02:00
3544915f89 refactor home-fragment to dashboard-fragment and add a tablayout 2024-05-31 16:09:58 +02:00
82e7b9ecd8 Upgrade Gradle from 8.2.2 to 8.3.0 2024-03-07 23:45:11 +01:00
21f535bd59 Add "org.eclipse.paho" Mqtt Client 2024-03-07 23:33:24 +01:00
23 changed files with 512 additions and 76 deletions

3
.gitignore vendored
View File

@@ -15,7 +15,8 @@ gen/
# Local configuration file (sdk path, etc)
local.properties
mqtt.properties
# Windows thumbnail db
Thumbs.db

View File

@@ -1,8 +1,14 @@
import java.io.FileInputStream
import java.util.Properties
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
}
val mqttProperties = Properties()
mqttProperties.load(FileInputStream(rootProject.file("mqtt.properties")))
android {
namespace = "de.chrissthecoder.store"
compileSdk = 34
@@ -13,6 +19,11 @@ android {
targetSdk = 34
versionCode = 1
versionName = "1.0"
buildConfigField("String", "MQTT_USERNAME", mqttProperties.getProperty("username"))
buildConfigField("String", "MQTT_PASSWORD", mqttProperties.getProperty("password"))
buildConfigField("String", "MQTT_HOST", mqttProperties.getProperty("host"))
buildConfigField("String", "MQTT_PORT", mqttProperties.getProperty("port"))
}
buildTypes {
@@ -36,6 +47,7 @@ android {
buildFeatures {
viewBinding = true
buildConfig = true
}
}
@@ -48,4 +60,5 @@ dependencies {
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0")
implementation("androidx.navigation:navigation-fragment-ktx:2.7.7")
implementation("androidx.navigation:navigation-ui-ktx:2.7.7")
implementation("org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5")
}

View File

@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Store"
tools:targetApi="31">
<application android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Store"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:exported="true"
@@ -16,10 +16,8 @@
android:theme="@style/Theme.Store.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View File

@@ -37,7 +37,7 @@ class MainActivity : AppCompatActivity() {
// menu should be considered as top level destinations.
appBarConfiguration = AppBarConfiguration(
setOf(
R.id.nav_home, R.id.nav_gallery, R.id.nav_slideshow
R.id.nav_dashboard, R.id.nav_gallery, R.id.nav_slideshow
), drawerLayout
)
setupActionBarWithNavController(navController, appBarConfiguration)

View File

@@ -0,0 +1,18 @@
package de.chrissthecoder.store.adapter
import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import de.chrissthecoder.store.ui.dashboard.tabfragment.shoppinglist.ShoplistFragment
import de.chrissthecoder.store.ui.dashboard.tabfragment.UnderstockFragment
class DashboardFragmentPagerAdapter(fragment: Fragment) : FragmentStateAdapter(fragment) {
override fun getItemCount() : Int {
return 2
}
override fun createFragment(position: Int) : Fragment {
return if(position == 0) { ShoplistFragment() }
else { UnderstockFragment() }
}
}

View File

@@ -0,0 +1,43 @@
package de.chrissthecoder.store.adapter
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import de.chrissthecoder.store.R
import de.chrissthecoder.store.dataclass.ShoppinglistShoplistItem
class ShoppinglistShoplistAdapter(val shoplist: List<ShoppinglistShoplistItem>) : RecyclerView.Adapter<ShoppinglistShoplistAdapter.ItemViewHolder>() {
inner class ItemViewHolder(view: View) : RecyclerView.ViewHolder(view) {
val shoplabel: TextView
val shopicon: ImageView
val shoppinglistCount: TextView
init {
Log.d(this.javaClass.name,"Get necessary Views")
shoplabel = view.findViewById(R.id.shoplabel)
shopicon = view.findViewById(R.id.shopicon)
shoppinglistCount = view.findViewById(R.id.shoppinglistCount)
}
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemViewHolder {
Log.d(this.javaClass.name, "Create new views (invoked by the layout manager)")
val view = LayoutInflater.from(parent.context).inflate(R.layout.fragment_shoppinglist_shoplist_item, parent, false)
return ItemViewHolder(view)
}
override fun onBindViewHolder(holder: ShoppinglistShoplistAdapter.ItemViewHolder, position: Int) {
Log.d(this.javaClass.name,"Replace the contents of a view (invoked by the layout manager)")
holder.shoplabel.text = shoplist[position].shoplabel
holder.shoppinglistCount.text = "(" + shoplist[position].shoppinglistCount + ")"
}
override fun getItemCount(): Int {
Log.d(this.javaClass.name, "Return the size of your dataset (invoked by the layout manager)")
return shoplist.size
}
}

View File

@@ -0,0 +1,3 @@
package de.chrissthecoder.store.dataclass
data class ShoppinglistShoplistItem(val shoplabel: String, val iconID: Int, val shoppinglistCount: Int)

View File

@@ -0,0 +1,118 @@
package de.chrissthecoder.store.mqtt
import android.util.Log
import de.chrissthecoder.store.BuildConfig
import org.eclipse.paho.client.mqttv3.*
class MqttHandler {
companion object {
private const val LINE = "_________________________"
private const val CONNECTION_TIMEOUT = 3
private const val CONNECTION_KEEP_ALIVE_INTERVAL = 60
private const val CONNECTION_CLEAN_SESSION = true
private const val CONNECTION_RECONNECT = true
}
private val client: MqttClient
init {
Log.d(this.javaClass.name, "Enter Initializer")
val clientId: String = "Test Smartphone"
val serverURL = "tcp://" + BuildConfig.MQTT_HOST + ":" + BuildConfig.MQTT_PORT
client = MqttClient(serverURL, clientId, null)
Log.d(this.javaClass.name, "Set Mqtt Call-Back and Connect")
client.setCallback(object : MqttCallbackExtended {
override fun connectionLost(cause: Throwable?) {
Log.w(this.javaClass.name, "Connection Lost")
}
override fun messageArrived(topic: String?, message: MqttMessage?) {
Log.d(this.javaClass.name, "Message on Topic: \"" + topic + "\" Arrived")
val payload = message?.payload?.toString(Charsets.UTF_8)
}
override fun deliveryComplete(token: IMqttDeliveryToken?) {
Log.d(this.javaClass.name, "Message successful delivered")
}
override fun connectComplete(reconnect: Boolean, serverURI: String?) {
var message = "Successful "
if (reconnect) { message += "re" }
message += "connected to: "
serverURI?.let { Log.d(this.javaClass.name, message + it) }
}
})
Log.d(this.javaClass.name, "MQTT Credentials:")
Log.d(this.javaClass.name, LINE)
Log.d(this.javaClass.name, "Client ID: " + clientId)
Log.d(this.javaClass.name, "Server URL: " + serverURL)
Log.d(this.javaClass.name, "Username: " + BuildConfig.MQTT_USERNAME)
Log.d(this.javaClass.name, "Password: " + BuildConfig.MQTT_PASSWORD)
Log.d(this.javaClass.name, LINE)
connect()
}
private fun connect() {
try {
Log.d(this.javaClass.name, "Connecting to Broker...")
// Set up the connection options
val mqttConnectOptions = MqttConnectOptions()
mqttConnectOptions.isAutomaticReconnect = CONNECTION_RECONNECT
mqttConnectOptions.isCleanSession = CONNECTION_CLEAN_SESSION
mqttConnectOptions.userName = BuildConfig.MQTT_USERNAME
mqttConnectOptions.password = BuildConfig.MQTT_PASSWORD.toCharArray()
mqttConnectOptions.connectionTimeout = CONNECTION_TIMEOUT
mqttConnectOptions.keepAliveInterval = CONNECTION_KEEP_ALIVE_INTERVAL
client.connect(mqttConnectOptions)
} catch (ex: MqttException) {
handleConnectionFailure(ex)
}
}
private fun handleConnectionFailure(cause: Throwable?) {
Log.w(this.javaClass.name,"Failed to connect: ${Log.getStackTraceString(cause)}")
}
fun subscribe(topic: String, qos: Int = 0) {
try {
Log.d(this.javaClass.name, "Subscribe to Topic: $topic")
client.subscribe(topic, qos)
} catch (ex: MqttException) {
Log.e(this.javaClass.name,"Error on subscribing to Topic: $topic", ex)
}
}
fun publish(topic: String, msg: String, qos: Int = 0, retained: Boolean = false) {
try {
val mqttMessage = MqttMessage(msg.toByteArray())
client.publish(topic, mqttMessage.payload, qos, retained)
Log.d(this.javaClass.name, "Message published to topic `$topic`: $msg")
} catch (e: MqttException) {
Log.e(this.javaClass.name, "Error publishing to $topic: " + e.message, e)
}
}
fun disconnect() {
try {
Log.d(this.javaClass.name, "Disconnecting from Broker...")
client.disconnect()
} catch (e: MqttException) {
Log.e(this.javaClass.name, "Error disconnection from Broker: " + e.message, e)
e.printStackTrace()
}
}
fun isConnected(): Boolean {
return client.isConnected
}
}

View File

@@ -0,0 +1,63 @@
package de.chrissthecoder.store.ui.dashboard
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModelProvider
import androidx.viewpager2.widget.ViewPager2
import androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback
import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayout.OnTabSelectedListener
import de.chrissthecoder.store.adapter.DashboardFragmentPagerAdapter
import de.chrissthecoder.store.databinding.FragmentDashboardBinding
class DashboardFragment : Fragment() {
private var _binding: FragmentDashboardBinding? = null
private val binding get() = _binding!!
private lateinit var tabLayout: TabLayout
private lateinit var viewPager: ViewPager2
private lateinit var adapter: DashboardFragmentPagerAdapter
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?) : View {
_binding = FragmentDashboardBinding.inflate(inflater, container, false)
val root: View = binding.root
val dashboardViewModel = ViewModelProvider(this).get(DashboardViewModel::class.java)
tabLayout = binding.tabLayout
viewPager = binding.viewPager
adapter = DashboardFragmentPagerAdapter(this)
viewPager.adapter = adapter
tabLayout.addOnTabSelectedListener(object : OnTabSelectedListener {
override fun onTabSelected(tab: TabLayout.Tab?) {
if (tab != null) {
viewPager.currentItem = tab.position
}
}
override fun onTabUnselected(tab: TabLayout.Tab?) { }
override fun onTabReselected(tab: TabLayout.Tab?) { }
})
viewPager.registerOnPageChangeCallback(object : OnPageChangeCallback() {
override fun onPageSelected(position: Int) {
super.onPageSelected(position)
tabLayout.selectTab(tabLayout.getTabAt(position))
}
})
return root
}
override fun onDestroyView() {
super.onDestroyView()
_binding = null
}
}

View File

@@ -1,10 +1,10 @@
package de.chrissthecoder.store.ui.home
package de.chrissthecoder.store.ui.dashboard
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
class HomeViewModel : ViewModel() {
class DashboardViewModel : ViewModel() {
private val _text = MutableLiveData<String>().apply {
value = "This is home Fragment"

View File

@@ -0,0 +1,60 @@
package de.chrissthecoder.store.ui.dashboard.tabfragment
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import de.chrissthecoder.store.R
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private const val ARG_PARAM1 = "param1"
private const val ARG_PARAM2 = "param2"
/**
* A simple [Fragment] subclass.
* Use the [UnderstockFragment.newInstance] factory method to
* create an instance of this fragment.
*/
class UnderstockFragment : Fragment() {
// TODO: Rename and change types of parameters
private var param1: String? = null
private var param2: String? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
arguments?.let {
param1 = it.getString(ARG_PARAM1)
param2 = it.getString(ARG_PARAM2)
}
}
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_understock, container, false)
}
companion object {
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment UnderstockFragment.
*/
// TODO: Rename and change types and number of parameters
@JvmStatic
fun newInstance(param1: String, param2: String) =
UnderstockFragment().apply {
arguments = Bundle().apply {
putString(ARG_PARAM1, param1)
putString(ARG_PARAM2, param2)
}
}
}
}

View File

@@ -0,0 +1,33 @@
package de.chrissthecoder.store.ui.dashboard.tabfragment.shoppinglist
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import de.chrissthecoder.store.adapter.ShoppinglistShoplistAdapter
import de.chrissthecoder.store.databinding.FragmentShoppinglistShoplistBinding
import de.chrissthecoder.store.dataclass.ShoppinglistShoplistItem
/**
* A [Fragment] subclass to list all shops that contains assigned shoppinglists.
*/
class ShoplistFragment : Fragment() {
private var _binding: FragmentShoppinglistShoplistBinding? = null
private val binding get() = _binding!!
private lateinit var adapter: ShoppinglistShoplistAdapter
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
_binding = FragmentShoppinglistShoplistBinding.inflate(inflater, container, false)
val shoplist = ArrayList<ShoppinglistShoplistItem>()
val shoplistRecyclerView = binding.shoplist
adapter = ShoppinglistShoplistAdapter(shoplist)
shoplistRecyclerView.adapter = adapter
return binding.root
}
}

View File

@@ -1,42 +0,0 @@
package de.chrissthecoder.store.ui.home
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModelProvider
import de.chrissthecoder.store.databinding.FragmentHomeBinding
class HomeFragment : Fragment() {
private var _binding: FragmentHomeBinding? = null
// This property is only valid between onCreateView and
// onDestroyView.
private val binding get() = _binding!!
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
val homeViewModel =
ViewModelProvider(this).get(HomeViewModel::class.java)
_binding = FragmentHomeBinding.inflate(inflater, container, false)
val root: View = binding.root
val textView: TextView = binding.textHome
homeViewModel.text.observe(viewLifecycleOwner) {
textView.text = it
}
return root
}
override fun onDestroyView() {
super.onDestroyView()
_binding = null
}
}

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.dashboard.DashboardFragment">
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0">
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tab_shoppinglist" />
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tab_understock" />
</com.google.android.material.tabs.TabLayout>
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/viewPager"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tabLayout" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -4,19 +4,16 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.home.HomeFragment">
tools:context=".ui.dashboard.tabfragment.shoppinglist.ShoplistFragment">
<TextView
android:id="@+id/text_home"
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/shoplist"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:textAlignment="center"
android:textSize="20sp"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="15dp"
app:cardBackgroundColor="@color/cardview_background"
app:cardCornerRadius="20dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/shoplabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="20dp"
android:textAlignment="center"
android:textColor="@color/cardview_textcolor"
android:textSize="24sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.5" />
<ImageView
android:id="@+id/shopicon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="100dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/shoppinglistCount"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.5"
app:srcCompat="@android:drawable/toast_frame" />
<TextView
android:id="@+id/shoppinglistCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="20dp"
android:textAlignment="center"
android:textColor="@color/cardview_textcolor"
android:textSize="24sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.5" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.dashboard.tabfragment.UnderstockFragment">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Minderbestand"
android:textAlignment="center"
android:textSize="32sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.5" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -5,9 +5,9 @@
<group android:checkableBehavior="single">
<item
android:id="@+id/nav_home"
android:id="@+id/nav_dashboard"
android:icon="@drawable/ic_menu_camera"
android:title="@string/menu_home" />
android:title="@string/menu_dashboard" />
<item
android:id="@+id/nav_gallery"
android:icon="@drawable/ic_menu_gallery"

View File

@@ -3,13 +3,13 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/mobile_navigation"
app:startDestination="@+id/nav_home">
app:startDestination="@+id/nav_dashboard">
<fragment
android:id="@+id/nav_home"
android:name="de.chrissthecoder.store.ui.home.HomeFragment"
android:label="@string/menu_home"
tools:layout="@layout/fragment_home" />
android:id="@+id/nav_dashboard"
android:name="de.chrissthecoder.store.ui.dashboard.DashboardFragment"
android:label="@string/menu_dashboard"
tools:layout="@layout/fragment_dashboard" />
<fragment
android:id="@+id/nav_gallery"

View File

@@ -7,4 +7,7 @@
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="cardview_background">#444444</color>
<color name="cardview_textcolor">#FFFFFF</color>
</resources>

View File

@@ -7,7 +7,10 @@
<string name="nav_header_desc">Navigation header</string>
<string name="action_settings">Settings</string>
<string name="menu_home">Home</string>
<string name="menu_dashboard">Dashboard</string>
<string name="menu_gallery">Gallery</string>
<string name="menu_slideshow">Slideshow</string>
<string name="tab_shoppinglist">Einkaufszettel</string>
<string name="tab_understock">Minderbestand</string>
</resources>

View File

@@ -1,5 +1,5 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "8.2.2" apply false
id("com.android.application") version "8.3.0" apply false
id("org.jetbrains.kotlin.android") version "1.9.22" apply false
}

View File

@@ -1,6 +1,6 @@
#Thu Mar 07 13:51:32 CET 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists