update v2

This commit is contained in:
tharun-adpth 2022-07-30 13:37:49 +05:30
commit 1338b042e1
17 changed files with 281 additions and 32 deletions

134
.idea/codeStyles/Project.xml generated Normal file
View File

@ -0,0 +1,134 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<JetCodeStyleSettings>
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
<value>
<package name="java.util" alias="false" withSubpackages="false" />
<package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
<package name="io.ktor" alias="false" withSubpackages="true" />
</value>
</option>
<option name="PACKAGES_IMPORT_LAYOUT">
<value>
<package name="" alias="false" withSubpackages="true" />
<package name="java" alias="false" withSubpackages="true" />
<package name="javax" alias="false" withSubpackages="true" />
<package name="kotlin" alias="false" withSubpackages="true" />
<package name="" alias="true" withSubpackages="true" />
</value>
</option>
</JetCodeStyleSettings>
<codeStyleSettings language="XML">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:id</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>ANDROID_ATTRIBUTE_ORDER</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>.*</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
</code_scheme>
</component>

3
.idea/gradle.xml generated
View File

@ -1,13 +1,12 @@
<?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="gradleJvm" value="Embedded JDK" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />

30
.idea/jarRepositories.xml generated Normal file
View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="BintrayJCenter" />
<option name="name" value="BintrayJCenter" />
<option name="url" value="https://jcenter.bintray.com/" />
</remote-repository>
<remote-repository>
<option name="id" value="Google" />
<option name="name" value="Google" />
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven" />
<option name="name" value="maven" />
<option name="url" value="https://jitpack.io" />
</remote-repository>
</component>
</project>

1
.idea/misc.xml generated
View File

@ -25,7 +25,6 @@
</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" />

View File

@ -1,3 +1,4 @@
<<<<<<< HEAD
BMI Calculator
=================
@ -46,3 +47,7 @@ Library & Features
Additional credits
--------------------
This App UI design inspiration is from [Ruben Vaalt](https://dribbble.com/shots/4585382-Simple-BMI-Calculator) Dribbbles account
=======
# BMI-Calculator
![Frame 284](https://user-images.githubusercontent.com/61702243/96000349-6afded00-0e54-11eb-9db7-652c8a78f7cb.png)
>>>>>>> 5428ae08b054eba7bfde28f2912f029b02e54b12

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -15,6 +15,7 @@ android {
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {

View File

@ -3,11 +3,9 @@
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"

View File

@ -76,8 +76,8 @@ class ResultFragment : Fragment() {
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}"
"my age is: ${binding.ageTxt.text}\n\n" +
"App suggested me that: ${binding.suggestion.text}"
val i = Intent(Intent.ACTION_SEND)
i.putExtra(Intent.EXTRA_TEXT, strShareMessage)

View File

@ -14,7 +14,7 @@ object Utils {
return category
}
fun getAdultCategory(result: Float): String {
private fun getAdultCategory(result: Float): String {
val category: String = if (result < 15) {
"Severe Thinness"
} else if (result in 15.0..16.0) {
@ -35,7 +35,7 @@ object Utils {
return category
}
fun getChildCategory(result: Float): String {
private fun getChildCategory(result: Float): String {
val category: String = when {
result < 15 -> {
"very severely underweight"

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,6 @@
<?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>

View File

@ -1,5 +1,7 @@
<?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>

View File

@ -7,10 +7,9 @@
<color name="colorPrimary">#6200EE</color>
<color name="colorPrimaryDark">#0B0A24</color>
<color name="colorAccent">#FE0049</color>
<color name="green">#5ADC65</color>
<color name="green">#5ADC65</color>
<color name="background">#0B0A24</color>
<color name="card_background">#11122A</color>
@ -18,5 +17,4 @@
<color name="stepper">#1C1D34</color>
<color name="tint">#8D8E99</color>
</resources>

View File

@ -2,13 +2,10 @@
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
}
}

View File

@ -6,6 +6,7 @@
# 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
@ -20,4 +21,4 @@ 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
android.nonTransitiveRClass=true

45
gradlew vendored
View File

@ -1,5 +1,6 @@
#!/usr/bin/env sh
<<<<<<< HEAD
#
# Copyright 2015 the original author or authors.
#
@ -16,6 +17,8 @@
# limitations under the License.
#
=======
>>>>>>> 5428ae08b054eba7bfde28f2912f029b02e54b12
##############################################################################
##
## Gradle start up script for UN*X
@ -44,7 +47,11 @@ 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.
<<<<<<< HEAD
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
=======
DEFAULT_JVM_OPTS=""
>>>>>>> 5428ae08b054eba7bfde28f2912f029b02e54b12
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
@ -82,7 +89,10 @@ esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
<<<<<<< HEAD
=======
>>>>>>> 5428ae08b054eba7bfde28f2912f029b02e54b12
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@ -126,11 +136,18 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
<<<<<<< HEAD
# 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"`
=======
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
>>>>>>> 5428ae08b054eba7bfde28f2912f029b02e54b12
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
@ -156,6 +173,7 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
else
eval `echo args$i`="\"$arg\""
fi
<<<<<<< HEAD
i=`expr $i + 1`
done
case $i in
@ -169,6 +187,21 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
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" ;;
=======
i=$((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" ;;
>>>>>>> 5428ae08b054eba7bfde28f2912f029b02e54b12
esac
fi
@ -177,9 +210,21 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
<<<<<<< HEAD
APP_ARGS=`save "$@"`
=======
APP_ARGS=$(save "$@")
>>>>>>> 5428ae08b054eba7bfde28f2912f029b02e54b12
# 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"
<<<<<<< HEAD
=======
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
>>>>>>> 5428ae08b054eba7bfde28f2912f029b02e54b12
exec "$JAVACMD" "$@"

39
gradlew.bat vendored
View File

@ -1,3 +1,4 @@
<<<<<<< HEAD
@rem
@rem Copyright 2015 the original author or authors.
@rem
@ -14,6 +15,8 @@
@rem limitations under the License.
@rem
=======
>>>>>>> 5428ae08b054eba7bfde28f2912f029b02e54b12
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@ -29,18 +32,27 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
<<<<<<< HEAD
@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 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=
>>>>>>> 5428ae08b054eba7bfde28f2912f029b02e54b12
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
<<<<<<< HEAD
if "%ERRORLEVEL%" == "0" goto execute
=======
if "%ERRORLEVEL%" == "0" goto init
>>>>>>> 5428ae08b054eba7bfde28f2912f029b02e54b12
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@ -54,7 +66,11 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
<<<<<<< HEAD
if exist "%JAVA_EXE%" goto execute
=======
if exist "%JAVA_EXE%" goto init
>>>>>>> 5428ae08b054eba7bfde28f2912f029b02e54b12
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@ -64,14 +80,37 @@ echo location of your Java installation.
goto fail
<<<<<<< HEAD
=======
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
>>>>>>> 5428ae08b054eba7bfde28f2912f029b02e54b12
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
<<<<<<< HEAD
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
=======
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
>>>>>>> 5428ae08b054eba7bfde28f2912f029b02e54b12
:end
@rem End local scope for the variables with windows NT shell