Don't setToolbar in minidrawer mode

This commit is contained in:
Mygod
2016-12-28 05:01:03 +08:00
parent 0732dd5981
commit b069b3e003
2 changed files with 2 additions and 4 deletions
@@ -70,7 +70,7 @@ class MainActivity extends Activity with ServiceBoundContext with Drawer.OnDrawe
private val handler = new Handler()
private var fab: FloatingActionButton = _
private var fabProgressCircle: FABProgressCircle = _
private var crossfader: Crossfader[CrossFadeSlidingPaneLayout] = _
var crossfader: Crossfader[CrossFadeSlidingPaneLayout] = _
var drawer: Drawer = _
private var testCount: Int = _
@@ -32,9 +32,7 @@ class ToolbarFragment extends Fragment {
super.onViewCreated(view, savedInstanceState)
toolbar = view.findViewById(R.id.toolbar).asInstanceOf[Toolbar]
val activity = getActivity.asInstanceOf[MainActivity]
try activity.drawer.setToolbar(activity, toolbar, true) catch {
case _: Exception => // ignore for now
}
if (activity.crossfader == null) activity.drawer.setToolbar(activity, toolbar, true)
}
def onTrafficUpdated(txRate: Long, rxRate: Long, txTotal: Long, rxTotal: Long): Unit = ()