This commit is contained in:
Володя 2023-10-18 12:32:11 +03:00
parent 57e3c94f51
commit 22c0b45ee5
40 changed files with 1259 additions and 0 deletions

View File

@ -0,0 +1,38 @@
package com.example.pizza
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.TextView
import androidx.navigation.Navigation
class Auth : Fragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
val view = inflater.inflate(R.layout.fragment_auth, container, false)
view.findViewById<Button>(R.id.button_auth).setOnClickListener {buttonClick(view)}
view.findViewById<TextView>(R.id.link_to_reg).setOnClickListener{TextViewClick(view)}
return view
}
private fun buttonClick(view: View) {
val action = AuthDirections
.actionNavigationAuthToNavigationPizzaList()
Navigation.findNavController(view).navigate(action)
}
private fun TextViewClick(view: View) {
val action = AuthDirections
.actionNavigationAuthToNavigationReg()
Navigation.findNavController(view).navigate(action)
}
}

View File

@ -0,0 +1,43 @@
package com.example.pizza
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import androidx.navigation.Navigation
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.example.pizza.Model.Pizza.Pizza
import com.example.pizza.Model.PizzaAdapter
class ListPizza : Fragment() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
}
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = inflater.inflate(R.layout.fragment_list_pizza, container, false)
val itemsList : RecyclerView = view.findViewById(R.id.pizzasList)
//TODO("Загрузка из БД!!")
var p = Pizza("1","1", listOf("1"),1)
var items = p.getTestPizza()
view.findViewById<Button>(R.id.button_add).setOnClickListener{
val action = ListPizzaDirections
.actionNavigationListToNavigationCreatePizza()
Navigation.findNavController(view).navigate(action)
}
itemsList.layoutManager = LinearLayoutManager(view.context)
itemsList.adapter = PizzaAdapter(items,view.context)
return view
}
}

View File

@ -0,0 +1,51 @@
package com.example.pizza
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import androidx.navigation.fragment.NavHostFragment
import androidx.navigation.ui.AppBarConfiguration
import androidx.navigation.ui.NavigationUI
import androidx.navigation.ui.setupActionBarWithNavController
import androidx.navigation.ui.setupWithNavController
import com.example.pizza.databinding.ActivityMainBinding
import com.google.android.material.bottomnavigation.BottomNavigationView
class MainActivity : AppCompatActivity() {
private lateinit var binding: ActivityMainBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)
val navView: BottomNavigationView = binding.navView
val navHostFragment: NavHostFragment = supportFragmentManager
.findFragmentById(R.id.nav_host_fragment_activity_main) as NavHostFragment
val navController = navHostFragment.navController
val appBarConfiguration = AppBarConfiguration(
setOf(
R.id.navigation_pizza_list, R.id.navigation_user, R.id.navigation_crate
)
)
val appBar = binding.appbar
navController.addOnDestinationChangedListener { _, destination, _ ->
if (!appBarConfiguration.topLevelDestinations.contains(destination.id)) {
navView.visibility = View.GONE
appBar.visibility = View.GONE
} else {
navView.visibility = View.VISIBLE
appBar.visibility = View.VISIBLE
}
}
val toolbar = binding.toolbar
setSupportActionBar(toolbar)
setupActionBarWithNavController(navController, appBarConfiguration)
navView.setupWithNavController(navController)
NavigationUI.setupWithNavController(toolbar, navController, appBarConfiguration)
}
}

View File

