Fix the application finish after selecting an account (#286)

This commit is contained in:
Rafał Borcz 2019-03-19 18:14:55 +01:00 committed by Mikołaj Pich
parent 040857ba20
commit 8db73e9459
3 changed files with 10 additions and 7 deletions

View File

@ -39,18 +39,12 @@
android:name=".ui.modules.main.MainActivity" android:name=".ui.modules.main.MainActivity"
android:configChanges="orientation|screenSize" android:configChanges="orientation|screenSize"
android:label="@string/main_title" android:label="@string/main_title"
android:launchMode="singleTop"
android:theme="@style/WulkanowyTheme.NoActionBar" /> android:theme="@style/WulkanowyTheme.NoActionBar" />
<activity <activity
android:name=".ui.modules.message.send.SendMessageActivity" android:name=".ui.modules.message.send.SendMessageActivity"
android:configChanges="orientation|screenSize" android:configChanges="orientation|screenSize"
android:label="@string/send_message_title" android:label="@string/send_message_title"
android:parentActivityName=".ui.modules.main.MainActivity" android:theme="@style/WulkanowyTheme.NoActionBar" />
android:theme="@style/WulkanowyTheme.NoActionBar">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".ui.modules.main.MainActivity" />
</activity>
<service <service
android:name=".services.widgets.TimetableWidgetService" android:name=".services.widgets.TimetableWidgetService"

View File

@ -72,6 +72,10 @@ class SendMessageActivity : BaseActivity(), SendMessageView {
else false else false
} }
override fun onSupportNavigateUp(): Boolean {
return presenter.onUpNavigate()
}
override fun setReportingUnit(unit: ReportingUnit) { override fun setReportingUnit(unit: ReportingUnit) {
sendMessageFromTextView.setText(unit.senderName) sendMessageFromTextView.setText(unit.senderName)
} }

View File

@ -47,6 +47,11 @@ class SendMessagePresenter @Inject constructor(
} }
} }
fun onUpNavigate(): Boolean {
view?.popView()
return true
}
private fun loadData(message: Message?) { private fun loadData(message: Message?) {
var reportingUnit: ReportingUnit? = null var reportingUnit: ReportingUnit? = null
var recipients: List<Recipient> = emptyList() var recipients: List<Recipient> = emptyList()