Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into foss
Browse files Browse the repository at this point in the history
  • Loading branch information
bmaroti9 committed Sep 1, 2024
2 parents 4637de0 + d1be38d commit 9ebfcf1
Show file tree
Hide file tree
Showing 49 changed files with 5,853 additions and 2,773 deletions.
22 changes: 10 additions & 12 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -6,10 +12,6 @@ if (localPropertiesFile.exists()) {
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
Expand All @@ -21,10 +23,6 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {


Expand All @@ -40,7 +38,7 @@ android {


namespace "com.example.overmorrow"
compileSdkVersion 34
compileSdk 34
// compileSdkVersion flutter.compileSdkVersion <- this vas the original one but
// geolocator insisted on it being 33
ndkVersion flutter.ndkVersion
Expand All @@ -65,8 +63,8 @@ android {
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode 37
versionName "2.3.10"
versionCode 41
versionName "2.4.1"
}

buildTypes {
Expand All @@ -83,5 +81,5 @@ flutter {
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

}
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
package="com.example.url_launcher_example">
<queries>
<!-- If your app opens https URLs -->
Expand Down
24 changes: 13 additions & 11 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
buildscript {
ext.kotlin_version = '1.7.10'
allprojects {
repositories {
google()
mavenCentral()
}
}

dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}

tasks.register("clean", Delete) {
delete rootProject.buildDir
}

allprojects {
Expand All @@ -24,8 +30,4 @@ subprojects {
}
subprojects {
project.evaluationDependsOn(':app')
}

tasks.register("clean", Delete) {
delete rootProject.buildDir
}
}
30 changes: 22 additions & 8 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "2.0.0" apply false
}

include ":app"
Binary file removed assets/icons/Overmorrow_white_circle.png
Binary file not shown.
Binary file removed assets/icons/Overmorrow_white_classic.png
Binary file not shown.
Binary file removed assets/icons/Overmorrow_white_rect.png
Binary file not shown.
Binary file removed assets/icons/cloudy.png
Binary file not shown.
Binary file removed assets/icons/cloudy_night.png
Binary file not shown.
Binary file removed assets/icons/drizzle.png
Binary file not shown.
Binary file removed assets/icons/fog.png
Binary file not shown.
Binary file removed assets/icons/haze.png
Binary file not shown.
Binary file removed assets/icons/heavy_rain.png
Binary file not shown.
Binary file removed assets/icons/heavy_snow.png
Binary file not shown.
Binary file removed assets/icons/lightning.png
Binary file not shown.
Binary file removed assets/icons/moon.png
Binary file not shown.
Binary file removed assets/icons/partly_cloudy.png
Binary file not shown.
Binary file removed assets/icons/rainy.png
Binary file not shown.
Binary file removed assets/icons/sleet.png
Binary file not shown.
Binary file removed assets/icons/snow.png
Binary file not shown.
Binary file removed assets/icons/sun.png
Binary file not shown.
Binary file added fonts/OvermorrowWeatherIcons.ttf
Binary file not shown.
38 changes: 38 additions & 0 deletions lib/Icons/overmorrow_weather_icons_icons.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/// Flutter icons OvermorrowWeatherIcons
/// Copyright (C) 2024 by original authors @ fluttericon.com, fontello.com
/// This font was generated by FlutterIcon.com, which is derived from Fontello.
///
/// To use this font, place it in your fonts/ directory and include the
/// following in your pubspec.yaml
///
/// flutter:
/// fonts:
/// - family: OvermorrowWeatherIcons
/// fonts:
/// - asset: fonts/OvermorrowWeatherIcons.ttf
///
///
///
import 'package:flutter/widgets.dart';

class OvermorrowWeatherIcons {
OvermorrowWeatherIcons._();

static const _kFontFam = 'OvermorrowWeatherIcons';
static const String? _kFontPkg = null;

static const IconData cloudy2 = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData cloudy_night2 = IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData drizzle2 = IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData fog2 = IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData haze2 = IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData heavy_rain2 = IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData heavy_snow2 = IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData lightning2 = IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData moon2 = IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData partly_cloudy2 = IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData rain2 = IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData sleet2 = IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData snow2 = IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData sun2 = IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg);
}
6 changes: 5 additions & 1 deletion lib/api_key_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
//IMPORTANT: Overmorrow has two weather providers (open-meteo and weatherapi)
//but only weatherapi requires an api key. You don't need an api key for open-meteo.

const String wapi_key = "YourApiKey"; //your api key from weatherapi.com
const String wapi_key = "YourWeatherApiKey"; //your api key from weatherapi.com
//the app works without this if you only use the open-meteo provider

const String access_key = "YourUnsplashApiKey"; //your api key from unsplash.com
//the app works without this if you set the image source to asset
19 changes: 18 additions & 1 deletion lib/caching.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,31 @@ class MyGetResponse implements FileServiceResponse {

@override
DateTime get validTill {
if (url.toString().contains("search.json")) {
if (url.toString().contains("search.json")) { //search results are stored for 20 days
return DateTime.now().add(const Duration(days: 20));
}


//snap to the next quarter hour because that's when the weather data updates
DateTime now = DateTime.now();
int minutes = now.minute;
int nextQuarter = (minutes + 15 - minutes % 15) % 60;
int hoursToAdd = nextQuarter == 0 ? 1 : 0;

return DateTime(
now.year,
now.month,
now.day,
now.hour + hoursToAdd,
nextQuarter,
);

/*
return DateTime.now().add(
Duration(minutes: 60 - DateTime.now().minute,
seconds: 60 - DateTime.now().second)
);
*/
}

@override
Expand Down
Loading

0 comments on commit 9ebfcf1

Please sign in to comment.