@ -0,0 +1,35 @@
package com.example.pizza.Model
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.example.pizza.Model.Order.Order
import com.example.pizza.R
class HistoryAdapter(var orders: List<Order>, var context: Context) : RecyclerView.Adapter<HistoryAdapter.MyViewHolder>() {
class MyViewHolder(view: View) : RecyclerView.ViewHolder(view){
val date: TextView = view.findViewById(R.id.date_order)
val pizzas: TextView = view.findViewById(R.id.pizza_order)
val price: TextView = view.findViewById(R.id.price_order)
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyViewHolder {
val view = LayoutInflater.from(parent.context).inflate(R.layout.history_list,parent,false)
return MyViewHolder(view)
}
override fun getItemCount(): Int {
return orders.count()
}
override fun onBindViewHolder(holder: MyViewHolder, position: Int) {
holder.date.text = orders[position].date
holder.pizzas.text = orders[position].getPizzas()
holder.price.text = orders[position].price.toString()
}
}

View File

@ -0,0 +1,20 @@
package com.example.pizza.Model.Order
import com.example.pizza.Model.Pizza.Pizza
class Order(val date:String, val pizzas: Map<String, Int> , val price : Int ) {
fun getOrders() : List<Order>{
return listOf(
Order("01.01.2023", mapOf("карбонара" to 5, "гриль" to 3,"гриль2" to 3,"гриль3" to 3), 100),
Order("02.01.2023", mapOf("карбонара" to 5), 100)
)
}
fun getPizzas() : String {
var res = ""
for(pizza in pizzas){
res += (pizza.key.toString() + " " + pizza.value.toString() + "x" + '\n')
}
return res
}
}

View File

@ -0,0 +1,59 @@
package com.example.pizza.Model
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.example.pizza.Model.Order.Order
import com.example.pizza.Model.Pizza.Pizza
import com.example.pizza.R
import kotlinx.coroutines.flow.combineTransform
import java.util.function.ToIntFunction
class OrderAdapter(var orders: List<Pizza>, var context: Context, val resSum: TextView ) : RecyclerView.Adapter<OrderAdapter.MyViewHolder>() {
class MyViewHolder(view: View) : RecyclerView.ViewHolder(view) {
val title: TextView = view.findViewById(R.id.order_title)
val btnP: TextView = view.findViewById(R.id.plus)
val btnM: TextView = view.findViewById(R.id.minus)
val count: TextView = view.findViewById(R.id.order_count)
val sum: TextView = view.findViewById(R.id.order_sum)
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyViewHolder {
val view = LayoutInflater.from(parent.context).inflate(R.layout.table_order, parent, false)
return MyViewHolder(view)
}
override fun getItemCount(): Int {
return orders.count()
}
override fun onBindViewHolder(holder: MyViewHolder, position: Int) {
holder.btnM.setOnClickListener{btnMinus(holder,position)}
holder.btnP.setOnClickListener{btnPlus(holder,position)}
holder.title.text = orders[position].title
holder.count.text = "0"
holder.sum.text = "0"
}
fun btnPlus(holder:MyViewHolder,position: Int){
var count = holder.count.text.toString().toInt()
count++
holder.count.text = count.toString()
holder.sum.text = (count * orders[position].price).toString()
resSum.text = (resSum.text.toString().toInt() + orders[position].price).toString()
}
fun btnMinus(holder:MyViewHolder,position: Int){
var count = holder.count.text.toString().toInt()
if(count == 0)
return
count--
holder.count.text = count.toString()
holder.sum.text = (count * orders[position].price).toString()
resSum.text = (resSum.text.toString().toInt() - orders[position].price).toString()
}
}

View File

@ -0,0 +1,18 @@
package com.example.pizza.Model.Pizza
import java.io.Serializable
class Pizza(
val title:String,
val image : String,
val ingredients: List<String>,
val price: Int
): Serializable {
fun getTestPizza(): List<Pizza>{
return listOf(
Pizza("карбонара","pizza", listOf("сыр", "колбаса"), 100),
Pizza("гриль", "pizza",listOf("сыр", "курица"), 200),
Pizza("сырная", "pizza",listOf("сыр", "еще сыр"), 300)
)
}
}

View File

@ -0,0 +1,49 @@
package com.example.pizza.Model
import android.content.Context
import android.content.Intent
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.ImageView
import android.widget.TextView
import android.widget.Toast
import androidx.recyclerview.widget.RecyclerView
import com.example.pizza.Model.Pizza.Pizza
import com.example.pizza.R
class PizzaAdapter(var pizzas: List<Pizza>, var context: Context) : RecyclerView.Adapter<PizzaAdapter.MyViewHolder>() {
class MyViewHolder(view: View) : RecyclerView.ViewHolder(view){
val image: ImageView = view.findViewById(R.id.pizza_list_image)
val title: TextView = view.findViewById(R.id.pizza_list_title)
val ingredients: TextView = view.findViewById(R.id.pizza_list_ingredients)
val price: TextView = view.findViewById(R.id.pizza_list_price)
val btn : Button = view.findViewById(R.id.item_list_botton)
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyViewHolder {
val view = LayoutInflater.from(parent.context).inflate(R.layout.pizza_in_list,parent,false)
return MyViewHolder(view)
}
override fun getItemCount(): Int {
return pizzas.count()
}
override fun onBindViewHolder(holder: MyViewHolder, position: Int) {
holder.title.text = pizzas[position].title
holder.ingredients.text = pizzas[position].ingredients.toString()
holder.price.text = pizzas[position].price.toString()
val imageId = context.resources.getIdentifier(
pizzas[position].image,
"drawable",
context.packageName
)
holder.image.setImageResource(imageId)
}
}

View File

@ -0,0 +1,4 @@
package com.example.pizza.Model.User
class User(val login:String , val email : String , val pass: String , val role : String ) {
}

View File

@ -0,0 +1,36 @@
package com.example.pizza
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.TextView
import androidx.navigation.Navigation
class Reg : Fragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = inflater.inflate(R.layout.fragment_reg, container, false)
view.findViewById<Button>(R.id.button_reg).setOnClickListener {buttonClick(view)}
view.findViewById<TextView>(R.id.link_to_auth).setOnClickListener{TextViewClick(view)}
return view
}
private fun buttonClick(view: View) {
val action = RegDirections
.actionNavigationRegToNavigationPizzaList()
Navigation.findNavController(view).navigate(action)
}
private fun TextViewClick(view: View) {
val action = RegDirections
.actionNavigationRegToNavigationAuth()
Navigation.findNavController(view).navigate(action)
}
}

View File

@ -0,0 +1,34 @@
package com.example.pizza
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.example.pizza.Model.OrderAdapter
import com.example.pizza.Model.Pizza.Pizza
import com.example.pizza.Model.PizzaAdapter
class crate : Fragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = inflater.inflate(R.layout.fragment_crate, container, false)
val itemsList : RecyclerView = view.findViewById(R.id.inOrderList)
//TODO("Загрузка из БД!!")
var p = Pizza("1","1", listOf("1"),1)
var items = p.getTestPizza()
itemsList.layoutManager = LinearLayoutManager(view.context)
var resSum = view.findViewById<TextView>(R.id.sum_pizzas)
itemsList.adapter = OrderAdapter(items,view.context, resSum)
return view
}
}

