@@ -58,7 +58,6 @@ import com.owncloud.android.datamodel.OCFile
58
58
import com.owncloud.android.extensions.checkPasscodeEnforced
59
59
import com.owncloud.android.extensions.manageOptionLockSelected
60
60
import com.owncloud.android.extensions.showMessageInSnackbar
61
- import com.owncloud.android.extensions.showMessageInToast
62
61
import com.owncloud.android.files.services.FileDownloader
63
62
import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder
64
63
import com.owncloud.android.files.services.FileUploader
@@ -228,7 +227,9 @@ class FileDisplayActivity : FileActivity(), FileFragment.ContainerActivity, OnEn
228
227
}
229
228
230
229
val dataIntent: Uri ? = intent.data
231
- manageDataIntent(dataIntent)
230
+ dataIntent?.let {
231
+ handleDeepLink(dataIntent)
232
+ }
232
233
233
234
setBackgroundText()
234
235
}
@@ -299,7 +300,7 @@ class FileDisplayActivity : FileActivity(), FileFragment.ContainerActivity, OnEn
299
300
private fun initFragmentsWithFile () {
300
301
if (account != null && file != null ) {
301
302
// / First fragment
302
- listOfFilesFragment?.listDirectory(file )
303
+ listOfFilesFragment?.listDirectory(currentDir )
303
304
? : Timber .e(" Still have a chance to lose the initialization of list fragment >(" )
304
305
305
306
// / Second fragment
@@ -423,7 +424,7 @@ class FileDisplayActivity : FileActivity(), FileFragment.ContainerActivity, OnEn
423
424
if (intent.data == null || isAlreadyHandledDeepLink) {
424
425
fileListFragment?.listDirectory(reloadData)
425
426
} else {
426
- fileListFragment?.listDirectory(isFileDiscovered (intent.data))
427
+ fileListFragment?.listDirectory(getFileDiscovered (intent.data))
427
428
}
428
429
429
430
}
@@ -1657,21 +1658,21 @@ class FileDisplayActivity : FileActivity(), FileFragment.ContainerActivity, OnEn
1657
1658
manageOptionLockSelected(type)
1658
1659
}
1659
1660
1660
- private fun manageDataIntent (uri : Uri ? ) {
1661
+ private fun handleDeepLink (uri : Uri ? ) {
1661
1662
if (uri != null && AccountUtils .getAccounts(applicationContext).isEmpty()) {
1662
- showMessageInToast( getString(R .string.no_account_configured))
1663
+ showMessageInSnackbar(message = getString(R .string.no_account_configured))
1663
1664
} else if (uri != null && AccountUtils .getAccounts(applicationContext).size == 1 ) {
1664
- isFileDiscovered (uri).let { OCFile ->
1665
- if (OCFile != null ) {
1666
- manageItem(OCFile )
1665
+ getFileDiscovered (uri).let { oCFile ->
1666
+ if (oCFile != null ) {
1667
+ manageItem(oCFile )
1667
1668
} else {
1668
- showMessageInToast( getString(R .string.no_file_found))
1669
+ showMessageInSnackbar(message = getString(R .string.no_file_found))
1669
1670
}
1670
1671
}
1671
1672
}
1672
1673
}
1673
1674
1674
- private fun isFileDiscovered (uri : Uri ? ): OCFile ? = storageManager.getFileByPrivateLink(uri.toString())
1675
+ private fun getFileDiscovered (uri : Uri ? ): OCFile ? = storageManager.getFileByPrivateLink(uri.toString())
1675
1676
1676
1677
private fun manageItem (file : OCFile ) {
1677
1678
onBrowsedDownTo(file)
0 commit comments