Initial commit

This commit is contained in:
E41212133_Naufal Kadhafi 2025-02-25 18:17:27 +07:00
commit 35fbf04385
89 changed files with 3258 additions and 0 deletions

15
.gitignore vendored Normal file
View File

@ -0,0 +1,15 @@
*.iml
.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
View File

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

6
.idea/compiler.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="17" />
</component>
</project>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetSelector">
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
</SelectionState>
</selectionStates>
</component>
</project>

19
.idea/gradle.xml Normal file
View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveExternalAnnotations" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>

View 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
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinJpsPluginSettings">
<option name="version" value="1.9.0" />
</component>
</project>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MaterialThemeProjectNewConfig">
<option name="metadata">
<MTProjectMetadataState>
<option name="migrated" value="true" />
<option name="pristineConfig" value="false" />
<option name="userId" value="1d973e5a:18cba8701c3:-8000" />
<option name="version" value="8.13.2" />
</MTProjectMetadataState>
</option>
</component>
</project>

10
.idea/migrations.xml Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectMigrations">
<option name="MigrateToGradleLocalJavaHome">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</component>
</project>

13
.idea/misc.xml Normal file
View File

@ -0,0 +1,13 @@
<project version="4">
<component name="DiscordProjectSettings">
<option name="show" value="ASK" />
<option name="description" value="" />
</component>
<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>

461
.idea/other.xml Normal file
View File

@ -0,0 +1,461 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="direct_access_persist.xml">
<option name="deviceSelectionList">
<list>
<PersistentDeviceSelectionData>
<option name="api" value="27" />
<option name="brand" value="DOCOMO" />
<option name="codename" value="F01L" />
<option name="id" value="F01L" />
<option name="manufacturer" value="FUJITSU" />
<option name="name" value="F-01L" />
<option name="screenDensity" value="360" />
<option name="screenX" value="720" />
<option name="screenY" value="1280" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="OPPO" />
<option name="codename" value="OP573DL1" />
<option name="id" value="OP573DL1" />
<option name="manufacturer" value="OPPO" />
<option name="name" value="CPH2557" />
<option name="screenDensity" value="480" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="28" />
<option name="brand" value="DOCOMO" />
<option name="codename" value="SH-01L" />
<option name="id" value="SH-01L" />
<option name="manufacturer" value="SHARP" />
<option name="name" value="AQUOS sense2 SH-01L" />
<option name="screenDensity" value="480" />
<option name="screenX" value="1080" />
<option name="screenY" value="2160" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="Lenovo" />
<option name="codename" value="TB370FU" />
<option name="id" value="TB370FU" />
<option name="manufacturer" value="Lenovo" />
<option name="name" value="Tab P12" />
<option name="screenDensity" value="340" />
<option name="screenX" value="1840" />
<option name="screenY" value="2944" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
<option name="codename" value="a15" />
<option name="id" value="a15" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="A15" />
<option name="screenDensity" value="450" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
<option name="codename" value="a35x" />
<option name="id" value="a35x" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="A35" />
<option name="screenDensity" value="450" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="31" />
<option name="brand" value="samsung" />
<option name="codename" value="a51" />
<option name="id" value="a51" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy A51" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="akita" />
<option name="id" value="akita" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 8a" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="motorola" />
<option name="codename" value="arcfox" />
<option name="id" value="arcfox" />
<option name="manufacturer" value="Motorola" />
<option name="name" value="razr plus 2024" />
<option name="screenDensity" value="360" />
<option name="screenX" value="1080" />
<option name="screenY" value="1272" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="samsung" />
<option name="codename" value="b0q" />
<option name="id" value="b0q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S22 Ultra" />
<option name="screenDensity" value="600" />
<option name="screenX" value="1440" />
<option name="screenY" value="3088" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="32" />
<option name="brand" value="google" />
<option name="codename" value="bluejay" />
<option name="id" value="bluejay" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 6a" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="caiman" />
<option name="id" value="caiman" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 9 Pro" />
<option name="screenDensity" value="360" />
<option name="screenX" value="960" />
<option name="screenY" value="2142" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="comet" />
<option name="id" value="comet" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 9 Pro Fold" />
<option name="screenDensity" value="390" />
<option name="screenX" value="2076" />
<option name="screenY" value="2152" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="29" />
<option name="brand" value="samsung" />
<option name="codename" value="crownqlteue" />
<option name="id" value="crownqlteue" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy Note9" />
<option name="screenDensity" value="420" />
<option name="screenX" value="2220" />
<option name="screenY" value="1080" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
<option name="codename" value="dm2q" />
<option name="id" value="dm2q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="S23 Plus" />
<option name="screenDensity" value="450" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
<option name="codename" value="dm3q" />
<option name="id" value="dm3q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S23 Ultra" />
<option name="screenDensity" value="600" />
<option name="screenX" value="1440" />
<option name="screenY" value="3088" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
<option name="codename" value="e1q" />
<option name="id" value="e1q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S24" />
<option name="screenDensity" value="480" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
<option name="codename" value="e3q" />
<option name="id" value="e3q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S24 Ultra" />
<option name="screenDensity" value="450" />
<option name="screenX" value="1440" />
<option name="screenY" value="3120" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
<option name="codename" value="eos" />
<option name="id" value="eos" />
<option name="manufacturer" value="Google" />
<option name="name" value="Eos" />
<option name="screenDensity" value="320" />
<option name="screenX" value="384" />
<option name="screenY" value="384" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
<option name="codename" value="felix" />
<option name="id" value="felix" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel Fold" />
<option name="screenDensity" value="420" />
<option name="screenX" value="2208" />
<option name="screenY" value="1840" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="felix" />
<option name="id" value="felix" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel Fold" />
<option name="screenDensity" value="420" />
<option name="screenX" value="2208" />
<option name="screenY" value="1840" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
<option name="codename" value="felix_camera" />
<option name="id" value="felix_camera" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel Fold (Camera-enabled)" />
<option name="screenDensity" value="420" />
<option name="screenX" value="2208" />
<option name="screenY" value="1840" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="motorola" />
<option name="codename" value="fogona" />
<option name="id" value="fogona" />
<option name="manufacturer" value="Motorola" />
<option name="name" value="moto g play - 2024" />
<option name="screenDensity" value="280" />
<option name="screenX" value="720" />
<option name="screenY" value="1600" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
<option name="codename" value="g0q" />
<option name="id" value="g0q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="SM-S906U1" />
<option name="screenDensity" value="450" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="samsung" />
<option name="codename" value="gts8uwifi" />
<option name="id" value="gts8uwifi" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy Tab S8 Ultra" />
<option name="screenDensity" value="320" />
<option name="screenX" value="1848" />
<option name="screenY" value="2960" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="husky" />
<option name="id" value="husky" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 8 Pro" />
<option name="screenDensity" value="390" />
<option name="screenX" value="1008" />
<option name="screenY" value="2244" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="30" />
<option name="brand" value="motorola" />
<option name="codename" value="java" />
<option name="id" value="java" />
<option name="manufacturer" value="Motorola" />
<option name="name" value="G20" />
<option name="screenDensity" value="280" />
<option name="screenX" value="720" />
<option name="screenY" value="1600" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="komodo" />
<option name="id" value="komodo" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 9 Pro XL" />
<option name="screenDensity" value="360" />
<option name="screenX" value="1008" />
<option name="screenY" value="2244" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
<option name="codename" value="lynx" />
<option name="id" value="lynx" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 7a" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="motorola" />
<option name="codename" value="maui" />
<option name="id" value="maui" />
<option name="manufacturer" value="Motorola" />
<option name="name" value="moto g play - 2023" />
<option name="screenDensity" value="280" />
<option name="screenX" value="720" />
<option name="screenY" value="1600" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="31" />
<option name="brand" value="google" />
<option name="codename" value="oriole" />
<option name="id" value="oriole" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 6" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
<option name="codename" value="panther" />
<option name="id" value="panther" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 7" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
<option name="codename" value="q5q" />
<option name="id" value="q5q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy Z Fold5" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1812" />
<option name="screenY" value="2176" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
<option name="codename" value="q6q" />
<option name="id" value="q6q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy Z Fold6" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1856" />
<option name="screenY" value="2160" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="30" />
<option name="brand" value="google" />
<option name="codename" value="r11" />
<option name="id" value="r11" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel Watch" />
<option name="screenDensity" value="320" />
<option name="screenX" value="384" />
<option name="screenY" value="384" />
<option name="type" value="WEAR_OS" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
<option name="codename" value="r11q" />
<option name="id" value="r11q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="SM-S711U" />
<option name="screenDensity" value="450" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="30" />
<option name="brand" value="google" />
<option name="codename" value="redfin" />
<option name="id" value="redfin" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 5" />
<option name="screenDensity" value="440" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="shiba" />
<option name="id" value="shiba" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 8" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
<option name="codename" value="t2q" />
<option name="id" value="t2q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S21 Plus" />
<option name="screenDensity" value="394" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
<option name="codename" value="tangorpro" />
<option name="id" value="tangorpro" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel Tablet" />
<option name="screenDensity" value="320" />
<option name="screenX" value="1600" />
<option name="screenY" value="2560" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="tokay" />
<option name="id" value="tokay" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 9" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2424" />
</PersistentDeviceSelectionData>
</list>
</option>
</component>
</project>