View File

@ -0,0 +1,45 @@
package com.example.pizza
import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.provider.MediaStore
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.widget.AppCompatImageView
import androidx.core.view.drawToBitmap
import androidx.fragment.app.Fragment
import com.google.android.material.floatingactionbutton.FloatingActionButton
private lateinit var selectedImage: AppCompatImageView
class create_pizza : Fragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = inflater.inflate(R.layout.fragment_create_pizza, container, false)
selectedImage = view.findViewById<AppCompatImageView>(R.id.pizza_image)
selectedImage.setOnClickListener{
val pickImg = Intent(Intent.ACTION_PICK, MediaStore.Images.Media.INTERNAL_CONTENT_URI)
changeImage.launch(pickImg)
}
//TODO добавление в бд
return view
}
private val changeImage =
registerForActivityResult(
ActivityResultContracts.StartActivityForResult()
) {
if (it.resultCode == Activity.RESULT_OK) {
val data = it.data
val imgUri = data?.data
selectedImage.setImageURI(imgUri)
}
}
}

View File

@ -0,0 +1,43 @@
package com.example.pizza
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.TextView
import androidx.navigation.Navigation
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.example.pizza.Model.Order.Order
import com.example.pizza.Model.HistoryAdapter
class user : Fragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = inflater.inflate(R.layout.fragment_user, container, false)
val itemsList : RecyclerView = view.findViewById(R.id.historyList)
view.findViewById<Button>(R.id.button_exit).setOnClickListener {buttonClick(view)}
view.findViewById<TextView>(R.id.user_login).text = view.findViewById<TextView>(R.id.user_login).text.toString() + "VOVA"
view.findViewById<TextView>(R.id.user_email).text = view.findViewById<TextView>(R.id.user_email).text.toString() + "VOVA@MAIL"
//TODO("Загрузка из БД!!")
var p = Order("1", mapOf<String,Int>("1" to 2), 1)
var items = p.getOrders()
itemsList.layoutManager = LinearLayoutManager(view.context)
itemsList.adapter = HistoryAdapter(items,view.context)
return view
}
private fun buttonClick(view: View) {
val action = userDirections
.actionNavigationUserToNavigationAuth()
Navigation.findNavController(view).navigate(action)
}
}

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:color="#BD350A" />
<item android:state_checked="false" android:color="#72ED3E06"/>
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

