package org.mian.gitnex.activities; import android.annotation.SuppressLint; import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.os.Handler; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.widget.ArrayAdapter; import android.widget.TextView; import androidx.activity.result.ActivityResultLauncher; import androidx.activity.result.contract.ActivityResultContracts; import androidx.annotation.NonNull; import androidx.recyclerview.widget.LinearLayoutManager; import com.google.android.material.bottomsheet.BottomSheetDialog; import com.google.android.material.datepicker.MaterialDatePicker; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.vdurmont.emoji.EmojiParser; import java.io.File; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.LinkedHashMap; import java.util.List; import java.util.Locale; import java.util.Objects; import java.util.TimeZone; import okhttp3.MediaType; import okhttp3.RequestBody; import org.gitnex.tea4j.v2.models.Attachment; import org.gitnex.tea4j.v2.models.CreateIssueOption; import org.gitnex.tea4j.v2.models.Issue; import org.gitnex.tea4j.v2.models.Label; import org.gitnex.tea4j.v2.models.Milestone; import org.gitnex.tea4j.v2.models.User; import org.mian.gitnex.R; import org.mian.gitnex.actions.AssigneesActions; import org.mian.gitnex.actions.LabelsActions; import org.mian.gitnex.adapters.AssigneesListAdapter; import org.mian.gitnex.adapters.AttachmentsAdapter; import org.mian.gitnex.adapters.LabelsListAdapter; import org.mian.gitnex.clients.RetrofitClient; import org.mian.gitnex.databinding.ActivityCreateIssueBinding; import org.mian.gitnex.databinding.BottomSheetAttachmentsBinding; import org.mian.gitnex.databinding.CustomAssigneesSelectionDialogBinding; import org.mian.gitnex.databinding.CustomLabelsSelectionDialogBinding; import org.mian.gitnex.fragments.IssuesFragment; import org.mian.gitnex.helpers.AlertDialogs; import org.mian.gitnex.helpers.AppDatabaseSettings; import org.mian.gitnex.helpers.Constants; import org.mian.gitnex.helpers.Markdown; import org.mian.gitnex.helpers.SnackBar; import org.mian.gitnex.helpers.attachments.AttachmentUtils; import org.mian.gitnex.helpers.attachments.AttachmentsModel; import org.mian.gitnex.helpers.contexts.RepositoryContext; import retrofit2.Call; import retrofit2.Callback; /** * @author M M Arif */ public class CreateIssueActivity extends BaseActivity implements LabelsListAdapter.LabelsListAdapterListener, AssigneesListAdapter.AssigneesListAdapterListener, AttachmentsAdapter.AttachmentsReceiverListener { private final List