1
app/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/build

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

@ -0,0 +1,73 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrains.kotlin.android)
}
android {
namespace = "com.example.caloryapp"
compileSdk = 35
defaultConfig {
applicationId = "com.example.caloryapp"
minSdk = 24
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.5.1"
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}
dependencies {
// library add
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.material)
// implementation (libs.ohteepee)
implementation (libs.ohteepee)
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.activity.compose)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.ui)
implementation(libs.androidx.ui.graphics)
implementation(libs.androidx.ui.tooling.preview)
implementation(libs.androidx.material3)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.ui.test.junit4)
debugImplementation(libs.androidx.ui.tooling)
debugImplementation(libs.androidx.ui.test.manifest)
}

21
app/proguard-rules.pro vendored Normal file
View 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

View File

@ -0,0 +1,24 @@
package com.example.caloryapp
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.caloryapp", appContext.packageName)
}
}

View 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.CaloryApp"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.CaloryApp">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View File

@ -0,0 +1,43 @@
package com.example.caloryapp
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import com.example.caloryapp.pages.NavBarScreen
import com.example.caloryapp.ui.theme.CaloryAppTheme
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContent {
CaloryAppTheme {
NavBarScreen()
// ChangePasswordScreen(navController = rememberNavController())
// Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
// Greeting(
// name = "Android",
// modifier = Modifier.padding(innerPadding)
// )
// }
}
}
}
}
//@Composable
//fun Greeting(name: String, modifier: Modifier = Modifier) {
// Text(
// text = "Hello $name!",
// modifier = modifier
// )
//}
//
//@Preview(showBackground = true)
//@Composable
//fun GreetingPreview() {
// CaloryAppTheme {
// Greeting("Android")
// }
//}

View File

@ -0,0 +1,50 @@
package com.example.caloryapp.navigation
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import com.example.caloryapp.pages.onboard.LoginScreen
import com.example.caloryapp.pages.NavBarScreen
import com.example.caloryapp.pages.onboard.ChangePasswordScreen
import com.example.caloryapp.pages.onboard.ForgotPasswordScreen
import com.example.caloryapp.pages.onboard.OTPVerificationScreen
import com.example.caloryapp.pages.onboard.OnBoardingScreen
import com.example.caloryapp.pages.onboard.SuccessChangePassword
import com.example.caloryapp.pages.onboard.SuccessRegister
@Composable
fun Navigation(modifier: Modifier = Modifier) {
val navController = rememberNavController()
NavHost(
navController = navController,
startDestination = NavigationScreen.OnBoardingScreen.name
) {
composable(NavigationScreen.OnBoardingScreen.name) {
OnBoardingScreen(navController = navController)
}
composable(NavigationScreen.LoginScreen.name) {
LoginScreen(navController = navController)
}
composable(NavigationScreen.NavBarScreen.name) {
NavBarScreen()
}
composable(NavigationScreen.ForgotPasswordScreen.name) {
ForgotPasswordScreen(navController = navController)
}
composable(NavigationScreen.ChangePasswordScreen.name) {
ChangePasswordScreen(navController = navController)
}
composable(NavigationScreen.OTPVerificationScreen.name) {
OTPVerificationScreen(navController = navController)
}
composable(NavigationScreen.SuccessRegister.name) {
SuccessRegister(navController = navController)
}
composable(NavigationScreen.SuccessChangePassword.name) {
SuccessChangePassword(navController = navController)
}
}
}

View File

@ -0,0 +1,30 @@
package com.example.caloryapp.navigation
enum class NavigationScreen {
OnBoardingScreen,
LoginScreen,
NavBarScreen,
HomeScreen,
ForgotPasswordScreen,
ChangePasswordScreen,
OTPVerificationScreen,
SuccessChangePassword,
SuccessRegister,
ProfileScreen;
fun fromRoute(route: String): NavigationScreen =
when (route.substringBefore("/")) {
OnBoardingScreen.name -> OnBoardingScreen
LoginScreen.name -> LoginScreen
NavBarScreen.name -> NavBarScreen
HomeScreen.name -> HomeScreen
ProfileScreen.name -> ProfileScreen
ForgotPasswordScreen.name -> ForgotPasswordScreen
ChangePasswordScreen.name -> ChangePasswordScreen
OTPVerificationScreen.name -> OTPVerificationScreen
SuccessChangePassword.name -> SuccessChangePassword
SuccessRegister.name -> SuccessRegister
else -> throw IllegalArgumentException("$route gagal bji")
}
}

View File

@ -0,0 +1,139 @@
package com.example.caloryapp.pages
import android.annotation.SuppressLint
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.*
import androidx.compose.runtime.*
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.res.painterResource
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.NavHostController
import androidx.navigation.compose.*
import com.example.caloryapp.R
import com.example.caloryapp.pages.account.ProfileScreen
import com.example.caloryapp.pages.dashboard.HomeScreen
import com.example.caloryapp.ui.theme.bold
import com.example.caloryapp.ui.theme.primary
sealed class BottomNavigationScreen(
val title: String,
val filledIcon: Int,
val outlinedIcon: Int
) {
data object HomeScreen :
BottomNavigationScreen("Home", R.drawable.ic_home_filled, R.drawable.ic_home_outlined)
data object ProfileScreen :
BottomNavigationScreen("Akun", R.drawable.ic_profile_filled, R.drawable.ic_profile_outlined)
}
@SuppressLint("UnusedMaterialScaffoldPaddingParameter")
@Composable
fun NavBarScreen(modifier: Modifier = Modifier) {
val navController = rememberNavController()
val items = listOf(
BottomNavigationScreen.HomeScreen,
BottomNavigationScreen.ProfileScreen
)
Scaffold(
bottomBar = { CustomBottomNavigation(navController, items) },
floatingActionButton = {
FloatingActionButton(
onClick = { /* TODO: Tambahkan aksi tombol scan */ },
backgroundColor = Color(0xFF28A745),
contentColor = Color.White,
elevation = FloatingActionButtonDefaults.elevation(8.dp),
modifier = Modifier.size(64.dp)
) {
Icon(painterResource(id = R.drawable.scan), contentDescription = "Scan")
}
},
floatingActionButtonPosition = FabPosition.Center,
isFloatingActionButtonDocked = true,
content = {
NavHost(
navController = navController,
startDestination = BottomNavigationScreen.HomeScreen.title
) {
composable(BottomNavigationScreen.HomeScreen.title) {
HomeScreen(navController = navController)
}
composable(BottomNavigationScreen.ProfileScreen.title) {
ProfileScreen(navController = navController)
}
}
}
)
}
@Composable
fun CustomBottomNavigation(navController: NavHostController, items: List<BottomNavigationScreen>) {
val navBackStackEntry by navController.currentBackStackEntryAsState()
val currentRoute = navBackStackEntry?.destination?.route
Box(
modifier = Modifier
.fillMaxWidth()
.height(70.dp)
.background(Color.Transparent),
contentAlignment = Alignment.BottomCenter
) {
Box(
modifier = Modifier
.fillMaxWidth()
.height(64.dp)
.clip(RoundedCornerShape(topStart = 25.dp, topEnd = 25.dp))
.background(Color.White),
contentAlignment = Alignment.Center
) {
Row(
modifier = Modifier
.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceAround
) {
items.forEach { screen ->
val isSelected = currentRoute == screen.title
Column(
modifier = Modifier
.clickable(
onClick = {
navController.navigate(screen.title) {
popUpTo(navController.graph.startDestinationId) {
saveState = true
}
launchSingleTop = true
}
},
indication = null,
interactionSource = remember { MutableInteractionSource() }
),
horizontalAlignment = Alignment.CenterHorizontally
) {
val iconId = if (isSelected) screen.filledIcon else screen.outlinedIcon
Icon(
painter = painterResource(id = iconId),
contentDescription = screen.title,
tint = if (isSelected) primary else Color.Gray,
modifier = Modifier.size(24.dp)
)
Text(
text = screen.title,
color = if (isSelected) primary else Color.Gray,
fontSize = 14.sp,
fontFamily = bold
)
}
}
}
}
}
}

View File

@ -0,0 +1,9 @@
package com.example.caloryapp.pages.account
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
@Composable
fun ProfileDetailScreen(modifier: Modifier = Modifier) {
}

View File