View File

@ -0,0 +1,10 @@
<vector android:height="24dp"
android:tint="#000000"
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,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-6h2v6zM13,9h-2L11,7h2v2z" />
</vector>

View File

@ -0,0 +1,11 @@
<vector android:autoMirrored="true"
android:height="24dp"
android:tint="#000000"
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="M3,13h2v-2L3,11v2zM3,17h2v-2L3,15v2zM3,9h2L5,7L3,7v2zM7,13h14v-2L7,11v2zM7,17h14v-2L7,15v2zM7,7v2h14L21,7L7,7z" />
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:app="http://schemas.android.com/apk/res-auto"
app:fontProviderAuthority="com.google.android.gms.fonts"
app:fontProviderPackage="com.google.android.gms"
app:fontProviderQuery="name=Inter&amp;weight=700"
app:fontProviderCerts="@array/com_google_android_gms_fonts_certs">
</font-family>

View File

@ -0,0 +1,53 @@
<?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"
android:background="@drawable/back"
tools:context=".MainActivity">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
app:layout_constraintBaseline_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:backgroundTint="#BD350A"
android:background="#BD350A"
app:layout_constraintRight_toRightOf="parent"
android:layout_width="0dp"
android:layout_height="?attr/actionBarSize">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:background="#BD350A"
app:logo="@drawable/logo"
android:backgroundTint="#BD350A"
android:layout_height="?attr/actionBarSize"
style="@style/Widget.MaterialComponents.Toolbar.Primary" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.fragment.app.FragmentContainerView
android:id="@+id/nav_host_fragment_activity_main"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="?attr/actionBarSize"
app:defaultNavHost="true"
app:layout_constraintBottom_toTopOf="@+id/nav_view"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/appbar"
app:navGraph="@navigation/nav_graph" />
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/nav_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="#D6704F"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:menu="@menu/bottom_nav_menu"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:context=".Auth">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#52F1744D"
android:paddingVertical="20dp"
android:paddingHorizontal="20dp"
android:layout_margin="30dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="@font/inter_bold"
android:text="Авторизируйтесь" />
<EditText
android:id="@+id/user_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginVertical="10dp"
android:ems="10"
android:fontFamily="@font/inter_bold"
android:hint="Логин"
android:inputType="text" />
<EditText
android:id="@+id/user_pass"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginVertical="10dp"
android:ems="10"
android:fontFamily="@font/inter_bold"
android:hint="Пароль"
android:inputType="textPassword" />
<Button
android:id="@+id/button_auth"
android:layout_width="220dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:backgroundTint="#BD350A"
android:fontFamily="@font/inter_bold"
android:text="Войти" />
<TextView
android:id="@+id/link_to_reg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="30dp"
android:fontFamily="@font/inter_bold"
android:text="Зарегистрироваться!"
android:textSize="15sp"
android:textStyle="bold" />
</LinearLayout>
<!-- TODO: Update blank fragment layout -->
</FrameLayout>

