Skip to content

Commit e8d2c5f

Browse files
committed
update dependencies, target pie, java 1.8 compat, move activities to a folder, fix some English, etc.
Signed-off-by: Taco <[email protected]>
1 parent 93953f9 commit e8d2c5f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+812
-931
lines changed

.gitignore

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
*.iml
22
.gradle
3-
/local.properties
3+
local.properties
44
.DS_Store
5-
/build
6-
/captures
5+
build
6+
captures
77
.externalNativeBuild
8-
/.idea
9-
/gradle.properties
8+
.idea
9+
gradle.properties
1010
app/src/main/res/values/keys.xml
1111
app/release/

.travis.yml

+15-8
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
11
language: android
22
android:
33
components:
4-
- tools
5-
- platform-tools
6-
- tools
7-
- build-tools-26.0.2
8-
- android-26
9-
licenses:
10-
- ".+"
4+
- tools
5+
- platform-tools
6+
- tools
7+
- build-tools-28.0.3
8+
- android-28
9+
10+
license:
11+
- android-sdk-license-.+
12+
- android-sdk-preview-license-.+
13+
- -.+
14+
1115
before_install:
12-
- yes | sdkmanager "platforms;android-27"
16+
- yes | sdkmanager "platforms;android-28"
17+
1318
before_script:
1419
- sed -i "s/app_icon/app_icon_devel/g" app/src/main/AndroidManifest.xml
1520
- sed -i "s/com.danhasting.radar/com.danhasting.radar.devel/g" app/build.gradle
1621
- sed -i "s/versionName \"\([0-9\.]\+\)\"/versionName \"\1~git:${TRAVIS_COMMIT:0:7}\"/g" app/build.gradle
22+
1723
before_deploy:
1824
- mkdir app/build/outputs/apk/debug/$TRAVIS_BRANCH/
1925
- mv app/build/outputs/apk/debug/app-debug.apk app/build/outputs/apk/debug/$TRAVIS_BRANCH/com.danhasting.radar.devel.apk
26+
2027
deploy:
2128
provider: s3
2229
access_key_id:

README.md

+25-6
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,36 @@
44

55
Weather Radar is an open-source application featuring doppler radar images from the United States National Weather Service and Weather Underground's API.
66

7-
The images are single images based on location rather than tiled images that can be panned like most other applications of this type. This allows faster loading when connection speeds are sub-optimal. Images can be customized including by resolution to help keep data usage to a minimum when needed. You can save your favorite views for easy reference.
8-
9-
National Weather Service radar imagery is available for the United States and its territories. The Weather Underground radar imagery requires and API key from their website to work. There is a test feature available so you can try it out before acquiring your own API key. Their radar imagery is available for the United States and some parts of Canada, Mexico, Western Europe, and Australia. Their satellite imagery is available worldwide.
10-
11-
__NOTE:__ Weather Underground discontinued free API keys at the same time I released this application. If you already have an API key from them, it will work. Otherwise, there doesn't seem to be a way to get the Weather Underground images working. The NWS images still work fine.
7+
The images are single images based on location rather than tiled images that can be panned like most other applications of this type.
8+
This allows faster loading when connection speeds are sub-optimal.
9+
Images can be customized including by resolution to help keep data usage to a minimum when needed.
10+
You can save your favorite views for easy reference.
11+
12+
National Weather Service radar imagery is available for the United States and its territories.
13+
The Weather Underground radar imagery requires an API key from their website to work.
14+
There is a test feature available so you can try it out before acquiring your own API key.
15+
Their radar imagery is available for the United States and some parts of Canada, Mexico, Western Europe, and Australia.
16+
Their satellite imagery is available worldwide.
17+
18+
__NOTE:__ Weather Underground discontinued free API keys at the same time I released this application.
19+
If you already have an API key from them, it will work.
20+
Otherwise, there doesn't seem to be a way to get the Weather Underground images working.
21+
The NWS images still work fine.
1222

