| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590 |
- package com.cygnusa.hyperm;
- import android.annotation.SuppressLint;
- import android.app.Dialog;
- import android.content.Intent;
- import android.graphics.Color;
- import android.graphics.PorterDuff;
- import android.graphics.Typeface;
- import android.graphics.drawable.Drawable;
- import android.os.Bundle;
- import android.util.Log;
- import android.view.LayoutInflater;
- import android.view.MenuItem;
- import android.view.View;
- import android.view.ViewGroup;
- import android.view.Window;
- import android.widget.Button;
- import android.widget.ImageView;
- import android.widget.LinearLayout;
- import android.widget.TextView;
- import android.widget.Toast;
- import androidx.annotation.NonNull;
- import androidx.appcompat.app.AppCompatActivity;
- import androidx.appcompat.widget.Toolbar;
- import androidx.recyclerview.widget.LinearLayoutManager;
- import androidx.recyclerview.widget.RecyclerView;
- import com.bumptech.glide.Glide;
- import com.bumptech.glide.load.engine.DiskCacheStrategy;
- import com.bumptech.glide.request.RequestOptions;
- import com.github.siyamed.shapeimageview.CircularImageView;
- import com.google.gson.Gson;
- import com.google.gson.JsonElement;
- import com.google.gson.reflect.TypeToken;
- import com.cygnusa.hyperm.tooltip.Tooltip;
- import com.cygnusa.hyperm.util.ApiService;
- import com.cygnusa.hyperm.util.GlobalData;
- import com.cygnusa.hyperm.util.MainApplication;
- import com.cygnusa.hyperm.util.UtilService;
- import com.cygnusa.hyperm.wrappers.CommonResponse;
- import com.cygnusa.hyperm.wrappers.ErrorResponse;
- import com.cygnusa.hyperm.wrappers.GetCancelOrRescheduleList;
- import com.cygnusa.hyperm.wrappers.Reasons;
- import net.danlew.android.joda.JodaTimeAndroid;
- import org.joda.time.LocalDate;
- import org.json.JSONArray;
- import org.json.JSONException;
- import org.json.JSONObject;
- import java.text.ParseException;
- import java.text.SimpleDateFormat;
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Locale;
- import java.util.Objects;
- import jp.wasabeef.recyclerview.animators.SlideInLeftAnimator;
- import retrofit2.Call;
- import retrofit2.Callback;
- import retrofit2.Response;
- public class ViewScheduleActivity extends AppCompatActivity {
- ParticipantListAdapter dateAdapter;
- List<String> eTime = new ArrayList<>();
- List<String> sTime = new ArrayList<>();
- private TextView txtDate, txtLocation;
- private TextView txtTrainingStartDate, txtTrainingEndDate, txtTrainingName, txtTrainingUID;
- private TextView txtDescription, txtTotalParticipant, txtSubmissionDays;
- private ApiService restService;
- private List<Reasons> REASONS = new ArrayList<>();
- private String[] reasonName = {"None"};
- private String[] reasonId = {"None"};
- private String reasonIdString = "";
- private Button btnPublish, btnCancel, btnList, btnModify;
- private List<Integer> PARTICIPANTIDS = new ArrayList<>();
- private LinearLayout layoutBtn, layoutDate, lloutModify;
- private String id1;
- private String id2;
- private ImageView imgSchedule;
- @SuppressLint("SetTextI18n")
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- JodaTimeAndroid.init(this);
- setContentView(R.layout.activity_view_training_schedule);
- Toolbar toolbar = findViewById(R.id.toolbar);
- setSupportActionBar(toolbar);
- toolbar.setContentInsetStartWithNavigation(0);
- toolbar.setTitle("");
- Objects.requireNonNull(getSupportActionBar()).setTitle("");
- getSupportActionBar().setDisplayHomeAsUpEnabled(true);
- getSupportActionBar().setDisplayShowHomeEnabled(true);
- @SuppressLint("PrivateResource")
- Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
- backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
- getSupportActionBar().setHomeAsUpIndicator(backArrow);
- restService = ((MainApplication) getApplication()).getClient();
- txtDate = findViewById(R.id.txtDate);
- txtLocation = findViewById(R.id.txtLocation);
- txtTrainingStartDate = findViewById(R.id.txtTrainingStartDate);
- txtTrainingEndDate = findViewById(R.id.txtTrainingEndDate);
- txtTrainingName = findViewById(R.id.txtTrainingName);
- txtDescription = findViewById(R.id.txtDescription);
- txtTotalParticipant = findViewById(R.id.txtTotalParticipant);
- txtSubmissionDays = findViewById(R.id.txtSubmissionDays);
- txtTrainingUID = findViewById(R.id.txtTrainingUID);
- btnPublish = findViewById(R.id.btnPublish);
- btnCancel = findViewById(R.id.btnCancel);
- btnModify = findViewById(R.id.btnModify);
- btnList = findViewById(R.id.btnList);
- lloutModify = findViewById(R.id.lloutModify);
- imgSchedule = findViewById(R.id.imgSchedule);
- if (GlobalData.scheduledDataList.get(0).isTraining_update_status() && GlobalData.scheduledDataList.get(0).getIsActiveHours().equalsIgnoreCase("1"))
- lloutModify.setVisibility(View.VISIBLE);
- else
- lloutModify.setVisibility(View.GONE);
- layoutBtn = findViewById(R.id.layoutBtn);
- layoutDate = findViewById(R.id.layoutDate);
- if (GlobalData.scheduledDataList.get(0).getStatus().equalsIgnoreCase("1")) {
- layoutBtn.setVisibility(View.GONE);
- }
- if (GlobalData.scheduledDataList.get(0).getIsDeleted().equalsIgnoreCase("1")) {
- btnPublish.setVisibility(View.GONE);
- btnCancel.setText("Training Cancelled");
- btnCancel.setBackground(getResources().getDrawable(R.drawable.border_full_red));
- btnCancel.setEnabled(false);
- imgSchedule.setVisibility(View.GONE);
- lloutModify.setVisibility(View.GONE);
- layoutBtn.setVisibility(View.VISIBLE);
- btnModify.setVisibility(View.GONE);
- }
- btnList.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- if ((GlobalData.scheduledDataList.get(0).getParticipant() != null) && GlobalData.scheduledDataList.get(0).getParticipant().size() > 0)
- openPopup();
- else
- GlobalData.toast(ViewScheduleActivity.this, "No Participant List Available");
- }
- });
- imgSchedule.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- if ((GlobalData.scheduledDataList.get(0).getParticipant() != null) && GlobalData.scheduledDataList.get(0).getParticipant().size() > 0)
- openPopup();
- else
- GlobalData.toast(ViewScheduleActivity.this, "No Participant List Available");
- }
- });
- btnCancel.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- onBackPressed();
- }
- });
- btnPublish.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- try {
- sendAllTrainingDatasToServer("1");
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
- });
- if (GlobalData.scheduledDataList != null && GlobalData.scheduledDataList.size() > 0) {
- txtDate.setText(GlobalData.scheduledDataList.get(0).getTitle());
- String startDate = GlobalData.scheduledDataList.get(0).getStartDate();
- String endDate = GlobalData.scheduledDataList.get(0).getEndDate();
- SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
- String startDateString = "", endDateString = "";
- try {
- startDateString = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(Objects.requireNonNull(format.parse(startDate)));
- endDateString = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(Objects.requireNonNull(format.parse(endDate)));
- } catch (ParseException e) {
- e.printStackTrace();
- }
- String s = GlobalData.scheduledDataList.get(0).getStartdate();
- String e = GlobalData.scheduledDataList.get(0).getEnddate();
- LocalDate start = LocalDate.parse(s);
- LocalDate end = LocalDate.parse(e);
- List<LocalDate> totalDates = new ArrayList<>();
- while (!start.isAfter(end)) {
- totalDates.add(start);
- start = start.plusDays(1);
- }
- String startTime = GlobalData.scheduledDataList.get(0).getStarttime();
- String endTime = GlobalData.scheduledDataList.get(0).getEndtime();
- try {
- JSONArray arrayFromTime = new JSONArray(startTime);
- for (int i = 0; i < arrayFromTime.length(); i++) {
- id1 = (String) arrayFromTime.get(i);
- sTime.add(id1);
- }
- JSONArray arrayToTime = new JSONArray(endTime);
- for (int i = 0; i < arrayToTime.length(); i++) {
- id2 = (String) arrayToTime.get(i);
- eTime.add(id2);
- }
- } catch (JSONException e1) {
- sTime.add(startTime);
- eTime.add(endTime);
- e1.printStackTrace();
- }
- int trainingDays = Integer.parseInt(GlobalData.scheduledDataList.get(0).getTrainingDays());
- for (int i = 0; i < trainingDays; i++) {
- TextView txtDays = new TextView(this);
- txtDays.setTextSize(15);
- txtDays.setTextColor(Color.parseColor("#00344C"));
- txtDays.setPadding(0, 0, 0, 0);
- if (sTime.size() - 1 >= i && eTime.size() - 1 >= i)
- txtDays.setText("Day " + (i + 1) + " : " + totalDates.get(i) + " " + sTime.get(i) + " - " + eTime.get(i));
- txtDays.setTypeface(Typeface.DEFAULT_BOLD);
- layoutDate.addView(txtDays);
- }
- txtLocation.setText(GlobalData.scheduledDataList.get(0).getVenueAddress());
- txtTrainingStartDate.setText(startDateString);
- txtTrainingEndDate.setText(endDateString);
- txtDescription.setText(GlobalData.scheduledDataList.get(0).getScheduleName());
- txtTrainingName.setText(GlobalData.scheduledDataList.get(0).getTitle());
- if (GlobalData.scheduledDataList.get(0).getParticipant() != null && GlobalData.scheduledDataList.get(0).getParticipant().size() > 0)
- txtTotalParticipant.setText(String.valueOf(GlobalData.scheduledDataList.get(0).getParticipant().size()));
- txtSubmissionDays.setText(String.valueOf(GlobalData.scheduledDataList.get(0).getTrainingDays()));
- txtTrainingUID.setText("TRAINING UID : " + "");
- }
- getReasons();
- // getScheduledList();
- LinearLayout lloutEdit = findViewById(R.id.lloutEdit);
- txtTrainingUID.setText("TRAINING UID : " + GlobalData.scheduledDataList.get(0).
- getTraining_id());
- if (GlobalData.user.getData().
- getRole().
- equalsIgnoreCase("5")) {
- lloutEdit.setVisibility(View.VISIBLE);
- } else {
- lloutEdit.setVisibility(View.GONE);
- }
- lloutModify.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- startActivity(new Intent(ViewScheduleActivity.this, ModifyClassRoomActivity.class));
- finish();
- }
- });
- btnModify.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- startActivity(new Intent(ViewScheduleActivity.this, ModifyClassRoomActivity.class));
- finish();
- }
- });
- }
- public void openPopup() {
- final Dialog aDialog = new Dialog(this);
- aDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
- aDialog.setContentView(R.layout.particiapnt_popup);
- aDialog.setCancelable(true);
- aDialog.show();
- TextView textTrainer = aDialog.findViewById(R.id.txtTrainer);
- textTrainer.setText(GlobalData.scheduledDataList.get(0).getOrganizerName());
- ImageView imgTrainer = aDialog.findViewById(R.id.imgTrainer);
- ImageView close = aDialog.findViewById(R.id.closeButton);
- close.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- aDialog.dismiss();
- }
- });
- if (GlobalData.scheduledDataList.get(0).getTrainingGroupImage() != null || !GlobalData.scheduledDataList.get(0).getTrainingGroupImage().isEmpty()) {
- Glide.with(ViewScheduleActivity.this).load(GlobalData.scheduledDataList.get(0).getTrainingGroupImage())
- .thumbnail(Glide.with(ViewScheduleActivity.this).load(R.drawable.gif_loader))
- .apply(new RequestOptions().fitCenter().diskCacheStrategy(DiskCacheStrategy.ALL)
- .placeholder(R.drawable.placeholder)).into(imgTrainer);
- } else {
- Glide.with(ViewScheduleActivity.this).load(R.drawable.placeholder)
- .thumbnail(Glide.with(ViewScheduleActivity.this).load(R.drawable.gif_loader))
- .apply(new RequestOptions().fitCenter().diskCacheStrategy(DiskCacheStrategy.ALL)
- .placeholder(R.drawable.placeholder)).into(imgTrainer);
- }
- RecyclerView rcvParticipant = aDialog.findViewById(R.id.rcvParticipant);
- rcvParticipant.setHasFixedSize(true);
- rcvParticipant.setItemAnimator(new SlideInLeftAnimator());
- LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getBaseContext());
- rcvParticipant.setLayoutManager(linearLayoutManager);
- dateAdapter = new ParticipantListAdapter();
- rcvParticipant.setAdapter(dateAdapter);
- }
- private void getReasons() {
- if (new UtilService().isNetworkAvailable(Objects.requireNonNull(ViewScheduleActivity.this))) {
- try {
- restService.getCancelOrReschedule().enqueue(new Callback<GetCancelOrRescheduleList>() {
- @Override
- public void onResponse(Call<GetCancelOrRescheduleList> call, Response<GetCancelOrRescheduleList> response) {
- if (response.body() != null && response.body().getStatus() == 200) {
- if (response.body().getReasonsList() != null && response.body().getReasonsList().size() > 0) {
- REASONS = response.body().getReasonsList();
- reasonName = new String[REASONS.size()];
- reasonId = new String[REASONS.size()];
- for (int i = 0; i < response.body().getReasonsList().size(); i++) {
- reasonName[i] = REASONS.get(i).getName();
- reasonId[i] = REASONS.get(i).getId();
- }
- }
- } else if (response.body() != null && response.body().getStatus() == 401) {
- GlobalData.canLogout = true;
- finish();
- } else if (response.body() != null) {
- GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
- } else if (response.errorBody() != null) {
- Gson gson = new Gson();
- ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
- GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
- if (message.getStatus() == 401) {
- GlobalData.canLogout = true;
- finish();
- }
- }
- }
- @Override
- public void onFailure(Call<GetCancelOrRescheduleList> call, Throwable t) {
- }
- });
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
- private void sendAllTrainingDatasToServer(String s) throws JSONException {
- JSONObject assessment = new JSONObject();
- try {
- for (int j = 0; j < GlobalData.scheduledDataList.get(0).getAssessment().size(); j++) {
- assessment.put("name", GlobalData.scheduledDataList.get(0).getAssessment().get(j).getAssessmentname());
- assessment.put("ques_count", GlobalData.scheduledDataList.get(0).getAssessment().get(j).getTotalQuestion());
- assessment.put("duration", GlobalData.scheduledDataList.get(0).getAssessment().get(j).getAssessmenttime());
- assessment.put("assessment", GlobalData.scheduledDataList.get(0).getAssessment().get(j).getAssessmenttype());
- }
- } catch (JSONException e) {
- e.printStackTrace();
- }
- JSONArray jsonArray = new JSONArray();
- jsonArray.put(assessment);
- JSONObject assessmentObj = new JSONObject();
- assessmentObj.put("assessments", jsonArray);
- Gson gson = new Gson();
- JsonElement dseJsonElement = null;
- for (int i = 0; i < GlobalData.scheduledDataList.get(0).getParticipant().size(); i++) {
- PARTICIPANTIDS.add(Integer.valueOf(GlobalData.scheduledDataList.get(0).getParticipant().get(i).getUserid()));
- }
- dseJsonElement = gson.toJsonTree(
- PARTICIPANTIDS, new TypeToken<ArrayList<String>>() {
- }.getType());
- HashMap<String, String> map = new HashMap<>();
- map.put("title", GlobalData.scheduledDataList.get(0).getLvlId());
- map.put("description", GlobalData.scheduledDataList.get(0).getScheduleName());
- map.put("startdate", GlobalData.scheduledDataList.get(0).getStartdate());
- map.put("enddate", GlobalData.scheduledDataList.get(0).getEnddate());
- map.put("starttime", GlobalData.scheduledDataList.get(0).getStarttime());
- map.put("endtime", GlobalData.scheduledDataList.get(0).getEndtime());
- map.put("venue_am", GlobalData.scheduledDataList.get(0).getVenueAm());
- map.put("schedule_id", GlobalData.scheduledDataList.get(0).getScheduleId());
- map.put("is_feedback", GlobalData.scheduledDataList.get(0).getIsFeedback());
- map.put("venue_type", GlobalData.scheduledDataList.get(0).getVenueType());
- map.put("venue_address", GlobalData.scheduledDataList.get(0).getVenueAddress());
- map.put("venue_dealer", GlobalData.scheduledDataList.get(0).getVenueDealer());
- map.put("assessments", jsonArray.toString());
- map.put("dse", dseJsonElement.toString());
- map.put("adhoc_training", GlobalData.scheduledDataList.get(0).getAdhocTraining());
- map.put("business_segment", GlobalData.scheduledDataList.get(0).getBusinessSegment());
- map.put("training_other_title", GlobalData.scheduledDataList.get(0).getTrainingOtherTitle());
- map.put("date_restriction", GlobalData.scheduledDataList.get(0).getDateRestriction());
- map.put("status", s);
- Log.e("MapValue", map.toString());
- restService.sendAllUpdateTrainingToServer(map).enqueue(new Callback<CommonResponse>() {
- @Override
- public void onResponse(Call<CommonResponse> call, Response<CommonResponse> response) {
- if (response.body() != null) {
- if (response.body().getResponse().equalsIgnoreCase("Success")) {
- GlobalData.toast(ViewScheduleActivity.this, "Published Successfully");
- startActivity(new Intent(ViewScheduleActivity.this, ClassRoomTrainerTainingActivity.class));
- finish();
- } else {
- GlobalData.toast(ViewScheduleActivity.this, response.body().getResponseText());
- }
- } else if (response.body() != null && response.body().getStatus() == 401) {
- GlobalData.canLogout = true;
- finish();
- } else if (response.errorBody() != null) {
- Gson gson = new Gson();
- ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
- GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
- if (message.getStatus() == 401) {
- GlobalData.canLogout = true;
- finish();
- }
- }
- }
- @Override
- public void onFailure(Call<CommonResponse> call, Throwable t) {
- }
- });
- }
- @Override
- public void onBackPressed() {
- super.onBackPressed();
- startActivity(new Intent(ViewScheduleActivity.this, ClassRoomTrainerTainingActivity.class));
- finish();
- this.overridePendingTransition(R.anim.animation_f_enter,
- R.anim.animation_f_leave);
- }
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- if (item.getItemId() == android.R.id.home) {
- finish();
- onBackPressed();
- }
- return super.onOptionsItemSelected(item);
- }
- private static class ParticipantViewHolder extends RecyclerView.ViewHolder {
- TextView txtName, txtStatus;
- CircularImageView imgPic;
- ImageView info;
- public ParticipantViewHolder(@NonNull View itemView) {
- super(itemView);
- txtName = itemView.findViewById(R.id.txt_Name);
- txtStatus = itemView.findViewById(R.id.txtStatus);
- imgPic = itemView.findViewById(R.id.imgPic);
- info = itemView.findViewById(R.id.info);
- }
- }
- private class ParticipantListAdapter extends RecyclerView.Adapter<ParticipantViewHolder> {
- @NonNull
- @Override
- public ParticipantViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
- View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.participant_view_holder, parent, false);
- return new ParticipantViewHolder(v);
- }
- @Override
- public void onBindViewHolder(@NonNull ParticipantViewHolder holder, int position) {
- if (GlobalData.scheduledDataList.get(0).getParticipant().get(position).getName() == null || GlobalData.scheduledDataList.get(0).getParticipant().get(position).getName().isEmpty()) {
- holder.txtName.setText("No Name");
- } else {
- holder.txtName.setText(GlobalData.scheduledDataList.get(0).getParticipant().get(position).getSmpin() + " " +
- GlobalData.scheduledDataList.get(0).getParticipant().get(position).getName());
- }
- if (GlobalData.scheduledDataList.get(0).getParticipant().get(position).getStatus().equalsIgnoreCase("0")) {
- holder.txtStatus.setText("Waiting for response");
- holder.txtStatus.setTextColor(Color.parseColor("#808080"));
- } else if (GlobalData.scheduledDataList.get(0).getParticipant().get(position).getStatus().equalsIgnoreCase("1")) {
- holder.txtStatus.setText("Acknowledged");
- holder.txtStatus.setTextColor(Color.parseColor("#348E00"));
- } else if (GlobalData.scheduledDataList.get(0).getParticipant().get(position).getStatus().equalsIgnoreCase("2")) {
- holder.txtStatus.setText("Declined");
- holder.info.setVisibility(View.VISIBLE);
- holder.txtStatus.setTextColor(Color.parseColor("#F90303"));
- }
- holder.info.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- String header = GlobalData.scheduledDataList.get(0).getParticipant().get(position).getDeclineReasonName() + "/" + GlobalData.scheduledDataList.get(0).getParticipant().get(position).getDeclineReasonDesc();
- View mView = LayoutInflater.from(ViewScheduleActivity.this).inflate(R.layout.tooltip_layout, null);
- TextView text = mView.findViewById(R.id.text11);
- TextView txtReasonTitle = mView.findViewById(R.id.txtReasonTitle);
- txtReasonTitle.setText(GlobalData.scheduledDataList.get(0).getParticipant().get(position).getDeclineReasonName());
- text.setText(header);
- Tooltip.TooltipView tooltip = Tooltip.make(ViewScheduleActivity.this,
- new Tooltip.Builder(101)
- .anchor(view, Tooltip.Gravity.TOP)
- .closePolicy(new Tooltip.ClosePolicy()
- .insidePolicy(true, false)
- .outsidePolicy(true, false), 0)
- .activateDelay(300)
- .withStyleId(R.style.ToolTipLayoutCustomStyle)
- .showDelay(300)
- .text("")
- .setBgColor(getResources().getColor(R.color.bg_color))
- .view(mView)
- .maxWidth(300)
- .withArrow(true)
- .build()
- );
- tooltip.setTextColor(Color.WHITE);
- tooltip.show();
- }
- });
- if (GlobalData.scheduledDataList.get(0).getParticipant().get(position).getProfilePhoto() != null || !GlobalData.scheduledDataList.get(0).getParticipant().get(position).getProfilePhoto().isEmpty()) {
- Glide.with(ViewScheduleActivity.this).load(GlobalData.scheduledDataList.get(0).getParticipant().get(position).getProfilePhoto())
- .thumbnail(Glide.with(ViewScheduleActivity.this).load(R.drawable.gif_loader))
- .apply(new RequestOptions().fitCenter().diskCacheStrategy(DiskCacheStrategy.ALL)
- .placeholder(R.drawable.placeholder)).into(holder.imgPic);
- } else {
- Glide.with(ViewScheduleActivity.this).load(R.drawable.placeholder)
- .thumbnail(Glide.with(ViewScheduleActivity.this).load(R.drawable.gif_loader))
- .apply(new RequestOptions().fitCenter().diskCacheStrategy(DiskCacheStrategy.ALL)
- .placeholder(R.drawable.placeholder)).into(holder.imgPic);
- }
- }
- @Override
- public int getItemCount() {
- return GlobalData.scheduledDataList.get(0).getParticipant().size();
- }
- }
- }
|