Fix flickering old theme color when opening task

pull/1074/head
Alex Baker 4 years ago
parent b97b9d5ef4
commit 3ca6ccae1b

@ -16,7 +16,6 @@ import android.view.View
import android.view.inputmethod.InputMethodManager
import androidx.appcompat.view.ActionMode
import androidx.drawerlayout.widget.DrawerLayout.SimpleDrawerListener
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.lifecycleScope
import com.todoroo.andlib.utility.AndroidUtilities
import com.todoroo.astrid.activity.TaskEditFragment.Companion.newTaskEditFragment
@ -243,7 +242,7 @@ class MainActivity : InjectingAppCompatActivity(), TaskListFragmentCallbackHandl
}
if (isSinglePaneLayout) {
if (openTask || tef != null) {
openTask(null)
openTask(filter)
} else {
openTaskListFragment(filter, false)
}
@ -273,13 +272,15 @@ class MainActivity : InjectingAppCompatActivity(), TaskListFragmentCallbackHandl
supportFragmentManager
.beginTransaction()
.replace(R.id.detail, newEmptyTaskEditFragment(it))
.commitNow()
}
.runOnCommit {
if (isSinglePaneLayout) {
binding.master.visibility = View.VISIBLE
binding.detail.visibility = View.GONE
}
}
.commitNow()
}
}
private fun setFilter(newFilter: Filter?) {
filter = newFilter
@ -363,9 +364,8 @@ class MainActivity : InjectingAppCompatActivity(), TaskListFragmentCallbackHandl
filterColor)
supportFragmentManager.beginTransaction()
.replace(R.id.detail, fragment, TaskEditFragment.TAG_TASKEDIT_FRAGMENT)
.addToBackStack(TaskEditFragment.TAG_TASKEDIT_FRAGMENT)
.commit()
showDetailFragment()
.runOnCommit(this::showDetailFragment)
.commitNow()
}
override fun onNavigationIconClicked() {
@ -412,9 +412,6 @@ class MainActivity : InjectingAppCompatActivity(), TaskListFragmentCallbackHandl
get() = !resources.getBoolean(R.bool.two_pane_layout)
fun removeTaskEditFragment() {
supportFragmentManager.popBackStack(
TaskEditFragment.TAG_TASKEDIT_FRAGMENT,
FragmentManager.POP_BACK_STACK_INCLUSIVE)
val removeTask = intent.removeTask
val finishAffinity = intent.finishAffinity
if (finishAffinity || taskListFragment == null) {

Loading…
Cancel
Save