1323
I will work on integrating another source.
1424

1525
## Downloading
1626

17-
<p><a href="https://f-droid.org/en/packages/com.danhasting.radar/"><img src="https://raw.githubusercontent.com/dh4/WeatherRadar/master/resources/fdroid.png" alt="Get it on F-Droid" /></a> <a href="https://play.google.com/store/apps/details?id=com.danhasting.radar"><img src="https://raw.githubusercontent.com/dh4/WeatherRadar/master/resources/googleplay.png" alt="Get it on Google Play" /></a></p>
27+
<a href="https://play.google.com/store/apps/details?id=com.danhasting.radar">
28+
<img src="https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png"
29+
alt="Get it on Google Play" height="80">
30+
</a>
31+
<a href="https://f-droid.org/packages/com.danhasting.radar/">
32+
<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png"
33+
alt="Get it on F-Droid" height="80">
34+
</a>
35+
36+
1837

1938
APKs are also available on the [releases](https://github.com/dh4/WeatherRadar/releases) page.
2039

app/build.gradle

+24-14
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 27
5-
buildToolsVersion '27.0.3'
4+
compileSdkVersion 28
5+
buildToolsVersion '28.0.3'
6+
67
defaultConfig {
78
applicationId "com.danhasting.radar"
89
minSdkVersion 16
9-
targetSdkVersion 27
10-
versionCode 2
11-
versionName "1.0"
10+
targetSdkVersion 28
11+
versionCode 3
12+
versionName "1.1"
13+
1214
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1315

1416
javaCompileOptions {
@@ -17,24 +19,32 @@ android {
1719
}
1820
}
1921
}
22+
2023
buildTypes {
2124
release {
2225
minifyEnabled false
2326
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2427
}
2528
}
29+
30+
compileOptions {
31+
encoding = 'UTF-8'
32+
sourceCompatibility JavaVersion.VERSION_1_8
33+
targetCompatibility JavaVersion.VERSION_1_8
34+
}
2635
}
2736

2837
dependencies {
29-
implementation 'com.android.support:appcompat-v7:27.1.1'
30-
implementation 'com.android.support:design:27.1.1'
31-
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
32-
implementation 'android.arch.lifecycle:extensions:1.1.1'
3338
testImplementation 'junit:junit:4.12'
34-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
35-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
36-
implementation 'android.arch.persistence.room:runtime:1.1.0'
37-
annotationProcessor 'android.arch.persistence.room:compiler:1.1.0'
38-
implementation 'com.x5dev:chunk-templates:3.3.1'
39+
40+
implementation 'com.android.support:design:28.0.0'
41+
implementation 'com.android.support:appcompat-v7:28.0.0'
42+
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
43+
44+
implementation 'android.arch.lifecycle:extensions:1.1.1'
45+
implementation 'android.arch.persistence.room:runtime:1.1.1'
46+
annotationProcessor 'android.arch.persistence.room:compiler:1.1.1'
47+
48+
implementation 'com.x5dev:chunk-templates:3.4.0'
3949
implementation 'com.loopj.android:android-async-http:1.4.9'
4050
}

app/src/main/AndroidManifest.xml

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@
1212
android:roundIcon="@mipmap/app_icon"
1313
android:supportsRtl="true"
1414
android:theme="@style/AppTheme">
15-
<activity android:name=".MainActivity">
15+
<activity android:name=".activities.MainActivity">
1616
<intent-filter>
1717
<action android:name="android.intent.action.MAIN" />
1818

1919
<category android:name="android.intent.category.LAUNCHER" />
2020
</intent-filter>
2121
</activity>
22-
<activity android:name=".SelectActivity" />
22+
<activity android:name=".activities.SelectActivity" />
2323
<activity
24-
android:name=".RadarActivity"
24+
android:name=".activities.RadarActivity"
2525
android:windowSoftInputMode="adjustPan" />
2626
<activity
27-
android:name=".SettingsActivity"
27+
android:name=".activities.SettingsActivity"
2828
android:theme="@style/SettingsTheme" />
29-
<activity android:name=".AboutActivity" />
29+
<activity android:name=".activities.AboutActivity" />
3030
</application>
3131

