mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-25 15:02:33 +01:00
back button clears selection: room list and chat
When a room or event is selected and the Android back button is pressed, don't pop but clear the current selection. Fixes #399.
This commit is contained in:
parent
bb5e0f8fb3
commit
24b632fc90
@ -26,7 +26,15 @@ class ChatListView extends StatelessWidget {
|
|||||||
: controller.selectedRoomIds.isEmpty
|
: controller.selectedRoomIds.isEmpty
|
||||||
? SelectMode.normal
|
? SelectMode.normal
|
||||||
: SelectMode.select;
|
: SelectMode.select;
|
||||||
return Scaffold(
|
return VWidgetGuard(
|
||||||
|
onSystemPop: (redirector) async {
|
||||||
|
if (controller.selectedRoomIds.isNotEmpty) {
|
||||||
|
controller.cancelAction();
|
||||||
|
redirector.stopRedirection();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child:
|
||||||
|
Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
elevation: MediaQuery.of(context).size.width >
|
elevation: MediaQuery.of(context).size.width >
|
||||||
FluffyThemes.columnWidth * 2
|
FluffyThemes.columnWidth * 2
|
||||||
@ -231,7 +239,7 @@ class ChatListView extends StatelessWidget {
|
|||||||
child: Icon(CupertinoIcons.chat_bubble),
|
child: Icon(CupertinoIcons.chat_bubble),
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
);
|
));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,15 @@ class ChatView extends StatelessWidget {
|
|||||||
context: context, future: () => controller.room.join());
|
context: context, future: () => controller.room.join());
|
||||||
}
|
}
|
||||||
|
|
||||||
return Scaffold(
|
return VWidgetGuard(
|
||||||
|
onSystemPop: (redirector) async {
|
||||||
|
if (controller.selectedEvents.isNotEmpty) {
|
||||||
|
controller.clearSelectedEvents();
|
||||||
|
redirector.stopRedirection();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child:
|
||||||
|
Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
leading: controller.selectMode
|
leading: controller.selectMode
|
||||||
? IconButton(
|
? IconButton(
|
||||||
@ -694,7 +702,7 @@ class ChatView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user