Compare commits

...

2 Commits

Author SHA1 Message Date
tonywesoly
3eff01d912 Finish child duties in xml 2022-08-07 20:02:06 +02:00
tonywesoly
0e47f464cf Create children duties xml 2022-08-04 19:46:16 +02:00
11 changed files with 320 additions and 37 deletions

View File

@ -5,13 +5,21 @@
<map>
<entry key="app/src/main/res/drawable-v24/ic_launcher_foreground.xml" value="0.3445" />
<entry key="app/src/main/res/drawable/bg_android.xml" value="0.1755" />
<entry key="app/src/main/res/drawable/ic_baseline_check_circle_outline_24.xml" value="0.3415" />
<entry key="app/src/main/res/drawable/ic_baseline_edit_24.xml" value="0.232" />
<entry key="app/src/main/res/drawable/ic_baseline_favorite_24.xml" value="0.3415" />
<entry key="app/src/main/res/drawable/ic_dashboard_black_24dp.xml" value="0.3415" />
<entry key="app/src/main/res/drawable/ic_duties.xml" value="0.3415" />
<entry key="app/src/main/res/drawable/ic_home_black_24dp.xml" value="0.2975" />
<entry key="app/src/main/res/drawable/ic_launcher_background.xml" value="0.3415" />
<entry key="app/src/main/res/drawable/ic_wave.xml" value="0.1755" />
<entry key="app/src/main/res/drawable/rb_selector.xml" value="0.232" />
<entry key="app/src/main/res/layout/activity_main.xml" value="0.35520833333333335" />
<entry key="app/src/main/res/layout/fragment_dashboard.xml" value="0.25" />
<entry key="app/src/main/res/layout/fragment_duties.xml" value="0.5" />
<entry key="app/src/main/res/layout/fragment_home.xml" value="0.33" />
<entry key="app/src/main/res/layout/fragment_notifications.xml" value="0.35520833333333335" />
<entry key="app/src/main/res/layout/fragment_person_card.xml" value="0.1" />
<entry key="app/src/main/res/layout/fragment_person_card.xml" value="0.67" />
<entry key="app/src/main/res/layout/person_card.xml" value="0.75" />
<entry key="app/src/main/res/layout/profile_image_border.xml" value="0.35520833333333335" />
<entry key="app/src/main/res/menu/bottom_nav_menu.xml" value="0.37083333333333335" />

View File

