android源码,高仿墨迹天气引导界面

移动开发
高仿墨迹天气引导界面 。

源码简介:高仿墨迹天气引导界面 。

源码效果:

源码片段:

  1. package com.way.fragment; 
  2.   
  3. import android.os.Bundle; 
  4. import android.support.v4.app.Fragment; 
  5. import android.view.LayoutInflater; 
  6. import android.view.View; 
  7. import android.view.ViewGroup; 
  8. import android.widget.ImageView; 
  9. import android.widget.TextView; 
  10.   
  11. import com.way.app.Application; 
  12. import com.way.bean.Weatherinfo; 
  13. import com.way.util.TimeUtil; 
  14. import com.way.weather.R; 
  15.   
  16. public class SecondWeatherFragment extends Fragment { 
  17.     private TextView weekTv1, weekTv2, weekTv3; 
  18.     private ImageView weather_imgIv1, weather_imgIv2, weather_imgIv3; 
  19.     private TextView temperatureTv1, temperatureTv2, temperatureTv3; 
  20.     private TextView climateTv1, climateTv2, climateTv3; 
  21.     private TextView windTv1, windTv2, windTv3; 
  22.   
  23.     @Override 
  24.     public View onCreateView(LayoutInflater inflater, ViewGroup container, 
  25.             Bundle savedInstanceState) { 
  26.         View view = inflater.inflate(R.layout.biz_plugin_weather_item, 
  27.                 container, false); 
  28.         View view1 = view.findViewById(R.id.subitem1); 
  29.         View view2 = view.findViewById(R.id.subitem2); 
  30.         View view3 = view.findViewById(R.id.subitem3); 
  31.   
  32.         weekTv1 = (TextView) view1.findViewById(R.id.week); 
  33.         weekTv2 = (TextView) view2.findViewById(R.id.week); 
  34.         weekTv3 = (TextView) view3.findViewById(R.id.week); 
  35.           
  36.         weekTv1.setText(TimeUtil.getWeek(4, TimeUtil.XING_QI)); 
  37.         weekTv2.setText(TimeUtil.getWeek(5, TimeUtil.XING_QI)); 
  38.   
  39.         weather_imgIv1 = (ImageView) view1.findViewById(R.id.weather_img); 
  40.         weather_imgIv2 = (ImageView) view2.findViewById(R.id.weather_img); 
  41.         weather_imgIv3 = (ImageView) view3.findViewById(R.id.weather_img); 
  42.         temperatureTv1 = (TextView) view1.findViewById(R.id.temperature); 
  43.         temperatureTv2 = (TextView) view2.findViewById(R.id.temperature); 
  44.         temperatureTv3 = (TextView) view3.findViewById(R.id.temperature); 
  45.   
  46.         climateTv1 = (TextView) view1.findViewById(R.id.climate); 
  47.         climateTv2 = (TextView) view2.findViewById(R.id.climate); 
  48.         climateTv3 = (TextView) view3.findViewById(R.id.climate); 
  49.   
  50.         windTv1 = (TextView) view1.findViewById(R.id.wind); 
  51.         windTv2 = (TextView) view2.findViewById(R.id.wind); 
  52.         windTv3 = (TextView) view3.findViewById(R.id.wind); 
  53.         return view; 
  54.     } 
  55.   
  56.     public void updateWeather(Weatherinfo weatherinfo) { 
  57.           
  58.         if (weatherinfo != null) { 
  59.             weather_imgIv1.setImageResource(Application.getInstance() 
  60.                     .getWeatherIcon(weatherinfo.getWeather5())); 
  61.             weather_imgIv2.setImageResource(Application.getInstance() 
  62.                     .getWeatherIcon(weatherinfo.getWeather6())); 
  63.             // weather_imgIv3.setImageResource(getWeatherIcon(weatherinfo 
  64.             // .getWeather6())); 
  65.             climateTv1.setText(weatherinfo.getWeather5()); 
  66.             climateTv2.setText(weatherinfo.getWeather6()); 
  67.   
  68.             temperatureTv1.setText(weatherinfo.getTemp5()); 
  69.             temperatureTv2.setText(weatherinfo.getTemp6()); 
  70.             // temperatureTv3.setText(weatherinfo.getTemp6()); 
  71.   
  72.             windTv1.setText(weatherinfo.getWind5()); 
  73.             windTv2.setText(weatherinfo.getWind6()); 
  74.             // windTv3.setText(weatherinfo.getWind6()); 
  75.         }else
  76.             weather_imgIv1.setImageResource(R.drawable.na); 
  77.             weather_imgIv2.setImageResource(R.drawable.na); 
  78.             // weather_imgIv3.setImageResource(getWeatherIcon(weatherinfo 
  79.             // .getWeather6())); 
  80.             climateTv1.setText("N/A"); 
  81.             climateTv2.setText("N/A"); 
  82.   
  83.             temperatureTv1.setText("N/A"); 
  84.             temperatureTv2.setText("N/A"); 
  85.             // temperatureTv3.setText(weatherinfo.getTemp6()); 
  86.   
  87.             windTv1.setText("N/A"); 
  88.             windTv2.setText("N/A"); 
  89.         } 
  90.     } 
  91.   

下载地址:http://down.51cto.com/data/2104428

责任编辑:倪明 来源: devstore
相关推荐

2015-02-28 15:15:47

插件Android桌面插件

2013-08-23 17:06:09

墨迹天气Android 2.4

2013-09-27 16:26:25

墨迹天气

2015-02-06 18:29:09

仿滴滴打车android

2017-05-12 14:55:39

Android绘制刻度盘

2012-12-25 13:16:56

AndroidQQ2012UI

2015-10-23 13:36:22

2014-11-21 12:57:55

墨迹天气

2014-05-12 09:38:38

墨迹天气智能硬件空气检测

2015-01-22 14:12:40

Android源码APP启动引导

2015-09-01 16:37:21

360手机卫士高仿

2017-08-07 14:24:16

互联网

2017-07-06 15:26:48

互联网

2013-08-23 17:23:01

墨迹天气可口可乐

2015-09-01 16:48:44

ios暴风视频播放器

2016-03-14 10:29:38

天气预报各类工具源码

2015-03-30 14:24:06

网易布局

2015-01-22 15:44:55

Android源码音乐播放器
点赞
收藏

51CTO技术栈公众号