@ -0,0 +1,186 @@
package com.example.caloryapp.pages.account
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.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.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.NavController
import com.example.caloryapp.R
import com.example.caloryapp.ui.theme.background
import com.example.caloryapp.ui.theme.bold
import com.example.caloryapp.ui.theme.primaryblack
import com.example.caloryapp.ui.theme.primarygrey
import com.example.caloryapp.ui.theme.primaryred
import com.example.caloryapp.widget.SimpleAlertDialog
@Composable
fun ProfileScreen(modifier: Modifier = Modifier, navController: NavController) {
val openAlertDialog = remember { mutableStateOf(false) }
Box(
modifier
.fillMaxSize()
.background(background)
) {
Column(modifier.padding(horizontal = 25.dp, vertical = 40.dp)) {
Spacer(modifier.height(50.dp))
androidx.compose.material.Text(
text = stringResource(R.string.akun),
style = TextStyle(
fontSize = 35.sp,
color = primaryblack,
fontFamily = bold
)
)
Spacer(modifier.height(50.dp))
Row(Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically) {
Image(
painter = painterResource(id = R.drawable.ic_profile_men),
contentDescription = null,
modifier = Modifier.size(80.dp)
)
Spacer(modifier.width(20.dp))
Column {
androidx.compose.material.Text(
text = "Naufal Kadhafi",
style = TextStyle(
fontSize = 23.sp,
color = primaryblack,
fontFamily = bold
)
)
Spacer(modifier = Modifier.height(5.dp))
androidx.compose.material.Text(
text = "kadhafinaufal2@gmail.com",
style = TextStyle(
fontSize = 15.sp,
color = primarygrey,
fontFamily = bold
)
)
}
}
Spacer(modifier.height(60.dp))
Row(Modifier.fillMaxWidth(), Arrangement.SpaceBetween) {
Row {
Image(
imageVector = ImageVector.vectorResource(id = R.drawable.ic_profile),
contentDescription = null
)
Spacer(modifier.width(25.dp))
Text(
text = stringResource(R.string.profile),
style = TextStyle(
fontSize = 20.sp,
color = primaryblack,
fontFamily = bold
)
)
}
Image(
imageVector = ImageVector.vectorResource(id = R.drawable.ic_btn_detail),
contentDescription = null
)
}
Spacer(modifier.height(40.dp))
Row(Modifier.fillMaxWidth(), Arrangement.SpaceBetween) {
Row {
Image(
imageVector = ImageVector.vectorResource(id = R.drawable.ic_history),
contentDescription = null
)
Spacer(modifier.width(25.dp))
Text(
text = stringResource(R.string.riwayat),
style = TextStyle(
fontSize = 20.sp,
color = primaryblack,
fontFamily = bold
)
)
}
Image(
imageVector = ImageVector.vectorResource(id = R.drawable.ic_btn_detail),
contentDescription = null
)
}
Spacer(modifier.height(40.dp))
Row(Modifier.fillMaxWidth(), Arrangement.SpaceBetween) {
Row {
Image(
imageVector = ImageVector.vectorResource(id = R.drawable.ic_change_pw),
contentDescription = null
)
Spacer(modifier.width(25.dp))
Text(
text = stringResource(R.string.ubah_password),
style = TextStyle(
fontSize = 20.sp,
color = primaryblack,
fontFamily = bold
)
)
}
Image(
imageVector = ImageVector.vectorResource(id = R.drawable.ic_btn_detail),
contentDescription = null
)
}
Spacer(modifier.height(60.dp))
Row(modifier.clickable {
openAlertDialog.value = true
}, verticalAlignment = Alignment.CenterVertically) {
Image(
imageVector = ImageVector.vectorResource(id = R.drawable.ic_log_out),
contentDescription = null
)
Spacer(modifier.width(20.dp))
Text(
text = stringResource(R.string.keluar),
style = TextStyle(
fontSize = 20.sp,
color = primaryred,
fontFamily = bold
)
)
}
if (openAlertDialog.value) {
SimpleAlertDialog(
dialogTitle = "Konfirmasi",
dialogSubTitle = "Apakah Anda yakin ingin keluar?",
onDismissRequest = { openAlertDialog.value = false },
onConfirmation = {
openAlertDialog.value = false
// Tambahkan aksi logout di sini
}
)
}
}
}
}

View File

@ -0,0 +1,10 @@
package com.example.caloryapp.pages.camera
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.navigation.NavController
@Composable
fun CameraDetectionScreen(modifier: Modifier = Modifier, navController: NavController) {
}

View File

@ -0,0 +1,91 @@
package com.example.caloryapp.pages.dashboard
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
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.material.Divider
import androidx.compose.material3.Text
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.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.NavController
import com.example.caloryapp.R
import com.example.caloryapp.ui.theme.background
import com.example.caloryapp.ui.theme.bold
import com.example.caloryapp.ui.theme.primary
import com.example.caloryapp.ui.theme.primaryblack
import com.example.caloryapp.ui.theme.primarygrey
import com.example.caloryapp.widget.FilterBar
@Composable
fun HomeScreen(modifier: Modifier = Modifier, navController: NavController) {
var selectedFilter by remember { mutableStateOf("Semua") }
Box(
modifier
.fillMaxSize()
.background(background)) {
Column(modifier.padding(horizontal = 25.dp, vertical = 45.dp)) {
Spacer(modifier = Modifier.height(50.dp))
Row(Modifier.fillMaxWidth(), Arrangement.SpaceBetween,verticalAlignment = Alignment.CenterVertically) {
Image(painter = painterResource(id = R.drawable.ic_home_acc), contentDescription = null)
Row(verticalAlignment = Alignment.CenterVertically) {
Column(horizontalAlignment = Alignment.End) {
androidx.compose.material.Text(
text = "Naufal Kadhafi",
style = TextStyle(
fontSize = 20.sp,
color = primaryblack,
fontFamily = bold
)
)
androidx.compose.material.Text(
text = "@kadhafiinl",
style = TextStyle(
fontSize = 14.sp,
color = primaryblack,
fontFamily = bold
)
)
}
Spacer(modifier = Modifier.width(14.dp))
Image(painter = painterResource(id = R.drawable.ic_profile_women), contentDescription = null, Modifier.size(45.dp))
}
}
Spacer(modifier = Modifier.height(35.dp))
Row(Modifier.width(215.dp)) {
Text(
text = "Hai Naufal, Bagaimana kabar kamu hari ini?",
style = TextStyle(
fontSize = 22.sp,
color = primaryblack,
fontFamily = bold
)
)
}
Spacer(modifier = Modifier.height(15.dp))
Divider(color = primary.copy(alpha = 0.2f), thickness = 3.dp)
Spacer(modifier = Modifier.height(15.dp))
FilterBar(selectedFilter = selectedFilter, onFilterSelected = { selectedFilter = it})
}
}
}

View File

@ -0,0 +1,108 @@
package com.example.caloryapp.pages.onboard
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.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Button
import androidx.compose.material3.Text
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.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.NavController
import com.example.caloryapp.R
import com.example.caloryapp.navigation.NavigationScreen
import com.example.caloryapp.ui.theme.background
import com.example.caloryapp.ui.theme.bold
import com.example.caloryapp.ui.theme.primary
import com.example.caloryapp.ui.theme.primaryblack
import com.example.caloryapp.widget.CustomTextField
@Composable
fun ChangePasswordScreen(modifier: Modifier = Modifier, navController: NavController) {
var newPassword by remember { mutableStateOf("") }
var confirmPassword by remember { mutableStateOf("") }
Box(
Modifier
.fillMaxSize()
.background(background)) {
Column(Modifier.padding(horizontal = 25.dp, vertical = 50.dp)) {
Spacer(Modifier.height(45.dp))
Row(Modifier.width(260.dp)) {
Text(
stringResource(R.string.buat_kata_sandi_baru),
style = TextStyle(
fontSize = 35.sp,
color = primaryblack,
fontFamily = bold
)
)
}
Spacer(modifier.height(42.dp))
androidx.compose.material.Text(
text = stringResource(R.string.masukkan_kata_sandi),
style = TextStyle(
fontSize = 20.sp,
color = primaryblack,
fontFamily = bold
)
)
Spacer(modifier.height(16.dp))
CustomTextField(
value = newPassword,
onValueChange = { newPassword = it },
placeholderText = "Masukkan Kata Sandi"
)
Spacer(modifier.height(20.dp))
androidx.compose.material.Text(
text = stringResource(R.string.konfirmasi_kata_sandi),
style = TextStyle(
fontSize = 20.sp,
color = primaryblack,
fontFamily = bold
)
)
Spacer(modifier.height(16.dp))
CustomTextField(
value = confirmPassword,
onValueChange = { confirmPassword = it },
placeholderText = "Konfirmasi Kata Sandi"
)
Spacer(modifier.height(45.dp))
Button(
onClick = { navController.navigate(NavigationScreen.SuccessChangePassword.name) },
modifier
.width(360.dp)
.height(50.dp),
colors = androidx.compose.material.ButtonDefaults.buttonColors(backgroundColor = primary),
shape = RoundedCornerShape(20.dp)
) {
androidx.compose.material.Text(
text = "Simpan",
style = TextStyle(
fontSize = 18.sp,
color = Color.White,
fontFamily = bold,
textAlign = TextAlign.Center
)
)
}
}
}
}

View File

