Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
# Conflicts:
#	MobileWeather/app/src/main/java/com/sdl/mobileweather/smartdevicelink/SdlService.java
#	README.md
  • Loading branch information
JulianKast committed Jun 30, 2022
2 parents 47bf65b + b3d1f43 commit 09ae072
Show file tree
Hide file tree
Showing 39 changed files with 902 additions and 963 deletions.
2 changes: 1 addition & 1 deletion MobileWeather/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
implementation 'com.smartdevicelink:sdl_android:5.4.0'
implementation 'com.smartdevicelink:sdl_android:5.5.0'
implementation 'net.hockeyapp.android:HockeySDK:5.1.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

import static org.junit.Assert.*;

import com.sdl.mobileweather.openweathermap.OpenWeatherMapService;

/**
* Instrumented test, which will execute on an Android device.
*
Expand All @@ -23,4 +25,11 @@ public void useAppContext() {

assertEquals("com.sdl.mobileweather", appContext.getPackageName());
}


@Test
public void openWeatherAPIRequestSuccessful() {
OpenWeatherMapService openWeatherMapService = new OpenWeatherMapService();
assertEquals(OpenWeatherMapService.REQUEST_SUCCESS, openWeatherMapService.getRequestStatus());
}
}
4 changes: 1 addition & 3 deletions MobileWeather/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
<activity android:name="com.smartdevicelink.managers.lockscreen.SDLLockScreenActivity"
android:launchMode="singleTop"/>

<service android:name="com.sdl.mobileweather.wunderground.WUndergroundService"/>
<service android:name="com.sdl.mobileweather.forecastio.ForecastIoService"/>
<service android:name="com.sdl.mobileweather.openweathermap.OpenWeatherMapService"/>
<activity android:name="com.smartdevicelink.transport.USBAccessoryAttachmentActivity"
android:launchMode="singleTop"
android:exported="true">
Expand All @@ -73,7 +72,6 @@
android:foregroundServiceType="connectedDevice"
/>


<service
android:name="com.sdl.mobileweather.smartdevicelink.SdlRouterService"
android:exported="true"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
package com.sdl.mobileweather.adapter;

import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Locale;

import android.app.Activity;
import android.content.Context;
import android.view.Gravity;
Expand All @@ -24,19 +18,26 @@
import com.sdl.mobileweather.weather.UnitConverter;
import com.sdl.mobileweather.weather.WeatherDataManager;

import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Locale;

public class ForecastListAdapter extends ArrayAdapter<Forecast> {
private final Context mContext;
private final Forecast[] mForecast;
private WeatherDataManager mDataManager;
private boolean[] mForecastType;
private LayoutInflater mInflater;
private Activity parentActivity;

public ForecastListAdapter(Context context, Forecast[] forecast) {
public ForecastListAdapter(Context context, Forecast[] forecast, Activity parentActivity) {
super(context, R.layout.forecast_list_item, forecast);
this.mContext = context;
this.mForecast = forecast;
this.mDataManager = WeatherDataManager.getInstance();
this.mForecastType = new boolean[forecast.length];
this.parentActivity = parentActivity;
Arrays.fill(this.mForecastType, false);
mInflater = ((Activity) this.mContext).getLayoutInflater();
}
Expand Down Expand Up @@ -80,12 +81,12 @@ public View getView(int position, View view, ViewGroup parent) {
precipTextView.setText(day.conditionTitle);
forecastImageView.setImageBitmap(null);
}
else if((day.conditionIcon != null) &&
else if((day.conditionId != null) &&
(day.precipitationChance != null) &&
(day.highTemperature != null) &&
(day.lowTemperature != null) &&
(day.date != null)) {
URL conditionURL = day.conditionIcon;
String conditionId = day.conditionId;
Integer precip = day.precipitationChance;
Float highTemperature = day.highTemperature;
Float lowTemperature = day.lowTemperature;
Expand Down Expand Up @@ -118,25 +119,11 @@ else if((day.conditionIcon != null) &&
precipTextView.setText(precipChance);
lowTempTextView.setText(lowTemp);
highTempTextView.setText(highTemp);
if (conditionURL != null)
ImageProcessor.setConditionsImage(forecastImageView, conditionURL, true);
if (conditionId != null)
ImageProcessor.setConditionsImage(forecastImageView, conditionId);
}
/*else {
forecastImageView.setImageBitmap(null);
shortDayTextView.setText("");
precipTextView.setText("");
lowTempTextView.setText("");
highTempTextView.setText("");
}*/
}
/*
else {
forecastImageView.setImageBitmap(null);
shortDayTextView.setText("");
precipTextView.setText("");
lowTempTextView.setText("");
highTempTextView.setText("");
}*/

}
else {
rowView = mInflater.inflate(R.layout.forecast_list_item, null, true);
Expand Down

This file was deleted.

0 comments on commit 09ae072

Please sign in to comment.