This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| android { | |
| flavorDimensions "platform" | |
| productFlavors { | |
| google { | |
| dimension "platform" | |
| } | |
| huawei { | |
| dimension "platform" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dependencies { | |
| // old code | |
| // implementation 'com.google.android.libraries.places:places:2.3.0' | |
| // implementation "com.google.android.gms:play-services-maps:17.0.0" | |
| // for Google-compatible | |
| googleImplementation 'com.google.android.libraries.places:places:2.3.0' | |
| googleImplementation "com.google.android.gms:play-services-maps:17.0.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package app.company.com.maps | |
| import com.google.android.gms.maps.SupportMapFragment | |
| class AgnosticMapFragment: SupportMapFragment() { | |
| companion object { | |
| @JvmStatic | |
| fun newInstance(): AgnosticMapFragment = AgnosticMapFragment() | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package app.company.com.maps | |
| import com.huawei.hms.maps.SupportMapFragment | |
| class AgnosticMapFragment: SupportMapFragment() { | |
| companion object { | |
| @JvmStatic | |
| fun newInstance(): AgnosticMapFragment = AgnosticMapFragment() | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.company.maps | |
| import androidx.fragment.app.FragmentActivity | |
| import com.google.android.gms.maps.CameraUpdateFactory | |
| import com.google.android.gms.maps.SupportMapFragment | |
| import com.google.android.gms.maps.model.LatLng | |
| import com.google.android.gms.maps.model.MarkerOptions | |
| import com.google.android.gms.maps.GoogleMap as Map | |
| class AgnosticMap { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.company.maps | |
| import androidx.fragment.app.FragmentActivity | |
| import com.huawei.hms.maps.CameraUpdateFactory | |
| import com.huawei.hms.maps.SupportMapFragment | |
| import com.huawei.hms.maps.model.LatLng | |
| import com.huawei.hms.maps.model.MarkerOptions | |
| import com.huawei.hms.maps.HuaweiMap as Map | |
| class AgnosticMap { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.company.maps | |
| import android.os.Bundle | |
| import android.widget.Toast | |
| import androidx.appcompat.app.AppCompatActivity | |
| class MapsActivity : AppCompatActivity() { | |
| private lateinit var map: AgnosticMap |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package mx.ncite.savinglista.common | |
| import org.joda.time.* | |
| import org.joda.time.format.DateTimeFormat | |
| import org.joda.time.format.ISODateTimeFormat | |
| object DateUtils { | |
| open val DAYS = "Dias" | |
| open val WEEKS = "Semanas" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun isTimeToSave(current: DateTime): Boolean { | |
| if (completed) return false | |
| val timeSpan = timeSpan ?: return false | |
| val timeGrain = timeGrain ?: return false | |
| val maxSpan = when (timeGrain) { | |
| DateUtils.DAYS -> timeSpan - 1 | |
| DateUtils.WEEKS -> timeSpan -1 | |
| DateUtils.MONTHS -> (timeSpan * 4) - 1 | |
| DateUtils.YEARS -> (timeSpan * 4 * 12) - 1 | |
| else -> timeSpan |