Auto stash before checking out "origin/version/4.1"

Remove ability to click links when editing notes
Fix issue with Discard dialog showing when not making any changes
Fix checklist item text not showing
Remove zeroWidthSpace addition during discard task check (As links won't show when editing tasks anymore)
This commit is contained in:
Hafiz 2023-01-11 19:46:05 -05:00
parent eb31227e30
commit 8e682d2171
3 changed files with 7 additions and 10 deletions

View file

@ -5,7 +5,6 @@ import android.os.Parcelable
import android.text.Spanned
import com.google.gson.annotations.SerializedName
import com.habitrpg.android.habitica.R
import com.habitrpg.android.habitica.extensions.removeZeroWidthSpace
import com.habitrpg.android.habitica.helpers.ExceptionHandler
import com.habitrpg.android.habitica.models.BaseMainObject
import com.habitrpg.android.habitica.models.Tag
@ -396,7 +395,7 @@ open class Task : RealmObject, BaseMainObject, Parcelable, BaseTask {
when {
text != task.text -> return true
notes != task.notes?.removeZeroWidthSpace() -> return true
notes != task.notes -> return true
reminders?.size != task.reminders?.size -> return true
checklist?.size != task.checklist?.size -> return true
reminders?.mapIndexed { index, remindersItem -> task.reminders?.get(index) != remindersItem }?.contains(true) == true -> return true

View file

@ -40,8 +40,6 @@ import com.habitrpg.android.habitica.data.TaskRepository
import com.habitrpg.android.habitica.databinding.ActivityTaskFormBinding
import com.habitrpg.android.habitica.extensions.OnChangeTextWatcher
import com.habitrpg.android.habitica.extensions.addCancelButton
import com.habitrpg.android.habitica.extensions.addZeroWidthSpace
import com.habitrpg.android.habitica.extensions.removeZeroWidthSpace
import com.habitrpg.android.habitica.helpers.ExceptionHandler
import com.habitrpg.android.habitica.helpers.TaskAlarmManager
import com.habitrpg.android.habitica.helpers.launchCatching
@ -214,7 +212,6 @@ class TaskFormActivity : BaseActivity() {
binding.notesEditText.onFocusChangeListener = View.OnFocusChangeListener { _, isFocused ->
binding.notesInputLayout.alpha = if (isFocused) 0.8f else 0.6f
}
binding.notesEditText.movementMethod = LinkMovementMethod.getInstance()
binding.scrollView.setOnTouchListener { view, event ->
userScrolled =
view == binding.scrollView && (event.action == MotionEvent.ACTION_SCROLL || event.action == MotionEvent.ACTION_MOVE)
@ -403,9 +400,9 @@ class TaskFormActivity : BaseActivity() {
menu.findItem(R.id.action_save).isEnabled = canSave
if (forcedTheme == "taskform" || forcedTheme == "maroon") {
menu.iterator().forEach {
val spannable = SpannableString(it.title)
spannable.setSpan(ForegroundColorSpan(Color.WHITE), 0, spannable.length, 0)
it.title = spannable
// val spannable = SpannableString(it.title)
// spannable.setSpan(ForegroundColorSpan(Color.WHITE), 0, spannable.length, 0)
// it.title = spannable
}
}
return true
@ -525,7 +522,7 @@ class TaskFormActivity : BaseActivity() {
}
canSave = true
binding.textEditText.setText(task.text)
binding.notesEditText.setText(task.notes?.addZeroWidthSpace())
binding.notesEditText.setText(task.notes)
viewModel.taskDifficulty.value = TaskDifficulty.valueOf(task.priority)
when (taskType) {
TaskType.HABIT -> {
@ -605,7 +602,7 @@ class TaskFormActivity : BaseActivity() {
thisTask.dateCreated = Date()
thisTask.text = binding.textEditText.text.toString()
thisTask.notes = binding.notesEditText.text.toString().removeZeroWidthSpace()
thisTask.notes = binding.notesEditText.text.toString()
thisTask.priority = viewModel.taskDifficulty.value.value
if (usesTaskAttributeStats) {
thisTask.attribute = viewModel.selectedAttribute.value

View file

@ -35,6 +35,7 @@ class ChecklistItemFormView @JvmOverloads constructor(
var item: ChecklistItem = ChecklistItem()
set(value) {
field = value
binding.editText.setText(item.text)
}
var tintColor: Int = context.getThemeColor(R.attr.taskFormTint)