// Path: app/src/main/java/com/monsterlin/pigeon/bean/User.java
// public class User extends BmobUser {
//     //默认含有的字段为；username ， password , email , sessionToken , mobilePhoneNumber
// 
//     private String nick ; //昵称
//     private int age ; //用户年龄
//     private int type ; // 0 : 子女 & 1 ：父母
//     private Boolean isCreate ;  //创建家庭
//     private Boolean isJoin ;  //加入家庭
//     private Family family ;  //加入的家庭
//     private BmobFile userPhoto ; //用户头像
//     private String location ; // 地理位置
// 
//     public String getNick() {
//         return nick;
//     }
// 
//     public void setNick(String nick) {
//         this.nick = nick;
//     }
// 
//     public int getAge() {
//         return age;
//     }
// 
//     public void setAge(int age) {
//         this.age = age;
//     }
// 
//     public int getType() {
//         return type;
//     }
// 
//     public void setType(int type) {
//         this.type = type;
//     }
// 
//     public Boolean getIsCreate() {
//         return isCreate;
//     }
// 
//     public void setIsCreate(Boolean create) {
//         isCreate = create;
//     }
// 
//     public Boolean getIsJoin() {
//         return isJoin;
//     }
// 
//     public void setIsJoin(Boolean join) {
//         isJoin = join;
//     }
// 
//     public Family getFamily() {
//         return family;
//     }
// 
//     public void setFamily(Family family) {
//         this.family = family;
//     }
// 
//     public BmobFile getUserPhoto() {
//         return userPhoto;
//     }
// 
//     public void setUserPhoto(BmobFile userPhoto) {
//         this.userPhoto = userPhoto;
//     }
// 
//     public String getLocation() {
//         return location;
//     }
// 
//     public void setLocation(String location) {
//         this.location = location;
//     }
// }
// 
// Path: app/src/main/java/com/monsterlin/pigeon/utils/ToastUtils.java
// public class ToastUtils {
// 
//     private static View toastRoot;
//     private static TextView tv;
//     private static Toast mToast;
//     private static int DURATION = Toast.LENGTH_SHORT;
// 
//     public static void showToast(Context context, CharSequence text) {
//         toastRoot = LayoutInflater.from(context).inflate(R.layout.custom_toast, null);
//         mToast = new Toast(context);
//         tv = (TextView) toastRoot.findViewById(R.id.tv_toast_tips);
//         mToast.setView(toastRoot);
//         tv.setText(text);
//         mToast.setDuration(DURATION);
//         mToast.show();
//     }
// 
// }
// 
// Path: app/src/main/java/com/monsterlin/pigeon/vholder/WeatherNumberVHolder.java
// public class WeatherNumberVHolder extends RecyclerView.ViewHolder {
//     public TextView mTvNick,mTvWeather;
//     public CircleImageView mCivUserPhoto ;
//     public ImageView mCivSms ;
// 
//     public WeatherNumberVHolder(View itemView) {
//         super(itemView);
//         mCivUserPhoto = (CircleImageView) itemView.findViewById(R.id.weather_number_iv_icon);
//         mTvNick = (TextView) itemView.findViewById(R.id.weather_number_tv_nick);
//         mTvWeather = (TextView) itemView.findViewById(R.id.weather_number_tv_weather);
//         mCivSms = (ImageView) itemView.findViewById(R.id.weather_number_iv_sms);
//     }
// }


