Skip to content

Commit

Permalink
1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sqayner committed Aug 19, 2023
1 parent 7fcb32c commit f836f68
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected void onCreate(Bundle savedInstanceState) {

text = findViewById(R.id.textView);

EarthquakeAPI.initialize().setSource(Source.USGS).setEarthquakeAPIListener(new EarthquakeAPIListener() {
EarthquakeAPI.initialize().setSource(Source.AFAD).setEarthquakeAPIListener(new EarthquakeAPIListener() {
@Override
public void onLoaded(ArrayList<Earthquake> earthquakes) {
StringBuilder output = new StringBuilder();
Expand Down
6 changes: 3 additions & 3 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group = 'com.github.sqayner'
version = '1.0.1'
version = '1.0.0'

android {
namespace 'tr.com.erenkaynar.library.earthquake'
Expand All @@ -13,7 +13,7 @@ android {
defaultConfig {
minSdk 26
versionCode 1
versionName "1.0.1"
versionName "1.0.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand Down Expand Up @@ -56,7 +56,7 @@ afterEvaluate {
from components.release
groupId = 'com.github.sqayner'
artifactId = 'earthquake-library-java'
version = '1.0.1'
version = '1.0.0'
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
import java.net.URL;
import java.net.URLConnection;
import java.nio.charset.StandardCharsets;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;

import tr.com.erenkaynar.library.earthquake.Constants;
Expand Down Expand Up @@ -58,7 +60,10 @@ private ArrayList<Earthquake> parse(String data) {
latLong.setLatitude(Double.parseDouble(datas.get(1).html()));
latLong.setLongitude(Double.parseDouble(datas.get(2).html()));
earthquake.setCoordinates(latLong);
earthquake.setDatetime(Instant.parse(datas.get(0).html().replace(" ", "T") + ".000Z").minusSeconds(60 * 60 * 3));

DateTimeFormatter f = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime ldt = LocalDateTime.parse(datas.get(0).html(), f);
earthquake.setDatetime(ldt.toInstant(ZoneOffset.ofHours(3)));

earthquakes.add(earthquake);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ private ArrayList<Earthquake> parse(ArrayList<String> lines) {

earthquake.setRevised(getRevised(earthquakeString));
earthquake.setDatetime(getDateTime(earthquakeString));
earthquake.setDatetime(getDateTime(earthquakeString));
earthquake.setDepth(Double.parseDouble(earthquakeString.substring(41, 49).trim()));
earthquake.setMagnitude(getMagnitude(earthquakeString));
earthquake.setLocation(earthquakeString.substring(71, 121).trim());
Expand Down

0 comments on commit f836f68

Please sign in to comment.