View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".crate">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="@font/inter_bold"
android:textSize="20sp"
android:text="Корзина" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/inOrderList"
android:layout_width="match_parent"
android:layout_gravity="center"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginBottom="90dp"
android:layout_gravity="bottom">
<TextView
android:id="@+id/sum_pizzas"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_margin="15dp"
android:fontFamily="@font/inter_bold"
android:textSize="15sp"
android:text="0" />
<Button
android:id="@+id/button_buy"
android:layout_width="wrap_content"
android:backgroundTint="#BD350A"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:layout_gravity="right"
android:text="Заказать" />
</LinearLayout>
</FrameLayout>

View File

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".create_pizza">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/inter_bold"
android:orientation="vertical">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/pizza_image"
android:layout_width="200dp"
android:layout_height="200dp"
android:src="@drawable/pizza"
android:layout_gravity="center"
android:layout_marginVertical="20dp"
android:gravity="center"/>
<EditText
android:id="@+id/pizza_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="20dp"
android:ems="10"
android:inputType="text"
android:layout_gravity="center"
android:hint="Название" />
<EditText
android:id="@+id/pizza_ingredients"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="20dp"
android:ems="10"
android:inputType="text"
android:layout_gravity="center"
android:hint="Ингридиенты" />
<EditText
android:id="@+id/pizza_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginVertical="20dp"
android:ems="10"
android:inputType="number"
android:hint="Цена" />
<Button
android:id="@+id/button_save"
android:layout_width="wrap_content"
android:layout_gravity="center"
android:backgroundTint="#BD350A"
android:layout_height="wrap_content"
android:text="Сохранить"/>
</LinearLayout>
</FrameLayout>

View File

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginVertical="10dp"
tools:context=".ListPizza"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="@font/inter_bold"
android:textSize="20sp"
android:layout_marginTop="40dp"
android:text="Пиццы" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/pizzasList"
android:layout_marginTop="15dp"
android:layout_marginHorizontal="20dp"
android:layout_marginVertical="30dp"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<Button
android:id="@+id/button_add"
android:layout_width="wrap_content"
android:layout_marginBottom="70dp"
android:backgroundTint="#BD350A"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:text="+"/>
<!-- TODO: Update blank fragment layout -->
</FrameLayout>

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:context=".Reg">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#52F1744D"
android:orientation="vertical"
android:paddingVertical="20dp"
android:paddingHorizontal="20dp"
android:layout_margin="30dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="@font/inter_bold"
android:layout_marginVertical="10dp"
android:text="Зарегистрируйтесь" />
<EditText
android:id="@+id/user_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="@font/inter_bold"
android:ems="10"
android:layout_marginVertical="10dp"
android:inputType="text"
android:hint="Логин"/>
<EditText
android:id="@+id/user_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/inter_bold"
android:layout_gravity="center"
android:ems="10"
android:layout_marginVertical="10dp"
android:inputType="textEmailAddress"
android:hint="Почта"/>
<EditText
android:id="@+id/user_pass"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/inter_bold"
android:layout_gravity="center"
android:ems="10"
android:layout_marginVertical="10dp"
android:inputType="textPassword"
android:hint="Пароль" />
<Button
android:id="@+id/button_reg"
android:layout_width="220dp"
android:fontFamily="@font/inter_bold"
android:backgroundTint="#BD350A"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Войти" />
<TextView
android:id="@+id/link_to_auth"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="@font/inter_bold"
android:layout_marginTop="30dp"
android:textStyle="bold"
android:textSize="15sp"
android:text="Уже зарегистрированы?" />
</LinearLayout>
</FrameLayout>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".user">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/inter_bold"
android:textSize="20sp"
android:text="Профиль"
android:layout_marginVertical="15dp"
android:layout_gravity="center"
/>
<TextView
android:id="@+id/user_login"
android:fontFamily="@font/inter_bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_gravity="left"
android:text="Логин: "
/>
<TextView
android:id="@+id/user_email"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_gravity="left"
android:text="Почта: "
/>
<Button
android:id="@+id/button_exit"
android:layout_width="150dp"
android:layout_marginTop="15dp"
android:layout_marginRight="15dp"
android:fontFamily="@font/inter_bold"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:backgroundTint="#BD350A"
android:text="Выход" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/historyList"
android:layout_marginHorizontal="20dp"
android:layout_marginVertical="30dp"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<!-- TODO: Update blank fragment layout -->
</FrameLayout>

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="20dp"
android:paddingBottom="20dp"
android:background="#F4D8D8"
>
<TextView
android:id="@+id/date_order"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center"
android:gravity="center_horizontal"
android:fontFamily="@font/inter_bold"
android:text="TextView" />
<TextView
android:id="@+id/pizza_order"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="@font/inter_bold"
android:gravity="center_horizontal"
android:layout_weight="1"
android:inputType="textMultiLine"
android:text="MultiAutoCompleteTextView" />
<TextView
android:id="@+id/price_order"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/inter_bold"
android:layout_gravity="center"
android:gravity="center_horizontal"
android:layout_weight="1"
android:text="TextView" />
</LinearLayout>

