Skip to content

Commit

Permalink
2.239
Browse files Browse the repository at this point in the history
  • Loading branch information
WangDaYeeeeee committed Feb 15, 2019
1 parent 9edc8bc commit 234e4bb
Show file tree
Hide file tree
Showing 40 changed files with 3,718 additions and 3,122 deletions.
11 changes: 8 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "wangdaye.com.geometricweather"
minSdkVersion 19
targetSdkVersion 28
versionCode 2238
versionName "2.238"
versionCode 2239
versionName "2.239"
}
buildTypes {
release {
Expand Down Expand Up @@ -60,12 +60,15 @@ allprojects {
maven {
url "https://jitpack.io"
}
maven {
url "https://dl.bintray.com/qichuan/maven/"
}
}
}

apply plugin: 'org.greenrobot.greendao'
greendao {
schemaVersion 40
schemaVersion 42
generateTests false
}
dependencies {
Expand Down Expand Up @@ -99,4 +102,6 @@ dependencies {

implementation 'org.cyanogenmod:platform.sdk:5.0'
implementation 'org.jetbrains:annotations-java5:15.0'

implementation 'com.zqc.opencc.android.lib:lib-opencc-android:0.8.0@aar'
}
2 changes: 1 addition & 1 deletion app/release/output.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":2238,"versionName":"2.238","enabled":true,"outputFile":"GeometricWeather 2.238.apk","fullName":"release","baseName":"release"},"path":"GeometricWeather 2.238.apk","properties":{}}]
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":2239,"versionName":"2.239","enabled":true,"outputFile":"GeometricWeather 2.239.apk","fullName":"release","baseName":"release"},"path":"GeometricWeather 2.239.apk","properties":{}}]
6,192 changes: 3,218 additions & 2,974 deletions app/src/main/assets/city_list.txt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import java.io.File;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;

import wangdaye.com.geometricweather.basic.GeoActivity;
Expand All @@ -38,6 +40,7 @@ public static GeometricWeather getInstance() {
private String locationService;
private String darkMode;
private String iconStyle;
private String[] cardDisplayValues;
private String cardOrder;
private boolean colorNavigationBar;
private boolean fahrenheit;
Expand Down Expand Up @@ -135,6 +138,9 @@ private void initialize() {
locationService = LocationHelper.getLocationServiceProvider(this, sharedPreferences);
darkMode = sharedPreferences.getString(getString(R.string.key_dark_mode), "auto");
iconStyle = sharedPreferences.getString(getString(R.string.key_icon_style), "material");
cardDisplayValues = sharedPreferences.getStringSet(
getString(R.string.key_card_display),
new HashSet<>(Arrays.asList(getResources().getStringArray(R.array.card_display_values)))).toArray(new String[] {});
cardOrder = sharedPreferences.getString(getString(R.string.key_card_order), "daily_first");
colorNavigationBar = sharedPreferences.getBoolean(getString(R.string.key_navigationBar_color), false);
fahrenheit = sharedPreferences.getBoolean(getString(R.string.key_fahrenheit), false);
Expand Down Expand Up @@ -192,6 +198,14 @@ public void setIconStyle(String iconStyle) {
this.iconStyle = iconStyle;
}

public String[] getCardDisplayValues() {
return cardDisplayValues;
}

public void setCardDisplayValues(String[] cardDisplayValues) {
this.cardDisplayValues = cardDisplayValues;
}

public String getCardOrder() {
return cardOrder;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import wangdaye.com.geometricweather.utils.manager.ShortcutsManager;

/**
* Alarm update service.
* Update service.
* */

public abstract class UpdateService extends Service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,90 @@

public class CNCityList {

public List<CNCity> citys;
private List<CNCity> cities;

public List<CNCity> getCities() {
return cities;
}

public void setCities(List<CNCity> cities) {
this.cities = cities;
}

public static class CNCity {
/**
* id : 110101
* province : 北京市
* city : 东城区
* district : 无
* lat : 39.928353
* lon : 116.416357
* requestKey : 101011600
* cityId : 101010100
* province : 北京
* city : 北京
* district : 北京
* latitude : 39.904987
* longitude : 116.40529
*/

public String id;
public String province;
public String city;
public String district;
public String lat;
public String lon;
public String requestKey;
private String cityId;
private String province;
private String city;
private String district;
private String latitude;
private String longitude;

public static CNCity buildCNCity(CNCityEntity entity) {
CNCity city = new CNCity();
city.id = String.valueOf(entity.id);
city.province = entity.province;
city.city = entity.city;
city.district = entity.district;
city.lat = entity.lat;
city.lon = entity.lon;
city.requestKey = entity.requestKey;
city.setCityId(entity.requestKey);
city.setProvince(entity.province);
city.setCity(entity.city);
city.setDistrict(entity.district);
city.setLatitude(entity.lat);
city.setLongitude(entity.lon);
return city;
}

public String getCityId() {
return cityId;
}

public void setCityId(String cityId) {
this.cityId = cityId;
}

public String getProvince() {
return province;
}

public void setProvince(String province) {
this.province = province;
}

public String getCity() {
return city;
}

public void setCity(String city) {
this.city = city;
}

public String getDistrict() {
return district;
}

public void setDistrict(String district) {
this.district = district;
}

public String getLatitude() {
return latitude;
}

public void setLatitude(String latitude) {
this.latitude = latitude;
}

public String getLongitude() {
return longitude;
}

public void setLongitude(String longitude) {
this.longitude = longitude;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,17 @@ public static List<Location> buildLocationListByCNWeather(List<CNCityList.CNCity
List<Location> locationList = new ArrayList<>();
for (int i = 0; i < cityList.size(); i ++) {
Location location = new Location();
location.cityId = cityList.get(i).requestKey;
if (cityList.get(i).district.equals("无")) {
location.cityId = cityList.get(i).getCityId();
if (cityList.get(i).getDistrict().equals("无")) {
location.district = "";
} else {
location.district = cityList.get(i).district;
location.district = cityList.get(i).getDistrict();
}
location.city = cityList.get(i).city;
location.province = cityList.get(i).province;
location.city = cityList.get(i).getCity();
location.province = cityList.get(i).getProvince();
location.country = "中国";
location.lat = cityList.get(i).lat;
location.lon = cityList.get(i).lon;
location.lat = cityList.get(i).getLatitude();
location.lon = cityList.get(i).getLongitude();
location.source = GeometricWeather.getInstance().getChineseSource();
if (location.source.equals("accu")) {
location.source = "cn";
Expand Down Expand Up @@ -167,17 +167,17 @@ public static List<Location> buildLocationList(AccuLocationResult result) {
public static List<Location> buildLocationList(CNCityList.CNCity city) {
List<Location> locationList = new ArrayList<>();
Location location = new Location();
location.cityId = city.requestKey;
if (city.district.equals("无")) {
location.cityId = city.getCityId();
if (city.getDistrict().equals("无")) {
location.district = "";
} else {
location.district = city.district;
location.district = city.getDistrict();
}
location.city = city.city;
location.province = city.province;
location.city = city.getCity();
location.province = city.getProvince();
location.country = "中国";
location.lat = city.lat;
location.lon = city.lon;
location.lat = city.getLatitude();
location.lon = city.getLongitude();
location.source = GeometricWeather.getInstance().getChineseSource();
if (location.source.equals("accu")) {
location.source = "cn";
Expand Down
Loading

0 comments on commit 234e4bb

Please sign in to comment.