3232
</manifest>

app/src/main/java/com/danhasting/radar/AboutActivity.java

-104
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
/*
2+
* Copyright (c) 2018, Dan Hasting
3+
*
4+
* This file is part of WeatherRadar
5+
*
6+
* WeatherRadar is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* WeatherRadar is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with WeatherRadar. If not, see <http://www.gnu.org/licenses/>.
18+
*/
19+
package com.danhasting.radar.activities;
20+
21+
import android.content.Context;
22+
import android.content.Intent;
23+
import android.net.Uri;
24+
import android.os.Bundle;
25+
import android.view.LayoutInflater;
26+
import android.view.View;
27+
import android.widget.Button;
28+
import android.widget.ImageView;
29+
import android.widget.TextView;
30+
31+
import com.danhasting.radar.BuildConfig;
32+
import com.danhasting.radar.R;
33+
34+
public class AboutActivity extends MainActivity {
35+
36+
@Override
37+
protected void onCreate(Bundle savedInstanceState) {
38+
super.onCreate(savedInstanceState);
39+
LayoutInflater inflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
40+
if (inflater != null) {
41+
View contentView = inflater.inflate(R.layout.activity_about, drawerLayout, false);
42+
drawerLayout.addView(contentView, 0);
43+
}
44+
45+
setTitle(R.string.about);
46+
47+
TextView version = findViewById(R.id.version);
48+
String versionName = String.format("%s %s", getText(R.string.version),
49+
BuildConfig.VERSION_NAME);
50+
version.setText(versionName);
51+
52+
Button donateButton = findViewById(R.id.donate_button);
53+
donateButton.setOnClickListener(v -> {
54+
Intent intent = new Intent();
55+
intent.setAction(Intent.ACTION_VIEW);
56+
intent.addCategory(Intent.CATEGORY_BROWSABLE);
57+
intent.setData(Uri.parse("https://dh4.github.io/donate/"));
58+
startActivity(intent);
59+
});
60+
61+
Button githubButton = findViewById(R.id.github_button);
62+
githubButton.setOnClickListener(v -> {
63+
Intent intent = new Intent();
64+
intent.setAction(Intent.ACTION_VIEW);
65+
intent.addCategory(Intent.CATEGORY_BROWSABLE);
66+
intent.setData(Uri.parse("https://github.com/dh4/WeatherRadar"));
67+
startActivity(intent);
68+
});
69+
70+
Button issueButton = findViewById(R.id.issue_button);
71+
issueButton.setOnClickListener(v -> {
72+
Intent intent = new Intent();
73+
intent.setAction(Intent.ACTION_VIEW);
74+
intent.addCategory(Intent.CATEGORY_BROWSABLE);
75+
intent.setData(Uri.parse("https://github.com/dh4/WeatherRadar/issues"));
76+
startActivity(intent);
77+
});
78+
79+
Button contactButton = findViewById(R.id.contact_button);
80+
contactButton.setOnClickListener(v -> {
81+
Intent intent = new Intent();
82+
intent.setAction(Intent.ACTION_VIEW);
83+
intent.addCategory(Intent.CATEGORY_BROWSABLE);
84+
intent.setData(Uri.parse("https://dh4.github.io/contact/"));
85+
startActivity(intent);
86+
});
87+
88+
ImageView wundergroundImage = findViewById(R.id.wunderground_image);
89+
wundergroundImage.setOnClickListener(v -> {
90+
Intent intent = new Intent();
91+
intent.setAction(Intent.ACTION_VIEW);
92+
intent.addCategory(Intent.CATEGORY_BROWSABLE);
93+
intent.setData(Uri.parse("https://www.wunderground.com/"));
94+
startActivity(intent);
95+
});
96+
}
97+
}

0 commit comments

Comments
 (0)