@ -0,0 +1,106 @@
package com.example.caloryapp.pages.onboard
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
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.material.Button
import androidx.compose.material3.Text
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.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.NavController
import com.example.caloryapp.R
import com.example.caloryapp.navigation.NavigationScreen
import com.example.caloryapp.ui.theme.bold
import com.example.caloryapp.ui.theme.medium
import com.example.caloryapp.ui.theme.primary
import com.example.caloryapp.ui.theme.primaryblack
import com.example.caloryapp.widget.CustomTextField
@Composable
fun ForgotPasswordScreen(modifier: Modifier = Modifier, navController: NavController) {
var gmail by remember { mutableStateOf("") }
Box(Modifier.fillMaxSize()) {
Column(Modifier.padding(horizontal = 25.dp, vertical = 50.dp)) {
Spacer(Modifier.height(45.dp))
Text(
text = stringResource(R.string.lupa_password2),
style = TextStyle(
fontSize = 35.sp,
color = primaryblack,
fontFamily = bold
)
)
Spacer(Modifier.height(10.dp))
Text(
text = stringResource(R.string.masukkan_gmail_kamu_nanti_akan_kita_kirimkan_kode_otp_ke_gmail_kamu_yaa),
style = TextStyle(
fontSize = 17.sp,
color = primaryblack,
fontFamily = medium
)
)
Spacer(modifier.height(50.dp))
Image(
painter = painterResource(id = R.drawable.ic_forgot_pw),
contentDescription = null,
Modifier
.size(200.dp)
.align(Alignment.CenterHorizontally)
)
Spacer(modifier.height(60.dp))
androidx.compose.material.Text(
text = stringResource(R.string.masukkan_gmail),
style = TextStyle(
fontSize = 20.sp,
color = primaryblack,
fontFamily = bold
)
)
Spacer(modifier.height(16.dp))
CustomTextField(
value = gmail,
onValueChange = { gmail = it },
placeholderText = stringResource(R.string.gmail)
)
Spacer(modifier.height(40.dp))
Button(
onClick = { navController.navigate(NavigationScreen.OTPVerificationScreen.name) },
modifier
.width(360.dp)
.height(50.dp),
colors = androidx.compose.material.ButtonDefaults.buttonColors(backgroundColor = primary),
shape = RoundedCornerShape(20.dp)
) {
androidx.compose.material.Text(
text = stringResource(R.string.kirim_otp),
style = TextStyle(
fontSize = 18.sp,
color = Color.White,
fontFamily = bold,
textAlign = TextAlign.Center
)
)
}
}
}
}

View File

@ -0,0 +1,146 @@
package com.example.caloryapp.pages.onboard
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.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
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.material.Button
import androidx.compose.material.Text
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.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.NavController
import com.example.caloryapp.R
import com.example.caloryapp.navigation.NavigationScreen
import com.example.caloryapp.ui.theme.background
import com.example.caloryapp.ui.theme.blueunderlined
import com.example.caloryapp.ui.theme.bold
import com.example.caloryapp.ui.theme.primary
import com.example.caloryapp.ui.theme.primaryblack
import com.example.caloryapp.ui.theme.semibold
import com.example.caloryapp.widget.CustomTextField
@Composable
fun LoginScreen(modifier: Modifier = Modifier, navController: NavController) {
var username by remember { mutableStateOf("") }
var password by remember { mutableStateOf("") }
Box(
modifier
.fillMaxSize()
.background(background)
) {
Column(
modifier.padding(horizontal = 25.dp, vertical = 50.dp)
) {
Spacer(modifier.height(50.dp))
Text(
text = stringResource(R.string.masuk),
style = TextStyle(
fontSize = 35.sp,
color = primaryblack,
fontFamily = bold
)
)
Spacer(modifier.height(35.dp))
Image(
painter = painterResource(id = R.drawable.image_onboard),
contentDescription = null,
Modifier
.size(200.dp)
.align(Alignment.CenterHorizontally)
)
Spacer(modifier.height(35.dp))
Text(
text = stringResource(R.string.username),
style = TextStyle(
fontSize = 20.sp,
color = primaryblack,
fontFamily = bold
)
)
Spacer(modifier.height(16.dp))
CustomTextField(
value = username,
onValueChange = { username = it },
placeholderText = "Username"
)
Spacer(modifier.height(16.dp))
Text(
text = stringResource(R.string.password),
style = TextStyle(
fontSize = 20.sp,
color = primaryblack,
fontFamily = bold
)
)
Spacer(modifier.height(16.dp))
CustomTextField(
value = password,
onValueChange = { password = it },
placeholderText = "Password"
)
Spacer(modifier.height(18.dp))
Row(
modifier
.align(Alignment.End)
.clickable { navController.navigate(NavigationScreen.ForgotPasswordScreen.name) }) {
Text(
text = stringResource(R.string.lupa_password),
style = TextStyle(
fontSize = 15.sp,
color = blueunderlined,
fontFamily = semibold,
textDecoration = TextDecoration.Underline
)
)
}
Spacer(modifier.height(35.dp))
Button(
onClick = { navController.navigate(NavigationScreen.NavBarScreen.name) },
modifier
.width(360.dp)
.height(50.dp),
colors = androidx.compose.material.ButtonDefaults.buttonColors(backgroundColor = primary),
shape = RoundedCornerShape(20.dp)
) {
Text(
text = stringResource(R.string.masuk),
style = TextStyle(
fontSize = 18.sp,
color = Color.White,
fontFamily = bold,
textAlign = TextAlign.Center
)
)
}
}
}
}
//@Preview(showBackground = true)
//@Composable
//fun Preview(modifier: Modifier = Modifier) {
// LoginScreen(navController = rememberNavController())
//}

View File

@ -0,0 +1,99 @@
package com.example.caloryapp.pages.onboard
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.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.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Button
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.NavController
import com.example.caloryapp.R
import com.example.caloryapp.navigation.NavigationScreen
import com.example.caloryapp.ui.theme.blueunderlined
import com.example.caloryapp.ui.theme.bold
import com.example.caloryapp.ui.theme.medium
import com.example.caloryapp.ui.theme.primary
import com.example.caloryapp.ui.theme.primaryblack
import com.example.caloryapp.ui.theme.semibold
import com.example.caloryapp.widget.OtpInput
@Composable
fun OTPVerificationScreen(modifier: Modifier = Modifier, navController: NavController) {
Box(modifier.fillMaxSize()) {
Column(Modifier.padding(horizontal = 25.dp, vertical = 50.dp)) {
Spacer(Modifier.height(45.dp))
Text(
stringResource(R.string.kode_otp),
style = TextStyle(
fontSize = 35.sp,
color = primaryblack,
fontFamily = bold
)
)
Spacer(Modifier.height(10.dp))
Text(
text = stringResource(R.string.masukkan_kode_otp_yang_sudah_dikirimkan_ke_gmail_kamu_yaa),
style = TextStyle(
fontSize = 17.sp,
color = primaryblack,
fontFamily = medium
)
)
Spacer(modifier.height(50.dp))
Row(Modifier.fillMaxWidth(), Arrangement.Center) {
OtpInput()
}
Spacer(modifier.height(18.dp))
Row(
modifier
.fillMaxWidth()
.clickable { }, Arrangement.End) {
androidx.compose.material.Text(
text = stringResource(R.string.kirim_ulang_kode),
style = TextStyle(
fontSize = 16.sp,
color = blueunderlined,
fontFamily = semibold,
textDecoration = TextDecoration.Underline
)
)
}
Spacer(modifier.height(45.dp))
Button(
onClick = { navController.navigate(NavigationScreen.ChangePasswordScreen.name) },
modifier
.width(360.dp)
.height(50.dp),
colors = androidx.compose.material.ButtonDefaults.buttonColors(backgroundColor = primary),
shape = RoundedCornerShape(20.dp)
) {
androidx.compose.material.Text(
text = stringResource(R.string.verifikasi_otp),
style = TextStyle(
fontSize = 18.sp,
color = Color.White,
fontFamily = bold,
textAlign = TextAlign.Center
)
)
}
}
}
}

View File

