Create project and made an application
48
.gitignore
vendored
@ -1,35 +1,15 @@
|
||||
# ---> Android
|
||||
# Gradle files
|
||||
.gradle/
|
||||
build/
|
||||
|
||||
# Local configuration file (sdk path, etc)
|
||||
local.properties
|
||||
|
||||
# Log/OS Files
|
||||
*.log
|
||||
|
||||
# Android Studio generated files and folders
|
||||
captures/
|
||||
.externalNativeBuild/
|
||||
.cxx/
|
||||
*.apk
|
||||
output.json
|
||||
|
||||
# IntelliJ
|
||||
*.iml
|
||||
.idea/
|
||||
misc.xml
|
||||
deploymentTargetDropDown.xml
|
||||
render.experimental.xml
|
||||
|
||||
# Keystore files
|
||||
*.jks
|
||||
*.keystore
|
||||
|
||||
# Google Services (e.g. APIs or Firebase)
|
||||
google-services.json
|
||||
|
||||
# Android Profiling
|
||||
*.hprof
|
||||
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
/.idea/modules.xml
|
||||
/.idea/workspace.xml
|
||||
/.idea/navEditor.xml
|
||||
/.idea/assetWizardSettings.xml
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
.cxx
|
||||
local.properties
|
||||
|
3
.idea/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
1
.idea/.name
Normal file
@ -0,0 +1 @@
|
||||
WatchLinkApp
|
123
.idea/codeStyles/Project.xml
Normal file
@ -0,0 +1,123 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<JetCodeStyleSettings>
|
||||
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
||||
</JetCodeStyleSettings>
|
||||
<codeStyleSettings language="XML">
|
||||
<option name="FORCE_REARRANGE_MODE" value="1" />
|
||||
<indentOptions>
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
</indentOptions>
|
||||
<arrangement>
|
||||
<rules>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:android</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:id</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>style</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>ANDROID_ATTRIBUTE_ORDER</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>.*</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
</rules>
|
||||
</arrangement>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="kotlin">
|
||||
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
5
.idea/codeStyles/codeStyleConfig.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||
</state>
|
||||
</component>
|
6
.idea/compiler.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="17" />
|
||||
</component>
|
||||
</project>
|
20
.idea/gradle.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="GRADLE" />
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="jbr-17" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
</set>
|
||||
</option>
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
41
.idea/inspectionProfiles/Project_Default.xml
Normal file
@ -0,0 +1,41 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="PreviewAnnotationInFunctionWithParameters" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewApiLevelMustBeValid" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewFontScaleMustBeGreaterThanZero" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewMultipleParameterProviders" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewPickerAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
6
.idea/kotlinc.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="KotlinJpsPluginSettings">
|
||||
<option name="version" value="1.8.10" />
|
||||
</component>
|
||||
</project>
|
9
.idea/misc.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
6
.idea/vcs.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
1
app/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/build
|
73
app/build.gradle.kts
Normal file
@ -0,0 +1,73 @@
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.example.watchlinkapp"
|
||||
compileSdk = 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.watchlinkapp"
|
||||
minSdk = 27
|
||||
targetSdk = 33
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
vectorDrawables {
|
||||
useSupportLibrary = true
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
}
|
||||
buildFeatures {
|
||||
compose = true
|
||||
}
|
||||
composeOptions {
|
||||
kotlinCompilerExtensionVersion = "1.4.3"
|
||||
}
|
||||
packaging {
|
||||
resources {
|
||||
excludes += "/META-INF/{AL2.0,LGPL2.1}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("com.google.accompanist:accompanist-systemuicontroller:0.28.0")
|
||||
implementation("com.google.accompanist:accompanist-pager:0.18.0")
|
||||
implementation("androidx.navigation:navigation-compose:2.6.0")
|
||||
implementation("androidx.core:core-ktx:1.12.0")
|
||||
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
|
||||
implementation("androidx.activity:activity-compose:1.8.0")
|
||||
implementation(platform("androidx.compose:compose-bom:2023.10.00"))
|
||||
implementation("androidx.compose.ui:ui")
|
||||
implementation("androidx.compose.ui:ui-graphics")
|
||||
implementation("androidx.compose.ui:ui-tooling-preview")
|
||||
implementation("androidx.compose.material3:material3")
|
||||
implementation("androidx.navigation:navigation-runtime-ktx:2.7.4")
|
||||
implementation("androidx.wear.compose:compose-material3:1.0.0-alpha13")
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
|
||||
androidTestImplementation(platform("androidx.compose:compose-bom:2023.10.00"))
|
||||
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
|
||||
debugImplementation("androidx.compose.ui:ui-tooling")
|
||||
debugImplementation("androidx.compose.ui:ui-test-manifest")
|
||||
}
|
21
app/proguard-rules.pro
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
@ -0,0 +1,24 @@
|
||||
package com.example.watchlinkapp
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class ExampleInstrumentedTest {
|
||||
@Test
|
||||
fun useAppContext() {
|
||||
// Context of the app under test.
|
||||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
||||
assertEquals("com.example.watchlinkapp", appContext.packageName)
|
||||
}
|
||||
}
|
28
app/src/main/AndroidManifest.xml
Normal file
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.WatchLinkApp"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/Theme.WatchLinkApp">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
@ -0,0 +1,2 @@
|
||||
package com.example.watchlinkapp.ComposeUI
|
||||
|
113
app/src/main/java/com/example/watchlinkapp/ComposeUI/Login.kt
Normal file
@ -0,0 +1,113 @@
|
||||
package com.example.watchlinkapp.ComposeUI
|
||||
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.text.KeyboardOptions
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.ButtonColors
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.material3.TextField
|
||||
import androidx.compose.material3.TextFieldDefaults
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.colorResource
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.input.KeyboardType
|
||||
import androidx.compose.ui.text.input.PasswordVisualTransformation
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.navigation.NavController
|
||||
import androidx.navigation.NavGraph.Companion.findStartDestination
|
||||
import com.example.watchlinkapp.ComposeUI.Navigation.Screen
|
||||
import com.example.watchlinkapp.R
|
||||
|
||||
@Composable
|
||||
fun Login(navController: NavController) {
|
||||
var username by remember { mutableStateOf("") }
|
||||
var password by remember { mutableStateOf("") }
|
||||
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.background(color = colorResource(id = R.color.backgroundColor)),
|
||||
verticalArrangement = Arrangement.Center, horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.weight(2f)
|
||||
.padding(bottom = 10.dp),
|
||||
verticalArrangement = Arrangement.Center,
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.login_title),
|
||||
fontSize = 26.sp,
|
||||
fontWeight = FontWeight.Medium,
|
||||
color = Color.White
|
||||
)
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
TextField(
|
||||
value = username,
|
||||
onValueChange = { username = it },
|
||||
label = { Text("Имя пользователя") },
|
||||
colors = TextFieldDefaults.colors(
|
||||
unfocusedLabelColor = Color.LightGray,
|
||||
focusedLabelColor = Color.LightGray,
|
||||
unfocusedTextColor = colorResource(id = R.color.button),
|
||||
focusedTextColor = colorResource(id = R.color.button),
|
||||
unfocusedContainerColor = colorResource(id = R.color.backgroundNavBarColor),
|
||||
focusedContainerColor = colorResource(id = R.color.backgroundNavBarColor)
|
||||
)
|
||||
)
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
TextField(
|
||||
value = password,
|
||||
onValueChange = { password = it },
|
||||
label = { Text("Пароль") },
|
||||
visualTransformation = PasswordVisualTransformation(),
|
||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password),
|
||||
colors = TextFieldDefaults.colors(
|
||||
unfocusedLabelColor = Color.LightGray,
|
||||
focusedLabelColor = Color.LightGray,
|
||||
unfocusedTextColor = colorResource(id = R.color.button),
|
||||
focusedTextColor = colorResource(id = R.color.button),
|
||||
unfocusedContainerColor = colorResource(id = R.color.backgroundNavBarColor),
|
||||
focusedContainerColor = colorResource(id = R.color.backgroundNavBarColor)
|
||||
)
|
||||
)
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
Button(shape = RoundedCornerShape(5.dp), onClick = { navController.navigate(Screen.MovieCatalog.route)},
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = colorResource(id = R.color.backgroundNavBarColor)
|
||||
)) {
|
||||
Text("Вход")
|
||||
}
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
TextButton(onClick = { navController.navigate(Screen.Signup.route) }) {
|
||||
Text(text = "У меня нет учетной записи")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,230 @@
|
||||
package com.example.watchlinkapp.ComposeUI.Navigation
|
||||
|
||||
import androidx.compose.animation.AnimatedVisibility
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
||||
import androidx.compose.material.icons.filled.ArrowBack
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.NavigationBar
|
||||
import androidx.compose.material3.NavigationBarItem
|
||||
import androidx.compose.material3.NavigationBarItemColors
|
||||
import androidx.compose.material3.NavigationBarItemDefaults
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TopAppBar
|
||||
import androidx.compose.material3.TopAppBarDefaults
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.blur
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.RectangleShape
|
||||
import androidx.compose.ui.graphics.graphicsLayer
|
||||
import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import androidx.compose.ui.res.colorResource
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.res.vectorResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.navigation.NavDestination
|
||||
import androidx.navigation.NavDestination.Companion.hierarchy
|
||||
import androidx.navigation.NavGraph.Companion.findStartDestination
|
||||
import androidx.navigation.NavHostController
|
||||
import androidx.navigation.NavType
|
||||
import androidx.navigation.compose.NavHost
|
||||
import androidx.navigation.compose.composable
|
||||
import androidx.navigation.compose.currentBackStackEntryAsState
|
||||
import androidx.navigation.compose.rememberNavController
|
||||
import androidx.navigation.navArgument
|
||||
import com.example.watchlinkapp.ComposeUI.Login
|
||||
import com.example.watchlinkapp.ComposeUI.Profile
|
||||
import com.example.watchlinkapp.ComposeUI.Search
|
||||
import com.example.watchlinkapp.ComposeUI.Signup
|
||||
import com.example.watchlinkapp.Movie.ComposeUI.MovieCatalog
|
||||
import com.example.watchlinkapp.Movie.ComposeUI.MovieView
|
||||
import com.example.watchlinkapp.R
|
||||
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun Topbar(
|
||||
navController: NavHostController,
|
||||
currentScreen: Screen?
|
||||
) {
|
||||
var showImage by remember { mutableStateOf(true) }
|
||||
TopAppBar(
|
||||
colors = TopAppBarDefaults.smallTopAppBarColors(
|
||||
containerColor = colorResource(id = R.color.backgroundColor),
|
||||
titleContentColor = colorResource(id = R.color.statusBarTextColor),
|
||||
),
|
||||
|
||||
title = {
|
||||
if (showImage) {
|
||||
Row(modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.End, verticalAlignment = Alignment.CenterVertically) {
|
||||
// }
|
||||
Column(horizontalAlignment = Alignment.End) {
|
||||
Image(
|
||||
painter = painterResource(id = R.drawable.ivi),
|
||||
contentDescription = "ivi",
|
||||
Modifier.padding(end = 14.dp).size(50.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
navigationIcon = {
|
||||
if (
|
||||
navController.previousBackStackEntry != null && (currentScreen == null || !currentScreen.showInBottomBar)
|
||||
) {
|
||||
showImage = false
|
||||
IconButton(onClick = { navController.navigateUp() }) {
|
||||
Icon(
|
||||
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colorScheme.onPrimary
|
||||
)
|
||||
}
|
||||
}
|
||||
else{
|
||||
showImage = true
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun Navbar(
|
||||
navController: NavHostController,
|
||||
currentDestination: NavDestination?,
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
Row(
|
||||
modifier
|
||||
.fillMaxWidth()
|
||||
.background(
|
||||
colorResource(id = R.color.backgroundNavBarColor),
|
||||
RoundedCornerShape(10.dp)
|
||||
), horizontalArrangement = Arrangement.SpaceAround) {
|
||||
Screen.bottomBarItems.forEach { screen ->
|
||||
val isSelected = currentDestination?.hierarchy?.any { it.route == screen.route } == true
|
||||
val background =
|
||||
if (isSelected) MaterialTheme.colorScheme.primary.copy(alpha = 0.1f) else Color.Transparent
|
||||
val contentColor =
|
||||
if (isSelected) MaterialTheme.colorScheme.primary else Color.LightGray
|
||||
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.clip(RoundedCornerShape(15.dp))
|
||||
//.background(colorResource(id = R.color.backgroundNavBarColor))
|
||||
.clickable(onClick = {
|
||||
navController.navigate(screen.route) {
|
||||
popUpTo(navController.graph.findStartDestination().id) {
|
||||
saveState = true
|
||||
}
|
||||
launchSingleTop = true
|
||||
restoreState = true
|
||||
}
|
||||
})
|
||||
|
||||
) {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.padding(12.dp),//.background(Color.Red),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.Center
|
||||
) {
|
||||
Icon(
|
||||
imageVector = screen.icon,
|
||||
contentDescription = null,
|
||||
tint = contentColor
|
||||
)
|
||||
AnimatedVisibility(
|
||||
visible = isSelected
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(screen.resourceId),
|
||||
color = contentColor
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun Navhost(
|
||||
navController: NavHostController,
|
||||
innerPadding: PaddingValues, modifier:
|
||||
Modifier = Modifier
|
||||
) {
|
||||
NavHost(
|
||||
navController,
|
||||
startDestination = Screen.Login.route,
|
||||
modifier.padding(innerPadding)
|
||||
) {
|
||||
composable(Screen.MovieCatalog.route) { MovieCatalog(navController) }
|
||||
composable(Screen.Profile.route) { Profile() }
|
||||
composable(Screen.Signup.route) { Signup(navController) }
|
||||
composable(Screen.Login.route) { Login(navController) }
|
||||
composable(Screen.Search.route) { Search(navController) }
|
||||
composable(
|
||||
Screen.MovieView.route,
|
||||
arguments = listOf(navArgument("id") { type = NavType.IntType })
|
||||
) { backStackEntry ->
|
||||
backStackEntry.arguments?.let { MovieView(it.getInt("id")) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun MainNavbar() {
|
||||
val navController = rememberNavController()
|
||||
val navBackStackEntry by navController.currentBackStackEntryAsState()
|
||||
val currentDestination = navBackStackEntry?.destination
|
||||
val currentScreen = currentDestination?.route?.let { Screen.getItem(it) }
|
||||
|
||||
Scaffold(modifier = Modifier,
|
||||
topBar = {
|
||||
if (currentScreen != null) {
|
||||
if (currentScreen.isAuthenticated) {
|
||||
Topbar(navController, currentScreen)
|
||||
}
|
||||
}
|
||||
},
|
||||
bottomBar = {
|
||||
if (currentScreen == null || (currentScreen.showInBottomBar && currentScreen.isAuthenticated)) {
|
||||
Navbar(navController, currentDestination, Modifier.padding(all = 8.dp).background(colorResource(id = R.color.backgroundColor)))
|
||||
}
|
||||
},
|
||||
containerColor = colorResource(id = R.color.backgroundColor)
|
||||
) { innerPadding ->
|
||||
Navhost(navController, innerPadding)
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.example.watchlinkapp.ComposeUI.Navigation
|
||||
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.AccountCircle
|
||||
import androidx.compose.material.icons.filled.Favorite
|
||||
import androidx.compose.material.icons.filled.Home
|
||||
import androidx.compose.material.icons.filled.List
|
||||
import androidx.compose.material.icons.filled.Search
|
||||
import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import com.example.watchlinkapp.R
|
||||
|
||||
enum class Screen (
|
||||
val route: String,
|
||||
@StringRes val resourceId: Int,
|
||||
val icon: ImageVector = Icons.Filled.Favorite,
|
||||
val showInBottomBar: Boolean = true,
|
||||
val isAuthenticated: Boolean = true,
|
||||
){
|
||||
MovieCatalog("movie-catalog", R.string.movie_catalog_title, Icons.Filled.Home),
|
||||
Profile("profile", R.string.profile_title, Icons.Filled.AccountCircle),
|
||||
Search("search", R.string.search_title, Icons.Filled.Search),
|
||||
Signup("signup", R.string.signup_title, Icons.Filled.Search, showInBottomBar = false, isAuthenticated = false),
|
||||
Login("login", R.string.login_title, Icons.Filled.Search, showInBottomBar = false, isAuthenticated = false),
|
||||
MovieView("movie-view/{id}", R.string.movie_view_title, Icons.Filled.List, showInBottomBar = false);
|
||||
companion object {
|
||||
val bottomBarItems = listOf(
|
||||
MovieCatalog,
|
||||
Profile,
|
||||
Search,
|
||||
)
|
||||
|
||||
fun getItem(route: String): Screen? {
|
||||
val findRoute = route.split("/").first()
|
||||
return values().find { value -> value.route.startsWith(findRoute) }
|
||||
}
|
||||
}
|
||||
}
|
122
app/src/main/java/com/example/watchlinkapp/ComposeUI/Profile.kt
Normal file
@ -0,0 +1,122 @@
|
||||
package com.example.watchlinkapp.ComposeUI
|
||||
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.text.KeyboardOptions
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.ButtonColors
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.material3.TextField
|
||||
import androidx.compose.material3.TextFieldDefaults
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.colorResource
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.example.watchlinkapp.R
|
||||
|
||||
@Composable
|
||||
fun Profile(){
|
||||
var phoneNumber by remember { mutableStateOf("Ваш номер телефона") }
|
||||
var FIO by remember { mutableStateOf("Имя пользователя") }
|
||||
var dateOfBirth by remember { mutableStateOf("01-01-2000") }
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.background(color = colorResource(id = R.color.backgroundColor)),
|
||||
verticalArrangement = Arrangement.Center, horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.weight(2f)
|
||||
.padding(bottom = 10.dp),
|
||||
verticalArrangement = Arrangement.Center,
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
Image(painter = painterResource(id = R.drawable.icon_profile), contentDescription = "", Modifier.size(140.dp))
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
Text(
|
||||
text = "Профиль",
|
||||
fontSize = 26.sp,
|
||||
fontWeight = FontWeight.Medium,
|
||||
color = Color.White
|
||||
)
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
TextField(
|
||||
value = FIO,
|
||||
onValueChange = { FIO = it },
|
||||
label = { Text("Имя пользователя") },
|
||||
colors = TextFieldDefaults.colors(
|
||||
unfocusedLabelColor = Color.LightGray,
|
||||
focusedLabelColor = Color.LightGray,
|
||||
unfocusedTextColor = colorResource(id = R.color.button),
|
||||
focusedTextColor = colorResource(id = R.color.button),
|
||||
unfocusedContainerColor = colorResource(id = R.color.backgroundNavBarColor),
|
||||
focusedContainerColor = colorResource(id = R.color.backgroundNavBarColor)
|
||||
)
|
||||
)
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
TextField(
|
||||
value = dateOfBirth,
|
||||
onValueChange = { dateOfBirth = it },
|
||||
label = { Text("Дата рождения") },
|
||||
colors = TextFieldDefaults.colors(
|
||||
unfocusedLabelColor = Color.LightGray,
|
||||
focusedLabelColor = Color.LightGray,
|
||||
unfocusedTextColor = colorResource(id = R.color.button),
|
||||
focusedTextColor = colorResource(id = R.color.button),
|
||||
unfocusedContainerColor = colorResource(id = R.color.backgroundNavBarColor),
|
||||
focusedContainerColor = colorResource(id = R.color.backgroundNavBarColor)
|
||||
)
|
||||
)
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
TextField(
|
||||
value = phoneNumber,
|
||||
onValueChange = { phoneNumber = it },
|
||||
label = { Text("Номер телефона") },
|
||||
colors = TextFieldDefaults.colors(
|
||||
unfocusedLabelColor = Color.LightGray,
|
||||
focusedLabelColor = Color.LightGray,
|
||||
unfocusedTextColor = colorResource(id = R.color.button),
|
||||
focusedTextColor = colorResource(id = R.color.button),
|
||||
unfocusedContainerColor = colorResource(id = R.color.backgroundNavBarColor),
|
||||
focusedContainerColor = colorResource(id = R.color.backgroundNavBarColor)
|
||||
)
|
||||
)
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
Button(
|
||||
shape = RoundedCornerShape(5.dp),
|
||||
onClick = { /* Handle saving data */ },
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = colorResource(id = R.color.backgroundNavBarColor)
|
||||
)
|
||||
) {
|
||||
Text("Сохранить")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
189
app/src/main/java/com/example/watchlinkapp/ComposeUI/Search.kt
Normal file
@ -0,0 +1,189 @@
|
||||
package com.example.watchlinkapp.ComposeUI
|
||||
|
||||
|
||||
import androidx.activity.OnBackPressedCallback
|
||||
import androidx.activity.compose.LocalOnBackPressedDispatcherOwner
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.text.KeyboardActions
|
||||
import androidx.compose.foundation.text.KeyboardOptions
|
||||
import androidx.compose.material3.Card
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextFieldDefaults
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.layout.ContentScale
|
||||
import androidx.compose.ui.res.colorResource
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.navigation.NavController
|
||||
import com.example.watchlinkapp.ComposeUI.Navigation.Screen
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.material.*
|
||||
import androidx.compose.material3.TextField
|
||||
import androidx.compose.runtime.DisposableEffect
|
||||
import androidx.compose.runtime.MutableState
|
||||
import androidx.compose.ui.platform.LocalFocusManager
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.TextRange
|
||||
import androidx.compose.ui.text.input.ImeAction
|
||||
import androidx.compose.ui.text.input.TextFieldValue
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.example.watchlinkapp.Movie.Model.Movie
|
||||
import com.example.watchlinkapp.Movie.Model.getMovies
|
||||
import com.example.watchlinkapp.R
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun Search(navController: NavController) {
|
||||
var movies by remember { mutableStateOf(getMovies()) }
|
||||
var filtredMovies by remember { mutableStateOf(getMovies().shuffled().take(10)) }
|
||||
var searchText by remember { mutableStateOf("") }
|
||||
|
||||
Column(modifier = Modifier.fillMaxSize()) {
|
||||
SearchBar(
|
||||
movies = movies,
|
||||
onMoviesChanged = { updatedMovies -> filtredMovies = updatedMovies },
|
||||
searchDisplay = searchText,
|
||||
onSearchDisplayChanged = { text ->
|
||||
searchText = text
|
||||
},
|
||||
onSearchDisplayClosed = { filtredMovies = getMovies() },
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
tint = Color.White
|
||||
)
|
||||
|
||||
LazyColumn(
|
||||
modifier = Modifier
|
||||
.background(colorResource(id = R.color.backgroundColor))
|
||||
.padding(top = 8.dp)
|
||||
) {
|
||||
item {
|
||||
Text(
|
||||
text = "Возможно тебя заинтересует",
|
||||
color = colorResource(id = R.color.textColor),
|
||||
fontWeight = FontWeight.Bold,
|
||||
fontSize = 15.sp,
|
||||
modifier = Modifier.padding(start = 16.dp, bottom = 12.dp)
|
||||
)
|
||||
}
|
||||
val chunkedMovies = filtredMovies.chunked(3)
|
||||
chunkedMovies.forEach { movieChunk ->
|
||||
item {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.padding(start = 8.dp, end = 8.dp, bottom = 8.dp)
|
||||
.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.Start
|
||||
) {
|
||||
movieChunk.forEach { movie ->
|
||||
val movieId =
|
||||
Screen.MovieView.route.replace("{id}", movie.id.toString())
|
||||
Card(
|
||||
modifier = Modifier
|
||||
.padding(
|
||||
start = 8.dp,
|
||||
end = 2.dp,
|
||||
top = 5.dp
|
||||
)
|
||||
.width(110.dp)
|
||||
.fillMaxWidth()
|
||||
.clickable { navController.navigate(movieId) },
|
||||
shape = RoundedCornerShape(5.dp)
|
||||
) {
|
||||
Image(
|
||||
painter = painterResource(id = movie.imageResourceId),
|
||||
contentDescription = "image",
|
||||
contentScale = ContentScale.Crop,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@Composable
|
||||
fun SearchBar(
|
||||
movies: List<Movie>,
|
||||
onMoviesChanged: (List<Movie>) -> Unit,
|
||||
searchDisplay: String,
|
||||
onSearchDisplayChanged: (String) -> Unit,
|
||||
onSearchDisplayClosed: () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
tint: Color = MaterialTheme.colorScheme.onPrimary,
|
||||
) {
|
||||
val focusManager = LocalFocusManager.current
|
||||
|
||||
val onBackPressedDispatcher = LocalOnBackPressedDispatcherOwner.current?.onBackPressedDispatcher
|
||||
DisposableEffect(key1 = onBackPressedDispatcher) {
|
||||
val callback = object : OnBackPressedCallback(true) {
|
||||
override fun handleOnBackPressed() {
|
||||
focusManager.clearFocus()
|
||||
onSearchDisplayClosed()
|
||||
}
|
||||
}
|
||||
onBackPressedDispatcher?.addCallback(callback)
|
||||
|
||||
onDispose {
|
||||
callback.remove()
|
||||
}
|
||||
}
|
||||
|
||||
var textFieldValue by remember {
|
||||
mutableStateOf(TextFieldValue(searchDisplay, TextRange(searchDisplay.length)))
|
||||
}
|
||||
|
||||
TextField(
|
||||
colors = TextFieldDefaults.colors(
|
||||
unfocusedContainerColor = colorResource(id = R.color.backgroundNavBarColor),
|
||||
focusedContainerColor = colorResource(id = R.color.backgroundNavBarColor),
|
||||
focusedTextColor = Color.White,
|
||||
unfocusedTextColor = Color.White
|
||||
),
|
||||
value = textFieldValue,
|
||||
onValueChange = {
|
||||
textFieldValue = it
|
||||
onSearchDisplayChanged(it.text)
|
||||
val updatedMovies = movies.filter { movie -> movie.title.startsWith(it.text, ignoreCase = true) }
|
||||
onMoviesChanged(updatedMovies)
|
||||
},
|
||||
trailingIcon = {
|
||||
// Ваш иконка поиска
|
||||
},
|
||||
modifier = modifier,
|
||||
label = {
|
||||
Text(text = "Поиск...", color = tint)
|
||||
},
|
||||
keyboardOptions = KeyboardOptions(
|
||||
imeAction = ImeAction.Done
|
||||
),
|
||||
keyboardActions = KeyboardActions(
|
||||
onDone = {
|
||||
focusManager.clearFocus()
|
||||
onSearchDisplayClosed()
|
||||
}
|
||||
),
|
||||
)
|
||||
}
|
129
app/src/main/java/com/example/watchlinkapp/ComposeUI/Signup.kt
Normal file
@ -0,0 +1,129 @@
|
||||
package com.example.watchlinkapp.ComposeUI
|
||||
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.text.KeyboardOptions
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.ButtonColors
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.material3.TextField
|
||||
import androidx.compose.material3.TextFieldDefaults
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.colorResource
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.input.KeyboardType
|
||||
import androidx.compose.ui.text.input.PasswordVisualTransformation
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.navigation.NavController
|
||||
import androidx.navigation.NavGraph.Companion.findStartDestination
|
||||
import com.example.watchlinkapp.ComposeUI.Navigation.Screen
|
||||
import com.example.watchlinkapp.R
|
||||
|
||||
@Composable
|
||||
fun Signup(navController: NavController) {
|
||||
var username by remember { mutableStateOf("") }
|
||||
var password by remember { mutableStateOf("") }
|
||||
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.background(color = colorResource(id = R.color.backgroundColor)),
|
||||
verticalArrangement = Arrangement.Center, horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.weight(2f)
|
||||
.padding(bottom = 10.dp),
|
||||
verticalArrangement = Arrangement.Center,
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.signup_title),
|
||||
fontSize = 26.sp,
|
||||
fontWeight = FontWeight.Medium,
|
||||
color = Color.White
|
||||
)
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
TextField(
|
||||
value = username,
|
||||
onValueChange = { username = it },
|
||||
label = { Text("Имя пользователя") },
|
||||
colors = TextFieldDefaults.colors(
|
||||
unfocusedLabelColor = Color.LightGray,
|
||||
focusedLabelColor = Color.LightGray,
|
||||
unfocusedTextColor = colorResource(id = R.color.button),
|
||||
focusedTextColor = colorResource(id = R.color.button),
|
||||
unfocusedContainerColor = colorResource(id = R.color.backgroundNavBarColor),
|
||||
focusedContainerColor = colorResource(id = R.color.backgroundNavBarColor)
|
||||
)
|
||||
)
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
TextField(
|
||||
value = password,
|
||||
onValueChange = { password = it },
|
||||
label = { Text("Пароль") },
|
||||
visualTransformation = PasswordVisualTransformation(),
|
||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password),
|
||||
colors = TextFieldDefaults.colors(
|
||||
unfocusedLabelColor = Color.LightGray,
|
||||
focusedLabelColor = Color.LightGray,
|
||||
unfocusedTextColor = colorResource(id = R.color.button),
|
||||
focusedTextColor = colorResource(id = R.color.button),
|
||||
unfocusedContainerColor = colorResource(id = R.color.backgroundNavBarColor),
|
||||
focusedContainerColor = colorResource(id = R.color.backgroundNavBarColor)
|
||||
)
|
||||
)
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
TextField(
|
||||
value = password,
|
||||
onValueChange = { password = it },
|
||||
label = { Text("Подтвердите пароль") },
|
||||
visualTransformation = PasswordVisualTransformation(),
|
||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password),
|
||||
colors = TextFieldDefaults.colors(
|
||||
unfocusedLabelColor = Color.LightGray,
|
||||
focusedLabelColor = Color.LightGray,
|
||||
unfocusedTextColor = colorResource(id = R.color.button),
|
||||
focusedTextColor = colorResource(id = R.color.button),
|
||||
unfocusedContainerColor = colorResource(id = R.color.backgroundNavBarColor),
|
||||
focusedContainerColor = colorResource(id = R.color.backgroundNavBarColor)
|
||||
)
|
||||
)
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
Button(shape = RoundedCornerShape(5.dp), onClick = { navController.navigate(Screen.Login.route) },
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = colorResource(id = R.color.backgroundNavBarColor)
|
||||
)) {
|
||||
Text("Зарегистрироваться")
|
||||
}
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
TextButton(onClick = { navController.navigate(Screen.Login.route) }) {
|
||||
Text(text = "У меня есть учетная запись")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
29
app/src/main/java/com/example/watchlinkapp/MainActivity.kt
Normal file
@ -0,0 +1,29 @@
|
||||
package com.example.watchlinkapp
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.SideEffect
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.colorResource
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import com.example.watchlinkapp.ComposeUI.Navigation.MainNavbar
|
||||
import com.example.watchlinkapp.ComposeUI.Navigation.Topbar
|
||||
import com.example.watchlinkapp.ui.theme.WatchLinkAppTheme
|
||||
import com.google.accompanist.systemuicontroller.rememberSystemUiController
|
||||
|
||||
class MainActivity : ComponentActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContent {
|
||||
MainNavbar()
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,138 @@
|
||||
package com.example.watchlinkapp.Movie.ComposeUI
|
||||
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.layout.wrapContentWidth
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.LazyRow
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.Card
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.layout.ContentScale
|
||||
import androidx.compose.ui.res.colorResource
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.navigation.NavController
|
||||
import com.example.watchlinkapp.ComposeUI.Navigation.Screen
|
||||
import com.example.watchlinkapp.Movie.Model.Movie
|
||||
import com.example.watchlinkapp.Movie.Model.getMovies
|
||||
import com.example.watchlinkapp.R
|
||||
import com.google.accompanist.pager.ExperimentalPagerApi
|
||||
import com.google.accompanist.pager.HorizontalPager
|
||||
import com.google.accompanist.pager.rememberPagerState
|
||||
import kotlinx.coroutines.delay
|
||||
|
||||
@Composable
|
||||
fun MovieCatalog(navController: NavController) {
|
||||
val movies = getMovies()
|
||||
|
||||
LazyColumn(
|
||||
modifier = Modifier
|
||||
.background(colorResource(id = R.color.backgroundColor))
|
||||
) {
|
||||
item {
|
||||
BannerView()
|
||||
}
|
||||
val genres = movies.map { it.genre }.distinct()
|
||||
genres.forEach { genre ->
|
||||
item {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.padding(start = 10.dp)
|
||||
.width(180.dp)
|
||||
) {
|
||||
Text(
|
||||
text = genre,
|
||||
color = Color.White,
|
||||
fontSize = 15.sp,
|
||||
fontWeight = FontWeight.Normal,
|
||||
modifier = Modifier
|
||||
.padding(top = 8.dp)
|
||||
.wrapContentWidth()
|
||||
)
|
||||
}
|
||||
}
|
||||
item {
|
||||
LazyRow(
|
||||
modifier = Modifier
|
||||
//.background(Color.Red)
|
||||
.padding(bottom = 8.dp)
|
||||
.fillMaxWidth()
|
||||
) {
|
||||
val moviesByGenre = movies.filter { it.genre == genre }
|
||||
items(moviesByGenre.size) { index ->
|
||||
val movie = moviesByGenre[index]
|
||||
val movieId = Screen.MovieView.route.replace("{id}", movie.id.toString())
|
||||
Card(
|
||||
modifier = Modifier
|
||||
.padding(
|
||||
start = 8.dp,
|
||||
end = 2.dp,
|
||||
top = 5.dp
|
||||
)//.background(Color.Green)
|
||||
//.widthIn(min = 150.dp, max = 200.dp)
|
||||
.width(110.dp)
|
||||
.fillMaxWidth()
|
||||
.clickable { navController.navigate(movieId) },
|
||||
shape = RoundedCornerShape(5.dp)
|
||||
) {
|
||||
Image(
|
||||
painter = painterResource(id = movie.imageResourceId),
|
||||
contentDescription = "image",
|
||||
contentScale = ContentScale.Crop,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
//.clip((5.dp))
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@OptIn(ExperimentalPagerApi::class)
|
||||
@Composable
|
||||
fun BannerView() {
|
||||
val images = listOf(
|
||||
painterResource(R.drawable.banner_image1),
|
||||
painterResource(R.drawable.banner_image2),
|
||||
painterResource(R.drawable.banner_image3)
|
||||
)
|
||||
var currentPage by remember { mutableStateOf(0) }
|
||||
LaunchedEffect(currentPage) {
|
||||
while (true) {
|
||||
delay(3000)
|
||||
currentPage = (currentPage + 1) % images.size
|
||||
}
|
||||
}
|
||||
val pagerState = rememberPagerState(
|
||||
pageCount = images.size,
|
||||
initialPage = currentPage,
|
||||
infiniteLoop = true)
|
||||
|
||||
HorizontalPager(state = pagerState) { page ->
|
||||
Image(
|
||||
painter = images[page],
|
||||
contentDescription = null,
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
contentScale = ContentScale.FillWidth
|
||||
)
|
||||
}
|
||||
}
|
@ -0,0 +1,153 @@
|
||||
package com.example.watchlinkapp.Movie.ComposeUI
|
||||
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.fillMaxHeight
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.Divider
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.OutlinedTextField
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextFieldDefaults
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.layout.ContentScale
|
||||
import androidx.compose.ui.res.colorResource
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.example.watchlinkapp.Movie.Model.Movie
|
||||
import com.example.watchlinkapp.Movie.Model.getMovies
|
||||
import com.example.watchlinkapp.R
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun MovieView(id: Int) {
|
||||
val movie = getMovies().find { it.id == id }
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(all = 10.dp)
|
||||
) {
|
||||
movie?.let {
|
||||
LazyColumn(modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally) {
|
||||
item {
|
||||
Image(
|
||||
painter = painterResource(id = movie.imageResourceId),
|
||||
contentDescription = null, // Укажите соответствующее описание
|
||||
modifier = Modifier
|
||||
//.fillMaxHeight()
|
||||
.width(200.dp)
|
||||
.clip(RoundedCornerShape(10.dp)),
|
||||
contentScale = ContentScale.Crop
|
||||
)
|
||||
}
|
||||
item {
|
||||
Column(modifier = Modifier.padding(start = 16.dp)) {
|
||||
OutlinedTextField(
|
||||
readOnly = true,
|
||||
value = movie.title,
|
||||
onValueChange = { /*TODO*/ },
|
||||
label = { Text("Title", color = Color.LightGray) },
|
||||
colors = TextFieldDefaults.outlinedTextFieldColors(
|
||||
unfocusedTextColor = Color.LightGray,
|
||||
focusedBorderColor = Color.Gray, // Цвет рамки при фокусе
|
||||
unfocusedBorderColor = Color.Gray // Цвет рамки при отсутствии фокуса
|
||||
),
|
||||
modifier = Modifier.padding(bottom = 8.dp)
|
||||
)
|
||||
OutlinedTextField(
|
||||
readOnly = true,
|
||||
value = "${movie.genre}",
|
||||
onValueChange = { /*TODO*/ },
|
||||
label = { Text("Genre", color = Color.LightGray) },
|
||||
colors = TextFieldDefaults.outlinedTextFieldColors(
|
||||
unfocusedTextColor = Color.LightGray,
|
||||
focusedBorderColor = Color.Gray, // Цвет рамки при фокусе
|
||||
unfocusedBorderColor = Color.Gray // Цвет рамки при отсутствии фокуса
|
||||
),
|
||||
modifier = Modifier.padding(bottom = 8.dp)
|
||||
)
|
||||
OutlinedTextField(
|
||||
readOnly = true,
|
||||
value = "${movie.releaseYear}",
|
||||
onValueChange = { /*TODO*/ },
|
||||
label = { Text("Release Year", color = Color.LightGray) },
|
||||
colors = TextFieldDefaults.outlinedTextFieldColors(
|
||||
unfocusedTextColor = Color.LightGray,
|
||||
focusedBorderColor = Color.Gray, // Цвет рамки при фокусе
|
||||
unfocusedBorderColor = Color.Gray // Цвет рамки при отсутствии фокуса
|
||||
),
|
||||
modifier = Modifier.padding(bottom = 8.dp)
|
||||
)
|
||||
OutlinedTextField(
|
||||
readOnly = true,
|
||||
value = "${movie.duration} minutes",
|
||||
onValueChange = { /*TODO*/ },
|
||||
label = { Text("Duration", color = Color.LightGray) },
|
||||
colors = TextFieldDefaults.outlinedTextFieldColors(
|
||||
unfocusedTextColor = Color.LightGray,
|
||||
focusedBorderColor = Color.Gray, // Цвет рамки при фокусе
|
||||
unfocusedBorderColor = Color.Gray // Цвет рамки при отсутствии фокуса
|
||||
),
|
||||
modifier = Modifier.padding(bottom = 8.dp)
|
||||
)
|
||||
OutlinedTextField(
|
||||
readOnly = true,
|
||||
value = "${movie.rating}",
|
||||
onValueChange = { /*TODO*/ },
|
||||
label = { Text("Rating", color = Color.LightGray) },
|
||||
colors = TextFieldDefaults.outlinedTextFieldColors(
|
||||
unfocusedTextColor = Color.LightGray,
|
||||
focusedBorderColor = Color.Gray, // Цвет рамки при фокусе
|
||||
unfocusedBorderColor = Color.Gray // Цвет рамки при отсутствии фокуса
|
||||
),
|
||||
modifier = Modifier.padding(bottom = 8.dp)
|
||||
)
|
||||
}
|
||||
Divider(Modifier.padding(vertical = 16.dp))
|
||||
OutlinedTextField(
|
||||
readOnly = true,
|
||||
value = movie.synopsis,
|
||||
onValueChange = { /*TODO*/ },
|
||||
label = { Text("Synopsis", color = Color.LightGray) },
|
||||
colors = TextFieldDefaults.outlinedTextFieldColors(
|
||||
unfocusedTextColor = Color.LightGray,
|
||||
focusedBorderColor = Color.Gray, // Цвет рамки при фокусе
|
||||
unfocusedBorderColor = Color.Gray // Цвет рамки при отсутствии фокуса
|
||||
),
|
||||
modifier = Modifier.padding(bottom = 8.dp)
|
||||
)
|
||||
OutlinedTextField(
|
||||
readOnly = true,
|
||||
value = "${movie.director}",
|
||||
onValueChange = { /*TODO*/ },
|
||||
label = { Text("Director", color = Color.LightGray) },
|
||||
colors = TextFieldDefaults.outlinedTextFieldColors(
|
||||
unfocusedTextColor = Color.LightGray,
|
||||
focusedBorderColor = Color.Gray, // Цвет рамки при фокусе
|
||||
unfocusedBorderColor = Color.Gray // Цвет рамки при отсутствии фокуса
|
||||
),
|
||||
modifier = Modifier.padding(bottom = 8.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
208
app/src/main/java/com/example/watchlinkapp/Movie/Model/Movie.kt
Normal file
@ -0,0 +1,208 @@
|
||||
package com.example.watchlinkapp.Movie.Model
|
||||
|
||||
import com.example.watchlinkapp.R
|
||||
import java.io.Serializable
|
||||
|
||||
data class Movie(
|
||||
val id: Int,
|
||||
val title: String,
|
||||
val genre: String,
|
||||
val releaseYear: Int,
|
||||
val duration: Double,
|
||||
val rating: Double,
|
||||
val synopsis: String,
|
||||
val director: String,
|
||||
val imageResourceId: Int
|
||||
) : Serializable
|
||||
|
||||
fun getMovies(): List<Movie> {
|
||||
return listOf(
|
||||
Movie(
|
||||
1,
|
||||
"Inception",
|
||||
"Sci-Fi",
|
||||
2010,
|
||||
2.28,
|
||||
8.8,
|
||||
"A thief who steals corporate secrets through the use of dream-sharing technology is given the inverse task of planting an idea into the mind of a C.E.O.",
|
||||
"Christopher Nolan",
|
||||
R.drawable.image1
|
||||
),
|
||||
Movie(
|
||||
2,
|
||||
"The Shawshank Redemption",
|
||||
"Drama",
|
||||
1994,
|
||||
2.22,
|
||||
9.3,
|
||||
"Two imprisoned men bond over a number of years, finding solace and eventual redemption through acts of common decency.",
|
||||
"Frank Darabont",
|
||||
R.drawable.image2
|
||||
),
|
||||
Movie(
|
||||
3,
|
||||
"The Godfather",
|
||||
"Crime",
|
||||
1972,
|
||||
2.58,
|
||||
9.2,
|
||||
"The aging patriarch of an organized crime dynasty transfers control of his clandestine empire to his reluctant son.",
|
||||
"Francis Ford Coppola",
|
||||
R.drawable.image3
|
||||
),
|
||||
Movie(
|
||||
4,
|
||||
"The Dark Knight",
|
||||
"Action",
|
||||
2008,
|
||||
2.32,
|
||||
9.0,
|
||||
"When the menace known as the Joker wreaks havoc and chaos on the people of Gotham, Batman must accept one of the greatest psychological and physical tests of his ability to fight injustice.",
|
||||
"Christopher Nolan",
|
||||
R.drawable.image4
|
||||
),
|
||||
Movie(
|
||||
5,
|
||||
"Pulp Fiction",
|
||||
"Crime",
|
||||
1994,
|
||||
2.34,
|
||||
8.9,
|
||||
"The lives of two mob hitmen, a boxer, a gangster and his wife, and a pair of diner bandits intertwine in four tales of violence and redemption.",
|
||||
"Quentin Tarantino",
|
||||
R.drawable.image5
|
||||
),
|
||||
Movie(
|
||||
6,
|
||||
"Interstellar",
|
||||
"Sci-Fi",
|
||||
2014,
|
||||
2.49,
|
||||
8.6,
|
||||
"A team of explorers travel through a wormhole in space in an attempt to ensure humanity's survival.",
|
||||
"Christopher Nolan",
|
||||
R.drawable.image6
|
||||
),
|
||||
Movie(
|
||||
7,
|
||||
"The Matrix",
|
||||
"Sci-Fi",
|
||||
1999,
|
||||
2.16,
|
||||
8.7,
|
||||
"A computer hacker learns from mysterious rebels about the true nature of his reality and his role in the war against its controllers.",
|
||||
"Lana Wachowski, Lilly Wachowski",
|
||||
R.drawable.image7
|
||||
),
|
||||
Movie(
|
||||
8,
|
||||
"Gravity",
|
||||
"Sci-Fi",
|
||||
2013,
|
||||
1.91,
|
||||
7.7,
|
||||
"Two astronauts work together to survive after an accident leaves them stranded in space.",
|
||||
"Alfonso Cuarón",
|
||||
R.drawable.image8
|
||||
),
|
||||
Movie(
|
||||
9,
|
||||
"Forrest Gump",
|
||||
"Drama",
|
||||
1994,
|
||||
2.22,
|
||||
8.8,
|
||||
"The presidencies of Kennedy and Johnson, the Vietnam War, and the Watergate scandal unfold through the perspective of an Alabama man with an IQ of 75.",
|
||||
"Robert Zemeckis",
|
||||
R.drawable.image9
|
||||
),
|
||||
Movie(
|
||||
10,
|
||||
"The Green Mile",
|
||||
"Drama",
|
||||
1999,
|
||||
3.09,
|
||||
8.6,
|
||||
"The lives of guards on Death Row are affected by one of their charges: a black man accused of child murder and rape, yet who has a mysterious gift.",
|
||||
"Frank Darabont",
|
||||
R.drawable.image10
|
||||
),
|
||||
Movie(
|
||||
11,
|
||||
"The Pursuit of Happyness",
|
||||
"Drama",
|
||||
2006,
|
||||
1.89,
|
||||
8.0,
|
||||
"A struggling salesman takes custody of his son as he's poised to begin a life-changing professional endeavor.",
|
||||
"Gabriele Muccino",
|
||||
R.drawable.image11
|
||||
),
|
||||
Movie(
|
||||
12,
|
||||
"The Departed",
|
||||
"Crime",
|
||||
2006,
|
||||
2.31,
|
||||
8.5,
|
||||
"An undercover cop and a mole in the police attempt to identify each other while infiltrating an Irish gang in South Boston.",
|
||||
"Martin Scorsese",
|
||||
R.drawable.image12
|
||||
),
|
||||
Movie(
|
||||
13,
|
||||
"Goodfellas",
|
||||
"Crime",
|
||||
1990,
|
||||
2.25,
|
||||
8.7,
|
||||
"The story of Henry Hill and his life in the mob, covering his relationship with his wife Karen Hill and his mob partners Jimmy Conway and Tommy DeVito in the Italian-American crime syndicate.",
|
||||
"Martin Scorsese",
|
||||
R.drawable.image13
|
||||
),
|
||||
Movie(
|
||||
14,
|
||||
"Die Hard",
|
||||
"Action",
|
||||
1988,
|
||||
2.12,
|
||||
8.2,
|
||||
"An NYPD officer tries to save his wife and several others taken hostage by German terrorists during a Christmas party at the Nakatomi Plaza in Los Angeles.",
|
||||
"John McTiernan",
|
||||
R.drawable.image14
|
||||
),
|
||||
Movie(
|
||||
15,
|
||||
"Mad Max: Fury Road",
|
||||
"Action",
|
||||
2015,
|
||||
2.0,
|
||||
8.1,
|
||||
"In a post-apocalyptic wasteland, a woman rebels against a tyrannical ruler in search of her homeland with the aid of a group of female prisoners, a psychotic worshiper, and a drifter named Max.",
|
||||
"George Miller",
|
||||
R.drawable.image15
|
||||
),
|
||||
Movie(
|
||||
16,
|
||||
"Reservoir Dogs",
|
||||
"Crime",
|
||||
1992,
|
||||
1.40,
|
||||
8.3,
|
||||
"When a simple jewelry heist goes horribly wrong, the surviving criminals begin to suspect that one of them is a police informant.",
|
||||
"Quentin Tarantino",
|
||||
R.drawable.image16
|
||||
),
|
||||
Movie(
|
||||
17,
|
||||
"Django Unchained",
|
||||
"Crime",
|
||||
2012,
|
||||
2.45,
|
||||
8.4,
|
||||
"With the help of a German bounty hunter, a freed slave sets out to rescue his wife from a brutal Mississippi plantation owner.",
|
||||
"Quentin Tarantino",
|
||||
R.drawable.image17
|
||||
)
|
||||
)
|
||||
}
|
11
app/src/main/java/com/example/watchlinkapp/ui/theme/Color.kt
Normal file
@ -0,0 +1,11 @@
|
||||
package com.example.watchlinkapp.ui.theme
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
|
||||
val Purple80 = Color(0xFFD0BCFF)
|
||||
val PurpleGrey80 = Color(0xFFCCC2DC)
|
||||
val Pink80 = Color(0xFFEFB8C8)
|
||||
|
||||
val Purple40 = Color(0xFF6650a4)
|
||||
val PurpleGrey40 = Color(0xFF625b71)
|
||||
val Pink40 = Color(0xFF7D5260)
|
70
app/src/main/java/com/example/watchlinkapp/ui/theme/Theme.kt
Normal file
@ -0,0 +1,70 @@
|
||||
package com.example.watchlinkapp.ui.theme
|
||||
|
||||
import android.app.Activity
|
||||
import android.os.Build
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.darkColorScheme
|
||||
import androidx.compose.material3.dynamicDarkColorScheme
|
||||
import androidx.compose.material3.dynamicLightColorScheme
|
||||
import androidx.compose.material3.lightColorScheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.SideEffect
|
||||
import androidx.compose.ui.graphics.toArgb
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.core.view.WindowCompat
|
||||
|
||||
private val DarkColorScheme = darkColorScheme(
|
||||
primary = Purple80,
|
||||
secondary = PurpleGrey80,
|
||||
tertiary = Pink80
|
||||
)
|
||||
|
||||
private val LightColorScheme = lightColorScheme(
|
||||
primary = Purple40,
|
||||
secondary = PurpleGrey40,
|
||||
tertiary = Pink40
|
||||
|
||||
/* Other default colors to override
|
||||
background = Color(0xFFFFFBFE),
|
||||
surface = Color(0xFFFFFBFE),
|
||||
onPrimary = Color.White,
|
||||
onSecondary = Color.White,
|
||||
onTertiary = Color.White,
|
||||
onBackground = Color(0xFF1C1B1F),
|
||||
onSurface = Color(0xFF1C1B1F),
|
||||
*/
|
||||
)
|
||||
|
||||
@Composable
|
||||
fun WatchLinkAppTheme(
|
||||
darkTheme: Boolean = isSystemInDarkTheme(),
|
||||
// Dynamic color is available on Android 12+
|
||||
dynamicColor: Boolean = true,
|
||||
content: @Composable () -> Unit
|
||||
) {
|
||||
val colorScheme = when {
|
||||
dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
|
||||
val context = LocalContext.current
|
||||
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
|
||||
}
|
||||
|
||||
darkTheme -> DarkColorScheme
|
||||
else -> LightColorScheme
|
||||
}
|
||||
val view = LocalView.current
|
||||
if (!view.isInEditMode) {
|
||||
SideEffect {
|
||||
val window = (view.context as Activity).window
|
||||
window.statusBarColor = colorScheme.primary.toArgb()
|
||||
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme
|
||||
}
|
||||
}
|
||||
|
||||
MaterialTheme(
|
||||
colorScheme = colorScheme,
|
||||
typography = Typography,
|
||||
content = content
|
||||
)
|
||||
}
|
34
app/src/main/java/com/example/watchlinkapp/ui/theme/Type.kt
Normal file
@ -0,0 +1,34 @@
|
||||
package com.example.watchlinkapp.ui.theme
|
||||
|
||||
import androidx.compose.material3.Typography
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.sp
|
||||
|
||||
// Set of Material typography styles to start with
|
||||
val Typography = Typography(
|
||||
bodyLarge = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 16.sp,
|
||||
lineHeight = 24.sp,
|
||||
letterSpacing = 0.5.sp
|
||||
)
|
||||
/* Other default text styles to override
|
||||
titleLarge = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 22.sp,
|
||||
lineHeight = 28.sp,
|
||||
letterSpacing = 0.sp
|
||||
),
|
||||
labelSmall = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
fontWeight = FontWeight.Medium,
|
||||
fontSize = 11.sp,
|
||||
lineHeight = 16.sp,
|
||||
letterSpacing = 0.5.sp
|
||||
)
|
||||
*/
|
||||
)
|
BIN
app/src/main/res/drawable/banner_image1.png
Normal file
After Width: | Height: | Size: 383 KiB |
BIN
app/src/main/res/drawable/banner_image2.png
Normal file
After Width: | Height: | Size: 312 KiB |
BIN
app/src/main/res/drawable/banner_image3.png
Normal file
After Width: | Height: | Size: 442 KiB |
5
app/src/main/res/drawable/baseline_person_24.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<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,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>
|
5
app/src/main/res/drawable/baseline_search_24.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<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="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/>
|
||||
</vector>
|
170
app/src/main/res/drawable/ic_launcher_background.xml
Normal file
@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
30
app/src/main/res/drawable/ic_launcher_foreground.xml
Normal file
@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
14
app/src/main/res/drawable/icon_profile.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="800dp"
|
||||
android:height="800dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M6.75,6.5C6.75,3.601 9.101,1.25 12,1.25C14.899,1.25 17.25,3.601 17.25,6.5C17.25,9.399 14.899,11.75 12,11.75C9.101,11.75 6.75,9.399 6.75,6.5Z"
|
||||
android:fillColor="#672287"
|
||||
android:fillType="evenOdd"/>
|
||||
<path
|
||||
android:pathData="M4.25,18.571C4.25,15.632 6.632,13.25 9.571,13.25H14.429C17.368,13.25 19.75,15.632 19.75,18.571C19.75,20.879 17.879,22.75 15.571,22.75H8.429C6.121,22.75 4.25,20.879 4.25,18.571Z"
|
||||
android:fillColor="#502a89"
|
||||
android:fillType="evenOdd"/>
|
||||
</vector>
|
BIN
app/src/main/res/drawable/image1.jpg
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
app/src/main/res/drawable/image10.png
Normal file
After Width: | Height: | Size: 80 KiB |
BIN
app/src/main/res/drawable/image11.png
Normal file
After Width: | Height: | Size: 79 KiB |
BIN
app/src/main/res/drawable/image12.png
Normal file
After Width: | Height: | Size: 85 KiB |
BIN
app/src/main/res/drawable/image13.png
Normal file
After Width: | Height: | Size: 65 KiB |
BIN
app/src/main/res/drawable/image14.png
Normal file
After Width: | Height: | Size: 82 KiB |
BIN
app/src/main/res/drawable/image15.png
Normal file
After Width: | Height: | Size: 72 KiB |
BIN
app/src/main/res/drawable/image16.png
Normal file
After Width: | Height: | Size: 77 KiB |
BIN
app/src/main/res/drawable/image17.png
Normal file
After Width: | Height: | Size: 92 KiB |
BIN
app/src/main/res/drawable/image18.png
Normal file
After Width: | Height: | Size: 89 KiB |
BIN
app/src/main/res/drawable/image19.png
Normal file
After Width: | Height: | Size: 80 KiB |
BIN
app/src/main/res/drawable/image2.jpg
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
app/src/main/res/drawable/image20.png
Normal file
After Width: | Height: | Size: 98 KiB |
BIN
app/src/main/res/drawable/image21.png
Normal file
After Width: | Height: | Size: 83 KiB |
BIN
app/src/main/res/drawable/image3.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/drawable/image4.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/drawable/image5.jpg
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
app/src/main/res/drawable/image6.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/drawable/image7.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/drawable/image8.png
Normal file
After Width: | Height: | Size: 68 KiB |
BIN
app/src/main/res/drawable/image9.png
Normal file
After Width: | Height: | Size: 86 KiB |
BIN
app/src/main/res/drawable/images/p1/main-foto.png
Normal file
After Width: | Height: | Size: 383 KiB |
BIN
app/src/main/res/drawable/images/p1/main-foto1.png
Normal file
After Width: | Height: | Size: 312 KiB |
BIN
app/src/main/res/drawable/images/p1/main-foto2.png
Normal file
After Width: | Height: | Size: 442 KiB |
BIN
app/src/main/res/drawable/images/p1/Гудбай, Америка.jpg
Normal file
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 13 KiB |
BIN
app/src/main/res/drawable/images/p1/Команда котиков.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/drawable/images/p1/Молодой человек.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/drawable/images/p1/Ниндзяго Мастера кружицу.jpg
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
app/src/main/res/drawable/images/p1/Семейка монстров.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/drawable/images/p1/Фиксики против кработов.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/drawable/images/p2/2021/Город кошек.png
Normal file
After Width: | Height: | Size: 68 KiB |
BIN
app/src/main/res/drawable/images/p2/2021/Зависнуть.png
Normal file
After Width: | Height: | Size: 86 KiB |
BIN
app/src/main/res/drawable/images/p2/2021/Звездные войны.png
Normal file
After Width: | Height: | Size: 80 KiB |
BIN
app/src/main/res/drawable/images/p2/2021/Прекрасная эпоха.png
Normal file
After Width: | Height: | Size: 79 KiB |
BIN
app/src/main/res/drawable/images/p2/2021/Слоеный торт.png
Normal file
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 65 KiB |
BIN
app/src/main/res/drawable/images/p2/2021/Таксист.png
Normal file
After Width: | Height: | Size: 82 KiB |
BIN
app/src/main/res/drawable/images/p2/2022/Век Адалин.png
Normal file
After Width: | Height: | Size: 72 KiB |
BIN
app/src/main/res/drawable/images/p2/2022/Дело Коллини.png
Normal file
After Width: | Height: | Size: 77 KiB |
BIN
app/src/main/res/drawable/images/p2/2022/Легенды Орленка.png
Normal file
After Width: | Height: | Size: 92 KiB |
BIN
app/src/main/res/drawable/images/p2/2022/Нормальный только я.png
Normal file
After Width: | Height: | Size: 89 KiB |
After Width: | Height: | Size: 80 KiB |
BIN
app/src/main/res/drawable/images/p2/2022/Холоп.png
Normal file
After Width: | Height: | Size: 98 KiB |
BIN
app/src/main/res/drawable/images/p2/2022/Экстрасенс.png
Normal file
After Width: | Height: | Size: 83 KiB |
After Width: | Height: | Size: 75 KiB |
After Width: | Height: | Size: 69 KiB |
After Width: | Height: | Size: 70 KiB |
BIN
app/src/main/res/drawable/images/p3/2021/Ранняя пташка.png
Normal file
After Width: | Height: | Size: 63 KiB |
BIN
app/src/main/res/drawable/images/p3/2021/Химера.png
Normal file
After Width: | Height: | Size: 65 KiB |
BIN
app/src/main/res/drawable/images/p3/2021/Черная любовь.png
Normal file
After Width: | Height: | Size: 86 KiB |
BIN
app/src/main/res/drawable/images/p3/2021/Эльбрус.png
Normal file
After Width: | Height: | Size: 62 KiB |
BIN
app/src/main/res/drawable/images/p3/2022/Ветреный.png
Normal file
After Width: | Height: | Size: 83 KiB |
BIN
app/src/main/res/drawable/images/p3/2022/Дом дракона.png
Normal file
After Width: | Height: | Size: 88 KiB |
BIN
app/src/main/res/drawable/images/p3/2022/Друзья.png
Normal file
After Width: | Height: | Size: 80 KiB |
BIN
app/src/main/res/drawable/images/p3/2022/Любовь напрокат.png
Normal file
After Width: | Height: | Size: 79 KiB |
BIN
app/src/main/res/drawable/images/p3/2022/Новые сваты.png
Normal file
After Width: | Height: | Size: 70 KiB |
BIN
app/src/main/res/drawable/images/p3/2022/Сверхъестественное.png
Normal file
After Width: | Height: | Size: 84 KiB |
After Width: | Height: | Size: 44 KiB |
BIN
app/src/main/res/drawable/images/p4/1.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/drawable/images/p4/2.png
Normal file
After Width: | Height: | Size: 43 KiB |
57
app/src/main/res/drawable/ivi.xml
Normal file
@ -0,0 +1,57 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="77dp"
|
||||
android:height="56dp"
|
||||
android:viewportWidth="77"
|
||||
android:viewportHeight="56">
|
||||
<path
|
||||
android:pathData="M40.512,30.794C38.621,47.274 34.685,50.402 18.205,48.512C1.726,46.621 -1.401,42.683 0.488,26.204C2.379,9.724 6.316,6.598 22.796,8.489C39.275,10.378 42.403,14.315 40.512,30.795V30.794Z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:startX="44.965"
|
||||
android:startY="73.64"
|
||||
android:endX="0.021"
|
||||
android:endY="6.412"
|
||||
android:type="linear">
|
||||
<item android:offset="0.798" android:color="#FFF30745"/>
|
||||
<item android:offset="0.977" android:color="#FFFFBCCE"/>
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:pathData="M73.019,18.553C71.374,18.553 70.006,19.21 68.708,21.185L63.531,28.993L63.999,22.899C64.172,20.614 62.735,18.553 60.173,18.553C57.784,18.553 56.312,20.164 56.173,22.19L55.359,33.322C55.169,36.127 56.606,37.685 58.961,37.685C61.316,37.685 62.666,36.075 63.705,34.516L68.708,26.951L68.258,33.322C68.068,35.937 69.435,37.685 71.998,37.685C74.37,37.685 75.894,36.282 76.049,34.17L76.88,22.898C77.036,20.717 75.963,18.553 73.019,18.553ZM53.317,32.317C53.317,29.771 51.378,28.126 48.815,27.798C51.204,27.296 53.3,25.72 53.3,23.157C53.3,20.318 51.101,18.708 47.067,18.725H38.895C35.121,18.725 33.718,20.249 33.424,24.404L32.939,31.364C32.61,36.039 33.943,37.51 38.549,37.51H46.374C50.876,37.51 53.317,35.658 53.317,32.316V32.317ZM45.595,31.815C45.595,33.425 44.348,34.187 42.271,34.187L40.068,34.169C40.068,34.169 40.413,31.902 40.636,29.633H42.652C44.383,29.633 45.595,30.343 45.595,31.815ZM45.681,24.197C45.681,25.582 44.556,26.413 42.565,26.413H40.908C40.908,26.413 41.073,23.887 40.965,22.067H42.79C44.607,22.067 45.681,22.846 45.681,24.196L45.681,24.197Z"
|
||||
android:fillColor="#fff"/>
|
||||
<path
|
||||
android:pathData="M27.267,18.583C25.605,18.583 24.275,19.247 22.946,21.205L17.777,28.997L18.256,22.94C18.404,20.65 16.964,18.583 14.416,18.583C12.052,18.583 10.575,20.171 10.427,22.202L9.615,33.355C9.43,36.125 10.87,37.712 13.159,37.712C15.449,37.712 16.889,36.05 17.961,34.536L22.945,26.965L22.503,33.354C22.281,35.939 23.684,37.711 26.232,37.711C28.596,37.711 30.146,36.308 30.294,34.203L31.107,22.94C31.292,20.724 30.221,18.583 27.266,18.583H27.267Z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:startX="19.513"
|
||||
android:startY="28.053"
|
||||
android:endX="11.525"
|
||||
android:endY="27.039"
|
||||
android:type="linear">
|
||||
<item android:offset="0.15" android:color="#FFFFFFFF"/>
|
||||
<item android:offset="0.62" android:color="#99FFFFFF"/>
|
||||
<item android:offset="1" android:color="#00FFFFFF"/>
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:pathData="M18.249,22.945L17.769,29.002L17.953,34.541C16.881,36.056 15.441,37.717 13.152,37.717C10.862,37.717 9.422,36.13 9.607,33.36L10.419,22.207C10.567,20.176 12.044,18.588 14.408,18.588C16.956,18.588 18.396,20.656 18.249,22.945Z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:startX="12.146"
|
||||
android:startY="37.572"
|
||||
android:endX="14.313"
|
||||
android:endY="25.753"
|
||||
android:type="linear">
|
||||
<item android:offset="0.15" android:color="#FFFFFFFF"/>
|
||||
<item android:offset="0.62" android:color="#99FFFFFF"/>
|
||||
<item android:offset="1" android:color="#00FFFFFF"/>
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:pathData="M18.264,22.624C18.264,20.512 16.898,18.581 14.387,18.581C11.875,18.581 10.418,20.464 10.418,22.496C10.418,24.674 12.053,26.373 14.342,26.373C16.632,26.373 18.264,24.802 18.264,22.624Z"
|
||||
android:fillColor="#fff"/>
|
||||
</vector>
|