creation of navigation and fragments ✅
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
5afe09859d
commit
ae34b24cb5
@ -1,12 +0,0 @@
|
|||||||
package uca.iut.clermont.view
|
|
||||||
|
|
||||||
import android.app.Activity
|
|
||||||
import android.os.Bundle
|
|
||||||
import uca.iut.clermont.R
|
|
||||||
|
|
||||||
class FavoriteActivity : Activity() {
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
|
||||||
super.onCreate(savedInstanceState)
|
|
||||||
setContentView(R.layout.activity_favorite)
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,18 @@
|
|||||||
|
package uca.iut.clermont.view
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import androidx.fragment.app.Fragment
|
||||||
|
import uca.iut.clermont.R
|
||||||
|
|
||||||
|
class FavoriteFragment: Fragment() {
|
||||||
|
override fun onCreateView(
|
||||||
|
inflater: LayoutInflater,
|
||||||
|
container: ViewGroup?,
|
||||||
|
savedInstanceState: Bundle?
|
||||||
|
): View? {
|
||||||
|
return inflater.inflate(R.layout.fragment_favorite, container, false)
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package uca.iut.clermont.view
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import androidx.fragment.app.Fragment
|
||||||
|
import uca.iut.clermont.R
|
||||||
|
|
||||||
|
class HomeFragment : Fragment() {
|
||||||
|
|
||||||
|
override fun onCreateView(
|
||||||
|
inflater: LayoutInflater,
|
||||||
|
container: ViewGroup?,
|
||||||
|
savedInstanceState: Bundle?
|
||||||
|
): View? {
|
||||||
|
|
||||||
|
/*val adapterMatches = findViewById<RecyclerView>(R.id.ListRecentsMatches)
|
||||||
|
|
||||||
|
with(adapterMatches) {
|
||||||
|
adapter = MatchesAdapter(manager.matchesMgr.getItems().toList().toTypedArray())
|
||||||
|
}
|
||||||
|
|
||||||
|
adapterMatches.layoutManager = LinearLayoutManager(this)*/
|
||||||
|
|
||||||
|
return inflater.inflate(R.layout.fragment_home, container, false)
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
<?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=".view.MainActivity">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.fragment.app.FragmentContainerView
|
||||||
|
android:id="@+id/fragment"
|
||||||
|
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||||
|
android:layout_width="409dp"
|
||||||
|
android:layout_height="729dp"
|
||||||
|
app:defaultNavHost="true"
|
||||||
|
app:navGraph="@navigation/my_nav"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintBottom_toTopOf="parent"/>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/my_nav"
|
||||||
|
app:startDestination="@id/homeFragment">
|
||||||
|
|
||||||
|
<fragment
|
||||||
|
android:id="@+id/homeFragment"
|
||||||
|
android:name="uca.iut.clermont.view.HomeFragment"
|
||||||
|
android:label="HomeFragment">
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_homeFragment_to_favoriteFragment"
|
||||||
|
app:destination="@id/favoriteFragment" />
|
||||||
|
</fragment>
|
||||||
|
<fragment
|
||||||
|
android:id="@+id/favoriteFragment"
|
||||||
|
android:name="uca.iut.clermont.view.FavoriteFragment"
|
||||||
|
android:label="FavoriteFragment">
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_favoriteFragment_to_homeFragment"
|
||||||
|
app:destination="@id/homeFragment" />
|
||||||
|
</fragment>
|
||||||
|
</navigation>
|
Loading…
Reference in new issue