import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.support.v7.widget.RecyclerView;
import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.amap.api.services.weather.LocalWeatherForecastResult;
import com.amap.api.services.weather.LocalWeatherLive;
import com.amap.api.services.weather.LocalWeatherLiveResult;
import com.amap.api.services.weather.WeatherSearch;
import com.amap.api.services.weather.WeatherSearchQuery;
import com.monsterlin.pigeon.R;
import com.monsterlin.pigeon.bean.User;
import com.monsterlin.pigeon.utils.ToastUtils;
import com.monsterlin.pigeon.vholder.WeatherNumberVHolder;
import com.squareup.picasso.Picasso;
import java.util.List;
import cn.bmob.v3.datatype.BmobFile;
        String nick = userList.get(position).getNick();
        if (!TextUtils.isEmpty(nick)) {
            holder.mTvNick.setText(nick);
        }

        holder.mCivSms.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                doSendSMSTo(userList.get(position).getMobilePhoneNumber());
            }
        });

        String location = userList.get(position).getLocation();

        if (!TextUtils.isEmpty(location)) {

            WeatherSearchQuery mquery = new WeatherSearchQuery(location, WeatherSearchQuery.WEATHER_TYPE_LIVE);
            WeatherSearch mweathersearch = new WeatherSearch(mContext);
            mweathersearch.setOnWeatherSearchListener(new WeatherSearch.OnWeatherSearchListener() {
                @Override
                public void onWeatherLiveSearched(LocalWeatherLiveResult localWeatherLiveResult, int rCode) {
                    if (rCode == 1000) {

                        if (localWeatherLiveResult.getLiveResult() != null) {
                            LocalWeatherLive weatherlive = localWeatherLiveResult.getLiveResult();
                            holder.mTvWeather.setText(weatherlive.getWeather());
                        } else {
                            holder.mTvWeather.setText("--");
                        }
                    } else {
// Path: app/src/main/java/com/monsterlin/pigeon/bean/User.java
// public class User extends BmobUser {
//     //默认含有的字段为；username ， password , email , sessionToken , mobilePhoneNumber
// 
//     private String nick ; //昵称
//     private int age ; //用户年龄
//     private int type ; // 0 : 子女 & 1 ：父母
//     private Boolean isCreate ;  //创建家庭
//     private Boolean isJoin ;  //加入家庭
//     private Family family ;  //加入的家庭
//     private BmobFile userPhoto ; //用户头像
//     private String location ; // 地理位置
// 
//     public String getNick() {
//         return nick;
//     }
// 
//     public void setNick(String nick) {
//         this.nick = nick;
//     }
// 
//     public int getAge() {
//         return age;
//     }
// 
//     public void setAge(int age) {
//         this.age = age;
//     }
// 
//     public int getType() {
//         return type;
//     }
// 
//     public void setType(int type) {
//         this.type = type;
//     }
// 
//     public Boolean getIsCreate() {
//         return isCreate;
//     }
// 
//     public void setIsCreate(Boolean create) {
//         isCreate = create;
//     }
// 
//     public Boolean getIsJoin() {
//         return isJoin;
//     }
// 
//     public void setIsJoin(Boolean join) {
//         isJoin = join;
//     }
// 
//     public Family getFamily() {
//         return family;
//     }
// 
//     public void setFamily(Family family) {
//         this.family = family;
//     }
// 
//     public BmobFile getUserPhoto() {
//         return userPhoto;
//     }
// 
//     public void setUserPhoto(BmobFile userPhoto) {
//         this.userPhoto = userPhoto;
//     }
// 
//     public String getLocation() {
//         return location;
//     }
// 
//     public void setLocation(String location) {
//         this.location = location;
//     }
// }
// 
// Path: app/src/main/java/com/monsterlin/pigeon/utils/ToastUtils.java
// public class ToastUtils {
// 
//     private static View toastRoot;
//     private static TextView tv;
//     private static Toast mToast;
//     private static int DURATION = Toast.LENGTH_SHORT;
// 
//     public static void showToast(Context context, CharSequence text) {
//         toastRoot = LayoutInflater.from(context).inflate(R.layout.custom_toast, null);
//         mToast = new Toast(context);
//         tv = (TextView) toastRoot.findViewById(R.id.tv_toast_tips);
//         mToast.setView(toastRoot);
//         tv.setText(text);
//         mToast.setDuration(DURATION);
//         mToast.show();
//     }
// 
// }
// 
// Path: app/src/main/java/com/monsterlin/pigeon/vholder/WeatherNumberVHolder.java
// public class WeatherNumberVHolder extends RecyclerView.ViewHolder {
//     public TextView mTvNick,mTvWeather;
//     public CircleImageView mCivUserPhoto ;
//     public ImageView mCivSms ;
// 
//     public WeatherNumberVHolder(View itemView) {
//         super(itemView);
//         mCivUserPhoto = (CircleImageView) itemView.findViewById(R.id.weather_number_iv_icon);
//         mTvNick = (TextView) itemView.findViewById(R.id.weather_number_tv_nick);
//         mTvWeather = (TextView) itemView.findViewById(R.id.weather_number_tv_weather);
//         mCivSms = (ImageView) itemView.findViewById(R.id.weather_number_iv_sms);
//     }
// }


// Path: app/src/main/java/com/monsterlin/pigeon/adapter/WeatherNumberAdapter.java
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.support.v7.widget.RecyclerView;
import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.amap.api.services.weather.LocalWeatherForecastResult;
import com.amap.api.services.weather.LocalWeatherLive;
import com.amap.api.services.weather.LocalWeatherLiveResult;
import com.amap.api.services.weather.WeatherSearch;
import com.amap.api.services.weather.WeatherSearchQuery;
import com.monsterlin.pigeon.R;
import com.monsterlin.pigeon.bean.User;
import com.monsterlin.pigeon.utils.ToastUtils;
import com.monsterlin.pigeon.vholder.WeatherNumberVHolder;
import com.squareup.picasso.Picasso;
import java.util.List;
import cn.bmob.v3.datatype.BmobFile;

        String nick = userList.get(position).getNick();
        if (!TextUtils.isEmpty(nick)) {
            holder.mTvNick.setText(nick);
        }

        holder.mCivSms.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                doSendSMSTo(userList.get(position).getMobilePhoneNumber());
            }
        });

        String location = userList.get(position).getLocation();

        if (!TextUtils.isEmpty(location)) {

            WeatherSearchQuery mquery = new WeatherSearchQuery(location, WeatherSearchQuery.WEATHER_TYPE_LIVE);
            WeatherSearch mweathersearch = new WeatherSearch(mContext);
            mweathersearch.setOnWeatherSearchListener(new WeatherSearch.OnWeatherSearchListener() {
                @Override
                public void onWeatherLiveSearched(LocalWeatherLiveResult localWeatherLiveResult, int rCode) {
                    if (rCode == 1000) {

                        if (localWeatherLiveResult.getLiveResult() != null) {
                            LocalWeatherLive weatherlive = localWeatherLiveResult.getLiveResult();
                            holder.mTvWeather.setText(weatherlive.getWeather());
                        } else {
                            holder.mTvWeather.setText("--");
                        }
                    } else {
                        ToastUtils.showToast(mContext, "查询天气异常：" + rCode);