Loading core/java/com/android/internal/util/weather/WeatherInfo.java +27 −19 Original line number Original line Diff line number Diff line Loading @@ -80,6 +80,7 @@ public class WeatherInfo { } } private String calcDirection(Context context, String degrees) { private String calcDirection(Context context, String degrees) { try { int deg = Integer.parseInt(degrees); int deg = Integer.parseInt(degrees); if (deg >= 338 || deg <= 22) if (deg >= 338 || deg <= 22) return context.getResources().getString(R.string.weather_N); return context.getResources().getString(R.string.weather_N); Loading @@ -99,9 +100,16 @@ public class WeatherInfo { return context.getResources().getString(R.string.weather_NW); return context.getResources().getString(R.string.weather_NW); else else return ""; return ""; } catch (NumberFormatException e) { return ""; } } } private String trimSpeed(String speed) { private String trimSpeed(String speed) { try { return String.valueOf(Math.round(Float.parseFloat(speed))); return String.valueOf(Math.round(Float.parseFloat(speed))); } catch (NumberFormatException e) { return ""; } } } } } Loading
core/java/com/android/internal/util/weather/WeatherInfo.java +27 −19 Original line number Original line Diff line number Diff line Loading @@ -80,6 +80,7 @@ public class WeatherInfo { } } private String calcDirection(Context context, String degrees) { private String calcDirection(Context context, String degrees) { try { int deg = Integer.parseInt(degrees); int deg = Integer.parseInt(degrees); if (deg >= 338 || deg <= 22) if (deg >= 338 || deg <= 22) return context.getResources().getString(R.string.weather_N); return context.getResources().getString(R.string.weather_N); Loading @@ -99,9 +100,16 @@ public class WeatherInfo { return context.getResources().getString(R.string.weather_NW); return context.getResources().getString(R.string.weather_NW); else else return ""; return ""; } catch (NumberFormatException e) { return ""; } } } private String trimSpeed(String speed) { private String trimSpeed(String speed) { try { return String.valueOf(Math.round(Float.parseFloat(speed))); return String.valueOf(Math.round(Float.parseFloat(speed))); } catch (NumberFormatException e) { return ""; } } } } }