View File

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="15dp"
android:orientation="horizontal"
>
<TextView
android:id="@+id/order_title"
android:fontFamily="@font/inter_bold"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:inputType="textMultiLine"
android:text="pizza"
/>
<TextView
android:id="@+id/minus"
android:layout_width="wrap_content"
android:gravity="center"
android:background="#80BD350A"
android:textStyle="bold"
android:fontFamily="@font/inter_bold"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="-" />
<TextView
android:id="@+id/order_count"
android:layout_width="10dp"
android:gravity="center"
android:fontFamily="@font/inter_bold"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="TextView" />
<TextView
android:id="@+id/plus"
android:layout_width="wrap_content"
android:gravity="center"
android:background="#80BD350A"
android:fontFamily="@font/inter_bold"
android:textStyle="bold"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="+" />
<TextView
android:id="@+id/order_sum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/inter_bold"
android:text="TextView" />
</LinearLayout>

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:paddingBottom="20dp"
>
<ImageView
android:id="@+id/pizza_list_image"
android:layout_width="match_parent"
android:fontFamily="@font/inter_bold"
android:layout_gravity="center"
android:layout_height="250dp"
android:scaleType="centerCrop"
android:src="@drawable/sofa" />
<TextView
android:id="@+id/pizza_list_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="20dp"
android:fontFamily="@font/inter_bold"
android:textStyle="bold"
android:textSize="30sp"
android:paddingVertical="10dp"
android:text="TextView" />
<TextView
android:id="@+id/pizza_list_ingredients"
android:layout_width="match_parent"
android:paddingHorizontal="20dp"
android:textSize="20sp"
android:fontFamily="@font/inter_bold"
android:paddingVertical="10dp"
android:layout_height="wrap_content"
android:text="TextView" />
<TextView
android:id="@+id/pizza_list_price"
android:layout_width="match_parent"
android:paddingHorizontal="20dp"
android:layout_height="wrap_content"
android:paddingVertical="10dp"
android:textSize="20sp"
android:gravity="end"
android:fontFamily="@font/inter_bold"
android:text="TextView" />
<Button
android:id="@+id/item_list_botton"
android:layout_width="match_parent"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:backgroundTint="#BD350A"
android:fontFamily="@font/inter_bold"
android:text="Купить" />
</LinearLayout>

