mirror of
https://git.mihon.tech/mihonapp/mihon
synced 2024-11-26 07:06:03 +03:00
Fix an error when restoring backup
This commit is contained in:
parent
0c0372dc51
commit
ac15c0c57e
3 changed files with 10 additions and 28 deletions
|
@ -97,9 +97,8 @@ class BackupFragment : BaseRxFragment<BackupPresenter>() {
|
||||||
.progress(true, 0)
|
.progress(true, 0)
|
||||||
.show()
|
.show()
|
||||||
|
|
||||||
context.contentResolver.openInputStream(data.data).use {
|
val stream = context.contentResolver.openInputStream(data.data)
|
||||||
presenter.restoreBackup(it)
|
presenter.restoreBackup(stream)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,30 +61,12 @@ class MainActivity : BaseActivity() {
|
||||||
text_label.text = ""
|
text_label.text = ""
|
||||||
|
|
||||||
when (item.itemId) {
|
when (item.itemId) {
|
||||||
R.id.nav_drawer_library -> {
|
R.id.nav_drawer_library -> setFragment(LibraryFragment.newInstance())
|
||||||
setFragment(LibraryFragment.newInstance())
|
R.id.nav_drawer_recent_updates -> setFragment(RecentChaptersFragment.newInstance())
|
||||||
item.isChecked = true
|
R.id.nav_drawer_catalogues -> setFragment(CatalogueFragment.newInstance())
|
||||||
}
|
R.id.nav_drawer_downloads -> setFragment(DownloadFragment.newInstance())
|
||||||
R.id.nav_drawer_recent_updates -> {
|
R.id.nav_drawer_settings -> startActivity(Intent(this, SettingsActivity::class.java))
|
||||||
setFragment(RecentChaptersFragment.newInstance())
|
R.id.nav_drawer_backup -> setFragment(BackupFragment.newInstance())
|
||||||
item.isChecked = true
|
|
||||||
}
|
|
||||||
R.id.nav_drawer_catalogues -> {
|
|
||||||
setFragment(CatalogueFragment.newInstance())
|
|
||||||
item.isChecked = true
|
|
||||||
}
|
|
||||||
R.id.nav_drawer_downloads -> {
|
|
||||||
setFragment(DownloadFragment.newInstance())
|
|
||||||
item.isChecked = true
|
|
||||||
}
|
|
||||||
R.id.nav_drawer_settings -> {
|
|
||||||
item.isChecked = false
|
|
||||||
startActivity(Intent(this, SettingsActivity::class.java))
|
|
||||||
}
|
|
||||||
R.id.nav_drawer_backup -> {
|
|
||||||
setFragment(BackupFragment.newInstance())
|
|
||||||
item.isChecked = true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
drawer.closeDrawer(GravityCompat.START)
|
drawer.closeDrawer(GravityCompat.START)
|
||||||
true
|
true
|
||||||
|
|
|
@ -25,7 +25,8 @@
|
||||||
<item
|
<item
|
||||||
android:id="@+id/nav_drawer_settings"
|
android:id="@+id/nav_drawer_settings"
|
||||||
android:icon="@drawable/ic_settings_black_24dp"
|
android:icon="@drawable/ic_settings_black_24dp"
|
||||||
android:title="@string/label_settings" />
|
android:title="@string/label_settings"
|
||||||
|
android:checkable="false" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/nav_drawer_backup"
|
android:id="@+id/nav_drawer_backup"
|
||||||
android:icon="@drawable/ic_backup_black_24dp"
|
android:icon="@drawable/ic_backup_black_24dp"
|
||||||
|
|
Loading…
Reference in a new issue