Playstore review fix (#41)

* Latest release (#40)

 - Imperial units added
 - change location retrieval accuracy
 - change location retrieval caching from location provider
 - Api fix

* - fix google play review issues
This commit is contained in:
2024-10-06 13:23:54 +01:00
committed by GitHub
parent de8802f7b4
commit a82ce7f862
9 changed files with 31 additions and 77 deletions

View File

@@ -5,12 +5,12 @@ plugins {
id 'androidx.navigation.safeargs'
}
def relStorePassword = System.getenv("RELEASE_STORE_PASSWORD")
def relKeyPassword = System.getenv("RELEASE_KEY_PASSWORD")
def relKeyAlias = System.getenv("RELEASE_KEY_ALIAS")
Properties properties = new Properties()
boolean propertiesFileExists = project.rootProject.file('local.properties').canRead()
if (propertiesFileExists) properties.load(project.rootProject.file('local.properties').newDataInputStream())
def keystoreFile = project.rootProject.file("app/keystore.jks")
def keystorePath = System.getenv('PWD') + "/app/keystore.jks"
def keystore = file(keystorePath).exists() ? file(keystorePath) : null
android {
namespace 'com.appttude.h_mal.atlas_weather'
compileSdk = Integer.parseInt(TARGET_SDK_VERSION)
@@ -23,15 +23,8 @@ android {
testInstrumentationRunner "com.appttude.h_mal.atlas_weather.application.TestRunner"
vectorDrawables.useSupportLibrary = true
Properties properties = new Properties()
if (project.rootProject.file('local.properties').canRead()) {
properties.load(project.rootProject.file('local.properties').newDataInputStream())
buildConfigField "String", "ParamOne", properties.getProperty('WEATHER_API')
buildConfigField "String", "ParamTwo", properties.getProperty('SEARCH_API')
} else {
buildConfigField "String", "ParamOne", System.getenv('WEATHER_API')
buildConfigField "String", "ParamTwo", System.getenv('SEARCH_API')
}
buildConfigField "String", "ParamOne", System.getenv('WEATHER_API') ?: properties.getProperty('WEATHER_API')
buildConfigField "String", "ParamTwo", System.getenv('SEARCH_API') ?: properties.getProperty('SEARCH_API')
packagingOptions {
resources.excludes.add("META-INF/*")
@@ -50,10 +43,10 @@ android {
}
signingConfigs {
release {
storePassword relStorePassword
keyPassword relKeyPassword
keyAlias relKeyAlias
storeFile keystore
storePassword System.getProperty("RELEASE_STORE_PASSWORD") ?: properties.getProperty('RELEASE_STORE_PASSWORD')
keyPassword System.getProperty("RELEASE_KEY_PASSWORD") ?: properties.getProperty('RELEASE_KEY_PASSWORD')
keyAlias System.getProperty("RELEASE_KEY_ALIAS") ?: properties.getProperty('RELEASE_KEY_ALIAS')
storeFile keystoreFile.exists() ? keystoreFile : null
}
}
testOptions {
@@ -221,4 +214,6 @@ dependencies {
implementation "com.github.permissions-dispatcher:permissionsdispatcher:$PERMISSIONS_DISPATCHER"
kapt "com.github.permissions-dispatcher:permissionsdispatcher-processor:$PERMISSIONS_DISPATCHER"
implementation "com.github.permissions-dispatcher:permissionsdispatcher-annotation:$PERMISSIONS_DISPATCHER"
/ * kotlinx-coroutines-rx2 * /
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-rx2:$KOTLINX_COROUTINES_RX2"
}

View File

@@ -12,8 +12,8 @@ data class CurrentConditions(
@SerializedName("dew") var dew: Double? = null,
@SerializedName("precip") var precip: Double? = null,
@SerializedName("precipprob") var precipprob: Double? = null,
@SerializedName("snow") var snow: Int? = null,
@SerializedName("snowdepth") var snowdepth: Int? = null,
@SerializedName("snow") var snow: Double? = null,
@SerializedName("snowdepth") var snowdepth: Double? = null,
@SerializedName("preciptype") var preciptype: ArrayList<String> = arrayListOf(),
@SerializedName("windgust") var windgust: Double? = null,
@SerializedName("windspeed") var windspeed: Double? = null,
@@ -23,7 +23,7 @@ data class CurrentConditions(
@SerializedName("cloudcover") var cloudcover: Double? = null,
@SerializedName("solarradiation") var solarradiation: Double? = null,
@SerializedName("solarenergy") var solarenergy: Double? = null,
@SerializedName("uvindex") var uvindex: Int? = null,
@SerializedName("uvindex") var uvindex: Double? = null,
@SerializedName("conditions") var conditions: String? = null,
@SerializedName("icon") var icon: String? = null,
@SerializedName("stations") var stations: ArrayList<String> = arrayListOf(),

View File

@@ -14,12 +14,12 @@ data class Days(
@SerializedName("feelslike") var feelslike: Double? = null,
@SerializedName("dew") var dew: Double? = null,
@SerializedName("humidity") var humidity: Double? = null,
@SerializedName("precip") var precip: Number? = null,
@SerializedName("precip") var precip: Double? = null,
@SerializedName("precipprob") var precipprob: Double? = null,
@SerializedName("precipcover") var precipcover: Double? = null,
@SerializedName("preciptype") var preciptype: ArrayList<String> = arrayListOf(),
@SerializedName("snow") var snow: Int? = null,
@SerializedName("snowdepth") var snowdepth: Int? = null,
@SerializedName("snow") var snow: Double? = null,
@SerializedName("snowdepth") var snowdepth: Double? = null,
@SerializedName("windgust") var windgust: Double? = null,
@SerializedName("windspeed") var windspeed: Double? = null,
@SerializedName("winddir") var winddir: Double? = null,
@@ -28,8 +28,8 @@ data class Days(
@SerializedName("visibility") var visibility: Double? = null,
@SerializedName("solarradiation") var solarradiation: Double? = null,
@SerializedName("solarenergy") var solarenergy: Double? = null,
@SerializedName("uvindex") var uvindex: Int? = null,
@SerializedName("severerisk") var severerisk: Int? = null,
@SerializedName("uvindex") var uvindex: Double? = null,
@SerializedName("severerisk") var severerisk: Double? = null,
@SerializedName("sunrise") var sunrise: String? = null,
@SerializedName("sunriseEpoch") var sunriseEpoch: Int? = null,
@SerializedName("sunset") var sunset: String? = null,

View File

@@ -10,10 +10,10 @@ data class Hours(
@SerializedName("feelslike") var feelslike: Double? = null,
@SerializedName("humidity") var humidity: Double? = null,
@SerializedName("dew") var dew: Double? = null,
@SerializedName("precip") var precip: Number? = null,
@SerializedName("precip") var precip: Double? = null,
@SerializedName("precipprob") var precipprob: Double? = null,
@SerializedName("snow") var snow: Int? = null,
@SerializedName("snowdepth") var snowdepth: Int? = null,
@SerializedName("snow") var snow: Double? = null,
@SerializedName("snowdepth") var snowdepth: Double? = null,
@SerializedName("preciptype") var preciptype: ArrayList<String> = arrayListOf(),
@SerializedName("windgust") var windgust: Double? = null,
@SerializedName("windspeed") var windspeed: Double? = null,
@@ -23,8 +23,8 @@ data class Hours(
@SerializedName("cloudcover") var cloudcover: Double? = null,
@SerializedName("solarradiation") var solarradiation: Double? = null,
@SerializedName("solarenergy") var solarenergy: Double? = null,
@SerializedName("uvindex") var uvindex: Int? = null,
@SerializedName("severerisk") var severerisk: Int? = null,
@SerializedName("uvindex") var uvindex: Double? = null,
@SerializedName("severerisk") var severerisk: Double? = null,
@SerializedName("conditions") var conditions: String? = null,
@SerializedName("icon") var icon: String? = null,
@SerializedName("stations") var stations: ArrayList<String> = arrayListOf(),

View File

@@ -15,7 +15,7 @@ data class WeatherApiResponse(
@SerializedName("resolvedAddress") var resolvedAddress: String? = null,
@SerializedName("address") var address: String? = null,
@SerializedName("timezone") var timezone: String? = null,
@SerializedName("tzoffset") var tzoffset: Int? = null,
@SerializedName("tzoffset") var tzoffset: Double? = null,
@SerializedName("description") var description: String? = null,
@SerializedName("days") var days: ArrayList<Days> = arrayListOf(),
@SerializedName("alerts") var alerts: ArrayList<Alerts> = arrayListOf(),
@@ -28,7 +28,7 @@ data class WeatherApiResponse(
return FullWeather(
current = Current(currentConditions),
timezone = timezone,
timezoneOffset = tzoffset,
timezoneOffset = tzoffset?.toInt(),
hourly = hours,
daily = collectedDays,
lat = latitude,

View File

@@ -12,7 +12,6 @@ import com.appttude.h_mal.atlas_weather.data.repository.SettingsRepository
import com.appttude.h_mal.atlas_weather.data.room.entity.CURRENT_LOCATION
import com.appttude.h_mal.atlas_weather.data.room.entity.EntityItem
import com.appttude.h_mal.atlas_weather.model.widget.InnerWidgetCellData
import com.appttude.h_mal.atlas_weather.model.widget.InnerWidgetData
import com.appttude.h_mal.atlas_weather.model.widget.WidgetData
import com.appttude.h_mal.atlas_weather.model.widget.WidgetError
import com.appttude.h_mal.atlas_weather.model.widget.WidgetState
@@ -21,8 +20,6 @@ import com.appttude.h_mal.atlas_weather.utils.getSymbol
import com.appttude.h_mal.atlas_weather.utils.toSmallDayName
import com.squareup.picasso.Picasso
import com.squareup.picasso.Target
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import java.io.IOException
import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine
@@ -137,44 +134,6 @@ class ServicesHelper(
return WidgetState.HasData(data)
}
suspend fun getWidgetWeather(): WidgetData? {
return try {
val result = repository.loadSingleCurrentWeatherFromRoom(CURRENT_LOCATION)
val epoc = System.currentTimeMillis()
result.weather.let {
val bitmap = it.current?.icon
val location = locationProvider.getLocationNameFromLatLong(it.lat!!, it.lon!!)
val temp = it.current?.temp?.toInt().toString()
WidgetData(location, bitmap, temp, epoc)
}
} catch (e: Exception) {
null
}
}
suspend fun getWidgetInnerWeather(): List<InnerWidgetData>? {
return try {
val result = repository.loadSingleCurrentWeatherFromRoom(CURRENT_LOCATION)
val list = mutableListOf<InnerWidgetData>()
result.weather.daily?.drop(1)?.dropLast(2)?.forEach { dailyWeather ->
val day = dailyWeather.dt?.toSmallDayName()
val bitmap = withContext(Dispatchers.Main) {
getBitmapFromUrl(dailyWeather.icon)
}
val temp = dailyWeather.max?.toInt().toString()
val item = InnerWidgetData(day, bitmap, temp)
list.add(item)
}
list.toList()
} catch (e: Exception) {
null
}
}
suspend fun getWidgetWeatherCollection(): WidgetWeatherCollection? {
return try {
val result = repository.loadSingleCurrentWeatherFromRoom(CURRENT_LOCATION)

View File

@@ -49,8 +49,8 @@ data class DailyWeather(
days.datetimeEpoch,
days.cloudcover?.toInt(),
days.precipprob,
days.uvindex?.toDouble(),
days.precip?.toDouble()
days.uvindex,
days.precipprob
)
}

View File

@@ -2,7 +2,6 @@ package com.appttude.h_mal.monoWeather.ui.world
import android.os.Bundle
import android.view.View
import android.widget.Button
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView

View File

@@ -62,6 +62,7 @@ GRADLE_PLUGIN_VERSION = 8.5.0
KOTLIN_VERSION = 2.0.0
KOTLIN_GRADLE_PLUGIN = 1.6.21
GRADLE_ANALYZE_VERSION = 1.20.0
KOTLINX_COROUTINES_RX2 = 1.9.0
# Android configuration
TARGET_SDK_VERSION = 34