mWeatherIconDrawable = mGenieResources.getDrawable(cur.getInt(
cur.getColumnIndexOrThrow("iconResId")));
-
+ mWeatherCurrentTemperatureString = String.format("%d\u00b0",
+ (cur.getInt(cur.getColumnIndexOrThrow("temperature"))));
+ mWeatherHighTemperatureString = String.format("%d\u00b0",
+ (cur.getInt(cur.getColumnIndexOrThrow("highTemperature"))));
+ mWeatherLowTemperatureString = String.format("%d\u00b0",
+ (cur.getInt(cur.getColumnIndexOrThrow("lowTemperature"))));
mWeatherLocationString = cur.getString(
cur.getColumnIndexOrThrow("location"));
-
- // any of these may be NULL
- final int colTemp = cur.getColumnIndexOrThrow("temperature");
- final int colHigh = cur.getColumnIndexOrThrow("highTemperature");
- final int colLow = cur.getColumnIndexOrThrow("lowTemperature");
-
- mWeatherCurrentTemperatureString =
- cur.isNull(colTemp)
- ? "\u2014"
- : String.format("%d\u00b0", cur.getInt(colTemp));
- mWeatherHighTemperatureString =
- cur.isNull(colHigh)
- ? "\u2014"
- : String.format("%d\u00b0", cur.getInt(colHigh));
- mWeatherLowTemperatureString =
- cur.isNull(colLow)
- ? "\u2014"
- : String.format("%d\u00b0", cur.getInt(colLow));
} else {
Log.w(LOG_TAG, "No weather information available (cur="
+ cur +")");
mWeatherIconDrawable = null;
+ mWeatherHighTemperatureString = "";
+ mWeatherLowTemperatureString = "";
mWeatherLocationString = getString(R.string.weather_fetch_failure);
- mWeatherCurrentTemperatureString =
- mWeatherHighTemperatureString =
- mWeatherLowTemperatureString = "";
}
mHandy.sendEmptyMessage(UPDATE_WEATHER_DISPLAY_MSG);
if (mDimmed) {
winParams.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
winParams.dimAmount = DIM_BEHIND_AMOUNT_DIMMED;
- winParams.buttonBrightness = WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_OFF;
// show the window tint
tintView.startAnimation(AnimationUtils.loadAnimation(this,
} else {
winParams.flags &= (~WindowManager.LayoutParams.FLAG_FULLSCREEN);
winParams.dimAmount = DIM_BEHIND_AMOUNT_NORMAL;
- winParams.buttonBrightness = WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_NONE;
// hide the window tint
tintView.startAnimation(AnimationUtils.loadAnimation(this,
am.setRepeating(AlarmManager.RTC, today.getTimeInMillis(), AlarmManager.INTERVAL_DAY, mMidnightIntent);
registerReceiver(mIntentReceiver, filter);
- doDim(false); // un-dim when resuming
+ // un-dim when resuming
+ mDimmed = false;
+ doDim(false);
+
restoreScreen(); // disable screen saver
refreshAll(); // will schedule periodic weather fetch