commit ebff7e55ff8cee76a6c76f2bb2623267f03433c1 Author: tharun-terces <tharunpasupuleti@gmail.com> Date: Sat Jul 30 10:51:51 2022 +0530 update v2 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/.gitignore @@ -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 diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..34a0773 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +BMI Calculator \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..fb7f4a8 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="CompilerConfiguration"> + <bytecodeTargetLevel target="11" /> + </component> +</project> \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..e9969a1 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="GradleMigrationSettings" migrationVersion="1" /> + <component name="GradleSettings"> + <option name="linkedExternalProjectsSettings"> + <GradleProjectSettings> + <option name="testRunner" value="GRADLE" /> + <option name="distributionType" value="DEFAULT_WRAPPED" /> + <option name="externalProjectPath" value="$PROJECT_DIR$" /> + <option name="gradleJvm" value="11" /> + <option name="modules"> + <set> + <option value="$PROJECT_DIR$" /> + <option value="$PROJECT_DIR$/app" /> + </set> + </option> + <option name="resolveModulePerSourceSet" value="false" /> + </GradleProjectSettings> + </option> + </component> +</project> \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..3ad393b --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="DesignSurface"> + <option name="filePathToZoomLevelMap"> + <map> + <entry key="app/src/main/res/drawable/calculate_btn.xml" value="0.187" /> + <entry key="app/src/main/res/drawable/female.xml" value="0.1215" /> + <entry key="app/src/main/res/drawable/female_white.xml" value="0.187" /> + <entry key="app/src/main/res/drawable/ic_logo_foreground.xml" value="0.1215" /> + <entry key="app/src/main/res/drawable/ic_refresh.xml" value="0.187" /> + <entry key="app/src/main/res/drawable/ic_share.xml" value="0.187" /> + <entry key="app/src/main/res/drawable/male.xml" value="0.187" /> + <entry key="app/src/main/res/drawable/male_white.xml" value="0.1215" /> + <entry key="app/src/main/res/drawable/result_btn.xml" value="0.187" /> + <entry key="app/src/main/res/drawable/ripple.xml" value="0.187" /> + <entry key="app/src/main/res/drawable/stepper_background.xml" value="0.187" /> + <entry key="app/src/main/res/layout/activity_main.xml" value="0.24270833333333333" /> + <entry key="app/src/main/res/layout/fragment_home.xml" value="0.24270833333333333" /> + <entry key="app/src/main/res/layout/fragment_result.xml" value="0.19670747150696496" /> + <entry key="app/src/main/res/menu/menu_main.xml" value="0.1" /> + <entry key="app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml" value="0.1" /> + <entry key="app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml" value="0.1565" /> + <entry key="app/src/main/res/mipmap-anydpi-v26/ic_logo_round.xml" value="0.1565" /> + </map> + </option> + </component> + <component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="1.8" project-jdk-type="JavaSDK"> + <output url="file://$PROJECT_DIR$/build/classes" /> + </component> + <component name="ProjectType"> + <option name="id" value="Android" /> + </component> +</project> \ No newline at end of file diff --git a/.idea/render.experimental.xml b/.idea/render.experimental.xml new file mode 100644 index 0000000..8ec256a --- /dev/null +++ b/.idea/render.experimental.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="RenderSettings"> + <option name="showDecorations" value="true" /> + </component> +</project> \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="VcsDirectoryMappings"> + <mapping directory="$PROJECT_DIR$" vcs="Git" /> + </component> +</project> \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..dcef9b5 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,53 @@ +plugins { + id 'com.android.application' + id 'org.jetbrains.kotlin.android' + id 'androidx.navigation.safeargs.kotlin' +} + +android { + compileSdk 31 + + defaultConfig { + applicationId "com.tharun.bmicalculator" + minSdk 21 + targetSdk 31 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled 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 { + viewBinding true + } +} + +dependencies { + + implementation 'androidx.core:core-ktx:1.8.0' + implementation 'androidx.appcompat:appcompat:1.4.2' + implementation 'com.google.android.material:material:1.6.1' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + implementation 'androidx.navigation:navigation-fragment-ktx:2.5.0' + implementation 'androidx.navigation:navigation-ui-ktx:2.5.0' + implementation 'androidx.legacy:legacy-support-v4:1.0.0' + implementation "androidx.fragment:fragment-ktx:1.5.0" + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.3' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' + + implementation "androidx.core:core-splashscreen:1.0.0-rc01" +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/app/proguard-rules.pro @@ -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 \ No newline at end of file diff --git a/app/src/androidTest/java/com/tharun/bmicalculator/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/tharun/bmicalculator/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..94a8ab7 --- /dev/null +++ b/app/src/androidTest/java/com/tharun/bmicalculator/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.tharun.bmicalculator + +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.tharun.bmicalculator", appContext.packageName) + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..91dd04d --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.tharun.bmicalculator"> + + <application + android:allowBackup="true" + android:icon="@mipmap/ic_launcher" + android:label="@string/app_name" + android:roundIcon="@mipmap/ic_launcher_round" + android:supportsRtl="true" + android:theme="@style/Theme.AppSplash"> + <activity + android:name=".MainActivity" + android:exported="true" + android:screenOrientation="portrait"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + </application> + +</manifest> \ No newline at end of file diff --git a/app/src/main/ic_launcher-playstore.png b/app/src/main/ic_launcher-playstore.png new file mode 100644 index 0000000..2634a86 Binary files /dev/null and b/app/src/main/ic_launcher-playstore.png differ diff --git a/app/src/main/ic_logo-playstore.png b/app/src/main/ic_logo-playstore.png new file mode 100644 index 0000000..2634a86 Binary files /dev/null and b/app/src/main/ic_logo-playstore.png differ diff --git a/app/src/main/java/com/tharun/bmicalculator/HomeFragment.kt b/app/src/main/java/com/tharun/bmicalculator/HomeFragment.kt new file mode 100644 index 0000000..e7e88e7 --- /dev/null +++ b/app/src/main/java/com/tharun/bmicalculator/HomeFragment.kt @@ -0,0 +1,125 @@ +package com.tharun.bmicalculator + +import android.graphics.Color +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.SeekBar +import android.widget.Toast +import androidx.fragment.app.Fragment +import androidx.navigation.fragment.findNavController +import com.tharun.bmicalculator.databinding.FragmentHomeBinding + +class HomeFragment : Fragment() { + + private var height: Float = 0f + private var weight: Float = 0f + private var countWeight = 50 + private var countAge = 19 + private var chosen: Boolean = true + private var _binding: FragmentHomeBinding? = null + private val binding get() = _binding!! + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + + _binding = FragmentHomeBinding.inflate(inflater, container, false) + + initComponents() + + return binding.root + } + + private fun initComponents() { + + binding.apply { + + Seekbar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener { + override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) { + val ht = progress.toString() + resources.getString(R.string.cm) + binding.heightTxt.text = ht + height = progress.toFloat() / 100 + } + + override fun onStartTrackingTouch(seekBar: SeekBar) {} + override fun onStopTrackingTouch(seekBar: SeekBar) {} + }) + + weightPlus.setOnClickListener { + binding.weightTxt.text = countWeight++.toString() + } + + weightMinus.setOnClickListener { + binding.weightTxt.text = countWeight--.toString() + } + + agePlus.setOnClickListener { + binding.age.text = countAge++.toString() + } + + ageMinus.setOnClickListener { + binding.age.text = countAge--.toString() + } + + calculate.setOnClickListener { + if(!chosen) { + if(height.equals(0f)) { + Toast.makeText(requireContext(),"Height cannot be Zero, Try again", Toast.LENGTH_SHORT).show() + } + else { + weight = binding.weightTxt.text.toString().toFloat() + calculateBMI(age.text.toString()) + } + } + else { + Toast.makeText(requireContext(),"Choose your gender", Toast.LENGTH_SHORT).show() + } + } + + cardViewMale.setOnClickListener { + if(chosen) { + maleTxt.setTextColor(Color.parseColor("#FFFFFF")) + maleTxt.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.male_white, 0, 0) + cardViewFemale.isEnabled = false + chosen = false + + } else { + maleTxt.setTextColor(Color.parseColor("#8D8E99")) + maleTxt.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.male, 0, 0) + cardViewFemale.isEnabled = true + chosen = true + } + } + + cardViewFemale.setOnClickListener { + if(chosen) { + femaleTxt.setTextColor(Color.parseColor("#FFFFFF")) + femaleTxt.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.female_white, 0, 0) + cardViewMale.isEnabled = false + chosen = false + + } else { + femaleTxt.setTextColor(Color.parseColor("#8D8E99")) + femaleTxt.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.female, 0, 0) + cardViewMale.isEnabled = true + chosen = true + } + } + } + } + + + private fun calculateBMI(age: String) { + val bmi = weight / (height*height) + val action = HomeFragmentDirections.actionHomeFragmentToResultFragment(bmi,age) + findNavController().navigate(action) + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } +} \ No newline at end of file diff --git a/app/src/main/java/com/tharun/bmicalculator/MainActivity.kt b/app/src/main/java/com/tharun/bmicalculator/MainActivity.kt new file mode 100644 index 0000000..38d10b6 --- /dev/null +++ b/app/src/main/java/com/tharun/bmicalculator/MainActivity.kt @@ -0,0 +1,20 @@ +package com.tharun.bmicalculator + +import android.os.Bundle +import androidx.appcompat.app.AppCompatActivity +import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen +import com.tharun.bmicalculator.databinding.ActivityMainBinding + +class MainActivity : AppCompatActivity() { + + private lateinit var binding: ActivityMainBinding + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + installSplashScreen() + + binding = ActivityMainBinding.inflate(layoutInflater) + setContentView(binding.root) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/tharun/bmicalculator/ResultFragment.kt b/app/src/main/java/com/tharun/bmicalculator/ResultFragment.kt new file mode 100644 index 0000000..b801144 --- /dev/null +++ b/app/src/main/java/com/tharun/bmicalculator/ResultFragment.kt @@ -0,0 +1,97 @@ +package com.tharun.bmicalculator + +import android.content.Intent +import android.graphics.Color +import android.os.Bundle +import android.text.SpannableString +import android.text.style.ForegroundColorSpan +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.Toast +import androidx.fragment.app.Fragment +import androidx.navigation.fragment.navArgs +import com.tharun.bmicalculator.databinding.FragmentResultBinding +import kotlin.math.roundToInt + +class ResultFragment : Fragment() { + + private var _binding: FragmentResultBinding? = null + private val binding get() = _binding!! + private val args: ResultFragmentArgs by navArgs() + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + _binding = FragmentResultBinding.inflate(inflater, container, false) + + val bmi = (args.bmi * 100 / 100).roundToInt().toFloat() + val age = args.age + + binding.apply { + + yourBmi.text = bmi.toString() + condition.text = Utils.checkAdult(age.toInt(),bmi) + //category.text = Utils.checkAdult(age.toInt(),bmi) + + recalculate.setOnClickListener { + requireActivity().onBackPressed() + } + + val spannable = SpannableString("Suggestion: ${Utils.getSuggestions(bmi)}") + + val fColor = ForegroundColorSpan(Color.parseColor("#FE0049")) + spannable.setSpan(fColor,0,11,SpannableString.SPAN_INCLUSIVE_EXCLUSIVE) + + suggestion.text = spannable + + val spannable1 = SpannableString("$age (${category(age.toInt())})") + + ageTxt.text = spannable1 + + share.setOnClickListener { + shareContent(bmi) + } + + } + + return binding.root + } + + private fun category(age: Int): String { + val category:String = when (age) { + in 2..19 -> { + "Teenage" + } + else -> { + "Adult" + } + } + return category + } + + private fun shareContent(bmi: Float) { + try { + + val strShareMessage = "Hello!! my BMI is ${bmi}\n\n" + + "my current condition: ${binding.condition.text}\n" + + "my age is: ${binding.ageTxt.text}" + "App suggested my that: ${binding.suggestion.text}" + + val i = Intent(Intent.ACTION_SEND) + i.putExtra(Intent.EXTRA_TEXT, strShareMessage) + i.type = "text/plain" + startActivity(Intent.createChooser(i, "Select App to Share with your friends")) + + } catch (e: Exception) { + + Toast.makeText(requireContext(),e.toString(),Toast.LENGTH_LONG).show() + } + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } +} \ No newline at end of file diff --git a/app/src/main/java/com/tharun/bmicalculator/Utils.kt b/app/src/main/java/com/tharun/bmicalculator/Utils.kt new file mode 100644 index 0000000..5eda755 --- /dev/null +++ b/app/src/main/java/com/tharun/bmicalculator/Utils.kt @@ -0,0 +1,85 @@ +package com.tharun.bmicalculator + +object Utils { + + fun checkAdult(age: Int, result: Float): String { + val category:String = when (age) { + in 2..19 -> { + getAdultCategory(result) + } + else -> { + getChildCategory(result) + } + } + return category + } + + fun getAdultCategory(result: Float): String { + val category: String = if (result < 15) { + "Severe Thinness" + } else if (result in 15.0..16.0) { + "Moderate Thinness" + } else if (result > 16 && result <= 18.5) { + "Mild Thinness" + } else if (result > 18.5 && result <= 25) { + "Normal" + } else if (result > 25 && result <= 30) { + "Overweight" + } else if (result > 30 && result <= 35) { + "Obese Class I" + } else if (result > 35 && result <= 40) { + "Obese Class II" + } else { + "Obese Class III" + } + return category + } + + fun getChildCategory(result: Float): String { + val category: String = when { + result < 15 -> { + "very severely underweight" + } + result in 15.0..16.0 -> { + "severely underweight" + } + result > 16 && result <= 18.5 -> { + "underweight" + } + result > 18.5 && result <= 25 -> { + "normal (healthy weight)" + } + result > 25 && result <= 30 -> { + "overweight" + } + result > 30 && result <= 35 -> { + "moderately obese" + } + result > 35 && result <= 40 -> { + "severely obese" + } + else -> { + "very severely obese" + } + } + return category + } + + fun getSuggestions(result: Float): String { + val suggestion: String = when { + result < 18.5 -> { + "A BMI of under 18.5 indicates that a person has insufficient weight, so they may need to put on some weight. They should ask a doctor or dietitian for advice." + } + result in 18.5..24.9 -> { + "A BMI of 18.5–24.9 indicates that a person has a healthy weight for their height. By maintaining a healthy weight, they can lower their risk of developing serious health problems." + } + result < 25 && result >=29.9 -> { + "A BMI of 25–29.9 indicates that a person is slightly overweight. A doctor may advise them to lose some weight for health reasons. They should talk with a doctor or dietitian for advice." + } + else -> { + "A BMI of over 30 indicates that a person has obesity. Their health may be at risk if they do not lose weight. They should talk with a doctor or dietitian for advice." + } + } + return suggestion + } +} \ No newline at end of file diff --git a/app/src/main/res/anim/slide_in_left.xml b/app/src/main/res/anim/slide_in_left.xml new file mode 100644 index 0000000..a12c857 --- /dev/null +++ b/app/src/main/res/anim/slide_in_left.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<set xmlns:android="http://schemas.android.com/apk/res/android"> + <translate android:fromXDelta="-100%" android:toXDelta="0%" + android:fromYDelta="0%" android:toYDelta="0%" + android:duration="200"/> +</set> \ No newline at end of file diff --git a/app/src/main/res/anim/slide_in_right.xml b/app/src/main/res/anim/slide_in_right.xml new file mode 100644 index 0000000..5f7d83a --- /dev/null +++ b/app/src/main/res/anim/slide_in_right.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<set xmlns:android="http://schemas.android.com/apk/res/android"> + <translate android:fromXDelta="100%" android:toXDelta="0%" + android:fromYDelta="0%" android:toYDelta="0%" + android:duration="200"/> +</set> \ No newline at end of file diff --git a/app/src/main/res/anim/slide_out_left.xml b/app/src/main/res/anim/slide_out_left.xml new file mode 100644 index 0000000..4feb61f --- /dev/null +++ b/app/src/main/res/anim/slide_out_left.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<set xmlns:android="http://schemas.android.com/apk/res/android"> + <translate android:fromXDelta="0%" android:toXDelta="-100%" + android:fromYDelta="0%" android:toYDelta="0%" + android:duration="200"/> +</set> \ No newline at end of file diff --git a/app/src/main/res/anim/slide_out_right.xml b/app/src/main/res/anim/slide_out_right.xml new file mode 100644 index 0000000..7df532b --- /dev/null +++ b/app/src/main/res/anim/slide_out_right.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<set xmlns:android="http://schemas.android.com/apk/res/android"> + <translate android:fromXDelta="0%" android:toXDelta="100%" + android:fromYDelta="0%" android:toYDelta="0%" + android:duration="200"/> +</set> \ No newline at end of file diff --git a/app/src/main/res/drawable/female.xml b/app/src/main/res/drawable/female.xml new file mode 100644 index 0000000..297cb94 --- /dev/null +++ b/app/src/main/res/drawable/female.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="90dp" + android:height="90dp" + android:viewportWidth="944" + android:viewportHeight="944"> + + <path + android:strokeColor="#8D8E99" + android:strokeWidth="60" + android:pathData="M437.176 194.639C520.841 110.973 658.703 111.743 745.108 198.148C831.513 284.553 832.283 422.415 748.618 506.081C664.952 589.746 527.09 588.976 440.685 502.571C354.28 416.166 353.51 278.304 437.176 194.639Z" /> + + <path + android:strokeColor="#8D8E99" + android:strokeWidth="60" + android:pathData="M443.562 503.105L178.152 767.54" /> + + <path + android:strokeColor="#8D8E99" + android:strokeWidth="60" + android:pathData="M 376.496 773.551 L 171.435 568.49" /> + +</vector> \ No newline at end of file diff --git a/app/src/main/res/drawable/female_white.xml b/app/src/main/res/drawable/female_white.xml new file mode 100644 index 0000000..0a163e2 --- /dev/null +++ b/app/src/main/res/drawable/female_white.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="90dp" + android:height="90dp" + android:viewportWidth="944" + android:viewportHeight="944"> + + <path + android:strokeColor="#FFFFFF" + android:strokeWidth="60" + android:pathData="M437.176 194.639C520.841 110.973 658.703 111.743 745.108 198.148C831.513 284.553 832.283 422.415 748.618 506.081C664.952 589.746 527.09 588.976 440.685 502.571C354.28 416.166 353.51 278.304 437.176 194.639Z" /> + + <path + android:strokeColor="#FFFFFF" + android:strokeWidth="60" + android:pathData="M443.562 503.105L178.152 767.54" /> + + <path + android:strokeColor="#FFFFFF" + android:strokeWidth="60" + android:pathData="M 376.496 773.551 L 171.435 568.49" /> + +</vector> \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_add.xml b/app/src/main/res/drawable/ic_add.xml new file mode 100644 index 0000000..70046c4 --- /dev/null +++ b/app/src/main/res/drawable/ic_add.xml @@ -0,0 +1,5 @@ +<vector android:height="24dp" android:tint="#FFFFFF" + android:viewportHeight="24" android:viewportWidth="24" + android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="@android:color/white" android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/> +</vector> diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..475f2ba --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,21 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + <group android:scaleX="0.34105262" + android:scaleY="0.34105262" + android:translateX="21.6" + android:translateY="21.6"> + <path + android:pathData="M0,0h190v190h-190z" + android:fillColor="#0B0A24"/> + <path + android:pathData="M78.5,56C80.849,57.174 82.674,59.011 84,61.179C85.306,63.314 86.129,65.77 86.494,68.232C87.006,71.684 86.617,75.147 85.395,77.754C85.012,78.572 84.546,79.307 84,79.929C83.422,80.588 82.755,81.123 82,81.5C82.72,81.692 83.39,82.069 84,82.595C86.332,84.608 87.793,88.812 87.888,93.276C87.979,97.536 86.826,102.034 84,105.093C82.496,106.721 80.517,107.941 78,108.5L73.004,108.558L72.5,108.564L49,108.837L35,109V100.5H48H49H72.5C73.937,100.41 75.067,99.901 75.917,99.126C76.986,98.151 77.612,96.756 77.846,95.245C77.864,95.129 77.88,95.012 77.893,94.894L77.895,94.88C78.332,90.985 76.246,86.5 72.5,86.5H62H48V82.848V72.5V70V56H62H78.5ZM98,95V84.245V83.842V80.612V78.001V75V74.279V70V64.271V61.851V57.887V56H109.5L112,60.914L116.533,69.824L117.071,70.882L119.167,75L123,82.535L124,84.5V85.5V98.225V99.5H123H121.5L115.939,88.601L113.847,84.5L112,80.88L109,75V85.891V95V105.805V109H98.22H98V95ZM152,109H141V95V88V79V74H152V79V88V95V109ZM141,60V56H152V60V65H141V60ZM67.574,78H72H72.4C77.49,78 76.9,65 72.4,65H72H67.762H58V78H67.574Z" + android:fillColor="#FE0049" + android:fillType="evenOdd"/> + <path + android:pathData="M50.75,134.234C49.521,134.234 48.464,133.974 47.578,133.453C46.698,132.927 46.021,132.198 45.547,131.266C45.078,130.333 44.844,129.26 44.844,128.047C44.844,126.818 45.081,125.74 45.555,124.812C46.034,123.88 46.714,123.154 47.594,122.633C48.474,122.107 49.521,121.844 50.734,121.844C51.781,121.844 52.698,122.034 53.484,122.414C54.271,122.794 54.893,123.328 55.352,124.016C55.81,124.703 56.063,125.51 56.109,126.438H52.969C52.88,125.839 52.646,125.357 52.266,124.992C51.891,124.622 51.398,124.437 50.789,124.437C50.273,124.437 49.823,124.578 49.438,124.859C49.057,125.135 48.76,125.539 48.547,126.07C48.333,126.602 48.227,127.245 48.227,128C48.227,128.766 48.331,129.417 48.539,129.953C48.753,130.49 49.052,130.898 49.438,131.18C49.823,131.461 50.273,131.602 50.789,131.602C51.169,131.602 51.51,131.523 51.813,131.367C52.12,131.211 52.372,130.984 52.57,130.687C52.773,130.385 52.906,130.023 52.969,129.602H56.109C56.057,130.518 55.807,131.326 55.359,132.023C54.917,132.716 54.305,133.258 53.523,133.648C52.742,134.039 51.818,134.234 50.75,134.234ZM61.662,134.227C60.896,134.227 60.214,134.094 59.615,133.828C59.016,133.557 58.542,133.159 58.193,132.633C57.85,132.102 57.678,131.44 57.678,130.648C57.678,129.982 57.8,129.422 58.045,128.969C58.29,128.516 58.623,128.151 59.045,127.875C59.467,127.599 59.946,127.391 60.482,127.25C61.024,127.109 61.592,127.01 62.186,126.953C62.883,126.88 63.446,126.812 63.873,126.75C64.3,126.682 64.61,126.583 64.803,126.453C64.995,126.323 65.092,126.13 65.092,125.875V125.828C65.092,125.333 64.936,124.951 64.623,124.68C64.316,124.409 63.878,124.273 63.311,124.273C62.712,124.273 62.235,124.406 61.881,124.672C61.527,124.932 61.292,125.26 61.178,125.656L58.1,125.406C58.256,124.677 58.563,124.047 59.021,123.516C59.48,122.979 60.071,122.568 60.795,122.281C61.524,121.99 62.368,121.844 63.326,121.844C63.993,121.844 64.631,121.922 65.24,122.078C65.855,122.234 66.399,122.477 66.873,122.805C67.352,123.133 67.73,123.555 68.006,124.07C68.282,124.581 68.42,125.193 68.42,125.906V134H65.264V132.336H65.17C64.977,132.711 64.719,133.042 64.396,133.328C64.074,133.609 63.686,133.831 63.232,133.992C62.779,134.148 62.256,134.227 61.662,134.227ZM62.615,131.93C63.105,131.93 63.537,131.833 63.912,131.641C64.287,131.443 64.581,131.177 64.795,130.844C65.008,130.51 65.115,130.133 65.115,129.711V128.438C65.011,128.505 64.868,128.568 64.686,128.625C64.508,128.677 64.308,128.727 64.084,128.773C63.86,128.815 63.636,128.854 63.412,128.891C63.188,128.922 62.985,128.951 62.803,128.977C62.412,129.034 62.071,129.125 61.779,129.25C61.488,129.375 61.261,129.544 61.1,129.758C60.938,129.966 60.857,130.227 60.857,130.539C60.857,130.992 61.021,131.339 61.35,131.578C61.683,131.812 62.105,131.93 62.615,131.93ZM74.33,118V134H71.002V118H74.33ZM82.418,134.234C81.189,134.234 80.132,133.974 79.246,133.453C78.366,132.927 77.689,132.198 77.215,131.266C76.746,130.333 76.512,129.26 76.512,128.047C76.512,126.818 76.749,125.74 77.223,124.812C77.702,123.88 78.382,123.154 79.262,122.633C80.142,122.107 81.189,121.844 82.402,121.844C83.449,121.844 84.366,122.034 85.152,122.414C85.939,122.794 86.561,123.328 87.02,124.016C87.478,124.703 87.73,125.51 87.777,126.438H84.637C84.548,125.839 84.314,125.357 83.934,124.992C83.559,124.622 83.066,124.437 82.457,124.437C81.941,124.437 81.491,124.578 81.105,124.859C80.725,125.135 80.428,125.539 80.215,126.07C80.001,126.602 79.895,127.245 79.895,128C79.895,128.766 79.999,129.417 80.207,129.953C80.421,130.49 80.72,130.898 81.105,131.18C81.491,131.461 81.941,131.602 82.457,131.602C82.837,131.602 83.178,131.523 83.48,131.367C83.788,131.211 84.04,130.984 84.238,130.687C84.441,130.385 84.574,130.023 84.637,129.602H87.777C87.725,130.518 87.475,131.326 87.027,132.023C86.585,132.716 85.973,133.258 85.191,133.648C84.41,134.039 83.486,134.234 82.418,134.234ZM97.604,128.891V122H100.932V134H97.736V131.82H97.611C97.34,132.523 96.89,133.089 96.26,133.516C95.635,133.943 94.872,134.156 93.971,134.156C93.169,134.156 92.463,133.974 91.854,133.609C91.244,133.245 90.768,132.727 90.424,132.055C90.085,131.383 89.913,130.578 89.908,129.641V122H93.236V129.047C93.242,129.755 93.432,130.315 93.807,130.727C94.182,131.138 94.684,131.344 95.314,131.344C95.715,131.344 96.09,131.253 96.439,131.07C96.788,130.883 97.07,130.607 97.283,130.242C97.502,129.878 97.609,129.427 97.604,128.891ZM106.922,118V134H103.594V118H106.922ZM113.01,134.227C112.244,134.227 111.562,134.094 110.963,133.828C110.364,133.557 109.89,133.159 109.541,132.633C109.197,132.102 109.025,131.44 109.025,130.648C109.025,129.982 109.148,129.422 109.393,128.969C109.637,128.516 109.971,128.151 110.393,127.875C110.814,127.599 111.294,127.391 111.83,127.25C112.372,127.109 112.939,127.01 113.533,126.953C114.231,126.88 114.794,126.812 115.221,126.75C115.648,126.682 115.958,126.583 116.15,126.453C116.343,126.323 116.439,126.13 116.439,125.875V125.828C116.439,125.333 116.283,124.951 115.971,124.68C115.663,124.409 115.226,124.273 114.658,124.273C114.059,124.273 113.583,124.406 113.229,124.672C112.874,124.932 112.64,125.26 112.525,125.656L109.447,125.406C109.604,124.677 109.911,124.047 110.369,123.516C110.827,122.979 111.419,122.568 112.143,122.281C112.872,121.99 113.715,121.844 114.674,121.844C115.34,121.844 115.979,121.922 116.588,122.078C117.202,122.234 117.747,122.477 118.221,122.805C118.7,123.133 119.077,123.555 119.354,124.07C119.63,124.581 119.768,125.193 119.768,125.906V134H116.611V132.336H116.518C116.325,132.711 116.067,133.042 115.744,133.328C115.421,133.609 115.033,133.831 114.58,133.992C114.127,134.148 113.604,134.227 113.01,134.227ZM113.963,131.93C114.452,131.93 114.885,131.833 115.26,131.641C115.635,131.443 115.929,131.177 116.143,130.844C116.356,130.51 116.463,130.133 116.463,129.711V128.438C116.359,128.505 116.215,128.568 116.033,128.625C115.856,128.677 115.656,128.727 115.432,128.773C115.208,128.815 114.984,128.854 114.76,128.891C114.536,128.922 114.333,128.951 114.15,128.977C113.76,129.034 113.419,129.125 113.127,129.25C112.835,129.375 112.609,129.544 112.447,129.758C112.286,129.966 112.205,130.227 112.205,130.539C112.205,130.992 112.369,131.339 112.697,131.578C113.031,131.812 113.452,131.93 113.963,131.93ZM128.732,122V124.5H121.506V122H128.732ZM123.146,119.125H126.475V130.312C126.475,130.62 126.521,130.859 126.615,131.031C126.709,131.198 126.839,131.315 127.006,131.383C127.178,131.451 127.376,131.484 127.6,131.484C127.756,131.484 127.912,131.471 128.068,131.445C128.225,131.414 128.344,131.391 128.428,131.375L128.951,133.852C128.785,133.904 128.55,133.964 128.248,134.031C127.946,134.104 127.579,134.148 127.146,134.164C126.344,134.195 125.641,134.089 125.037,133.844C124.438,133.599 123.972,133.219 123.639,132.703C123.305,132.187 123.141,131.536 123.146,130.75V119.125ZM136.193,134.234C134.98,134.234 133.93,133.977 133.045,133.461C132.165,132.94 131.485,132.216 131.006,131.289C130.527,130.357 130.287,129.276 130.287,128.047C130.287,126.807 130.527,125.724 131.006,124.797C131.485,123.865 132.165,123.141 133.045,122.625C133.93,122.104 134.98,121.844 136.193,121.844C137.407,121.844 138.454,122.104 139.334,122.625C140.219,123.141 140.902,123.865 141.381,124.797C141.86,125.724 142.1,126.807 142.1,128.047C142.1,129.276 141.86,130.357 141.381,131.289C140.902,132.216 140.219,132.94 139.334,133.461C138.454,133.977 137.407,134.234 136.193,134.234ZM136.209,131.656C136.761,131.656 137.222,131.5 137.592,131.188C137.962,130.87 138.24,130.437 138.428,129.891C138.62,129.344 138.717,128.721 138.717,128.023C138.717,127.326 138.62,126.703 138.428,126.156C138.24,125.609 137.962,125.177 137.592,124.859C137.222,124.542 136.761,124.383 136.209,124.383C135.652,124.383 135.183,124.542 134.803,124.859C134.428,125.177 134.144,125.609 133.951,126.156C133.764,126.703 133.67,127.326 133.67,128.023C133.67,128.721 133.764,129.344 133.951,129.891C134.144,130.437 134.428,130.87 134.803,131.188C135.183,131.5 135.652,131.656 136.209,131.656ZM144.264,134V122H147.49V124.094H147.615C147.834,123.349 148.201,122.786 148.717,122.406C149.232,122.021 149.826,121.828 150.498,121.828C150.665,121.828 150.844,121.839 151.037,121.859C151.23,121.88 151.399,121.909 151.545,121.945V124.898C151.389,124.852 151.173,124.81 150.896,124.773C150.62,124.737 150.368,124.719 150.139,124.719C149.649,124.719 149.212,124.826 148.826,125.039C148.446,125.247 148.144,125.539 147.92,125.914C147.701,126.289 147.592,126.721 147.592,127.211V134H144.264Z" + android:fillColor="#ffffff"/> + </group> +</vector> diff --git a/app/src/main/res/drawable/ic_logo_foreground.xml b/app/src/main/res/drawable/ic_logo_foreground.xml new file mode 100644 index 0000000..475f2ba --- /dev/null +++ b/app/src/main/res/drawable/ic_logo_foreground.xml @@ -0,0 +1,21 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + <group android:scaleX="0.34105262" + android:scaleY="0.34105262" + android:translateX="21.6" + android:translateY="21.6"> + <path + android:pathData="M0,0h190v190h-190z" + android:fillColor="#0B0A24"/> + <path + android:pathData="M78.5,56C80.849,57.174 82.674,59.011 84,61.179C85.306,63.314 86.129,65.77 86.494,68.232C87.006,71.684 86.617,75.147 85.395,77.754C85.012,78.572 84.546,79.307 84,79.929C83.422,80.588 82.755,81.123 82,81.5C82.72,81.692 83.39,82.069 84,82.595C86.332,84.608 87.793,88.812 87.888,93.276C87.979,97.536 86.826,102.034 84,105.093C82.496,106.721 80.517,107.941 78,108.5L73.004,108.558L72.5,108.564L49,108.837L35,109V100.5H48H49H72.5C73.937,100.41 75.067,99.901 75.917,99.126C76.986,98.151 77.612,96.756 77.846,95.245C77.864,95.129 77.88,95.012 77.893,94.894L77.895,94.88C78.332,90.985 76.246,86.5 72.5,86.5H62H48V82.848V72.5V70V56H62H78.5ZM98,95V84.245V83.842V80.612V78.001V75V74.279V70V64.271V61.851V57.887V56H109.5L112,60.914L116.533,69.824L117.071,70.882L119.167,75L123,82.535L124,84.5V85.5V98.225V99.5H123H121.5L115.939,88.601L113.847,84.5L112,80.88L109,75V85.891V95V105.805V109H98.22H98V95ZM152,109H141V95V88V79V74H152V79V88V95V109ZM141,60V56H152V60V65H141V60ZM67.574,78H72H72.4C77.49,78 76.9,65 72.4,65H72H67.762H58V78H67.574Z" + android:fillColor="#FE0049" + android:fillType="evenOdd"/> + <path + android:pathData="M50.75,134.234C49.521,134.234 48.464,133.974 47.578,133.453C46.698,132.927 46.021,132.198 45.547,131.266C45.078,130.333 44.844,129.26 44.844,128.047C44.844,126.818 45.081,125.74 45.555,124.812C46.034,123.88 46.714,123.154 47.594,122.633C48.474,122.107 49.521,121.844 50.734,121.844C51.781,121.844 52.698,122.034 53.484,122.414C54.271,122.794 54.893,123.328 55.352,124.016C55.81,124.703 56.063,125.51 56.109,126.438H52.969C52.88,125.839 52.646,125.357 52.266,124.992C51.891,124.622 51.398,124.437 50.789,124.437C50.273,124.437 49.823,124.578 49.438,124.859C49.057,125.135 48.76,125.539 48.547,126.07C48.333,126.602 48.227,127.245 48.227,128C48.227,128.766 48.331,129.417 48.539,129.953C48.753,130.49 49.052,130.898 49.438,131.18C49.823,131.461 50.273,131.602 50.789,131.602C51.169,131.602 51.51,131.523 51.813,131.367C52.12,131.211 52.372,130.984 52.57,130.687C52.773,130.385 52.906,130.023 52.969,129.602H56.109C56.057,130.518 55.807,131.326 55.359,132.023C54.917,132.716 54.305,133.258 53.523,133.648C52.742,134.039 51.818,134.234 50.75,134.234ZM61.662,134.227C60.896,134.227 60.214,134.094 59.615,133.828C59.016,133.557 58.542,133.159 58.193,132.633C57.85,132.102 57.678,131.44 57.678,130.648C57.678,129.982 57.8,129.422 58.045,128.969C58.29,128.516 58.623,128.151 59.045,127.875C59.467,127.599 59.946,127.391 60.482,127.25C61.024,127.109 61.592,127.01 62.186,126.953C62.883,126.88 63.446,126.812 63.873,126.75C64.3,126.682 64.61,126.583 64.803,126.453C64.995,126.323 65.092,126.13 65.092,125.875V125.828C65.092,125.333 64.936,124.951 64.623,124.68C64.316,124.409 63.878,124.273 63.311,124.273C62.712,124.273 62.235,124.406 61.881,124.672C61.527,124.932 61.292,125.26 61.178,125.656L58.1,125.406C58.256,124.677 58.563,124.047 59.021,123.516C59.48,122.979 60.071,122.568 60.795,122.281C61.524,121.99 62.368,121.844 63.326,121.844C63.993,121.844 64.631,121.922 65.24,122.078C65.855,122.234 66.399,122.477 66.873,122.805C67.352,123.133 67.73,123.555 68.006,124.07C68.282,124.581 68.42,125.193 68.42,125.906V134H65.264V132.336H65.17C64.977,132.711 64.719,133.042 64.396,133.328C64.074,133.609 63.686,133.831 63.232,133.992C62.779,134.148 62.256,134.227 61.662,134.227ZM62.615,131.93C63.105,131.93 63.537,131.833 63.912,131.641C64.287,131.443 64.581,131.177 64.795,130.844C65.008,130.51 65.115,130.133 65.115,129.711V128.438C65.011,128.505 64.868,128.568 64.686,128.625C64.508,128.677 64.308,128.727 64.084,128.773C63.86,128.815 63.636,128.854 63.412,128.891C63.188,128.922 62.985,128.951 62.803,128.977C62.412,129.034 62.071,129.125 61.779,129.25C61.488,129.375 61.261,129.544 61.1,129.758C60.938,129.966 60.857,130.227 60.857,130.539C60.857,130.992 61.021,131.339 61.35,131.578C61.683,131.812 62.105,131.93 62.615,131.93ZM74.33,118V134H71.002V118H74.33ZM82.418,134.234C81.189,134.234 80.132,133.974 79.246,133.453C78.366,132.927 77.689,132.198 77.215,131.266C76.746,130.333 76.512,129.26 76.512,128.047C76.512,126.818 76.749,125.74 77.223,124.812C77.702,123.88 78.382,123.154 79.262,122.633C80.142,122.107 81.189,121.844 82.402,121.844C83.449,121.844 84.366,122.034 85.152,122.414C85.939,122.794 86.561,123.328 87.02,124.016C87.478,124.703 87.73,125.51 87.777,126.438H84.637C84.548,125.839 84.314,125.357 83.934,124.992C83.559,124.622 83.066,124.437 82.457,124.437C81.941,124.437 81.491,124.578 81.105,124.859C80.725,125.135 80.428,125.539 80.215,126.07C80.001,126.602 79.895,127.245 79.895,128C79.895,128.766 79.999,129.417 80.207,129.953C80.421,130.49 80.72,130.898 81.105,131.18C81.491,131.461 81.941,131.602 82.457,131.602C82.837,131.602 83.178,131.523 83.48,131.367C83.788,131.211 84.04,130.984 84.238,130.687C84.441,130.385 84.574,130.023 84.637,129.602H87.777C87.725,130.518 87.475,131.326 87.027,132.023C86.585,132.716 85.973,133.258 85.191,133.648C84.41,134.039 83.486,134.234 82.418,134.234ZM97.604,128.891V122H100.932V134H97.736V131.82H97.611C97.34,132.523 96.89,133.089 96.26,133.516C95.635,133.943 94.872,134.156 93.971,134.156C93.169,134.156 92.463,133.974 91.854,133.609C91.244,133.245 90.768,132.727 90.424,132.055C90.085,131.383 89.913,130.578 89.908,129.641V122H93.236V129.047C93.242,129.755 93.432,130.315 93.807,130.727C94.182,131.138 94.684,131.344 95.314,131.344C95.715,131.344 96.09,131.253 96.439,131.07C96.788,130.883 97.07,130.607 97.283,130.242C97.502,129.878 97.609,129.427 97.604,128.891ZM106.922,118V134H103.594V118H106.922ZM113.01,134.227C112.244,134.227 111.562,134.094 110.963,133.828C110.364,133.557 109.89,133.159 109.541,132.633C109.197,132.102 109.025,131.44 109.025,130.648C109.025,129.982 109.148,129.422 109.393,128.969C109.637,128.516 109.971,128.151 110.393,127.875C110.814,127.599 111.294,127.391 111.83,127.25C112.372,127.109 112.939,127.01 113.533,126.953C114.231,126.88 114.794,126.812 115.221,126.75C115.648,126.682 115.958,126.583 116.15,126.453C116.343,126.323 116.439,126.13 116.439,125.875V125.828C116.439,125.333 116.283,124.951 115.971,124.68C115.663,124.409 115.226,124.273 114.658,124.273C114.059,124.273 113.583,124.406 113.229,124.672C112.874,124.932 112.64,125.26 112.525,125.656L109.447,125.406C109.604,124.677 109.911,124.047 110.369,123.516C110.827,122.979 111.419,122.568 112.143,122.281C112.872,121.99 113.715,121.844 114.674,121.844C115.34,121.844 115.979,121.922 116.588,122.078C117.202,122.234 117.747,122.477 118.221,122.805C118.7,123.133 119.077,123.555 119.354,124.07C119.63,124.581 119.768,125.193 119.768,125.906V134H116.611V132.336H116.518C116.325,132.711 116.067,133.042 115.744,133.328C115.421,133.609 115.033,133.831 114.58,133.992C114.127,134.148 113.604,134.227 113.01,134.227ZM113.963,131.93C114.452,131.93 114.885,131.833 115.26,131.641C115.635,131.443 115.929,131.177 116.143,130.844C116.356,130.51 116.463,130.133 116.463,129.711V128.438C116.359,128.505 116.215,128.568 116.033,128.625C115.856,128.677 115.656,128.727 115.432,128.773C115.208,128.815 114.984,128.854 114.76,128.891C114.536,128.922 114.333,128.951 114.15,128.977C113.76,129.034 113.419,129.125 113.127,129.25C112.835,129.375 112.609,129.544 112.447,129.758C112.286,129.966 112.205,130.227 112.205,130.539C112.205,130.992 112.369,131.339 112.697,131.578C113.031,131.812 113.452,131.93 113.963,131.93ZM128.732,122V124.5H121.506V122H128.732ZM123.146,119.125H126.475V130.312C126.475,130.62 126.521,130.859 126.615,131.031C126.709,131.198 126.839,131.315 127.006,131.383C127.178,131.451 127.376,131.484 127.6,131.484C127.756,131.484 127.912,131.471 128.068,131.445C128.225,131.414 128.344,131.391 128.428,131.375L128.951,133.852C128.785,133.904 128.55,133.964 128.248,134.031C127.946,134.104 127.579,134.148 127.146,134.164C126.344,134.195 125.641,134.089 125.037,133.844C124.438,133.599 123.972,133.219 123.639,132.703C123.305,132.187 123.141,131.536 123.146,130.75V119.125ZM136.193,134.234C134.98,134.234 133.93,133.977 133.045,133.461C132.165,132.94 131.485,132.216 131.006,131.289C130.527,130.357 130.287,129.276 130.287,128.047C130.287,126.807 130.527,125.724 131.006,124.797C131.485,123.865 132.165,123.141 133.045,122.625C133.93,122.104 134.98,121.844 136.193,121.844C137.407,121.844 138.454,122.104 139.334,122.625C140.219,123.141 140.902,123.865 141.381,124.797C141.86,125.724 142.1,126.807 142.1,128.047C142.1,129.276 141.86,130.357 141.381,131.289C140.902,132.216 140.219,132.94 139.334,133.461C138.454,133.977 137.407,134.234 136.193,134.234ZM136.209,131.656C136.761,131.656 137.222,131.5 137.592,131.188C137.962,130.87 138.24,130.437 138.428,129.891C138.62,129.344 138.717,128.721 138.717,128.023C138.717,127.326 138.62,126.703 138.428,126.156C138.24,125.609 137.962,125.177 137.592,124.859C137.222,124.542 136.761,124.383 136.209,124.383C135.652,124.383 135.183,124.542 134.803,124.859C134.428,125.177 134.144,125.609 133.951,126.156C133.764,126.703 133.67,127.326 133.67,128.023C133.67,128.721 133.764,129.344 133.951,129.891C134.144,130.437 134.428,130.87 134.803,131.188C135.183,131.5 135.652,131.656 136.209,131.656ZM144.264,134V122H147.49V124.094H147.615C147.834,123.349 148.201,122.786 148.717,122.406C149.232,122.021 149.826,121.828 150.498,121.828C150.665,121.828 150.844,121.839 151.037,121.859C151.23,121.88 151.399,121.909 151.545,121.945V124.898C151.389,124.852 151.173,124.81 150.896,124.773C150.62,124.737 150.368,124.719 150.139,124.719C149.649,124.719 149.212,124.826 148.826,125.039C148.446,125.247 148.144,125.539 147.92,125.914C147.701,126.289 147.592,126.721 147.592,127.211V134H144.264Z" + android:fillColor="#ffffff"/> + </group> +</vector> diff --git a/app/src/main/res/drawable/ic_refresh.xml b/app/src/main/res/drawable/ic_refresh.xml new file mode 100644 index 0000000..46a8af8 --- /dev/null +++ b/app/src/main/res/drawable/ic_refresh.xml @@ -0,0 +1,10 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24" + android:tint="?attr/colorControlNormal"> + <path + android:fillColor="@color/colorAccent" + android:pathData="M8.35 1.55l-6.2 0.87L4.43 4.7c-1.55 1.6-2.54 3.67-2.84 5.89-0.3 2.29 0.16 4.61 1.32 6.61 1.15 2 2.94 3.57 5.07 4.45 2.14 0.89 4.5 1.04 6.74 0.45 2.23-0.6 4.2-1.92 5.6-3.75 1.41-1.84 2.18-4.08 2.18-6.4 0-2.3-0.76-4.55-2.17-6.39-1.41-1.83-3.38-3.15-5.61-3.75l-0.39 1.45c1.91 0.51 3.6 1.64 4.81 3.22 1.2 1.57 1.86 3.5 1.86 5.47 0 1.99-0.65 3.91-1.86 5.48-1.2 1.57-2.9 2.7-4.81 3.21-1.91 0.52-3.94 0.39-5.77-0.37-1.84-0.76-3.37-2.1-4.36-3.82-0.96-1.68-1.36-3.63-1.13-5.56 0.23-1.93 1.08-3.73 2.42-5.13l1.97 1.97 0.22-1.49 0.67-4.7Z"/> +</vector> diff --git a/app/src/main/res/drawable/ic_share.xml b/app/src/main/res/drawable/ic_share.xml new file mode 100644 index 0000000..01f7b11 --- /dev/null +++ b/app/src/main/res/drawable/ic_share.xml @@ -0,0 +1,10 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24" + android:tint="?attr/colorControlNormal"> + <path + android:fillColor="@color/colorAccent" + android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92 1.61,0 2.92,-1.31 2.92,-2.92s-1.31,-2.92 -2.92,-2.92z"/> +</vector> diff --git a/app/src/main/res/drawable/male.xml b/app/src/main/res/drawable/male.xml new file mode 100644 index 0000000..ba72776 --- /dev/null +++ b/app/src/main/res/drawable/male.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="90dp" + android:height="90dp" + android:viewportWidth="944" + android:viewportHeight="944"> + + <path + android:strokeColor="#8D8E99" + android:strokeWidth="60" + android:pathData="M506.675 748.748C423.009 832.414 285.147 831.644 198.742 745.239C112.337 658.834 111.567 520.971 195.233 437.306C278.898 353.64 416.76 354.41 503.165 440.815C589.57 527.22 590.34 665.083 506.675 748.748Z" /> + + <path + android:fillColor="#8D8E99" + android:pathData="M789.259 176.907C789.259 164.481 779.185 154.407 766.759 154.407L564.259 154.407C551.832 154.407 541.759 164.481 541.759 176.907C541.759 189.334 551.832 199.407 564.259 199.407L744.259 199.407L744.259 379.407C744.259 391.834 754.332 401.907 766.759 401.907C779.185 401.907 789.259 391.834 789.259 379.407L789.259 176.907ZM517.504 457.982L782.669 192.817L750.849 160.997L485.684 426.162L517.504 457.982Z" /> + +</vector> \ No newline at end of file diff --git a/app/src/main/res/drawable/male_white.xml b/app/src/main/res/drawable/male_white.xml new file mode 100644 index 0000000..0501773 --- /dev/null +++ b/app/src/main/res/drawable/male_white.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="90dp" + android:height="90dp" + android:viewportWidth="944" + android:viewportHeight="944"> + + <path + android:strokeColor="#FFFFFF" + android:strokeWidth="60" + android:pathData="M506.675 748.748C423.009 832.414 285.147 831.644 198.742 745.239C112.337 658.834 111.567 520.971 195.233 437.306C278.898 353.64 416.76 354.41 503.165 440.815C589.57 527.22 590.34 665.083 506.675 748.748Z" /> + + <path + android:fillColor="#FFFFFF" + android:pathData="M789.259 176.907C789.259 164.481 779.185 154.407 766.759 154.407L564.259 154.407C551.832 154.407 541.759 164.481 541.759 176.907C541.759 189.334 551.832 199.407 564.259 199.407L744.259 199.407L744.259 379.407C744.259 391.834 754.332 401.907 766.759 401.907C779.185 401.907 789.259 391.834 789.259 379.407L789.259 176.907ZM517.504 457.982L782.669 192.817L750.849 160.997L485.684 426.162L517.504 457.982Z" /> + +</vector> \ No newline at end of file diff --git a/app/src/main/res/drawable/result_btn.xml b/app/src/main/res/drawable/result_btn.xml new file mode 100644 index 0000000..2d1bc28 --- /dev/null +++ b/app/src/main/res/drawable/result_btn.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape + xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + + <stroke android:width="2dp" android:color="@color/colorAccent" /> + + <size android:height="50dp" + android:width="50dp"/> + + <corners android:radius="10dp"/> + +</shape> \ No newline at end of file diff --git a/app/src/main/res/drawable/stepper_background.xml b/app/src/main/res/drawable/stepper_background.xml new file mode 100644 index 0000000..46b6ce1 --- /dev/null +++ b/app/src/main/res/drawable/stepper_background.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape + xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + + <solid android:color="@color/stepper" /> + + <size android:height="60dp" + android:width="60dp"/> + + <corners android:radius="60dp"/> + +</shape> \ No newline at end of file diff --git a/app/src/main/res/drawable/subtract.xml b/app/src/main/res/drawable/subtract.xml new file mode 100644 index 0000000..ca60e2f --- /dev/null +++ b/app/src/main/res/drawable/subtract.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="42" + android:viewportHeight="42"> + + <path + android:fillColor="#FFFFFF" + android:pathData="M 0 19 H 42 V 23 H 0 V 19 Z" /> +</vector> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..d18a740 --- /dev/null +++ b/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".MainActivity"> + + <androidx.fragment.app.FragmentContainerView + android:id="@+id/fragmentContainer" + android:layout_width="match_parent" + android:layout_height="match_parent" + app:defaultNavHost="true" + android:name="androidx.navigation.fragment.NavHostFragment" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:navGraph="@navigation/nav_graph"/> + +</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml new file mode 100644 index 0000000..1b029c1 --- /dev/null +++ b/app/src/main/res/layout/fragment_home.xml @@ -0,0 +1,324 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + xmlns:app="http://schemas.android.com/apk/res-auto" + tools:context=".HomeFragment"> + + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <androidx.cardview.widget.CardView + android:id="@+id/cardView_male" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginTop="32dp" + android:layout_marginEnd="8dp" + app:cardBackgroundColor="@color/card_background" + app:cardCornerRadius="10dp" + app:layout_constraintBottom_toTopOf="@+id/cardView5" + app:layout_constraintEnd_toStartOf="@+id/cardView_female" + app:layout_constraintHorizontal_chainStyle="spread" + app:layout_constraintHorizontal_weight="1" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_bias="1.0"> + + <TextView + android:id="@+id/maleTxt" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center|bottom" + android:drawablePadding="5sp" + android:padding="20dp" + android:text="@string/male" + android:textAlignment="center" + android:textColor="@color/tint" + android:textSize="20sp" + android:textStyle="bold" + app:drawableTopCompat="@drawable/male" /> + + </androidx.cardview.widget.CardView> + + <androidx.cardview.widget.CardView + android:id="@+id/cardView_female" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginEnd="16dp" + app:layout_constraintHorizontal_weight="1" + app:cardBackgroundColor="@color/card_background" + app:cardCornerRadius="10dp" + app:layout_constraintBottom_toBottomOf="@+id/cardView_male" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@+id/cardView_male" + app:layout_constraintTop_toTopOf="@+id/cardView_male"> + + <TextView + android:id="@+id/femaleTxt" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center|bottom" + android:drawablePadding="5sp" + android:padding="20dp" + android:text="@string/female" + android:textAlignment="center" + android:textColor="@color/tint" + android:textSize="20sp" + android:textStyle="bold" + app:drawableTopCompat="@drawable/female" /> + + </androidx.cardview.widget.CardView> + + <androidx.cardview.widget.CardView + android:id="@+id/cardView5" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="16dp" + app:cardBackgroundColor="@color/card_background" + app:cardCornerRadius="10dp" + app:layout_constraintBottom_toTopOf="@+id/cardView3" + app:layout_constraintHorizontal_chainStyle="spread" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toBottomOf="@+id/cardView_male"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center" + android:orientation="vertical" + android:padding="20dp"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/height" + android:textColor="#8D8E99" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/height_txt" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/_0cm" + android:textColor="@android:color/white" + android:textSize="50sp" + android:textStyle="bold" /> + + <SeekBar + android:id="@+id/Seekbar" + style="?android:attr/progressBarStyleHorizontal" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="10dp" + android:max="200" + android:thumbTint="@color/colorAccent" + android:progressBackgroundTint="#888994" + android:progressTint="@android:color/white" /> + + </LinearLayout> + + </androidx.cardview.widget.CardView> + + <androidx.cardview.widget.CardView + android:id="@+id/cardView3" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginEnd="8dp" + app:layout_constraintHorizontal_weight="1" + app:cardBackgroundColor="@color/card_background" + app:cardCornerRadius="10dp" + app:layout_constraintBottom_toTopOf="@+id/calculate" + app:layout_constraintEnd_toStartOf="@+id/cardView4" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/cardView5"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center_horizontal" + android:orientation="vertical" + android:padding="15dp"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/weight" + android:textColor="#8D8E99" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/weight_txt" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:text="@string/_50" + android:textColor="@android:color/white" + android:textSize="50sp" + android:textStyle="bold" /> + + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:baselineAligned="false" + android:gravity="center_horizontal" + android:weightSum="2"> + + <RelativeLayout + android:id="@+id/weight_minus" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginEnd="5dp" + android:layout_weight="1" + android:background="@drawable/stepper_background"> + + <ImageView + android:layout_width="60dp" + android:layout_height="60dp" + android:contentDescription="@string/minus" + android:padding="14dp" + app:srcCompat="@drawable/subtract" /> + + </RelativeLayout> + + + <RelativeLayout + android:id="@+id/weight_plus" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="5dp" + android:layout_weight="1" + android:background="@drawable/stepper_background"> + + <ImageView + android:layout_width="60dp" + android:layout_height="60dp" + android:contentDescription="@string/plus" + android:padding="3dp" + app:srcCompat="@drawable/ic_add" /> + + </RelativeLayout> + + </LinearLayout> + + </LinearLayout> + + </androidx.cardview.widget.CardView> + + <androidx.cardview.widget.CardView + android:id="@+id/cardView4" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginEnd="16dp" + app:cardBackgroundColor="@color/card_background" + app:cardCornerRadius="10dp" + app:layout_constraintHorizontal_weight="1" + app:layout_constraintBottom_toBottomOf="@+id/cardView3" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@+id/cardView3" + app:layout_constraintTop_toTopOf="@+id/cardView3"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center_horizontal" + android:orientation="vertical" + android:padding="15dp"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:gravity="center" + android:text="@string/age" + android:textColor="#8D8E99" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/age" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/_19" + android:textColor="@android:color/white" + android:textSize="50sp" + android:textStyle="bold" /> + + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:baselineAligned="false" + android:gravity="center_horizontal" + android:weightSum="2"> + + <RelativeLayout + android:id="@+id/age_minus" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginEnd="5dp" + android:layout_weight="1" + android:background="@drawable/stepper_background"> + + <ImageView + android:layout_width="60dp" + android:layout_height="60dp" + android:contentDescription="@string/minus" + android:padding="14dp" + app:srcCompat="@drawable/subtract" /> + + </RelativeLayout> + + + <RelativeLayout + android:id="@+id/age_plus" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="5dp" + android:layout_weight="1" + android:background="@drawable/stepper_background"> + + <ImageView + android:layout_width="60dp" + android:layout_height="60dp" + android:contentDescription="@string/plus" + android:padding="3dp" + app:srcCompat="@drawable/ic_add" /> + + </RelativeLayout> + + </LinearLayout> + + </LinearLayout> + + </androidx.cardview.widget.CardView> + + <com.google.android.material.button.MaterialButton + android:id="@+id/calculate" + android:layout_width="match_parent" + android:layout_height="55dp" + android:layout_marginLeft="16dp" + android:layout_marginTop="16dp" + android:layout_marginRight="16dp" + android:layout_marginBottom="24dp" + app:cornerRadius="7dp" + android:backgroundTint="@color/colorAccent" + android:text="@string/calculate" + android:textColor="@android:color/white" + android:textSize="17sp" + android:textStyle="bold" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/cardView3" /> + + </androidx.constraintlayout.widget.ConstraintLayout> + +</androidx.core.widget.NestedScrollView> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_result.xml b/app/src/main/res/layout/fragment_result.xml new file mode 100644 index 0000000..e1c72ff --- /dev/null +++ b/app/src/main/res/layout/fragment_result.xml @@ -0,0 +1,165 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".ResultFragment"> + + <TextView + android:id="@+id/textView" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:layout_marginEnd="16dp" + android:text="@string/your_result" + android:textColor="@android:color/white" + android:textSize="30sp" + android:textStyle="bold" + app:layout_constraintBottom_toTopOf="@+id/result_card" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <androidx.cardview.widget.CardView + android:id="@+id/result_card" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="16dp" + android:layout_marginTop="16dp" + android:layout_marginRight="16dp" + app:cardBackgroundColor="@color/card_background" + app:cardCornerRadius="10sp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/textView"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center" + android:orientation="vertical" + android:padding="20dp"> + + <TextView + android:id="@+id/condition" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="15dp" + android:textColor="@color/green" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/your_bmi" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:textColor="@android:color/white" + android:textSize="50sp" + android:textStyle="bold" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="16dp" + android:text="@string/normal_bmi_range" + android:textColor="#8D8E99" + android:textSize="22sp" + android:textStyle="bold" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="5dp" + android:text="@string/_18_5_25_kg_m2" + android:textColor="@android:color/white" + android:textSize="18sp" /> + + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="16dp" + android:layout_marginBottom="8dp" + android:gravity="center" + android:orientation="horizontal"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/your_age" + android:textColor="@color/colorAccent" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/ageTxt" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="5dp" + android:textColor="@android:color/white" + android:textSize="20sp" /> + + </LinearLayout> + + </LinearLayout> + + </androidx.cardview.widget.CardView> + + <androidx.cardview.widget.CardView + android:id="@+id/sug_container" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="16dp" + android:layout_marginTop="16dp" + android:layout_marginRight="16dp" + app:cardCornerRadius="10sp" + app:cardBackgroundColor="@color/card_background" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/result_card"> + + <TextView + android:id="@+id/suggestion" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:padding="20sp"/> + + </androidx.cardview.widget.CardView> + + <ImageView + android:id="@+id/share" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginBottom="32dp" + android:padding="15dp" + android:src="@drawable/ic_share" + android:contentDescription="@string/share" + android:background="@drawable/result_btn" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@+id/recalculate" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/sug_container" + app:layout_constraintVertical_bias="1.0" /> + + <ImageView + android:id="@+id/recalculate" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginBottom="32dp" + android:padding="15dp" + android:contentDescription="@string/recalculate" + android:src="@drawable/ic_refresh" + android:background="@drawable/result_btn" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toEndOf="@+id/share" + app:layout_constraintTop_toBottomOf="@+id/sug_container" + app:layout_constraintVertical_bias="1.0" + app:shapeAppearanceOverlay="@style/circleImageView"/> + + +</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..7353dbd --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@color/ic_launcher_background"/> + <foreground android:drawable="@drawable/ic_launcher_foreground"/> +</adaptive-icon> \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..7353dbd --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@color/ic_launcher_background"/> + <foreground android:drawable="@drawable/ic_launcher_foreground"/> +</adaptive-icon> \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..acb1efa Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..6c5199f Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..bc6f739 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..64336aa Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..613bb3b Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..f9c0202 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..28c5bb2 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..fbcae95 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..41e54a8 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..1842903 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/navigation/nav_graph.xml b/app/src/main/res/navigation/nav_graph.xml new file mode 100644 index 0000000..fd66591 --- /dev/null +++ b/app/src/main/res/navigation/nav_graph.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="utf-8"?> +<navigation xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/nav_graph" + app:startDestination="@id/homeFragment"> + + <fragment + android:id="@+id/homeFragment" + android:name="com.tharun.bmicalculator.HomeFragment" + android:label="fragment_home" + tools:layout="@layout/fragment_home" > + <action + android:id="@+id/action_homeFragment_to_resultFragment" + app:destination="@id/resultFragment" + app:enterAnim="@anim/slide_in_right" + app:exitAnim="@anim/slide_out_left" + app:popEnterAnim="@anim/slide_in_left" + app:popExitAnim="@anim/slide_out_right" /> + </fragment> + + <fragment + android:id="@+id/resultFragment" + android:name="com.tharun.bmicalculator.ResultFragment" + android:label="fragment_result" + tools:layout="@layout/fragment_result" > + <argument + android:name="bmi" + app:argType="float" /> + <argument + android:name="age" + app:argType="string" /> + </fragment> + +</navigation> \ No newline at end of file diff --git a/app/src/main/res/values-night-v23/splash_theme.xml b/app/src/main/res/values-night-v23/splash_theme.xml new file mode 100644 index 0000000..e56974a --- /dev/null +++ b/app/src/main/res/values-night-v23/splash_theme.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources xmlns:tools="http://schemas.android.com/tools"> + + <style name="Theme.AppSplash" parent="Theme.SplashScreen"> + <item name="windowSplashScreenBackground">@color/background</item> + <item name="windowSplashScreenAnimatedIcon">@mipmap/ic_launcher_round</item> + <item name="windowSplashScreenAnimationDuration">1000</item> + <item name="postSplashScreenTheme">@style/Theme.BMICalculator</item> + + <!-- Status bar and Nav bar configs --> + <item name="android:statusBarColor" tools:targetApi="l">@color/background</item> + <item name="android:navigationBarColor">@color/background</item> + <item name="android:windowLightStatusBar">false</item> + </style> + +</resources> \ No newline at end of file diff --git a/app/src/main/res/values-night/splash_theme.xml b/app/src/main/res/values-night/splash_theme.xml new file mode 100644 index 0000000..c632bd6 --- /dev/null +++ b/app/src/main/res/values-night/splash_theme.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources xmlns:tools="http://schemas.android.com/tools"> + + <style name="Theme.AppSplash" parent="Theme.SplashScreen"> + <item name="windowSplashScreenBackground">@color/background</item> + <item name="windowSplashScreenAnimatedIcon">@mipmap/ic_launcher_round</item> + <item name="windowSplashScreenAnimationDuration">1000</item> + <item name="postSplashScreenTheme">@style/Theme.BMICalculator</item> + + <!-- Status bar and Nav bar configs --> + <item name="android:statusBarColor" tools:targetApi="l">@color/background</item> + <item name="android:navigationBarColor">@color/background</item> + <item name="android:windowLightStatusBar" tools:targetApi="m">false</item> + </style> + +</resources> \ No newline at end of file diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..62d5b48 --- /dev/null +++ b/app/src/main/res/values-night/themes.xml @@ -0,0 +1,26 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Theme.BMICalculator" parent="Theme.MaterialComponents.DayNight.NoActionBar"> + <!-- Primary brand color. --> + <item name="colorPrimary">@color/colorPrimary</item> + <item name="colorPrimaryVariant">@color/colorPrimaryDark</item> + <item name="colorOnPrimary">@color/white</item> + <!-- Secondary brand color. --> + <item name="colorSecondary">@color/teal_200</item> + <item name="colorSecondaryVariant">@color/teal_700</item> + <item name="colorOnSecondary">@color/black</item> + <!-- Status bar color. --> + <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item> + <!-- Customize your theme here. --> + + <item name="android:windowBackground">@color/background</item> + <item name="android:navigationBarColor">@color/background</item> + + </style> + + <style name="circleImageView" parent=""> + <item name="cornerFamily">rounded</item> + <item name="cornerSize">5%</item> + </style> + +</resources> \ No newline at end of file diff --git a/app/src/main/res/values-v23/splash_theme.xml b/app/src/main/res/values-v23/splash_theme.xml new file mode 100644 index 0000000..b632c5a --- /dev/null +++ b/app/src/main/res/values-v23/splash_theme.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources xmlns:tools="http://schemas.android.com/tools"> + + <style name="Theme.AppSplash" parent="Theme.SplashScreen"> + <item name="windowSplashScreenBackground">@color/background</item> + <item name="windowSplashScreenAnimatedIcon">@mipmap/ic_launcher_round</item> + <item name="windowSplashScreenAnimationDuration">1000</item> + <item name="postSplashScreenTheme">@style/Theme.BMICalculator</item> + + <!-- Status bar and Nav bar configs --> + <item name="android:statusBarColor" tools:targetApi="l">@color/background</item> + <item name="android:navigationBarColor">@color/background</item> + <item name="android:windowLightStatusBar">false</item> + </style> +</resources> \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..4898431 --- /dev/null +++ b/app/src/main/res/values/colors.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <color name="teal_200">#FF03DAC5</color> + <color name="teal_700">#FF018786</color> + <color name="black">#FF000000</color> + <color name="white">#FFFFFFFF</color> + + <color name="colorPrimary">#6200EE</color> + <color name="colorPrimaryDark">#0B0A24</color> + + <color name="colorAccent">#FE0049</color> + <color name="green">#5ADC65</color> + + + <color name="background">#0B0A24</color> + <color name="card_background">#11122A</color> + + <color name="stepper">#1C1D34</color> + <color name="tint">#8D8E99</color> + + +</resources> \ No newline at end of file diff --git a/app/src/main/res/values/ic_launcher_background.xml b/app/src/main/res/values/ic_launcher_background.xml new file mode 100644 index 0000000..7187709 --- /dev/null +++ b/app/src/main/res/values/ic_launcher_background.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <color name="ic_launcher_background">#0B0A24</color> +</resources> \ No newline at end of file diff --git a/app/src/main/res/values/ic_logo_background.xml b/app/src/main/res/values/ic_logo_background.xml new file mode 100644 index 0000000..f10233f --- /dev/null +++ b/app/src/main/res/values/ic_logo_background.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <color name="ic_logo_background">#0B0A24</color> +</resources> \ No newline at end of file diff --git a/app/src/main/res/values/splash_theme.xml b/app/src/main/res/values/splash_theme.xml new file mode 100644 index 0000000..c632bd6 --- /dev/null +++ b/app/src/main/res/values/splash_theme.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources xmlns:tools="http://schemas.android.com/tools"> + + <style name="Theme.AppSplash" parent="Theme.SplashScreen"> + <item name="windowSplashScreenBackground">@color/background</item> + <item name="windowSplashScreenAnimatedIcon">@mipmap/ic_launcher_round</item> + <item name="windowSplashScreenAnimationDuration">1000</item> + <item name="postSplashScreenTheme">@style/Theme.BMICalculator</item> + + <!-- Status bar and Nav bar configs --> + <item name="android:statusBarColor" tools:targetApi="l">@color/background</item> + <item name="android:navigationBarColor">@color/background</item> + <item name="android:windowLightStatusBar" tools:targetApi="m">false</item> + </style> + +</resources> \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..fc6ee9f --- /dev/null +++ b/app/src/main/res/values/strings.xml @@ -0,0 +1,23 @@ +<resources> + <string name="app_name">BMI Calculator</string> + + <string name="_18_5_25_kg_m2">18.5 – 25 kg/m²</string> + <string name="normal_bmi_range">Normal BMI range:</string> + <string name="recalculate">Recalculate your BMI</string> + <string name="calculate">Calculate your BMI</string> + <string name="weight">WEIGHT</string> + <string name="age">AGE</string> + <string name="height">HEIGHT</string> + <string name="male">Male</string> + <string name="female">Female</string> + <string name="plus">plus</string> + <string name="minus">minus</string> + <string name="_0cm">0cm</string> + <string name="_50">50</string> + <string name="_19">19</string> + <string name="your_result">Your Result</string> + <string name="cm">cm</string> + <string name="share">share your Result</string> + <string name="your_age">your Age:</string> + +</resources> \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..62d5b48 --- /dev/null +++ b/app/src/main/res/values/themes.xml @@ -0,0 +1,26 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Theme.BMICalculator" parent="Theme.MaterialComponents.DayNight.NoActionBar"> + <!-- Primary brand color. --> + <item name="colorPrimary">@color/colorPrimary</item> + <item name="colorPrimaryVariant">@color/colorPrimaryDark</item> + <item name="colorOnPrimary">@color/white</item> + <!-- Secondary brand color. --> + <item name="colorSecondary">@color/teal_200</item> + <item name="colorSecondaryVariant">@color/teal_700</item> + <item name="colorOnSecondary">@color/black</item> + <!-- Status bar color. --> + <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item> + <!-- Customize your theme here. --> + + <item name="android:windowBackground">@color/background</item> + <item name="android:navigationBarColor">@color/background</item> + + </style> + + <style name="circleImageView" parent=""> + <item name="cornerFamily">rounded</item> + <item name="cornerSize">5%</item> + </style> + +</resources> \ No newline at end of file diff --git a/app/src/test/java/com/tharun/bmicalculator/ExampleUnitTest.kt b/app/src/test/java/com/tharun/bmicalculator/ExampleUnitTest.kt new file mode 100644 index 0000000..0736077 --- /dev/null +++ b/app/src/test/java/com/tharun/bmicalculator/ExampleUnitTest.kt @@ -0,0 +1,17 @@ +package com.tharun.bmicalculator + +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) + } +} \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..c7dfcf3 --- /dev/null +++ b/build.gradle @@ -0,0 +1,23 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +buildscript { + repositories { + google() + mavenCentral() + } + dependencies { + classpath "com.android.tools.build:gradle:7.0.4" + classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.5.0" + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +plugins { + id 'com.android.application' version '7.1.2' apply false + id 'com.android.library' version '7.1.2' apply false + id 'org.jetbrains.kotlin.android' version '1.6.20' apply false +} + +task clean(type: Delete) { + delete rootProject.buildDir +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..cd0519b --- /dev/null +++ b/gradle.properties @@ -0,0 +1,23 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app"s APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Kotlin code style for this project: "official" or "obsolete": +kotlin.code.style=official +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..9195208 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Fri Jul 29 01:35:58 IST 2022 +distributionBase=GRADLE_USER_HOME +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionPath=wrapper/dists +zipStorePath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..4f906e0 --- /dev/null +++ b/gradlew @@ -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" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..107acd3 --- /dev/null +++ b/gradlew.bat @@ -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 diff --git a/screenshots/screens.png b/screenshots/screens.png new file mode 100644 index 0000000..8c812d4 Binary files /dev/null and b/screenshots/screens.png differ diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..aa2f173 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,16 @@ +pluginManagement { + repositories { + gradlePluginPortal() + google() + mavenCentral() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} +rootProject.name = "BMI Calculator" +include ':app'