Lock DrawerLayout closed when drawer is disabled
@@ -18,6 +18,7 @@ import android.widget.Toast
import androidx.appcompat.app.ActionBar
import androidx.appcompat.app.ActionBarDrawerToggle
import androidx.appcompat.widget.Toolbar
+import androidx.drawerlayout.widget.DrawerLayout
import androidx.drawerlayout.widget.DrawerLayout.DrawerListener
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentTransaction
@@ -522,6 +523,8 @@ open class MessageList :
private fun initializeDrawer(savedInstanceState: Bundle?) {
if (!isDrawerEnabled) {
+ val drawerLayout = findViewById<DrawerLayout>(R.id.drawerLayout)
+ drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED)
return
}