@ -7,11 +7,11 @@ import android.view.ViewGroup
import android.widget.TextView
import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModelProvider
import com.lsm.kothlin_app.databinding.FragmentDashboardBinding
import com.lsm.kothlin_app.databinding.FragmentDutiesBinding
class DashboardFragment : Fragment() {
class DutiesFragment : Fragment() {
private var _binding: FragmentDashboardBinding? = null
private var _binding: FragmentDutiesBinding? = null
// This property is only valid between onCreateView and
// onDestroyView.
@ -22,16 +22,16 @@ class DashboardFragment : Fragment() {
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
val dashboardViewModel =
ViewModelProvider(this).get(DashboardViewModel::class.java)
// val dutiesViewModel =
// ViewModelProvider(this).get(DutiesViewModel::class.java)
_binding = FragmentDashboardBinding.inflate(inflater, container, false)
_binding = FragmentDutiesBinding.inflate(inflater, container, false)
val root: View = binding.root
val textView: TextView = binding.textDashboard
dashboardViewModel.text.observe(viewLifecycleOwner) {
textView.text = it
}
// val textView: TextView = binding.textDashboard
// dutiesViewModel.text.observe(viewLifecycleOwner) {
// textView.text = it
// }
return root
}

View File

@ -4,10 +4,10 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
class DashboardViewModel : ViewModel() {
class DutiesViewModel : ViewModel() {
private val _text = MutableLiveData<String>().apply {
value = "This is dashboard Fragment"
value = "This is duties Fragment"
}
val text: LiveData<String> = _text
}

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#3700B3"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M19,4h-1V2h-2v2H8V2H6v2H5C3.89,4 3.01,4.9 3.01,6L3,20c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2V6C21,4.9 20.1,4 19,4zM19,20H5V10h14V20zM9,14H7v-2h2V14zM13,14h-2v-2h2V14zM17,14h-2v-2h2V14zM9,18H7v-2h2V18zM13,18h-2v-2h2V18zM17,18h-2v-2h2V18z"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#3700B3"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
</vector>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" android:enterFadeDuration="@android:integer/config_shortAnimTime" android:exitFadeDuration="@android:integer/config_shortAnimTime">
<item android:state_checked="true">
<shape android:shape="oval">
<stroke android:width="5dp" android:color="@color/purple_500" />
<size android:width="20dp" android:height="20dp" />
</shape>
</item>
<item>
<shape android:shape="oval">
<stroke android:width="1.5dp" android:color="@color/purple_500" />
<size android:width="20dp" android:height="20dp" />
</shape>
</item>
</selector>

View File

@ -1,22 +0,0 @@
<?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">
<TextView
android:id="@+id/text_dashboard"
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"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,266 @@
<?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.DutiesFragment">
<RadioGroup
android:id="@+id/radioGroup"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:gravity="fill"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
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/textView2"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="Behaviour"-->
<!-- android:drawableEnd="@drawable/ic_baseline_favorite_24"-->
<!-- app:layout_constraintEnd_toEndOf="@+id/radioButton1"-->
<!-- app:layout_constraintStart_toStartOf="@+id/radioButton1"-->
<!-- app:layout_constraintTop_toBottomOf="@+id/radioButton1" />-->
<com.google.android.material.radiobutton.MaterialRadioButton
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_weight="1"
android:button="@null"
android:buttonTint="@color/purple_500"
android:drawableTop="@drawable/rb_selector"
android:padding="15dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/radioButton1"
app:layout_constraintTop_toTopOf="@+id/radioButton1" />
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="Duties"-->
<!-- android:drawableEnd="@drawable/ic_baseline_check_circle_outline_24"-->
<!-- app:layout_constraintEnd_toEndOf="@+id/radioButton"-->
<!-- app:layout_constraintStart_toStartOf="@+id/radioButton"-->
<!-- app:layout_constraintTop_toBottomOf="@+id/radioButton" />-->
<com.google.android.material.radiobutton.MaterialRadioButton
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:button="@null"
android:buttonTint="@color/purple_500"
android:drawableTop="@drawable/rb_selector"
android:gravity="center"
android:padding="15dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/radioButton1"
app:layout_constraintTop_toTopOf="@+id/radioButton1" />
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
</RadioGroup>
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="4dp"
android:text="Behaviour"
app:drawableEndCompat="@drawable/ic_baseline_favorite_24"
app:layout_constraintEnd_toStartOf="@+id/guideline2"
app:layout_constraintStart_toStartOf="@+id/radioGroup"
app:layout_constraintTop_toTopOf="@+id/textView4" />
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="4dp"
android:text="Duties"
app:drawableEndCompat="@drawable/ic_baseline_check_circle_outline_24"
app:layout_constraintEnd_toEndOf="@+id/radioGroup"
app:layout_constraintStart_toStartOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/radioGroup" />
<EditText
android:id="@+id/editTextName"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:backgroundTint="@color/purple_500"
android:drawableLeft="@drawable/ic_baseline_person_24"
android:drawablePadding="10dp"
android:ems="10"
android:hint="Name"
android:inputType="textPersonName"
android:minHeight="48dp"
android:textColor="@color/purple_500"
android:textColorHint="@color/purple_500"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView3" />
<EditText
android:id="@+id/editTextRepeat"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:backgroundTint="@color/purple_500"
android:drawableLeft="@drawable/ic_baseline_calendar_month_24"
android:drawablePadding="10dp"
android:ems="10"
android:hint="Repeat"
android:inputType="textPersonName"
android:minHeight="48dp"
android:textColor="@color/purple_500"
android:textColorHint="@color/purple_500"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editTextName" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="32dp"
android:text="Assigned to:"
android:textColor="@color/purple_500"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editTextRepeat" />
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView">
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="1.5dp"
android:layout_weight="1"
android:adjustViewBounds="true"
android:padding="1.5dp"
app:shapeAppearanceOverlay="@style/Circular"
app:srcCompat="@drawable/ico_2"
app:strokeColor="#5b00e8"
app:strokeWidth="3dp" />
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="1.5dp"
android:layout_weight="1"
android:adjustViewBounds="true"
android:padding="1.5dp"
app:shapeAppearanceOverlay="@style/Circular"
app:srcCompat="@drawable/ico_2"
app:strokeColor="#5b00e8"
app:strokeWidth="3dp" />
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="1.5dp"
android:layout_weight="1"
android:adjustViewBounds="true"
android:padding="1.5dp"
app:shapeAppearanceOverlay="@style/Circular"
app:srcCompat="@drawable/ico_2"
app:strokeColor="#5b00e8"
app:strokeWidth="3dp" />
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="1.5dp"
android:layout_weight="1"
android:adjustViewBounds="true"
android:padding="1.5dp"
app:shapeAppearanceOverlay="@style/Circular"
app:srcCompat="@drawable/ico_2"
app:strokeColor="#5b00e8"
app:strokeWidth="3dp" />
<!-- <ImageView-->
<!-- android:id="@+id/imageView5"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_weight="1"-->
<!-- android:adjustViewBounds="true"-->
<!-- android:src="@drawable/ico_2" />-->
<!-- <ImageView-->
<!-- android:id="@+id/imageView6"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_weight="1"-->
<!-- android:adjustViewBounds="true"-->
<!-- android:src="@drawable/ico_2" />-->
<!-- <ImageView-->
<!-- android:id="@+id/imageView7"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_weight="1"-->
<!-- android:adjustViewBounds="true"-->
<!-- android:src="@drawable/ico_2" />-->
<!-- <ImageView-->
<!-- android:id="@+id/imageView8"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_weight="1"-->
<!-- android:adjustViewBounds="true"-->
<!-- android:src="@drawable/ico_2" />-->
</LinearLayout>
<!-- <Button-->
<com.google.android.material.button.MaterialButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:text="ADD"
app:icon="@drawable/ic_baseline_plus"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout"
app:layout_constraintVertical_bias="0.8" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_begin="206dp" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -18,6 +18,7 @@
android:id="@+id/profile1"
android:layout_width="70dp"
android:layout_height="70dp"
android:adjustViewBounds="true"
android:padding="1.5dp"
app:layout_constraintEnd_toStartOf="@+id/heart1"
app:layout_constraintStart_toStartOf="parent"

View File

@ -13,9 +13,9 @@
<fragment
android:id="@+id/navigation_duties"
android:name="com.lsm.kothlin_app.ui.dashboard.DashboardFragment"
android:name="com.lsm.kothlin_app.ui.dashboard.DutiesFragment"
android:label="@string/title_duties"
tools:layout="@layout/fragment_dashboard" />
tools:layout="@layout/fragment_duties" />
<fragment
android:id="@+id/navigation_rewards"