|
|
@@ -1,6 +1,7 @@
|
|
|
package com.modular.booking.adapter;
|
|
|
|
|
|
import android.content.Context;
|
|
|
+import android.content.Intent;
|
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
|
@@ -12,6 +13,8 @@ import android.widget.TextView;
|
|
|
|
|
|
import com.core.utils.helper.AvatarHelper;
|
|
|
import com.modular.booking.R;
|
|
|
+import com.modular.booking.activity.services.BServiceAddActivity;
|
|
|
+import com.modular.booking.model.SBListModel;
|
|
|
import com.modular.booking.model.SBStoremanModel;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
@@ -23,13 +26,14 @@ public class ItemBserviceStoremanListAdapter extends BaseAdapter {
|
|
|
|
|
|
private Context context;
|
|
|
private LayoutInflater layoutInflater;
|
|
|
+ private SBListModel model;
|
|
|
|
|
|
public ItemBserviceStoremanListAdapter(Context context, List<SBStoremanModel> objects) {
|
|
|
this.context = context;
|
|
|
this.layoutInflater = LayoutInflater.from(context);
|
|
|
this.objects = objects;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@Override
|
|
|
public int getCount() {
|
|
|
return objects.size();
|
|
|
@@ -45,6 +49,14 @@ public class ItemBserviceStoremanListAdapter extends BaseAdapter {
|
|
|
return position;
|
|
|
}
|
|
|
|
|
|
+ public SBListModel getModel() {
|
|
|
+ return model;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setModel(SBListModel model) {
|
|
|
+ this.model = model;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public View getView(int position, View convertView, ViewGroup parent) {
|
|
|
if (convertView == null) {
|
|
|
@@ -55,14 +67,21 @@ public class ItemBserviceStoremanListAdapter extends BaseAdapter {
|
|
|
return convertView;
|
|
|
}
|
|
|
|
|
|
- private void initializeViews(SBStoremanModel object, ViewHolder holder) {
|
|
|
+ private void initializeViews(final SBStoremanModel object, ViewHolder holder) {
|
|
|
holder.bserviceStoremanTitleTv.setText(object.getSm_username());
|
|
|
AvatarHelper.getInstance().display(object.getSm_userid(), holder.bserviceStoremanIv, true);
|
|
|
holder.model=object;
|
|
|
holder.bserviceStoremanOrderBtn.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
-
|
|
|
+ if (context!=null) {
|
|
|
+ SBStoremanModel bean =object;
|
|
|
+ Intent intent = new Intent(context, BServiceAddActivity.class);
|
|
|
+ intent.putExtra("model", model);
|
|
|
+ intent.putExtra("sb_userid", bean.getSm_userid());
|
|
|
+ intent.putExtra("sb_username", bean.getSm_username());
|
|
|
+ context.startActivity(intent);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
}
|