lab 3 modif

This commit is contained in:
Володя 2023-11-29 10:21:50 +03:00
parent 683679737a
commit da5b03bd7c
12 changed files with 206 additions and 8 deletions

80
app/build.gradle.kts Normal file
View File

@ -0,0 +1,80 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("androidx.navigation.safeargs.kotlin")
id("kotlin-kapt")
}
android {
namespace = "com.example.pizza"
compileSdk = 33
defaultConfig {
applicationId = "com.example.pizza"
minSdk = 24
targetSdk = 33
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
buildFeatures {
dataBinding = true
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
viewBinding = true
}
}
dependencies {
// Core
implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.6.2")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2")
implementation("com.google.android.material:material:1.9.0")
implementation("androidx.navigation:navigation-fragment-ktx:2.6.0")
implementation("androidx.navigation:navigation-ui-ktx:2.6.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
// Room
val room_version = "2.5.2"
implementation("androidx.room:room-runtime:$room_version")
annotationProcessor("androidx.room:room-compiler:$room_version")
kapt("androidx.room:room-compiler:$room_version")
implementation("androidx.room:room-ktx:$room_version")
implementation("androidx.room:room-rxjava3:$room_version")
implementation("androidx.room:room-paging:$room_version")
implementation("androidx.room:room-paging-rxjava3:$room_version")
implementation("io.reactivex.rxjava3:rxandroid:3.0.2")
// Paging
val paging_version = "3.1.1"
implementation("androidx.paging:paging-runtime:$paging_version")
// optional - RxJava3 support
implementation("androidx.paging:paging-rxjava3:$paging_version")
// Test
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
}

View File

@ -7,7 +7,7 @@
android:dataExtractionRules="@xml/data_extraction_rules" android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules" android:fullBackupContent="@xml/backup_rules"
android:icon="@drawable/icon" android:icon="@drawable/icon"
android:label="@string/app_name" android:label="Pizza"
android:roundIcon="@drawable/icon" android:roundIcon="@drawable/icon"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/Theme.Pizza" android:theme="@style/Theme.Pizza"

View File

@ -7,7 +7,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="500dp"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/crateText" android:id="@+id/crateText"
@ -22,7 +22,7 @@
android:id="@+id/inOrderList" android:id="@+id/inOrderList"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_height="wrap_content" /> android:layout_height="match_parent" />
</LinearLayout> </LinearLayout>
@ -30,14 +30,17 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="horizontal"
android:layout_marginBottom="90dp" android:layout_marginBottom="90dp"
android:layout_gravity="bottom"> android:layout_marginTop="20dp"
android:layout_gravity="bottom"
android:gravity="right">
<TextView <TextView
android:id="@+id/sum_pizzas" android:id="@+id/sum_pizzas"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="right" android:layout_gravity="center"
android:layout_margin="15dp" android:layout_margin="15dp"
android:fontFamily="@font/inter_bold" android:fontFamily="@font/inter_bold"
android:textSize="15sp" android:textSize="15sp"
@ -48,7 +51,7 @@
android:backgroundTint="#BD350A" android:backgroundTint="#BD350A"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="15dp" android:layout_margin="15dp"
android:layout_gravity="right" android:layout_gravity="center"
android:text="Заказать" /> android:text="Заказать" />
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>

View File

@ -7,6 +7,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginVertical="20dp"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -49,7 +50,8 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/historyList" android:id="@+id/historyList"
android:layout_marginHorizontal="20dp" android:layout_marginHorizontal="20dp"
android:layout_marginVertical="30dp" android:layout_marginTop="10dp"
android:layout_marginBottom="50dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />

View File

@ -0,0 +1,9 @@
<resources>
<!-- Base application theme. -->
<style name="Theme.Pizza" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">#882506</item>
<item name="colorSecondary">#3C1103</item>
<item name="android:statusBarColor">#882506</item>
</style>
</resources>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?><!--
Sample backup rules file; uncomment and customize as necessary.
See https://developer.android.com/guide/topics/data/autobackup
for details.
Note: This file is ignored for devices older that API 31
See https://developer.android.com/about/versions/12/backup-restore
-->
<full-backup-content>
<!--
<include domain="sharedpref" path="."/>
<exclude domain="sharedpref" path="device.xml"/>
-->
</full-backup-content>

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?><!--
Sample data extraction rules file; uncomment and customize as necessary.
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
for details.
-->
<data-extraction-rules>
<cloud-backup>
<!-- TODO: Use <include> and <exclude> to control what is backed up.
<include .../>
<exclude .../>
-->
</cloud-backup>
<!--
<device-transfer>
<include .../>
<exclude .../>
</device-transfer>
-->
</data-extraction-rules>

15
build.gradle.kts Normal file
View File

@ -0,0 +1,15 @@
buildscript {
repositories {
google()
}
dependencies {
val nav_version = "2.7.3"
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version")
}
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "8.1.3" apply false
id("org.jetbrains.kotlin.android") version "1.9.0" apply false
}

23
gradle.properties Normal file
View File

@ -0,0 +1,23 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true

View File

@ -0,0 +1,6 @@
#Wed Nov 15 19:13:50 MSK 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

10
local.properties Normal file
View File

@ -0,0 +1,10 @@
## This file is automatically generated by Android Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file should *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=C\:\\androidSDK

18
settings.gradle.kts Normal file
View File

@ -0,0 +1,18 @@
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name = "pizza"
include(":app")