Start google tasks integration
This commit is contained in:
parent
5b9ef9abc7
commit
67fc3dbcd8
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
1
.idea/gradle.xml
generated
1
.idea/gradle.xml
generated
@ -11,6 +11,7 @@
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
<option value="$PROJECT_DIR$/tasksintegration" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
|
1
.idea/modules.xml
generated
1
.idea/modules.xml
generated
@ -4,6 +4,7 @@
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/Another Widget.iml" filepath="$PROJECT_DIR$/Another Widget.iml" group="Another Widget" />
|
||||
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" group="Another Widget/app" />
|
||||
<module fileurl="file://$PROJECT_DIR$/tasksintegration/tasksintegration.iml" filepath="$PROJECT_DIR$/tasksintegration/tasksintegration.iml" group="Another Widget/tasksintegration" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
@ -52,6 +52,7 @@ android {
|
||||
|
||||
viewBinding.enabled = true
|
||||
|
||||
dynamicFeatures = [":tasksintegration"]
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.tommasoberlose.anotherwidget.helpers
|
||||
|
||||
import android.Manifest
|
||||
import android.content.Context
|
||||
import com.google.android.gms.location.LocationServices
|
||||
import com.kwabenaberko.openweathermaplib.constants.Units
|
||||
@ -10,6 +11,7 @@ import com.tommasoberlose.anotherwidget.R
|
||||
import com.tommasoberlose.anotherwidget.global.Preferences
|
||||
import com.tommasoberlose.anotherwidget.network.WeatherNetworkApi
|
||||
import com.tommasoberlose.anotherwidget.ui.widgets.MainWidget
|
||||
import com.tommasoberlose.anotherwidget.utils.checkGrantedPermission
|
||||
|
||||
|
||||
/**
|
||||
@ -22,12 +24,14 @@ object WeatherHelper {
|
||||
val networkApi = WeatherNetworkApi(context)
|
||||
if (Preferences.customLocationAdd != "") {
|
||||
networkApi.updateWeather()
|
||||
} else {
|
||||
} else if (context.checkGrantedPermission(Manifest.permission.ACCESS_FINE_LOCATION)) {
|
||||
LocationServices.getFusedLocationProviderClient(context).lastLocation.addOnSuccessListener {
|
||||
Preferences.customLocationLat = it.latitude.toString()
|
||||
Preferences.customLocationLon = it.longitude.toString()
|
||||
if (it != null) {
|
||||
Preferences.customLocationLat = it.latitude.toString()
|
||||
Preferences.customLocationLon = it.longitude.toString()
|
||||
|
||||
networkApi.updateWeather()
|
||||
networkApi.updateWeather()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -182,4 +182,5 @@
|
||||
<string name="support_dev_subtitle">This is a single developer project,\nso thank you for the support!</string>
|
||||
<string name="settings_feedback_subtitle">This is an open-source project, feel free to help.</string>
|
||||
<string name="settings_feedback_title">Feedback and feature requests</string>
|
||||
<string name="title_tasksintegration">Tasks Integration</string>
|
||||
</resources>
|
||||
|
@ -1,2 +1,3 @@
|
||||
rootProject.name='Another Widget'
|
||||
include ':app'
|
||||
include ':tasksintegration'
|
||||
|
1
tasksintegration/.gitignore
vendored
Normal file
1
tasksintegration/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/build
|
21
tasksintegration/build.gradle
Normal file
21
tasksintegration/build.gradle
Normal file
@ -0,0 +1,21 @@
|
||||
apply plugin: 'com.android.dynamic-feature'
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 29
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation project(':app')
|
||||
}
|
14
tasksintegration/src/main/AndroidManifest.xml
Normal file
14
tasksintegration/src/main/AndroidManifest.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:dist="http://schemas.android.com/apk/distribution"
|
||||
package="com.tommasoberlose.tasksintegration">
|
||||
|
||||
<dist:module
|
||||
dist:instant="false"
|
||||
dist:title="@string/title_tasksintegration">
|
||||
<dist:delivery>
|
||||
<dist:on-demand />
|
||||
</dist:delivery>
|
||||
<dist:fusing dist:include="true" />
|
||||
</dist:module>
|
||||
</manifest>
|
||||
|
Loading…
x
Reference in New Issue
Block a user