@ -0,0 +1,102 @@
package com.example.caloryapp.pages.onboard
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
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.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.material.Button
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.NavController
import com.example.caloryapp.R
import com.example.caloryapp.navigation.NavigationScreen
import com.example.caloryapp.ui.theme.bold
import com.example.caloryapp.ui.theme.primary
@Composable
fun OnBoardingScreen(modifier: Modifier = Modifier, navController: NavController) {
Box(modifier.fillMaxSize()) {
Column(
modifier
.fillMaxSize()
.padding(horizontal = 25.dp, vertical = 40.dp)
) {
Spacer(modifier.height(60.dp))
Text(
text = stringResource(R.string.selamat_datang) +
stringResource(R.string.di_caloriey_app),
style = TextStyle(
fontSize = 35.sp,
color = primary,
fontFamily = bold
)
)
Spacer(modifier.height(80.dp))
Image(
painter = painterResource(id = R.drawable.image_onboard),
contentDescription = null,
Modifier
.size(200.dp)
.align(Alignment.CenterHorizontally)
)
Spacer(modifier.height(32.dp))
Row(modifier.align(Alignment.CenterHorizontally)) {
Text(
text = "Lorem ipsum dolor sit amet consectetur. Feugiat pellentesque tellus feugiat tristique.",
style = TextStyle(
fontSize = 14.sp,
color = primary,
fontFamily = bold,
textAlign = TextAlign.Center
)
)
}
Spacer(modifier.height(200.dp))
Row(
modifier
.align(Alignment.CenterHorizontally)
) {
Button(
onClick = { navController.navigate(NavigationScreen.LoginScreen.name) },
modifier
.width(360.dp)
.height(50.dp),
colors = androidx.compose.material.ButtonDefaults.buttonColors(backgroundColor = primary),
shape = RoundedCornerShape(20.dp)
) {
Text(
text = stringResource(R.string.lanjut),
style = TextStyle(
fontSize = 18.sp,
color = Color.White,
fontFamily = bold,
textAlign = TextAlign.Center
)
)
}
}
}
}
}
//@Preview(showBackground = true)
//@Composable
//fun Preview(modifier: Modifier = Modifier) {
// OnBoardingScreen(navController = rememberNavController())
//}

View File

@ -0,0 +1,80 @@
package com.example.caloryapp.pages.onboard
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
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.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Button
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.NavController
import com.example.caloryapp.R
import com.example.caloryapp.ui.theme.background
import com.example.caloryapp.ui.theme.bold
import com.example.caloryapp.ui.theme.primary
import com.example.caloryapp.ui.theme.primaryblack
@Composable
fun SuccessChangePassword(modifier: Modifier = Modifier, navController: NavController) {
Box(modifier = Modifier
.fillMaxSize()
.background(background)) {
Column(Modifier.padding(horizontal = 25.dp, vertical = 50.dp)) {
Spacer(modifier = Modifier.height(50.dp))
Text(
stringResource(R.string.password_kamu_berhasil_dibuat),
style = TextStyle(
fontSize = 35.sp,
color = primaryblack,
fontFamily = bold
)
)
Spacer(modifier = Modifier.height(100.dp))
Row(Modifier.fillMaxWidth(), Arrangement.Center) {
Image(
painter = painterResource(id = R.drawable.ic_success),
contentDescription = ""
)
}
Spacer(modifier = Modifier.height(115.dp))
Button(
onClick = { },
modifier
.width(360.dp)
.height(50.dp),
colors = androidx.compose.material.ButtonDefaults.buttonColors(backgroundColor = primary),
shape = RoundedCornerShape(20.dp)
) {
androidx.compose.material.Text(
text = "Lanjut",
style = TextStyle(
fontSize = 18.sp,
color = Color.White,
fontFamily = bold,
textAlign = TextAlign.Center
)
)
}
}
}
}

View File

@ -0,0 +1,70 @@
package com.example.caloryapp.pages.onboard
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.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Button
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.NavController
import com.example.caloryapp.R
import com.example.caloryapp.ui.theme.background
import com.example.caloryapp.ui.theme.bold
import com.example.caloryapp.ui.theme.primary
import com.example.caloryapp.ui.theme.primaryblack
@Composable
fun SuccessRegister(modifier: Modifier = Modifier, navController: NavController) {
Box(modifier = Modifier
.fillMaxSize()
.background(background)) {
Column(Modifier.padding(horizontal = 25.dp, vertical = 50.dp)) {
Spacer(modifier = Modifier.height(50.dp))
Text(
"Akun Kamu Berhasil Dibuat",
style = TextStyle(
fontSize = 35.sp,
color = primaryblack,
fontFamily = bold
)
)
Spacer(modifier = Modifier.height(100.dp))
Image(imageVector = ImageVector.vectorResource(id = R.drawable.ic_success), contentDescription = "")
Spacer(modifier = Modifier.height(115.dp))
Button(
onClick = { },
modifier
.width(360.dp)
.height(50.dp),
colors = androidx.compose.material.ButtonDefaults.buttonColors(backgroundColor = primary),
shape = RoundedCornerShape(20.dp)
) {
androidx.compose.material.Text(
text = "Lanjut",
style = TextStyle(
fontSize = 18.sp,
color = Color.White,
fontFamily = bold,
textAlign = TextAlign.Center
)
)
}
}
}
}

View File

@ -0,0 +1,18 @@
package com.example.caloryapp.ui.theme
import androidx.compose.ui.graphics.Color
var primary = Color(0xff109A17)
var primaryblack = Color(0xff202020)
var primarygrey = Color(0xffBABABA)
var background = Color(0xffF4F4F4)
var blueunderlined = Color(0xff0063BF)
var primaryred = Color(0xffE85454)
val Purple80 = Color(0xFFD0BCFF)
val PurpleGrey80 = Color(0xFFCCC2DC)
val Pink80 = Color(0xFFEFB8C8)
val Purple40 = Color(0xFF6650a4)
val PurpleGrey40 = Color(0xFF625b71)
val Pink40 = Color(0xFF7D5260)

View File

@ -0,0 +1,10 @@
package com.example.caloryapp.ui.theme
import androidx.compose.ui.text.font.Font
import androidx.compose.ui.text.font.FontFamily
import com.example.caloryapp.R
var bold = FontFamily(Font(R.font.sfpro_bold))
var semibold = FontFamily(Font(R.font.sfpro_semibold))
var medium = FontFamily(Font(R.font.sfpro_medium))
var regular = FontFamily(Font(R.font.sfpro_regular))

View File

@ -0,0 +1,58 @@
package com.example.caloryapp.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.ui.platform.LocalContext
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 CaloryAppTheme(
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
}
MaterialTheme(
colorScheme = colorScheme,
typography = Typography,
content = content
)
}

View File

@ -0,0 +1,34 @@
package com.example.caloryapp.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
)
*/
)

View File

@ -0,0 +1,87 @@
package com.example.caloryapp.widget
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.compose.ui.window.DialogProperties
import com.example.caloryapp.R
import com.example.caloryapp.ui.theme.bold
import com.example.caloryapp.ui.theme.medium
import com.example.caloryapp.ui.theme.primaryblack
import com.example.caloryapp.ui.theme.primaryred
import com.example.caloryapp.ui.theme.semibold
@Composable
fun SimpleAlertDialog(
dialogTitle: String,
dialogSubTitle: String,
onDismissRequest: () -> Unit,
onConfirmation: () -> Unit,
) {
AlertDialog(
modifier = Modifier.fillMaxWidth(0.92f),
properties = DialogProperties(
usePlatformDefaultWidth = false,
decorFitsSystemWindows = true,
dismissOnClickOutside = true,
dismissOnBackPress = true
),
shape = RoundedCornerShape(20.dp),
onDismissRequest = {
onDismissRequest()
},
confirmButton = {
TextButton(onClick = { onConfirmation() }) {
androidx.compose.material.Text(
text = stringResource(R.string.ya),
style = TextStyle(
fontSize = 18.sp,
color = primaryred,
fontFamily = semibold
)
)
}
},
dismissButton = {
TextButton(onClick = { onDismissRequest() }) {
androidx.compose.material.Text(
text = stringResource(R.string.tidak),
style = TextStyle(
fontSize = 18.sp,
color = primaryblack,
fontFamily = semibold
)
)
}
},
title = {
androidx.compose.material.Text(
text = dialogTitle,
style = TextStyle(
fontSize = 24.sp,
color = primaryblack,
fontFamily = bold
)
)
},
text = {
androidx.compose.material.Text(
text = dialogSubTitle,
style = TextStyle(
fontSize = 18.sp,
color = primaryblack,
fontFamily = medium
)
)
})
}

View File

@ -0,0 +1,54 @@
package com.example.caloryapp.widget
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
//noinspection UsingMaterialAndMaterial3Libraries
import androidx.compose.material.OutlinedTextField
//noinspection UsingMaterialAndMaterial3Libraries
import androidx.compose.material.TextFieldDefaults
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.example.caloryapp.R
import com.example.caloryapp.ui.theme.bold
import com.example.caloryapp.ui.theme.primaryblack
import com.example.caloryapp.ui.theme.primarygrey
@Composable
fun CustomTextField(
value: String,
onValueChange: (String) -> Unit,
placeholderText: String
) {
OutlinedTextField(
value = value,
onValueChange = onValueChange,
placeholder = {
androidx.compose.material.Text(
text = placeholderText,
style = TextStyle(
fontSize = 16.sp,
color = primarygrey,
fontFamily = bold
)
)
},
modifier = Modifier
.fillMaxWidth()
.height(50.dp),
colors = TextFieldDefaults.outlinedTextFieldColors(
backgroundColor = Color(0xFFF8F8F8), // Warna putih dengan sedikit transparansi
focusedBorderColor = Color.Transparent, // Menghilangkan border saat fokus
unfocusedBorderColor = Color.Transparent, // Menghilangkan border saat tidak fokus
cursorColor = Color.Black // Warna kursor
),
shape = RoundedCornerShape(8.dp) // Membuat border melengkung
)
}