View File

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="20dp"
>
<TableRow>
<TextView
android:id="@+id/order_title"
android:fontFamily="@font/inter_bold"
android:layout_marginLeft="10dp"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:inputType="textMultiLine"
android:text="pizza"
/>
<TextView
android:id="@+id/minus"
android:layout_width="wrap_content"
android:gravity="center"
android:background="#80BD350A"
android:textStyle="bold"
android:fontFamily="@font/inter_bold"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="-" />
<TextView
android:id="@+id/order_count"
android:layout_width="10dp"
android:gravity="center"
android:fontFamily="@font/inter_bold"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="TextView" />
<TextView
android:id="@+id/plus"
android:layout_width="wrap_content"
android:gravity="center"
android:background="#80BD350A"
android:fontFamily="@font/inter_bold"
android:textStyle="bold"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="+" />
<TextView
android:id="@+id/order_sum"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginRight="10dp"
android:gravity="right"
android:fontFamily="@font/inter_bold"
android:text="TextView" />
</TableRow>
</TableLayout>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/navigation_user"
android:icon="@drawable/user"
android:title="Профиль" />
<item
android:id="@+id/navigation_crate"
android:icon="@drawable/puper"
android:title="Корзина" />
</menu>

View File

@ -0,0 +1,67 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
app:startDestination="@+id/navigation_auth"
android:id="@+id/nav_graph">
<fragment
android:id="@+id/navigation_auth"
android:name="com.example.pizza.Auth"
android:label="Auth"
tools:layout="@layout/fragment_auth">
<action
android:id="@+id/action_navigation_auth_to_navigation_pizza_list"
app:destination="@id/navigation_pizza_list" />
<action
android:id="@+id/action_navigation_auth_to_navigation_reg"
app:destination="@id/navigation_reg" />
</fragment>
<fragment
android:id="@+id/navigation_reg"
android:name="com.example.pizza.Reg"
android:label="Auth"
tools:layout="@layout/fragment_reg">
<action
android:id="@+id/action_navigation_reg_to_navigation_pizza_list"
app:destination="@id/navigation_pizza_list" />
<action
android:id="@+id/action_navigation_reg_to_navigation_auth"
app:destination="@id/navigation_auth" />
</fragment>
<fragment
android:id="@+id/navigation_pizza_list"
android:name="com.example.pizza.ListPizza"
android:label="pizzas"
tools:layout="@layout/fragment_list_pizza">
<action
android:id="@+id/action_navigation_list_to_navigation_create_pizza"
app:destination="@id/navigation_create_pizza" />
</fragment>
<fragment
android:id="@+id/navigation_crate"
android:name="com.example.pizza.crate"
android:label="crate"
tools:layout="@layout/fragment_crate">
</fragment>
<fragment
android:id="@+id/navigation_create_pizza"
android:name="com.example.pizza.create_pizza"
android:label="create_pizza"
tools:layout="@layout/fragment_create_pizza">
</fragment>
<fragment
android:id="@+id/navigation_user"
android:name="com.example.pizza.user"
android:label="User"
tools:layout="@layout/fragment_user">
<action
android:id="@+id/action_navigation_user_to_navigation_auth"
app:destination="@id/navigation_auth" />
</fragment>
</navigation>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<array name="com_google_android_gms_fonts_certs">
<item>@array/com_google_android_gms_fonts_certs_dev</item>
<item>@array/com_google_android_gms_fonts_certs_prod</item>
</array>
<string-array name="com_google_android_gms_fonts_certs_dev">
<item>
MIIEqDCCA5CgAwIBAgIJANWFuGx90071MA0GCSqGSIb3DQEBBAUAMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTAeFw0wODA0MTUyMzM2NTZaFw0zNTA5MDEyMzM2NTZaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBANbOLggKv+IxTdGNs8/TGFy0PTP6DHThvbbR24kT9ixcOd9W+EaBPWW+wPPKQmsHxajtWjmQwWfna8mZuSeJS48LIgAZlKkpFeVyxW0qMBujb8X8ETrWy550NaFtI6t9+u7hZeTfHwqNvacKhp1RbE6dBRGWynwMVX8XW8N1+UjFaq6GCJukT4qmpN2afb8sCjUigq0GuMwYXrFVee74bQgLHWGJwPmvmLHC69EH6kWr22ijx4OKXlSIx2xT1AsSHee70w5iDBiK4aph27yH3TxkXy9V89TDdexAcKk/cVHYNnDBapcavl7y0RiQ4biu8ymM8Ga/nmzhRKya6G0cGw8CAQOjgfwwgfkwHQYDVR0OBBYEFI0cxb6VTEM8YYY6FbBMvAPyT+CyMIHJBgNVHSMEgcEwgb6AFI0cxb6VTEM8YYY6FbBMvAPyT+CyoYGapIGXMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbYIJANWFuGx90071MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADggEBABnTDPEF+3iSP0wNfdIjIz1AlnrPzgAIHVvXxunW7SBrDhEglQZBbKJEk5kT0mtKoOD1JMrSu1xuTKEBahWRbqHsXclaXjoBADb0kkjVEJu/Lh5hgYZnOjvlba8Ld7HCKePCVePoTJBdI4fvugnL8TsgK05aIskyY0hKI9L8KfqfGTl1lzOv2KoWD0KWwtAWPoGChZxmQ+nBli+gwYMzM1vAkP+aayLe0a1EQimlOalO762r0GXO0ks+UeXde2Z4e+8S/pf7pITEI/tP+MxJTALw9QUWEv9lKTk+jkbqxbsh8nfBUapfKqYn0eidpwq2AzVp3juYl7//fKnaPhJD9gs=
</item>
</string-array>
<string-array name="com_google_android_gms_fonts_certs_prod">
<item>
MIIEQzCCAyugAwIBAgIJAMLgh0ZkSjCNMA0GCSqGSIb3DQEBBAUAMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDAeFw0wODA4MjEyMzEzMzRaFw0zNjAxMDcyMzEzMzRaMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBAKtWLgDYO6IIrgqWbxJOKdoR8qtW0I9Y4sypEwPpt1TTcvZApxsdyxMJZ2JORland2qSGT2y5b+3JKkedxiLDmpHpDsz2WCbdxgxRczfey5YZnTJ4VZbH0xqWVW/8lGmPav5xVwnIiJS6HXk+BVKZF+JcWjAsb/GEuq/eFdpuzSqeYTcfi6idkyugwfYwXFU1+5fZKUaRKYCwkkFQVfcAs1fXA5V+++FGfvjJ/CxURaSxaBvGdGDhfXE28LWuT9ozCl5xw4Yq5OGazvV24mZVSoOO0yZ31j7kYvtwYK6NeADwbSxDdJEqO4k//0zOHKrUiGYXtqw/A0LFFtqoZKFjnkCAQOjgdkwgdYwHQYDVR0OBBYEFMd9jMIhF1Ylmn/Tgt9r45jk14alMIGmBgNVHSMEgZ4wgZuAFMd9jMIhF1Ylmn/Tgt9r45jk14aloXikdjB0MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLR29vZ2xlIEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxEDAOBgNVBAMTB0FuZHJvaWSCCQDC4IdGZEowjTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4IBAQBt0lLO74UwLDYKqs6Tm8/yzKkEu116FmH4rkaymUIE0P9KaMftGlMexFlaYjzmB2OxZyl6euNXEsQH8gjwyxCUKRJNexBiGcCEyj6z+a1fuHHvkiaai+KL8W1EyNmgjmyy8AW7P+LLlkR+ho5zEHatRbM/YAnqGcFh5iZBqpknHf1SKMXFh4dd239FJ1jWYfbMDMy3NS5CTMQ2XFI1MvcyUTdZPErjQfTbQe3aDQsQcafEQPD+nqActifKZ0Np0IS9L9kR/wbNvyz6ENwPiTrjV2KRkEjH78ZMcUQXg0L3BYHJ3lc69Vs5Ddf9uUGGMYldX3WfMBEmh/9iFBDAaTCK
</item>
</string-array>
</resources>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<array name="preloaded_fonts" translatable="false">
<item>@font/inter_bold</item>
</array>
</resources>