增加了车友列表拨打电话的功能
This commit is contained in:
@@ -9,12 +9,15 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.module.carchattingprovider.ICarsChattingProvider;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.api.CallChatApi;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
import com.mogo.module.common.entity.MarkerOnlineCar;
|
||||
import com.mogo.module.common.entity.MarkerUserInfo;
|
||||
import com.mogo.module.common.glide.SkinAbleBitmapTarget;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.R;
|
||||
@@ -23,8 +26,11 @@ import com.mogo.utils.ResourcesHelper;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
import com.mogo.utils.glide.GlideApp;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.carchattingprovider.CallChattingProviderConstant;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -60,6 +66,22 @@ class OnlineCarPanelAdapter extends RecyclerView.Adapter<OnlineCarPanelAdapter.V
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull OnlineCarPanelAdapter.VH holder, int position) {
|
||||
holder.bind(mDatums.get(position), mToLon, mToLat);
|
||||
holder.call.setOnClickListener(view -> {
|
||||
//TODO 拨打电话
|
||||
Map<String, String> params = new HashMap<>();
|
||||
MarkerUserInfo userInfo = mDatums.get(position).getUserInfo();
|
||||
params.put(CallChattingProviderConstant.CCPROVIDER_SN, userInfo.getSn());
|
||||
params.put(CallChattingProviderConstant.CCPROVIDER_USER_IMG, userInfo.getUserHead());
|
||||
params.put(CallChattingProviderConstant.CCPROVIDER_USER_AGE, userInfo.getAgeNumber() + "");
|
||||
params.put(CallChattingProviderConstant.CCPROVIDER_NICK_NAME, userInfo.getUserName());
|
||||
params.put(CallChattingProviderConstant.CCPROVIDER_USER_SEX, userInfo.getGender() + "");
|
||||
MarkerLocation location = mDatums.get(position).getLocation();
|
||||
params.put(CallChattingProviderConstant.CCPROVIDER_ADDRESS, location.getAddress());
|
||||
params.put(CallChattingProviderConstant.CCPROVIDER_LAT, location.getLat() + "");
|
||||
params.put(CallChattingProviderConstant.CCPROVIDER_LON, location.getLon() + "");
|
||||
ICarsChattingProvider carChatting = MarkerServiceHandler.getCarChatting();
|
||||
carChatting.call(params);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -101,20 +123,22 @@ class OnlineCarPanelAdapter extends RecyclerView.Adapter<OnlineCarPanelAdapter.V
|
||||
Logger.e(TAG, e, "detail.OnClick");
|
||||
}
|
||||
});
|
||||
call.setOnClickListener(view -> {
|
||||
//TODO 拨打电话
|
||||
});
|
||||
// call.setOnClickListener(view -> {
|
||||
// //TODO 拨打电话
|
||||
//
|
||||
//
|
||||
// });
|
||||
}
|
||||
|
||||
private String getDistanceStr( MarkerLocation location, double lon, double lat ) {
|
||||
if ( location == null ) {
|
||||
private String getDistanceStr(MarkerLocation location, double lon, double lat) {
|
||||
if (location == null) {
|
||||
return "未知";
|
||||
}
|
||||
float distance = Utils.calculateLineDistance( location.getLon(), location.getLat(), lon, lat );
|
||||
if ( distance >= 1000 ) {
|
||||
return String.format( "%.1f千米", distance / 1000 );
|
||||
float distance = Utils.calculateLineDistance(location.getLon(), location.getLat(), lon, lat);
|
||||
if (distance >= 1000) {
|
||||
return String.format("%.1f千米", distance / 1000);
|
||||
} else {
|
||||
return String.format( "%.1f米", distance );
|
||||
return String.format("%.1f米", distance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import android.util.Log;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.module.service.network.RefreshCallback;
|
||||
import com.mogo.module.service.network.bean.TtsConfigEntity;
|
||||
|
||||
/**
|
||||
* @author :zhuangyan
|
||||
|
||||
Reference in New Issue
Block a user