mirror of
https://github.com/hmalik144/Weather-apps.git
synced 2025-12-10 02:05:20 +00:00
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:
@@ -5,12 +5,12 @@ plugins {
|
|||||||
id 'androidx.navigation.safeargs'
|
id 'androidx.navigation.safeargs'
|
||||||
}
|
}
|
||||||
|
|
||||||
def relStorePassword = System.getenv("RELEASE_STORE_PASSWORD")
|
Properties properties = new Properties()
|
||||||
def relKeyPassword = System.getenv("RELEASE_KEY_PASSWORD")
|
boolean propertiesFileExists = project.rootProject.file('local.properties').canRead()
|
||||||
def relKeyAlias = System.getenv("RELEASE_KEY_ALIAS")
|
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 {
|
android {
|
||||||
namespace 'com.appttude.h_mal.atlas_weather'
|
namespace 'com.appttude.h_mal.atlas_weather'
|
||||||
compileSdk = Integer.parseInt(TARGET_SDK_VERSION)
|
compileSdk = Integer.parseInt(TARGET_SDK_VERSION)
|
||||||
@@ -23,15 +23,8 @@ android {
|
|||||||
testInstrumentationRunner "com.appttude.h_mal.atlas_weather.application.TestRunner"
|
testInstrumentationRunner "com.appttude.h_mal.atlas_weather.application.TestRunner"
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
|
|
||||||
Properties properties = new Properties()
|
buildConfigField "String", "ParamOne", System.getenv('WEATHER_API') ?: properties.getProperty('WEATHER_API')
|
||||||
if (project.rootProject.file('local.properties').canRead()) {
|
buildConfigField "String", "ParamTwo", System.getenv('SEARCH_API') ?: properties.getProperty('SEARCH_API')
|
||||||
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')
|
|
||||||
}
|
|
||||||
|
|
||||||
packagingOptions {
|
packagingOptions {
|
||||||
resources.excludes.add("META-INF/*")
|
resources.excludes.add("META-INF/*")
|
||||||
@@ -50,10 +43,10 @@ android {
|
|||||||
}
|
}
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
storePassword relStorePassword
|
storePassword System.getProperty("RELEASE_STORE_PASSWORD") ?: properties.getProperty('RELEASE_STORE_PASSWORD')
|
||||||
keyPassword relKeyPassword
|
keyPassword System.getProperty("RELEASE_KEY_PASSWORD") ?: properties.getProperty('RELEASE_KEY_PASSWORD')
|
||||||
keyAlias relKeyAlias
|
keyAlias System.getProperty("RELEASE_KEY_ALIAS") ?: properties.getProperty('RELEASE_KEY_ALIAS')
|
||||||
storeFile keystore
|
storeFile keystoreFile.exists() ? keystoreFile : null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
testOptions {
|
testOptions {
|
||||||
@@ -221,4 +214,6 @@ dependencies {
|
|||||||
implementation "com.github.permissions-dispatcher:permissionsdispatcher:$PERMISSIONS_DISPATCHER"
|
implementation "com.github.permissions-dispatcher:permissionsdispatcher:$PERMISSIONS_DISPATCHER"
|
||||||
kapt "com.github.permissions-dispatcher:permissionsdispatcher-processor:$PERMISSIONS_DISPATCHER"
|
kapt "com.github.permissions-dispatcher:permissionsdispatcher-processor:$PERMISSIONS_DISPATCHER"
|
||||||
implementation "com.github.permissions-dispatcher:permissionsdispatcher-annotation:$PERMISSIONS_DISPATCHER"
|
implementation "com.github.permissions-dispatcher:permissionsdispatcher-annotation:$PERMISSIONS_DISPATCHER"
|
||||||
|
/ * kotlinx-coroutines-rx2 * /
|
||||||
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-rx2:$KOTLINX_COROUTINES_RX2"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ data class CurrentConditions(
|
|||||||
@SerializedName("dew") var dew: Double? = null,
|
@SerializedName("dew") var dew: Double? = null,
|
||||||
@SerializedName("precip") var precip: Double? = null,
|
@SerializedName("precip") var precip: Double? = null,
|
||||||
@SerializedName("precipprob") var precipprob: Double? = null,
|
@SerializedName("precipprob") var precipprob: Double? = null,
|
||||||
@SerializedName("snow") var snow: Int? = null,
|
@SerializedName("snow") var snow: Double? = null,
|
||||||
@SerializedName("snowdepth") var snowdepth: Int? = null,
|
@SerializedName("snowdepth") var snowdepth: Double? = null,
|
||||||
@SerializedName("preciptype") var preciptype: ArrayList<String> = arrayListOf(),
|
@SerializedName("preciptype") var preciptype: ArrayList<String> = arrayListOf(),
|
||||||
@SerializedName("windgust") var windgust: Double? = null,
|
@SerializedName("windgust") var windgust: Double? = null,
|
||||||
@SerializedName("windspeed") var windspeed: Double? = null,
|
@SerializedName("windspeed") var windspeed: Double? = null,
|
||||||
@@ -23,7 +23,7 @@ data class CurrentConditions(
|
|||||||
@SerializedName("cloudcover") var cloudcover: Double? = null,
|
@SerializedName("cloudcover") var cloudcover: Double? = null,
|
||||||
@SerializedName("solarradiation") var solarradiation: Double? = null,
|
@SerializedName("solarradiation") var solarradiation: Double? = null,
|
||||||
@SerializedName("solarenergy") var solarenergy: 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("conditions") var conditions: String? = null,
|
||||||
@SerializedName("icon") var icon: String? = null,
|
@SerializedName("icon") var icon: String? = null,
|
||||||
@SerializedName("stations") var stations: ArrayList<String> = arrayListOf(),
|
@SerializedName("stations") var stations: ArrayList<String> = arrayListOf(),
|
||||||
|
|||||||
@@ -14,12 +14,12 @@ data class Days(
|
|||||||
@SerializedName("feelslike") var feelslike: Double? = null,
|
@SerializedName("feelslike") var feelslike: Double? = null,
|
||||||
@SerializedName("dew") var dew: Double? = null,
|
@SerializedName("dew") var dew: Double? = null,
|
||||||
@SerializedName("humidity") var humidity: 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("precipprob") var precipprob: Double? = null,
|
||||||
@SerializedName("precipcover") var precipcover: Double? = null,
|
@SerializedName("precipcover") var precipcover: Double? = null,
|
||||||
@SerializedName("preciptype") var preciptype: ArrayList<String> = arrayListOf(),
|
@SerializedName("preciptype") var preciptype: ArrayList<String> = arrayListOf(),
|
||||||
@SerializedName("snow") var snow: Int? = null,
|
@SerializedName("snow") var snow: Double? = null,
|
||||||
@SerializedName("snowdepth") var snowdepth: Int? = null,
|
@SerializedName("snowdepth") var snowdepth: Double? = null,
|
||||||
@SerializedName("windgust") var windgust: Double? = null,
|
@SerializedName("windgust") var windgust: Double? = null,
|
||||||
@SerializedName("windspeed") var windspeed: Double? = null,
|
@SerializedName("windspeed") var windspeed: Double? = null,
|
||||||
@SerializedName("winddir") var winddir: Double? = null,
|
@SerializedName("winddir") var winddir: Double? = null,
|
||||||
@@ -28,8 +28,8 @@ data class Days(
|
|||||||
@SerializedName("visibility") var visibility: Double? = null,
|
@SerializedName("visibility") var visibility: Double? = null,
|
||||||
@SerializedName("solarradiation") var solarradiation: Double? = null,
|
@SerializedName("solarradiation") var solarradiation: Double? = null,
|
||||||
@SerializedName("solarenergy") var solarenergy: Double? = null,
|
@SerializedName("solarenergy") var solarenergy: Double? = null,
|
||||||
@SerializedName("uvindex") var uvindex: Int? = null,
|
@SerializedName("uvindex") var uvindex: Double? = null,
|
||||||
@SerializedName("severerisk") var severerisk: Int? = null,
|
@SerializedName("severerisk") var severerisk: Double? = null,
|
||||||
@SerializedName("sunrise") var sunrise: String? = null,
|
@SerializedName("sunrise") var sunrise: String? = null,
|
||||||
@SerializedName("sunriseEpoch") var sunriseEpoch: Int? = null,
|
@SerializedName("sunriseEpoch") var sunriseEpoch: Int? = null,
|
||||||
@SerializedName("sunset") var sunset: String? = null,
|
@SerializedName("sunset") var sunset: String? = null,
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ data class Hours(
|
|||||||
@SerializedName("feelslike") var feelslike: Double? = null,
|
@SerializedName("feelslike") var feelslike: Double? = null,
|
||||||
@SerializedName("humidity") var humidity: Double? = null,
|
@SerializedName("humidity") var humidity: Double? = null,
|
||||||
@SerializedName("dew") var dew: 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("precipprob") var precipprob: Double? = null,
|
||||||
@SerializedName("snow") var snow: Int? = null,
|
@SerializedName("snow") var snow: Double? = null,
|
||||||
@SerializedName("snowdepth") var snowdepth: Int? = null,
|
@SerializedName("snowdepth") var snowdepth: Double? = null,
|
||||||
@SerializedName("preciptype") var preciptype: ArrayList<String> = arrayListOf(),
|
@SerializedName("preciptype") var preciptype: ArrayList<String> = arrayListOf(),
|
||||||
@SerializedName("windgust") var windgust: Double? = null,
|
@SerializedName("windgust") var windgust: Double? = null,
|
||||||
@SerializedName("windspeed") var windspeed: Double? = null,
|
@SerializedName("windspeed") var windspeed: Double? = null,
|
||||||
@@ -23,8 +23,8 @@ data class Hours(
|
|||||||
@SerializedName("cloudcover") var cloudcover: Double? = null,
|
@SerializedName("cloudcover") var cloudcover: Double? = null,
|
||||||
@SerializedName("solarradiation") var solarradiation: Double? = null,
|
@SerializedName("solarradiation") var solarradiation: Double? = null,
|
||||||
@SerializedName("solarenergy") var solarenergy: Double? = null,
|
@SerializedName("solarenergy") var solarenergy: Double? = null,
|
||||||
@SerializedName("uvindex") var uvindex: Int? = null,
|
@SerializedName("uvindex") var uvindex: Double? = null,
|
||||||
@SerializedName("severerisk") var severerisk: Int? = null,
|
@SerializedName("severerisk") var severerisk: Double? = null,
|
||||||
@SerializedName("conditions") var conditions: String? = null,
|
@SerializedName("conditions") var conditions: String? = null,
|
||||||
@SerializedName("icon") var icon: String? = null,
|
@SerializedName("icon") var icon: String? = null,
|
||||||
@SerializedName("stations") var stations: ArrayList<String> = arrayListOf(),
|
@SerializedName("stations") var stations: ArrayList<String> = arrayListOf(),
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ data class WeatherApiResponse(
|
|||||||
@SerializedName("resolvedAddress") var resolvedAddress: String? = null,
|
@SerializedName("resolvedAddress") var resolvedAddress: String? = null,
|
||||||
@SerializedName("address") var address: String? = null,
|
@SerializedName("address") var address: String? = null,
|
||||||
@SerializedName("timezone") var timezone: 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("description") var description: String? = null,
|
||||||
@SerializedName("days") var days: ArrayList<Days> = arrayListOf(),
|
@SerializedName("days") var days: ArrayList<Days> = arrayListOf(),
|
||||||
@SerializedName("alerts") var alerts: ArrayList<Alerts> = arrayListOf(),
|
@SerializedName("alerts") var alerts: ArrayList<Alerts> = arrayListOf(),
|
||||||
@@ -28,7 +28,7 @@ data class WeatherApiResponse(
|
|||||||
return FullWeather(
|
return FullWeather(
|
||||||
current = Current(currentConditions),
|
current = Current(currentConditions),
|
||||||
timezone = timezone,
|
timezone = timezone,
|
||||||
timezoneOffset = tzoffset,
|
timezoneOffset = tzoffset?.toInt(),
|
||||||
hourly = hours,
|
hourly = hours,
|
||||||
daily = collectedDays,
|
daily = collectedDays,
|
||||||
lat = latitude,
|
lat = latitude,
|
||||||
|
|||||||
@@ -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.CURRENT_LOCATION
|
||||||
import com.appttude.h_mal.atlas_weather.data.room.entity.EntityItem
|
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.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.WidgetData
|
||||||
import com.appttude.h_mal.atlas_weather.model.widget.WidgetError
|
import com.appttude.h_mal.atlas_weather.model.widget.WidgetError
|
||||||
import com.appttude.h_mal.atlas_weather.model.widget.WidgetState
|
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.appttude.h_mal.atlas_weather.utils.toSmallDayName
|
||||||
import com.squareup.picasso.Picasso
|
import com.squareup.picasso.Picasso
|
||||||
import com.squareup.picasso.Target
|
import com.squareup.picasso.Target
|
||||||
import kotlinx.coroutines.Dispatchers
|
|
||||||
import kotlinx.coroutines.withContext
|
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import kotlin.coroutines.resume
|
import kotlin.coroutines.resume
|
||||||
import kotlin.coroutines.suspendCoroutine
|
import kotlin.coroutines.suspendCoroutine
|
||||||
@@ -137,44 +134,6 @@ class ServicesHelper(
|
|||||||
return WidgetState.HasData(data)
|
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? {
|
suspend fun getWidgetWeatherCollection(): WidgetWeatherCollection? {
|
||||||
return try {
|
return try {
|
||||||
val result = repository.loadSingleCurrentWeatherFromRoom(CURRENT_LOCATION)
|
val result = repository.loadSingleCurrentWeatherFromRoom(CURRENT_LOCATION)
|
||||||
|
|||||||
@@ -49,8 +49,8 @@ data class DailyWeather(
|
|||||||
days.datetimeEpoch,
|
days.datetimeEpoch,
|
||||||
days.cloudcover?.toInt(),
|
days.cloudcover?.toInt(),
|
||||||
days.precipprob,
|
days.precipprob,
|
||||||
days.uvindex?.toDouble(),
|
days.uvindex,
|
||||||
days.precip?.toDouble()
|
days.precipprob
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,6 @@ package com.appttude.h_mal.monoWeather.ui.world
|
|||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.Button
|
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ GRADLE_PLUGIN_VERSION = 8.5.0
|
|||||||
KOTLIN_VERSION = 2.0.0
|
KOTLIN_VERSION = 2.0.0
|
||||||
KOTLIN_GRADLE_PLUGIN = 1.6.21
|
KOTLIN_GRADLE_PLUGIN = 1.6.21
|
||||||
GRADLE_ANALYZE_VERSION = 1.20.0
|
GRADLE_ANALYZE_VERSION = 1.20.0
|
||||||
|
KOTLINX_COROUTINES_RX2 = 1.9.0
|
||||||
|
|
||||||
# Android configuration
|
# Android configuration
|
||||||
TARGET_SDK_VERSION = 34
|
TARGET_SDK_VERSION = 34
|
||||||
|
|||||||
Reference in New Issue
Block a user