Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/madhur-code' into debz-first
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/src/main/res/layout/fragment_fridge.xml
  • Loading branch information
debz-g committed Feb 26, 2022
2 parents f0ec084 + f638d38 commit 33dac48
Show file tree
Hide file tree
Showing 10 changed files with 219 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package dev.dsi.robust.fridge.Adapter

class FridgeAdapter {
}
4 changes: 4 additions & 0 deletions app/src/main/java/dev/dsi/robust/fridge/Database/Fridge.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package dev.dsi.robust.fridge.Database

class Fridge {
}
4 changes: 4 additions & 0 deletions app/src/main/java/dev/dsi/robust/fridge/Database/FridgeDao.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package dev.dsi.robust.fridge.Database

interface FridgeDao {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package dev.dsi.robust.fridge.Database

class FridgeDatabase {
}
7 changes: 6 additions & 1 deletion app/src/main/java/dev/dsi/robust/ui/FridgeFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import dev.dsi.robust.R
import dev.dsi.robust.databinding.FragmentFridgeBinding
import dev.dsi.robust.fridge.Adapter.FridgeAdapter


class FridgeFragment : Fragment() {


lateinit var fridgeAdapter: FridgeAdapter
private var _binding:FragmentFridgeBinding? = null
private val binding
get() = _binding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_baseline_add_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="30dp"
android:height="30dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_baseline_keyboard_arrow_down_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M7.41,8.59L12,13.17l4.59,-4.58L18,10l-6,6 -6,-6 1.41,-1.41z"/>
</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_baseline_keyboard_arrow_up_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M7.41,15.41L12,10.83l4.59,4.58L18,14l-6,-6 -6,6z"/>
</vector>
66 changes: 62 additions & 4 deletions app/src/main/res/layout/fragment_fridge.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"

<androidx.coordinatorlayout.widget.CoordinatorLayout 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:id="@+id/coordLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.FridgeFragment">

<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:background="@color/purple_500"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbarDashboard"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:title="Fridge"
app:titleTextAppearance="@style/TextAppearance.AppCompat.Large"
app:titleTextColor="@color/white"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:navigationIcon="?attr/homeAsUpIndicator"/>

</com.google.android.material.appbar.AppBarLayout>

<RelativeLayout
android:id="@+id/anim"
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="12dp"
android:text="No subject added"
android:textColor="@color/black"
android:textSize="14sp" />
</RelativeLayout>

<TextView
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Fridge Fragment" />
android:layout_marginTop="75dp"
android:orientation="vertical">

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="match_parent"
android:layout_height="match_parent">

</androidx.recyclerview.widget.RecyclerView>
</LinearLayout>

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/floating_action_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:src="@drawable/ic_baseline_add_24"
app:backgroundTint="#E86200EE"
app:tint="@color/white" />

</FrameLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
105 changes: 105 additions & 0 deletions app/src/main/res/layout/recycler_view_item.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:elevation="16dp"
android:padding="5dp"
app:cardCornerRadius="10dp">

<RelativeLayout
android:id="@+id/attendance_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="15dp">

<TextView
android:id="@+id/product_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_alignStart="@+id/expiry"
android:layout_marginTop="10dp"
android:text="Butter"
android:textColor="#292929"
android:textSize="28sp" />

<LinearLayout
android:id="@+id/ll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_marginStart="8dp"
android:orientation="vertical">

<ImageView
android:id="@+id/increment"
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@drawable/ic_baseline_keyboard_arrow_up_24" />

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:orientation="vertical">

<TextView
android:id="@+id/number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="10dp"
android:text="0"
android:textColor="@color/black"
android:textSize="18sp" />

</LinearLayout>

<ImageView
android:id="@+id/decrement"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginTop="4dp"
android:src="@drawable/ic_baseline_keyboard_arrow_down_24" />
</LinearLayout>

<TextView
android:id="@+id/expiry"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/product_name"
android:layout_centerHorizontal="true"
android:layout_marginTop="8dp"
android:text="Expires in 1 month"
android:textColor="#494949"
android:textSize="18sp" />

<com.google.android.material.card.MaterialCardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_marginTop="20dp"
android:layout_marginRight="40dp"
app:cardCornerRadius="13dp"
app:strokeWidth="1dp"
app:strokeColor="#FF6060">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="dairy"
android:background="#FFE8E8"
android:paddingHorizontal="10dp"
android:paddingVertical="1.5dp"
android:textSize="12sp"/>

</com.google.android.material.card.MaterialCardView>

</RelativeLayout>

</androidx.cardview.widget.CardView>

0 comments on commit 33dac48

Please sign in to comment.