View File

@ -0,0 +1,84 @@
package com.example.caloryapp.widget
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.horizontalScroll
import androidx.compose.foundation.layout.Arrangement
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.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text
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.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.example.caloryapp.R
import com.example.caloryapp.ui.theme.bold
import com.example.caloryapp.ui.theme.primary
import com.example.caloryapp.ui.theme.primaryblack
import com.example.caloryapp.ui.theme.semibold
@Composable
fun FilterBar(
selectedFilter: String,
onFilterSelected: (String) -> Unit
) {
val filters = listOf("Semua", "Hari ini", "Minggu Ini", "Bulan Ini")
val scrollState = rememberScrollState()
Row(
modifier = Modifier
.fillMaxWidth()
.horizontalScroll(scrollState),
horizontalArrangement = Arrangement.spacedBy(8.dp)
) {
filters.forEach { filter ->
FilterButton(
text = filter,
isSelected = filter == selectedFilter,
onClick = { onFilterSelected(filter) }
)
}
}
}
@Composable
fun FilterButton(
text: String,
isSelected: Boolean,
onClick: () -> Unit
) {
val backgroundColor = if (isSelected) primary.copy(alpha = 0.6f) else Color.White
val textColor = if (isSelected) Color.White else primary.copy(alpha = 0.6f)
Box(
modifier = Modifier
.clip(RoundedCornerShape(20.dp))
.background(backgroundColor)
.width(100.dp)
.clickable { onClick() }
.padding(horizontal = 16.dp, vertical = 8.dp),
contentAlignment = Alignment.Center
) {
androidx.compose.material.Text(
text = text,
style = TextStyle(
fontSize = 15.sp,
color = textColor,
fontFamily = bold,
letterSpacing = 0.2.sp
)
)
}
}

View File

@ -0,0 +1,80 @@
package com.example.caloryapp.widget
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
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.text.TextStyle
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.composeuisuite.ohteepee.OhTeePeeInput
import com.composeuisuite.ohteepee.configuration.OhTeePeeCellConfiguration
import com.composeuisuite.ohteepee.configuration.OhTeePeeConfigurations
import com.example.caloryapp.ui.theme.primary
import com.example.caloryapp.ui.theme.primaryblack
import com.example.caloryapp.ui.theme.primarygrey
import com.example.caloryapp.ui.theme.primaryred
import com.example.caloryapp.ui.theme.semibold
enum class OtpState { Loading, Error, None }
@Composable
fun OtpInput() {
// a mutable state to handle OTP value changes…
var otpValue: String by remember { mutableStateOf("") }
var state: OtpState by remember {
mutableStateOf(OtpState.None)
}
// this config will be used for each cell
val defaultCellConfig = OhTeePeeCellConfiguration.withDefaults(
borderColor = primarygrey,
borderWidth = 1.dp,
shape = RoundedCornerShape(16.dp),
textStyle = TextStyle(
fontSize = 20.sp,
color = primaryblack,
fontFamily = semibold
)
)
OhTeePeeInput(
value = otpValue,
onValueChange = { newValue, isValid ->
otpValue = newValue
if (isValid) {
state = OtpState.Loading
// Send a request to validate the value here...
// vm.validateOtp(otpValue)
} else {
// Reset the state when user enters (to remove the error state)
state = OtpState.None
}
},
configurations = OhTeePeeConfigurations.withDefaults(
cellsCount = 4,
emptyCellConfig = defaultCellConfig,
activeCellConfig = defaultCellConfig.copy(
borderColor = primary,
borderWidth = 1.dp
),
errorCellConfig = defaultCellConfig.copy(
borderColor = primaryred,
borderWidth = 1.dp
),
cellModifier = Modifier
.padding(horizontal = 10.dp)
.size(60.dp),
placeHolder = "-",
),
)
}

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="25dp"
android:viewportWidth="24"
android:viewportHeight="25">
<path
android:pathData="M9.31,7.21C9.217,7.303 9.144,7.412 9.094,7.533C9.043,7.654 9.018,7.784 9.018,7.915C9.018,8.046 9.043,8.176 9.094,8.297C9.144,8.418 9.217,8.527 9.31,8.62L13.19,12.5L9.31,16.38C9.123,16.567 9.018,16.821 9.018,17.085C9.018,17.349 9.123,17.603 9.31,17.79C9.497,17.977 9.751,18.082 10.015,18.082C10.279,18.082 10.533,17.977 10.72,17.79L15.31,13.2C15.403,13.108 15.476,12.998 15.526,12.877C15.577,12.756 15.602,12.626 15.602,12.495C15.602,12.364 15.577,12.234 15.526,12.113C15.476,11.992 15.403,11.882 15.31,11.79L10.72,7.2C10.34,6.82 9.7,6.82 9.31,7.21Z"
android:fillColor="#000000"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="25dp"
android:height="25dp"
android:viewportWidth="25"
android:viewportHeight="25">
<path
android:pathData="M3.125,17.708H21.875C22.17,17.708 22.418,17.808 22.618,18.008C22.818,18.208 22.917,18.456 22.917,18.75C22.916,19.044 22.816,19.292 22.617,19.493C22.417,19.693 22.17,19.793 21.875,19.792H3.125C2.83,19.792 2.583,19.692 2.383,19.492C2.184,19.292 2.084,19.044 2.083,18.75C2.083,18.456 2.183,18.208 2.383,18.008C2.584,17.808 2.831,17.708 3.125,17.708ZM4.167,11.927L3.672,12.813C3.568,13.003 3.412,13.125 3.203,13.177C2.995,13.229 2.795,13.203 2.604,13.099C2.413,12.995 2.292,12.839 2.24,12.63C2.188,12.422 2.214,12.222 2.318,12.031L2.813,11.146H1.823C1.597,11.146 1.411,11.072 1.264,10.925C1.116,10.778 1.042,10.591 1.042,10.365C1.041,10.138 1.115,9.952 1.264,9.805C1.412,9.659 1.599,9.585 1.823,9.583H2.813L2.318,8.75C2.214,8.559 2.188,8.359 2.24,8.151C2.292,7.943 2.413,7.786 2.604,7.682C2.795,7.578 2.995,7.552 3.203,7.604C3.412,7.656 3.568,7.778 3.672,7.969L4.167,8.802L4.662,7.969C4.766,7.778 4.922,7.656 5.13,7.604C5.339,7.552 5.538,7.578 5.729,7.682C5.92,7.786 6.042,7.943 6.094,8.151C6.146,8.359 6.12,8.559 6.016,8.75L5.521,9.583H6.51C6.736,9.583 6.923,9.657 7.071,9.805C7.219,9.953 7.292,10.14 7.292,10.365C7.291,10.59 7.217,10.776 7.07,10.925C6.923,11.074 6.736,11.147 6.51,11.146H5.521L6.016,12.031C6.12,12.222 6.146,12.422 6.094,12.63C6.042,12.839 5.92,12.995 5.729,13.099C5.538,13.203 5.339,13.229 5.13,13.177C4.922,13.125 4.766,13.003 4.662,12.813L4.167,11.927ZM12.5,11.927L12.005,12.813C11.901,13.003 11.745,13.125 11.536,13.177C11.328,13.229 11.129,13.203 10.938,13.099C10.747,12.995 10.625,12.839 10.573,12.63C10.521,12.422 10.547,12.222 10.651,12.031L11.146,11.146H10.156C9.931,11.146 9.744,11.072 9.597,10.925C9.45,10.778 9.376,10.591 9.375,10.365C9.374,10.138 9.448,9.952 9.597,9.805C9.746,9.659 9.932,9.585 10.156,9.583H11.146L10.651,8.75C10.547,8.559 10.521,8.359 10.573,8.151C10.625,7.943 10.747,7.786 10.938,7.682C11.129,7.578 11.328,7.552 11.536,7.604C11.745,7.656 11.901,7.778 12.005,7.969L12.5,8.802L12.995,7.969C13.099,7.778 13.255,7.656 13.464,7.604C13.672,7.552 13.872,7.578 14.063,7.682C14.254,7.786 14.375,7.943 14.427,8.151C14.479,8.359 14.453,8.559 14.349,8.75L13.854,9.583H14.844C15.069,9.583 15.256,9.657 15.403,9.805C15.55,9.953 15.624,10.14 15.625,10.365C15.626,10.59 15.552,10.776 15.403,10.925C15.255,11.074 15.068,11.147 14.844,11.146H13.854L14.349,12.031C14.453,12.222 14.479,12.422 14.427,12.63C14.375,12.839 14.254,12.995 14.063,13.099C13.872,13.203 13.672,13.229 13.464,13.177C13.255,13.125 13.099,13.003 12.995,12.813L12.5,11.927ZM20.833,11.927L20.339,12.813C20.235,13.003 20.078,13.125 19.87,13.177C19.662,13.229 19.462,13.203 19.271,13.099C19.08,12.995 18.958,12.839 18.906,12.63C18.854,12.422 18.88,12.222 18.985,12.031L19.479,11.146H18.49C18.264,11.146 18.077,11.072 17.93,10.925C17.783,10.778 17.709,10.591 17.708,10.365C17.708,10.138 17.782,9.952 17.93,9.805C18.079,9.659 18.265,9.585 18.49,9.583H19.479L18.985,8.75C18.88,8.559 18.854,8.359 18.906,8.151C18.958,7.943 19.08,7.786 19.271,7.682C19.462,7.578 19.662,7.552 19.87,7.604C20.078,7.656 20.235,7.778 20.339,7.969L20.833,8.802L21.328,7.969C21.432,7.778 21.589,7.656 21.797,7.604C22.005,7.552 22.205,7.578 22.396,7.682C22.587,7.786 22.708,7.943 22.76,8.151C22.813,8.359 22.787,8.559 22.682,8.75L22.188,9.583H23.177C23.403,9.583 23.59,9.657 23.738,9.805C23.885,9.953 23.959,10.14 23.958,10.365C23.958,10.59 23.884,10.776 23.736,10.925C23.589,11.074 23.403,11.147 23.177,11.146H22.188L22.682,12.031C22.787,12.222 22.813,12.422 22.76,12.63C22.708,12.839 22.587,12.995 22.396,13.099C22.205,13.203 22.005,13.229 21.797,13.177C21.589,13.125 21.432,13.003 21.328,12.813L20.833,11.927Z"
android:fillColor="#000000"/>
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@ -0,0 +1,20 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="27dp"
android:height="27dp"
android:viewportWidth="27"
android:viewportHeight="27">
<path
android:pathData="M13.43,8.067V13.622L16.208,16.4"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#000000"
android:strokeLineCap="round"/>
<path
android:pathData="M1,12.233C1.311,9.178 2.736,6.344 5.004,4.272C7.271,2.2 10.222,1.036 13.293,1.001C16.364,0.966 19.34,2.063 21.654,4.082C23.969,6.101 25.458,8.902 25.839,11.95C26.22,14.997 25.466,18.078 23.72,20.605C21.974,23.132 19.359,24.928 16.374,25.65C13.389,26.372 10.242,25.969 7.535,24.52C4.827,23.07 2.748,20.674 1.694,17.789M1,24.733V17.789H7.944"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#000000"
android:strokeLineCap="round"/>
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M2.52,7.823C2,8.77 2,9.915 2,12.203V13.725C2,17.625 2,19.576 3.172,20.788C4.344,22 6.229,22 10,22H14C17.771,22 19.657,22 20.828,20.788C21.999,19.576 22,17.626 22,13.725V12.204C22,9.915 22,8.771 21.48,7.823C20.962,6.874 20.013,6.286 18.116,5.108L16.116,3.867C14.111,2.622 13.108,2 12,2C10.892,2 9.89,2.622 7.884,3.867L5.884,5.108C3.987,6.286 3.039,6.874 2.52,7.823ZM11.25,18C11.25,18.199 11.329,18.39 11.47,18.53C11.61,18.671 11.801,18.75 12,18.75C12.199,18.75 12.39,18.671 12.53,18.53C12.671,18.39 12.75,18.199 12.75,18V15C12.75,14.801 12.671,14.61 12.53,14.47C12.39,14.329 12.199,14.25 12,14.25C11.801,14.25 11.61,14.329 11.47,14.47C11.329,14.61 11.25,14.801 11.25,15V18Z"
android:fillColor="#109A17"
android:fillType="evenOdd"/>
</vector>

