diff --git a/.gitignore b/.gitignore index e645270..f5af208 100644 --- a/.gitignore +++ b/.gitignore @@ -1,353 +1,76 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore +# Built application files +*.apk +*.aar +*.ap_ +*.aab -# User-specific files -*.rsuser -*.suo -*.user -*.userosscache -*.sln.docstates +# Files for the ART/Dalvik VM +*.dex -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs +# Java class files +*.class -# Mono auto generated files -mono_crash.* +# Generated files +bin/ +gen/ +out/ +# Uncomment the following line in case you need and you don't have the release build type files in your app +# release/ -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ -[Ll]ogs/ +# Gradle files +.gradle/ +build/ -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ +# Local configuration file (sdk path, etc) +local.properties -# Visual Studio 2017 auto generated files -Generated\ Files/ +# Proguard folder generated by Eclipse +proguard/ -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUnit -*.VisualState.xml -TestResult.xml -nunit-*.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_h.h -*.ilk -*.meta -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*_wpftmp.csproj +# Log Files *.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# NuGet Symbol Packages -*.snupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx -*.appxbundle -*.appxupload - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!?*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser -*- [Bb]ackup.rdl -*- [Bb]ackup ([0-9]).rdl -*- [Bb]ackup ([0-9][0-9]).rdl - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# CodeRush personal settings -.cr/personal - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss -# Telerik's JustMock configuration file -*.jmconfig +# Android Studio Navigation editor temp files +.navigation/ -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs +# Android Studio captures folder +captures/ -# OpenCover UI analysis results -OpenCover/ +# IntelliJ +*.iml +.idea -# Azure Stream Analytics local run output -ASALocalRun/ +# Keystore files +# Uncomment the following lines if you do not want to check your keystore files in. +#*.jks +#*.keystore -# MSBuild Binary and Structured Log -*.binlog +# External native build folder generated in Android Studio 2.2 and later +.externalNativeBuild +.cxx/ -# NVidia Nsight GPU debugger configuration file -*.nvuser +# Google Services (e.g. APIs or Firebase) +# google-services.json -# MFractors (Xamarin productivity tool) working folder -.mfractor/ +# Freeline +freeline.py +freeline/ +freeline_project_description.json -# Local History for Visual Studio -.localhistory/ +# fastlane +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots +fastlane/test_output +fastlane/readme.md -# BeatPulse healthcheck temp database -healthchecksdb +# Version control +vcs.xml -# Backup folder for Package Reference Convert tool in Visual Studio 2017 -MigrationBackup/ +# lint +lint/intermediates/ +lint/generated/ +lint/outputs/ +lint/tmp/ +# lint/reports/ -# Ionide (cross platform F# VS Code tools) working folder -.ionide/ diff --git a/.gradle/5.4.1/executionHistory/executionHistory.bin b/.gradle/5.4.1/executionHistory/executionHistory.bin deleted file mode 100644 index 082963a..0000000 Binary files a/.gradle/5.4.1/executionHistory/executionHistory.bin and /dev/null differ diff --git a/.gradle/5.4.1/executionHistory/executionHistory.lock b/.gradle/5.4.1/executionHistory/executionHistory.lock deleted file mode 100644 index 2234b77..0000000 Binary files a/.gradle/5.4.1/executionHistory/executionHistory.lock and /dev/null differ diff --git a/.gradle/5.4.1/fileChanges/last-build.bin b/.gradle/5.4.1/fileChanges/last-build.bin deleted file mode 100644 index f76dd23..0000000 Binary files a/.gradle/5.4.1/fileChanges/last-build.bin and /dev/null differ diff --git a/.gradle/5.4.1/fileHashes/fileHashes.bin b/.gradle/5.4.1/fileHashes/fileHashes.bin deleted file mode 100644 index 8f7eff6..0000000 Binary files a/.gradle/5.4.1/fileHashes/fileHashes.bin and /dev/null differ diff --git a/.gradle/5.4.1/fileHashes/fileHashes.lock b/.gradle/5.4.1/fileHashes/fileHashes.lock deleted file mode 100644 index 69711c5..0000000 Binary files a/.gradle/5.4.1/fileHashes/fileHashes.lock and /dev/null differ diff --git a/.gradle/5.4.1/gc.properties b/.gradle/5.4.1/gc.properties deleted file mode 100644 index e69de29..0000000 diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock deleted file mode 100644 index 4f8f0d1..0000000 Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and /dev/null differ diff --git a/.gradle/buildOutputCleanup/cache.properties b/.gradle/buildOutputCleanup/cache.properties deleted file mode 100644 index d7d057f..0000000 --- a/.gradle/buildOutputCleanup/cache.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Tue Feb 04 17:06:57 MST 2020 -gradle.version=5.4.1 diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin deleted file mode 100644 index 276a71c..0000000 Binary files a/.gradle/buildOutputCleanup/outputFiles.bin and /dev/null differ diff --git a/.gradle/vcs-1/gc.properties b/.gradle/vcs-1/gc.properties deleted file mode 100644 index e69de29..0000000 diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser deleted file mode 100644 index e0ba3bf..0000000 Binary files a/.idea/caches/build_file_checksums.ser and /dev/null differ diff --git a/.idea/caches/gradle_models.ser b/.idea/caches/gradle_models.ser deleted file mode 100644 index d77d4fa..0000000 Binary files a/.idea/caches/gradle_models.ser and /dev/null differ diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml deleted file mode 100644 index 681f41a..0000000 --- a/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - -
- - - - xmlns:android - - ^$ - - - -
-
- - - - xmlns:.* - - ^$ - - - BY_NAME - -
-
- - - - .*:id - - http://schemas.android.com/apk/res/android - - - -
-
- - - - .*:name - - http://schemas.android.com/apk/res/android - - - -
-
- - - - name - - ^$ - - - -
-
- - - - style - - ^$ - - - -
-
- - - - .* - - ^$ - - - BY_NAME - -
-
- - - - .* - - http://schemas.android.com/apk/res/android - - - ANDROID_ATTRIBUTE_ORDER - -
-
- - - - .* - - .* - - - BY_NAME - -
-
-
-
-
-
\ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml deleted file mode 100644 index d291b3d..0000000 --- a/.idea/gradle.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_activity_activity_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_activity_activity_1_0_0_aar.xml deleted file mode 100644 index 2431bc5..0000000 --- a/.idea/libraries/Gradle__androidx_activity_activity_1_0_0_aar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_annotation_annotation_1_1_0_jar.xml b/.idea/libraries/Gradle__androidx_annotation_annotation_1_1_0_jar.xml deleted file mode 100644 index 5b17db6..0000000 --- a/.idea/libraries/Gradle__androidx_annotation_annotation_1_1_0_jar.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_appcompat_appcompat_1_1_0_aar.xml b/.idea/libraries/Gradle__androidx_appcompat_appcompat_1_1_0_aar.xml deleted file mode 100644 index acb08df..0000000 --- a/.idea/libraries/Gradle__androidx_appcompat_appcompat_1_1_0_aar.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_appcompat_appcompat_resources_1_1_0_aar.xml b/.idea/libraries/Gradle__androidx_appcompat_appcompat_resources_1_1_0_aar.xml deleted file mode 100644 index f59a0af..0000000 --- a/.idea/libraries/Gradle__androidx_appcompat_appcompat_resources_1_1_0_aar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_arch_core_core_common_2_1_0_jar.xml b/.idea/libraries/Gradle__androidx_arch_core_core_common_2_1_0_jar.xml deleted file mode 100644 index a7f501b..0000000 --- a/.idea/libraries/Gradle__androidx_arch_core_core_common_2_1_0_jar.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_arch_core_core_runtime_2_0_0_aar.xml b/.idea/libraries/Gradle__androidx_arch_core_core_runtime_2_0_0_aar.xml deleted file mode 100644 index 0a3db8d..0000000 --- a/.idea/libraries/Gradle__androidx_arch_core_core_runtime_2_0_0_aar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_collection_collection_1_1_0_jar.xml b/.idea/libraries/Gradle__androidx_collection_collection_1_1_0_jar.xml deleted file mode 100644 index ecb16c3..0000000 --- a/.idea/libraries/Gradle__androidx_collection_collection_1_1_0_jar.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_constraintlayout_constraintlayout_1_1_3_aar.xml b/.idea/libraries/Gradle__androidx_constraintlayout_constraintlayout_1_1_3_aar.xml deleted file mode 100644 index f513a6d..0000000 --- a/.idea/libraries/Gradle__androidx_constraintlayout_constraintlayout_1_1_3_aar.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_constraintlayout_constraintlayout_solver_1_1_3_jar.xml b/.idea/libraries/Gradle__androidx_constraintlayout_constraintlayout_solver_1_1_3_jar.xml deleted file mode 100644 index f92fb42..0000000 --- a/.idea/libraries/Gradle__androidx_constraintlayout_constraintlayout_solver_1_1_3_jar.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_core_core_1_1_0_aar.xml b/.idea/libraries/Gradle__androidx_core_core_1_1_0_aar.xml deleted file mode 100644 index 29c1813..0000000 --- a/.idea/libraries/Gradle__androidx_core_core_1_1_0_aar.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_cursoradapter_cursoradapter_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_cursoradapter_cursoradapter_1_0_0_aar.xml deleted file mode 100644 index 99bf6ae..0000000 --- a/.idea/libraries/Gradle__androidx_cursoradapter_cursoradapter_1_0_0_aar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_customview_customview_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_customview_customview_1_0_0_aar.xml deleted file mode 100644 index a60d992..0000000 --- a/.idea/libraries/Gradle__androidx_customview_customview_1_0_0_aar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_drawerlayout_drawerlayout_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_drawerlayout_drawerlayout_1_0_0_aar.xml deleted file mode 100644 index cd77561..0000000 --- a/.idea/libraries/Gradle__androidx_drawerlayout_drawerlayout_1_0_0_aar.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_fragment_fragment_1_1_0_aar.xml b/.idea/libraries/Gradle__androidx_fragment_fragment_1_1_0_aar.xml deleted file mode 100644 index e4fa697..0000000 --- a/.idea/libraries/Gradle__androidx_fragment_fragment_1_1_0_aar.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_interpolator_interpolator_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_interpolator_interpolator_1_0_0_aar.xml deleted file mode 100644 index e07bc26..0000000 --- a/.idea/libraries/Gradle__androidx_interpolator_interpolator_1_0_0_aar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_common_2_1_0_jar.xml b/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_common_2_1_0_jar.xml deleted file mode 100644 index 8c4384c..0000000 --- a/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_common_2_1_0_jar.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_2_0_0_aar.xml b/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_2_0_0_aar.xml deleted file mode 100644 index 09e3b63..0000000 --- a/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_2_0_0_aar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_core_2_0_0_aar.xml b/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_core_2_0_0_aar.xml deleted file mode 100644 index 6fc4421..0000000 --- a/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_core_2_0_0_aar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_runtime_2_1_0_aar.xml b/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_runtime_2_1_0_aar.xml deleted file mode 100644 index c256a69..0000000 --- a/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_runtime_2_1_0_aar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_2_1_0_aar.xml b/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_2_1_0_aar.xml deleted file mode 100644 index c831418..0000000 --- a/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_2_1_0_aar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_loader_loader_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_loader_loader_1_0_0_aar.xml deleted file mode 100644 index ff332cb..0000000 --- a/.idea/libraries/Gradle__androidx_loader_loader_1_0_0_aar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_savedstate_savedstate_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_savedstate_savedstate_1_0_0_aar.xml deleted file mode 100644 index a8395ca..0000000 --- a/.idea/libraries/Gradle__androidx_savedstate_savedstate_1_0_0_aar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_test_core_1_2_0_aar.xml b/.idea/libraries/Gradle__androidx_test_core_1_2_0_aar.xml deleted file mode 100644 index bfeb926..0000000 --- a/.idea/libraries/Gradle__androidx_test_core_1_2_0_aar.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_test_espresso_espresso_core_3_2_0_aar.xml b/.idea/libraries/Gradle__androidx_test_espresso_espresso_core_3_2_0_aar.xml deleted file mode 100644 index a0455c7..0000000 --- a/.idea/libraries/Gradle__androidx_test_espresso_espresso_core_3_2_0_aar.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_test_espresso_espresso_idling_resource_3_2_0_aar.xml b/.idea/libraries/Gradle__androidx_test_espresso_espresso_idling_resource_3_2_0_aar.xml deleted file mode 100644 index ef06d29..0000000 --- a/.idea/libraries/Gradle__androidx_test_espresso_espresso_idling_resource_3_2_0_aar.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_test_ext_junit_1_1_1_aar.xml b/.idea/libraries/Gradle__androidx_test_ext_junit_1_1_1_aar.xml deleted file mode 100644 index 65a3dcd..0000000 --- a/.idea/libraries/Gradle__androidx_test_ext_junit_1_1_1_aar.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_test_monitor_1_2_0_aar.xml b/.idea/libraries/Gradle__androidx_test_monitor_1_2_0_aar.xml deleted file mode 100644 index c7ddfa5..0000000 --- a/.idea/libraries/Gradle__androidx_test_monitor_1_2_0_aar.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_test_runner_1_2_0_aar.xml b/.idea/libraries/Gradle__androidx_test_runner_1_2_0_aar.xml deleted file mode 100644 index 1026283..0000000 --- a/.idea/libraries/Gradle__androidx_test_runner_1_2_0_aar.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_1_1_0_aar.xml b/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_1_1_0_aar.xml deleted file mode 100644 index 7995d84..0000000 --- a/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_1_1_0_aar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_animated_1_1_0_aar.xml b/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_animated_1_1_0_aar.xml deleted file mode 100644 index 5b5c21b..0000000 --- a/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_animated_1_1_0_aar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_versionedparcelable_versionedparcelable_1_1_0_aar.xml b/.idea/libraries/Gradle__androidx_versionedparcelable_versionedparcelable_1_1_0_aar.xml deleted file mode 100644 index 0a4319d..0000000 --- a/.idea/libraries/Gradle__androidx_versionedparcelable_versionedparcelable_1_1_0_aar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_viewpager_viewpager_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_viewpager_viewpager_1_0_0_aar.xml deleted file mode 100644 index 844a612..0000000 --- a/.idea/libraries/Gradle__androidx_viewpager_viewpager_1_0_0_aar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_2_0_1_jar.xml b/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_2_0_1_jar.xml deleted file mode 100644 index 947e251..0000000 --- a/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_2_0_1_jar.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_squareup_javawriter_2_1_1_jar.xml b/.idea/libraries/Gradle__com_squareup_javawriter_2_1_1_jar.xml deleted file mode 100644 index f97c138..0000000 --- a/.idea/libraries/Gradle__com_squareup_javawriter_2_1_1_jar.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__javax_inject_javax_inject_1_jar.xml b/.idea/libraries/Gradle__javax_inject_javax_inject_1_jar.xml deleted file mode 100644 index 5ac7d7b..0000000 --- a/.idea/libraries/Gradle__javax_inject_javax_inject_1_jar.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__junit_junit_4_12_jar.xml b/.idea/libraries/Gradle__junit_junit_4_12_jar.xml deleted file mode 100644 index 24e5b72..0000000 --- a/.idea/libraries/Gradle__junit_junit_4_12_jar.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__net_sf_kxml_kxml2_2_3_0_jar.xml b/.idea/libraries/Gradle__net_sf_kxml_kxml2_2_3_0_jar.xml deleted file mode 100644 index ddd2635..0000000 --- a/.idea/libraries/Gradle__net_sf_kxml_kxml2_2_3_0_jar.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3_jar.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3_jar.xml deleted file mode 100644 index 6b1e2e7..0000000 --- a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3_jar.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_integration_1_3_jar.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_integration_1_3_jar.xml deleted file mode 100644 index a8015c9..0000000 --- a/.idea/libraries/Gradle__org_hamcrest_hamcrest_integration_1_3_jar.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_library_1_3_jar.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_library_1_3_jar.xml deleted file mode 100644 index 00bb125..0000000 --- a/.idea/libraries/Gradle__org_hamcrest_hamcrest_library_1_3_jar.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 37a7509..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 3a9395e..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index 7f68460..0000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/QRyde.iml b/QRyde.iml index a636f06..f6ccec8 100644 --- a/QRyde.iml +++ b/QRyde.iml @@ -8,13 +8,12 @@ - + - - + \ No newline at end of file diff --git a/app/app.iml b/app/app.iml index 4c2d42a..e8369c0 100644 --- a/app/app.iml +++ b/app/app.iml @@ -4,8 +4,8 @@ @@ -25,23 +25,21 @@ - + - + - + - - + - + - @@ -95,7 +93,6 @@ - @@ -104,30 +101,66 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + - - - + + + + + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 387ad3b..bf2161a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,15 +2,19 @@ apply plugin: 'com.android.application' android { compileSdkVersion 29 - buildToolsVersion "29.0.2" + buildToolsVersion "29.0.3" defaultConfig { applicationId "com.datainfo.QRyde" - minSdkVersion 14 + minSdkVersion 16 //changed for maps targetSdkVersion 29 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } buildTypes { release { minifyEnabled false @@ -26,4 +30,16 @@ dependencies { testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + //maps + implementation 'com.google.android.gms:play-services-location:17.0.0' + implementation 'com.google.android.gms:play-services-maps:17.0.0' + implementation 'com.google.android.libraries.places:places:2.2.0' +// implementation 'com.google.android.libraries.places:places-compat:2.2.0' + implementation 'com.google.android.gms:play-services-places:17.0.0' + + //directions + implementation 'com.google.maps:google-maps-services:0.11.0' + implementation 'org.slf4j:slf4j-simple:1.7.25' + + } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index df2ed50..80c7e31 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,17 +2,33 @@ + + + + + + + + + + + + + - + diff --git a/app/src/main/java/com/datainfo/QRyde/MainActivity.java b/app/src/main/java/com/datainfo/QRyde/MainActivity.java index 008c1fd..f253dbf 100644 --- a/app/src/main/java/com/datainfo/QRyde/MainActivity.java +++ b/app/src/main/java/com/datainfo/QRyde/MainActivity.java @@ -2,13 +2,30 @@ import androidx.appcompat.app.AppCompatActivity; +import android.content.Intent; import android.os.Bundle; +import android.view.View; +import android.widget.Button; public class MainActivity extends AppCompatActivity { + private Button button; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); + + button = findViewById(R.id.buttonToMap); + button.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + MapsActivity(); + } + }); + } + public void MapsActivity() { + Intent intent = new Intent(this, MapActivity.class); + startActivity(intent); } } diff --git a/app/src/main/java/com/datainfo/QRyde/MapActivity.java b/app/src/main/java/com/datainfo/QRyde/MapActivity.java new file mode 100644 index 0000000..8e5d6bd --- /dev/null +++ b/app/src/main/java/com/datainfo/QRyde/MapActivity.java @@ -0,0 +1,426 @@ +package com.datainfo.QRyde; +import android.location.Address; +import android.location.Geocoder; +import android.location.Location; +import android.os.Build; +import android.os.Bundle; + +import android.Manifest; +import android.content.pm.PackageManager; +import android.os.Handler; +import android.os.Looper; +import android.util.Log; +import android.view.View; +import android.widget.Button; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; + +import com.google.android.gms.common.api.Status; +import com.google.android.gms.location.FusedLocationProviderClient; +import com.google.android.gms.location.LocationServices; +import com.google.android.gms.maps.CameraUpdateFactory; +import com.google.android.gms.maps.GoogleMap; +import com.google.android.gms.maps.OnMapReadyCallback; +import com.google.android.gms.maps.SupportMapFragment; +import com.google.android.gms.maps.model.LatLng; +import com.google.android.gms.maps.model.LatLngBounds; +import com.google.android.gms.maps.model.Polyline; +import com.google.android.gms.maps.model.PolylineOptions; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; + +import com.google.android.libraries.places.api.Places; +import com.google.android.libraries.places.api.model.Place; +import com.google.android.libraries.places.api.net.PlacesClient; +import com.google.android.libraries.places.widget.AutocompleteSupportFragment; +import com.google.android.libraries.places.widget.listener.PlaceSelectionListener; +import com.google.maps.DirectionsApiRequest; +import com.google.maps.GeoApiContext; +import com.google.maps.PendingResult; +import com.google.maps.internal.PolylineEncoding; +import com.google.maps.model.DirectionsResult; +import com.google.maps.model.DirectionsRoute; + +import java.math.BigDecimal; +import java.math.MathContext; +import java.math.RoundingMode; +import java.sql.Time; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Locale; +import java.util.Objects; + +public class MapActivity extends AppCompatActivity implements OnMapReadyCallback { + + //initialization of variables + private Boolean LocationPermission = false; + private GoogleMap ActualMap; + private Location locationCurr; + private final LatLng EarthDefaultLocation = new LatLng(0, 0); //just center of earth + private AutocompleteSupportFragment autocompleteSupportFragment, autocompleteSupportFragmentdest; + private GeoApiContext geoApiContext = null; //for directions api + private Place startPos, endPos; + private Polyline polyline; + private View mapView; + + private TextView distanceView; + private TextView durationView; + private TextView costView; + + @RequiresApi(api = Build.VERSION_CODES.M) + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_map); + + if (!Places.isInitialized()) { + Places.initialize(getApplicationContext(), getString(R.string.google_maps_key)); + } + + //Finding views from layout files + autocompleteSupportFragment = (AutocompleteSupportFragment) + getSupportFragmentManager().findFragmentById(R.id.autocomplete_fragment); + autocompleteSupportFragmentdest = (AutocompleteSupportFragment) + getSupportFragmentManager().findFragmentById(R.id.autocomplete_fragmentdes); + + distanceView = findViewById(R.id.distance); + durationView = findViewById(R.id.time); + costView = findViewById(R.id.cost); + + autocompleteSupportFragment.setPlaceFields(Arrays.asList(Place.Field.ID, Place.Field.NAME, Place.Field.LAT_LNG)); + autocompleteSupportFragmentdest.setPlaceFields(Arrays.asList(Place.Field.ID, Place.Field.NAME, Place.Field.LAT_LNG)); + + //initializing countries to search from and adding hints to the search bar + autocompleteSupportFragment.setCountries("CA"); // sets for now the location for autocomplete + autocompleteSupportFragment.setHint("Current Location"); + autocompleteSupportFragmentdest.setHint("Enter a Destination"); + autocompleteSupportFragmentdest.setCountries("CA"); //sets for now the location for autocomplete + + //Getting permission to access location from the user + getLocationPermission(); + } + + //converting a location to an address + private String getCompleteAddressString(Location location) { + String returnedAddress = ""; + Geocoder geocoder = new Geocoder(this, Locale.getDefault()); + + //catching for null locations + try { + List
addresses = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 1); + if (addresses != null) { + returnedAddress = addresses.get(0).getAddressLine(0); + } + } catch (Exception e) { + e.printStackTrace(); + } + return returnedAddress; + } + + //creates map fragment + private void MapInit() { + SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager() + .findFragmentById(R.id.map); + mapView = mapFragment.getView(); + mapFragment.getMapAsync(MapActivity.this); + if (geoApiContext == null) { + geoApiContext = new GeoApiContext.Builder() + .apiKey(getString(R.string.google_maps_key)) + .build(); + } + } + + //getting permissions to access location of the device from the user + //if permission is granted current user location is accessed + private void getLocationPermission() { + String[] permissions = {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}; + if(ContextCompat.checkSelfPermission(this.getApplicationContext(), Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED){ + if(ContextCompat.checkSelfPermission(this.getApplicationContext(), Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED){ + LocationPermission = true; + MapInit(); + }else { + ActivityCompat.requestPermissions(this, permissions, 1515); + } + }else { + ActivityCompat.requestPermissions(this, permissions, 1515); + } + } + + //requests the location permissions + @Override + public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { + LocationPermission = false; + if (requestCode == 1515) { + for (int grantResult : grantResults) { + if (grantResult != PackageManager.PERMISSION_GRANTED) { + LocationPermission = false; + return; + } + } + LocationPermission = true; + MapInit(); + } + } + + //getting the google map ready once location is permitted + @Override + public void onMapReady(GoogleMap googleMap) { + googleMap.setPadding(0,310,0,0); + ActualMap = googleMap; + if (LocationPermission) { + updateLocationUI(); + DeviceLocation(); + searchInit(); + } + } + + //getting the current GPS location of the user and setting that as the current location + private void DeviceLocation() { + FusedLocationProviderClient fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(this); + try { + if (LocationPermission) { + Task locationResult = fusedLocationProviderClient.getLastLocation(); + locationResult.addOnCompleteListener(task -> { + if (task.isSuccessful()) { + locationCurr = (Location) task.getResult(); + autocompleteSupportFragment.setText(String.format("%s", getCompleteAddressString((Location) task.getResult()))); + mapMove(new LatLng(locationCurr.getLatitude(), locationCurr.getLongitude()), 15f); + + } else { + mapMove(new LatLng(EarthDefaultLocation.latitude, EarthDefaultLocation.longitude), 15f); + Toast.makeText(MapActivity.this, "Could not find your location.", Toast.LENGTH_SHORT).show(); + ActualMap.getUiSettings().setMyLocationButtonEnabled(false); + } + }); + } + }catch (SecurityException e) { + Log.e("Exception: %s", e.getMessage()); + } + } + + private void mapMove(LatLng latLng, float zoom) { + //method for map camera movement + ActualMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, zoom), 600, null); + } + + //shows the blue dot on the map as the current GPs location of the user + private void updateLocationUI() { + if (ActualMap == null) { + return; + } + try { + if (LocationPermission) { + ActualMap.setMyLocationEnabled(true); + View locationButton = ((View) mapView.findViewById(Integer.parseInt("1")).getParent()).findViewById(Integer.parseInt("2")); + locationButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (polyline !=null) polyline.remove(); + startPos = null; + autocompleteSupportFragment.setText(String.format("%s", getCompleteAddressString(locationCurr))); + calculateDirections(); + } + }); + + ActualMap.getUiSettings().setMyLocationButtonEnabled(true); + ActualMap.getUiSettings().setZoomControlsEnabled(true); + } else { + ActualMap.setMyLocationEnabled(false); + ActualMap.getUiSettings().setMyLocationButtonEnabled(false); + locationCurr = null; + getLocationPermission(); + } + } catch (SecurityException e) { + Log.e("Exception: %s", Objects.requireNonNull(e.getMessage())); + } + } + + //searching for a location to route to using the autocomplete API methods provided by Google + private void searchInit() { + autocompleteSupportFragment.setOnPlaceSelectedListener(new PlaceSelectionListener() { + @Override + public void onPlaceSelected(@NonNull Place place) { + // TODO: Get info about the selected place. + Log.i("AutoComplete", "Place: " + place.getName() + ", " + place.getId() + place.getLatLng()); + + startPos = place; + mapMove(place.getLatLng(),15f); + if (endPos != null) { + calculateDirections(); + } + } + @Override + public void onError(@NonNull Status status) { + // TODO: Handle the error. + Log.i("AutoComplete", "An error occurred: " + status); + Toast.makeText(MapActivity.this, "Couldn't find place.", Toast.LENGTH_SHORT).show(); + } + }); + + //clearing the user input in the autocomplete search fragment when clicked on + Objects.requireNonNull(autocompleteSupportFragment.getView()).findViewById(R.id.places_autocomplete_clear_button).setOnClickListener(v -> { + startPos = null; + autocompleteSupportFragment.setText(""); + if (endPos != null) { + calculateDirections(); + } + }); + autocompleteSupportFragmentdest.getView().findViewById(R.id.places_autocomplete_clear_button).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + polyline.remove(); + endPos = null; + if (startPos == null) { + mapMove(new LatLng(locationCurr.getLatitude(), locationCurr.getLongitude()), 15f); + autocompleteSupportFragmentdest.setText(""); + } + else { + mapMove(startPos.getLatLng(),15f); + autocompleteSupportFragmentdest.setText(""); + } + + } + }); + + //routing from the addresses provided in the fragments on click + autocompleteSupportFragmentdest.setOnPlaceSelectedListener(new PlaceSelectionListener() { + @Override + public void onPlaceSelected(@NonNull Place place) { + endPos = place; + calculateDirections(); + } + + //error on failure to route + @Override + public void onError(@NonNull Status status) { + Log.i("AutoComplete", "An error occurred: " + status); + Toast.makeText(MapActivity.this, "Couldn't find place.", Toast.LENGTH_SHORT).show(); + } + }); + } + + //method to add the best possible route from one point entered to another + private void calculateDirections() { + Log.d("Directions", "calculateDirections: calculating directions."); + + if (polyline !=null) { //removes a poly line if exists + polyline.remove(); + } + com.google.maps.model.LatLng destination = new com.google.maps.model.LatLng( + endPos.getLatLng().latitude, + endPos.getLatLng().longitude + ); + DirectionsApiRequest directions = new DirectionsApiRequest(geoApiContext); + + if (startPos == null) { + directions.origin(new com.google.maps.model.LatLng(locationCurr.getLatitude(), locationCurr.getLongitude())); + } else { + directions.origin(new com.google.maps.model.LatLng(startPos.getLatLng().latitude,startPos.getLatLng().longitude)); + } + + Log.d("Directions", "calculateDirections: destination: " + destination.toString()); + directions.destination(destination).setCallback(new PendingResult.Callback() { + @RequiresApi(api = Build.VERSION_CODES.M) + @Override + public void onResult(DirectionsResult result) { + Log.d("Directions", "calculateDirections: routes: " + result.routes[0].toString()); + Log.d("Directions", "calculateDirections: duration: " + result.routes[0].legs[0].duration); + Log.d("Directions", "calculateDirections: distance: " + result.routes[0].legs[0].distance); + Log.d("Directions", "calculateDirections: geocodedWayPoints: " + result.geocodedWaypoints[0].toString()); + + //adding the route calculated to the map + addPolylinesToMap(result); + + double seconds = (double) result.routes[0].legs[0].duration.inSeconds; + double minutes = roundUp(seconds/60, 1); + + double kilometres = result.routes[0].legs[0].distance.inMeters; + kilometres = roundUp(kilometres/1000, 2); + + double cost = costCalculator(minutes, kilometres); + cost = roundUp(cost, 2); + + //displaying the variables calculated onto the activity + distanceView.setText(String.format("Distance: %s km", kilometres)); + durationView.setText(String.format("Time: %s minutes", minutes)); + costView.setText(String.format("Cost: $%s", cost)); + } + + //throwing an error on failure to route + @Override + public void onFailure(Throwable e) { + Log.e("Directions", "calculateDirections: Failed to get directions: " + e.getMessage()); + } + }); + } + + //adding the route polylines to the map + @RequiresApi(api = Build.VERSION_CODES.M) + private void addPolylinesToMap(final DirectionsResult result){ + // for main thread + new Handler(Looper.getMainLooper()).post(() -> { + + //getting best route only, so only one route + List decodedPath = PolylineEncoding.decode(result.routes[0].overviewPolyline.getEncodedPath()); + List newDecodedPath = new ArrayList<>(); + + //for loop goes through several lat/log to make the route. Array holds several lat/longs + for(com.google.maps.model.LatLng latLng: decodedPath){ + newDecodedPath.add(new LatLng(latLng.lat, latLng.lng)); + } + Log.d("addPolylinesToMap", "run: leg: " + decodedPath.get(0).toString()); + + polyline = ActualMap.addPolyline(new PolylineOptions() + .addAll(newDecodedPath) + .color(getColor(R.color.QrydeB))); + + polylineZoom(polyline.getPoints()); + }); + } + + //this is for animating camera to zoom out or in to the route size + public void polylineZoom(List lstLatLngRoute) { + + if (ActualMap == null || lstLatLngRoute == null || lstLatLngRoute.isEmpty()) return; + + LatLngBounds.Builder boundsBuilder = new LatLngBounds.Builder(); + for (LatLng latLngPoint : lstLatLngRoute) + boundsBuilder.include(latLngPoint); + + int routePadding = 120; + LatLngBounds latLngBounds = boundsBuilder.build(); + + ActualMap.animateCamera( + CameraUpdateFactory.newLatLngBounds(latLngBounds, routePadding), + 600, + null + ); + } + + //calculating the cost for a ride using time and distance + public double costCalculator(double minutes, double distance) + { + double baseCost = 2.00; + double minimumFare = 4.00; + + double perKm = 0.85; + double perMinute = 0.25; + + return (baseCost + minimumFare + (minutes*perMinute) + (distance*perKm)); + } + + //rounding up decimal numbers to a precision point + public double roundUp(double number, int precision) + { + BigDecimal bd = new BigDecimal(number).setScale(precision, RoundingMode.HALF_UP); + return bd.doubleValue(); + } +} + diff --git a/app/src/main/res/drawable-v24/gps.png b/app/src/main/res/drawable-v24/gps.png new file mode 100644 index 0000000..d7735f4 Binary files /dev/null and b/app/src/main/res/drawable-v24/gps.png differ diff --git a/app/src/main/res/drawable/border.xml b/app/src/main/res/drawable/border.xml new file mode 100644 index 0000000..21507a3 --- /dev/null +++ b/app/src/main/res/drawable/border.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ 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 index 4fc2444..b41499d 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -6,13 +6,15 @@ android:layout_height="match_parent" tools:context=".MainActivity"> - + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_bias="0.499" /> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_map.xml b/app/src/main/res/layout/activity_map.xml new file mode 100644 index 0000000..cf395c6 --- /dev/null +++ b/app/src/main/res/layout/activity_map.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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 deleted file mode 100644 index eca70cf..0000000 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ 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 deleted file mode 100644 index 898f3ed..0000000 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null 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 deleted file mode 100644 index dffca36..0000000 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png and /dev/null differ diff --git a/app/src/main/res/mipmap-hdpi/qryde_logo_drawer.png b/app/src/main/res/mipmap-hdpi/qryde_logo_drawer.png new file mode 100644 index 0000000..79d68ac Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/qryde_logo_drawer.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 64ba76f..0000000 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null 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 deleted file mode 100644 index dae5e08..0000000 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png and /dev/null differ diff --git a/app/src/main/res/mipmap-mdpi/qryde_logo_drawer.png b/app/src/main/res/mipmap-mdpi/qryde_logo_drawer.png new file mode 100644 index 0000000..79d68ac Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/qryde_logo_drawer.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index e5ed465..0000000 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null 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 deleted file mode 100644 index 14ed0af..0000000 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xhdpi/qryde_logo_drawer.png b/app/src/main/res/mipmap-xhdpi/qryde_logo_drawer.png new file mode 100644 index 0000000..79d68ac Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/qryde_logo_drawer.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index b0907ca..0000000 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null 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 deleted file mode 100644 index d8ae031..0000000 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxhdpi/qryde_logo_drawer.png b/app/src/main/res/mipmap-xxhdpi/qryde_logo_drawer.png new file mode 100644 index 0000000..79d68ac Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/qryde_logo_drawer.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 2c18de9..0000000 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null 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 deleted file mode 100644 index beed3cd..0000000 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxxhdpi/qryde_logo_drawer.png b/app/src/main/res/mipmap-xxxhdpi/qryde_logo_drawer.png new file mode 100644 index 0000000..79d68ac Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/qryde_logo_drawer.png differ diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 69b2233..8da28d0 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -3,4 +3,5 @@ #008577 #00574B #D81B60 + #0ecef0 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b75d1d6..e5a5942 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,3 +1,4 @@ QRyde + AIzaSyAdjzIMGqa_bYOIy7dmsXYyTpl0zNcBqxc diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 5885930..0eb88fe 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -1,7 +1,7 @@ -