Example #1
0
  private void showImg() {
    life_img01.setBackground(null);
    life_img02.setBackground(null);
    life_img03.setBackground(null);
    life_img04.setBackground(null);
    city_num = (int) WeatherHelper.getCurrentCity(1).get("cityIndex");

    Log.d("iii", "clothes_color : " + list.get(city_num).clothes_color);
    Log.d("iii", "car_color : " + list.get(city_num).car_color);
    Log.d("iii", "outdoor_color : " + list.get(city_num).outdoor_color);
    Log.d("iii", "Clothesline_color : " + list.get(city_num).Clothesline_color);

    if (list.get(city_num).clothes_color.equals("1")) {
      life_img01.setBackgroundResource(R.drawable.weather_03_o_green);
    } else if (list.get(city_num).clothes_color.equals("2")) {
      life_img01.setBackgroundResource(R.drawable.weather_03_o_yellow);
    } else if (list.get(city_num).clothes_color.equals("3")) {
      life_img01.setBackgroundResource(R.drawable.weather_03_o_red);
    } else {

    }

    if (list.get(city_num).car_color.equals("1")) {
      life_img02.setBackgroundResource(R.drawable.weather_03_o_green);
    } else if (list.get(city_num).car_color.equals("2")) {
      life_img02.setBackgroundResource(R.drawable.weather_03_o_yellow);
    } else if (list.get(city_num).car_color.equals("3")) {
      life_img02.setBackgroundResource(R.drawable.weather_03_o_red);
    } else {

    }

    if (list.get(city_num).outdoor_color.equals("1")) {
      life_img03.setBackgroundResource(R.drawable.weather_03_o_green);
    } else if (list.get(city_num).outdoor_color.equals("2")) {
      life_img03.setBackgroundResource(R.drawable.weather_03_o_yellow);
    } else if (list.get(city_num).outdoor_color.equals("3")) {
      life_img03.setBackgroundResource(R.drawable.weather_03_o_red);
    } else {

    }

    if (list.get(city_num).Clothesline_color.equals("1")) {
      life_img04.setBackgroundResource(R.drawable.weather_03_o_green);
    } else if (list.get(city_num).Clothesline_color.equals("2")) {
      life_img04.setBackgroundResource(R.drawable.weather_03_o_yellow);
    } else if (list.get(city_num).Clothesline_color.equals("3")) {
      life_img04.setBackgroundResource(R.drawable.weather_03_o_red);
    } else {

    }
  }
Example #2
0
 /* (non-Javadoc)
  * @see android.os.AsyncTask#onPostExecute(java.lang.Object)
  */
 @Override
 protected void onPostExecute(Boolean result) {
   if (null != weather) {
     String tokens[] = weather.split(",");
     if (tokens.length >= 2) {
       mWeatherColor = WeatherHelper.metarColor(tokens[0]);
       mTextPaint.setColor(Color.WHITE);
       mWeatherLayout =
           new StaticLayout(
               tokens[1].trim(),
               mTextPaint,
               getWidth() - SHADOW * 2,
               Layout.Alignment.ALIGN_NORMAL,
               1,
               0,
               true);
     }
   }
   invalidate();
 }
Example #3
0
 public void setWeatherList(ArrayList<WeatherLife> weatherlist) {
   this.list = weatherlist;
   city_num = (int) WeatherHelper.getCurrentCity(1).get("cityIndex");
 }