File tree Expand file tree Collapse file tree
app/src/main/java/com/philkes/notallyx/presentation/activity/note Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -937,7 +937,7 @@ abstract class EditActivity(private val type: Type) : LockedActivity<ActivityEdi
937937 updateBottomActions(preferences.editNoteActivityBottomAction.value)
938938 }
939939
940- private fun updateTopActions (topActions : List <EditAction >) {
940+ protected fun updateTopActions (topActions : List <EditAction >, changeable : Boolean = true ) {
941941 binding.Toolbar .menu.apply {
942942 clear()
943943 topActions.forEachIndexed { idx, action ->
@@ -952,10 +952,12 @@ abstract class EditActivity(private val type: Type) : LockedActivity<ActivityEdi
952952 actionHandler.handleAction(action)
953953 }
954954 // Try to get the view for long click
955- binding.Toolbar .post {
956- findViewById<View >(idx)?.setOnLongClickListener {
957- showActionSelectionDialog(action, idx)
958- true
955+ if (changeable) {
956+ binding.Toolbar .post {
957+ findViewById<View >(idx)?.setOnLongClickListener {
958+ showActionSelectionDialog(action, idx)
959+ true
960+ }
959961 }
960962 }
961963 }
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import com.philkes.notallyx.presentation.setCancelButton
2222import com.philkes.notallyx.presentation.setOnNextAction
2323import com.philkes.notallyx.presentation.showKeyboard
2424import com.philkes.notallyx.presentation.showToast
25+ import com.philkes.notallyx.presentation.viewmodel.preference.EditAction
2526import com.philkes.notallyx.utils.changehistory.ChangeHistory
2627import com.philkes.notallyx.utils.findAllOccurrences
2728import com.philkes.notallyx.utils.getFileName
@@ -140,6 +141,7 @@ class EditTextPlainActivity : EditActivity(Type.NOTE) {
140141 override fun resetToolbars () {
141142 binding.Toolbar .setNavigationOnClickListener { finish() }
142143 binding.Toolbar .setNavigationIcon(R .drawable.close)
144+ updateTopActions(listOf (EditAction .SEARCH ), changeable = false )
143145 }
144146
145147 override fun setStateFromModel (savedInstanceState : Bundle ? ) {
You can’t perform that action at this time.
0 commit comments