View File

@ -0,0 +1,17 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M2,12.204C2,9.915 2,8.771 2.52,7.823C3.038,6.874 3.987,6.286 5.884,5.108L7.884,3.867C9.889,2.622 10.892,2 12,2C13.108,2 14.11,2.622 16.116,3.867L18.116,5.108C20.013,6.286 20.962,6.874 21.481,7.823C22,8.772 22,9.915 22,12.203V13.725C22,17.625 22,19.576 20.828,20.788C19.656,22 17.771,22 14,22H10C6.229,22 4.343,22 3.172,20.788C2.001,19.576 2,17.626 2,13.725V12.204Z"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#109A17"/>
<path
android:pathData="M12,15V18"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#109A17"
android:strokeLineCap="round"/>
</vector>

View 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>

View 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>

View File

@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="30dp"
android:height="30dp"
android:viewportWidth="30"
android:viewportHeight="30">
<path
android:pathData="M15,22.813C14.751,22.813 14.513,22.911 14.337,23.087C14.161,23.263 14.063,23.501 14.063,23.75C14.063,23.999 14.161,24.237 14.337,24.413C14.513,24.589 14.751,24.688 15,24.688H22.5C23.08,24.688 23.637,24.457 24.047,24.047C24.457,23.637 24.688,23.08 24.688,22.5V7.5C24.688,6.92 24.457,6.363 24.047,5.953C23.637,5.543 23.08,5.313 22.5,5.313H15C14.751,5.313 14.513,5.411 14.337,5.587C14.161,5.763 14.063,6.001 14.063,6.25C14.063,6.499 14.161,6.737 14.337,6.913C14.513,7.089 14.751,7.188 15,7.188H22.5C22.583,7.188 22.662,7.22 22.721,7.279C22.78,7.338 22.813,7.417 22.813,7.5V22.5C22.813,22.583 22.78,22.662 22.721,22.721C22.662,22.78 22.583,22.813 22.5,22.813H15Z"
android:fillColor="#E85454"/>
<path
android:pathData="M18.129,17.956C18.991,17.956 19.691,17.256 19.691,16.394V13.594C19.691,12.731 18.991,12.031 18.129,12.031H12.363L12.337,11.756L12.27,11.061C12.246,10.816 12.163,10.58 12.029,10.373C11.894,10.166 11.712,9.995 11.497,9.874C11.282,9.753 11.042,9.685 10.795,9.677C10.549,9.669 10.304,9.72 10.081,9.826C8.037,10.804 6.187,12.144 4.621,13.781L4.497,13.91C4.218,14.202 4.062,14.59 4.062,14.994C4.062,15.398 4.218,15.786 4.497,16.077L4.622,16.206C6.188,17.844 8.038,19.184 10.081,20.161C10.304,20.268 10.549,20.319 10.795,20.311C11.042,20.302 11.282,20.235 11.497,20.114C11.712,19.992 11.894,19.821 12.029,19.615C12.163,19.408 12.246,19.172 12.27,18.926L12.337,18.231L12.363,17.956H18.129ZM11.494,16.081C11.255,16.081 11.026,16.173 10.852,16.336C10.678,16.5 10.573,16.723 10.559,16.961C10.535,17.324 10.506,17.687 10.471,18.05L10.451,18.253C8.82,17.411 7.336,16.31 6.056,14.994C7.336,13.677 8.82,12.577 10.451,11.735L10.471,11.938C10.506,12.3 10.535,12.663 10.559,13.026C10.573,13.264 10.678,13.488 10.852,13.651C11.026,13.815 11.255,13.906 11.494,13.906H17.816V16.081H11.494Z"
android:fillColor="#E85454"
android:fillType="evenOdd"/>
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

View File

@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:width="27dp"
android:height="27dp"
android:viewportWidth="27"
android:viewportHeight="27">
<path
android:pathData="M1,22.875L0.25,22.875L1,22.875ZM7.25,16.625L7.25,15.875L7.25,16.625ZM19.75,16.625V15.875V16.625ZM1.75,22.875C1.75,21.416 2.329,20.017 3.361,18.986L2.3,17.925C0.987,19.238 0.25,21.018 0.25,22.875H1.75ZM3.361,18.986C4.392,17.955 5.791,17.375 7.25,17.375L7.25,15.875C5.393,15.875 3.613,16.612 2.3,17.925L3.361,18.986ZM7.25,17.375H19.75V15.875H7.25V17.375ZM19.75,17.375C21.209,17.375 22.608,17.955 23.639,18.986L24.7,17.925C23.387,16.612 21.607,15.875 19.75,15.875V17.375ZM23.639,18.986C24.67,20.017 25.25,21.416 25.25,22.875H26.75C26.75,21.018 26.013,19.238 24.7,17.925L23.639,18.986ZM25.25,22.875C25.25,23.505 25,24.109 24.554,24.554L25.615,25.615C26.342,24.888 26.75,23.903 26.75,22.875H25.25ZM24.554,24.554C24.109,25 23.505,25.25 22.875,25.25V26.75C23.903,26.75 24.888,26.342 25.615,25.615L24.554,24.554ZM22.875,25.25H4.125V26.75H22.875V25.25ZM4.125,25.25C3.495,25.25 2.891,25 2.446,24.554L1.385,25.615C2.112,26.342 3.097,26.75 4.125,26.75V25.25ZM2.446,24.554C2,24.109 1.75,23.505 1.75,22.875L0.25,22.875C0.25,23.903 0.658,24.888 1.385,25.615L2.446,24.554ZM17.438,5.688C17.438,7.862 15.675,9.625 13.5,9.625V11.125C16.503,11.125 18.938,8.691 18.938,5.688H17.438ZM13.5,9.625C11.325,9.625 9.563,7.862 9.563,5.688H8.063C8.063,8.691 10.497,11.125 13.5,11.125V9.625ZM9.563,5.688C9.563,3.513 11.325,1.75 13.5,1.75V0.25C10.497,0.25 8.063,2.684 8.063,5.688H9.563ZM13.5,1.75C15.675,1.75 17.438,3.513 17.438,5.688H18.938C18.938,2.684 16.503,0.25 13.5,0.25V1.75Z"
android:fillColor="#000000"
tools:ignore="VectorPath" />
</vector>

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M8,7C8,5.939 8.421,4.922 9.172,4.172C9.922,3.421 10.939,3 12,3C13.061,3 14.078,3.421 14.828,4.172C15.579,4.922 16,5.939 16,7C16,8.061 15.579,9.078 14.828,9.828C14.078,10.579 13.061,11 12,11C10.939,11 9.922,10.579 9.172,9.828C8.421,9.078 8,8.061 8,7ZM8,13C6.674,13 5.402,13.527 4.464,14.465C3.527,15.402 3,16.674 3,18C3,18.796 3.316,19.559 3.879,20.121C4.441,20.684 5.204,21 6,21H18C18.796,21 19.559,20.684 20.121,20.121C20.684,19.559 21,18.796 21,18C21,16.674 20.473,15.402 19.535,14.465C18.598,13.527 17.326,13 16,13H8Z"
android:fillColor="#109A17"
android:fillType="evenOdd"/>
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

View File

@ -0,0 +1,17 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M4,18C4,16.939 4.421,15.922 5.172,15.172C5.922,14.421 6.939,14 8,14H16C17.061,14 18.078,14.421 18.828,15.172C19.579,15.922 20,16.939 20,18C20,18.53 19.789,19.039 19.414,19.414C19.039,19.789 18.53,20 18,20H6C5.47,20 4.961,19.789 4.586,19.414C4.211,19.039 4,18.53 4,18Z"
android:strokeLineJoin="round"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#109A17"/>
<path
android:pathData="M12,10C13.657,10 15,8.657 15,7C15,5.343 13.657,4 12,4C10.343,4 9,5.343 9,7C9,8.657 10.343,10 12,10Z"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#109A17"/>
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

@ -0,0 +1,27 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="37dp"
android:height="37dp"
android:viewportWidth="37"
android:viewportHeight="37">
<path
android:pathData="M4.27,15.417C3.607,15.417 3.083,14.892 3.083,14.23V10.668C3.083,6.49 6.49,3.083 10.668,3.083H14.229C14.892,3.083 15.417,3.608 15.417,4.27C15.417,4.933 14.892,5.458 14.229,5.458H10.668C7.785,5.458 5.457,7.801 5.457,10.668V14.23C5.457,14.892 4.918,15.417 4.27,15.417Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M32.729,15.417C32.082,15.417 31.542,14.892 31.542,14.23V10.668C31.542,7.785 29.199,5.458 26.332,5.458H22.77C22.107,5.458 21.583,4.918 21.583,4.27C21.583,3.623 22.107,3.083 22.77,3.083H26.332C30.51,3.083 33.917,6.49 33.917,10.668V14.23C33.917,14.892 33.392,15.417 32.729,15.417Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M26.332,33.917H24.189C23.541,33.917 23.002,33.393 23.002,32.73C23.002,32.082 23.526,31.542 24.189,31.542H26.332C29.215,31.542 31.542,29.199 31.542,26.332V24.204C31.542,23.557 32.067,23.017 32.73,23.017C33.377,23.017 33.917,23.541 33.917,24.204V26.332C33.917,30.51 30.51,33.917 26.332,33.917Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M14.229,33.917H10.668C6.49,33.917 3.083,30.51 3.083,26.332V22.77C3.083,22.108 3.607,21.583 4.27,21.583C4.933,21.583 5.457,22.108 5.457,22.77V26.332C5.457,29.215 7.801,31.542 10.668,31.542H14.229C14.877,31.542 15.417,32.067 15.417,32.73C15.417,33.393 14.892,33.917 14.229,33.917Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M28.459,17.313H26.362H10.637H8.541C7.878,17.313 7.354,17.853 7.354,18.5C7.354,19.147 7.878,19.687 8.541,19.687H10.637H26.362H28.459C29.122,19.687 29.646,19.147 29.646,18.5C29.646,17.853 29.122,17.313 28.459,17.313Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M10.637,21.491V22C10.637,24.559 12.703,26.625 15.262,26.625H21.737C24.297,26.625 26.362,24.559 26.362,22V21.491C26.362,21.306 26.224,21.167 26.039,21.167H10.961C10.776,21.167 10.637,21.306 10.637,21.491Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M10.637,15.509V15C10.637,12.441 12.703,10.375 15.262,10.375H21.737C24.297,10.375 26.362,12.441 26.362,15V15.509C26.362,15.694 26.224,15.833 26.039,15.833H10.961C10.776,15.833 10.637,15.694 10.637,15.509Z"
android:fillColor="#ffffff"/>
</vector>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
</resources>

View File

@ -0,0 +1,31 @@
<resources>
<string name="app_name">CaloryApp</string>
<string name="di_caloriey_app">di Caloriey App</string>
<string name="selamat_datang">Selamat Datang\n</string>
<string name="lanjut">Lanjut</string>
<string name="masuk">Masuk</string>
<string name="username">Username</string>
<string name="password">Password</string>
<string name="lupa_password">Lupa Password</string>
<string name="akun">Akun</string>
<string name="profile">Profile</string>
<string name="riwayat">Riwayat</string>
<string name="ubah_password">Ubah Password</string>
<string name="keluar">Keluar</string>
<string name="ya">Ya</string>
<string name="tidak">Tidak</string>
<string name="konfirmasi">Konfirmasi</string>
<string name="lupa_password2">Lupa Password?</string>
<string name="masukkan_gmail_kamu_nanti_akan_kita_kirimkan_kode_otp_ke_gmail_kamu_yaa">Masukkan gmail kamu, nanti akan kita kirimkan kode OTP ke gmail kamu yaa!</string>
<string name="masukkan_gmail">Masukkan Gmail</string>
<string name="gmail">Gmail</string>
<string name="kirim_otp">Kirim OTP</string>
<string name="kode_otp">Kode OTP</string>
<string name="masukkan_kode_otp_yang_sudah_dikirimkan_ke_gmail_kamu_yaa">Masukkan Kode OTP yang sudah dikirimkan ke gmail kamu yaa!</string>
<string name="kirim_ulang_kode">Kirim Ulang Kode</string>
<string name="buat_kata_sandi_baru">Buat Kata Sandi Baru</string>
<string name="masukkan_kata_sandi">Masukkan Kata Sandi</string>
<string name="konfirmasi_kata_sandi">Konfirmasi Kata Sandi</string>
<string name="verifikasi_otp">Verifikasi OTP</string>
<string name="password_kamu_berhasil_dibuat">Password Kamu Berhasil Dibuat</string>
</resources>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.CaloryApp" parent="android:Theme.Material.Light.NoActionBar" />
</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>

View File

@ -0,0 +1,17 @@
package com.example.caloryapp
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}

5
build.gradle.kts Normal file
View File

@ -0,0 +1,5 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.jetbrains.kotlin.android) 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. For more details, visit
# https://developer.android.com/r/tools/gradle-multi-project-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

37
gradle/libs.versions.toml Normal file
View File

@ -0,0 +1,37 @@
[versions]
agp = "8.5.2"
kotlin = "1.9.0"
coreKtx = "1.15.0"
junit = "4.13.2"
junitVersion = "1.2.1"
espressoCore = "3.6.1"
material = "1.7.7"
navigationCompose = "2.8.6"
lifecycleRuntimeKtx = "2.8.7"
activityCompose = "1.10.0"
composeBom = "2025.01.01"
ohteepee = "1.0.3"
[libraries]
androidx-material = { module = "androidx.compose.material:material", version.ref = "material" }
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "navigationCompose" }
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
androidx-ui = { group = "androidx.compose.ui", name = "ui" }
androidx-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
androidx-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
androidx-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
androidx-material3 = { group = "androidx.compose.material3", name = "material3" }
ohteepee = { module = "com.github.composeuisuite:ohteepee", version.ref = "ohteepee" }
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,6 @@
#Sun Feb 09 17:46:14 ICT 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

185
gradlew vendored Normal file
View File

@ -0,0 +1,185 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"

89
gradlew.bat vendored Normal file
View File

@ -0,0 +1,89 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

25
settings.gradle.kts Normal file
View File

@ -0,0 +1,25 @@
pluginManagement {
repositories {
google {
content {
includeGroupByRegex("com\\.android.*")
includeGroupByRegex("com\\.google.*")
includeGroupByRegex("androidx.*")
}
}
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven("https://jitpack.io")
}
}
rootProject.name = "CaloryApp"
include(":app")