changes to allow attaching any type of file. mainly for video and audio attachments but nothing to stop any type of file being attached

This commit is contained in:
gavine99
2025-01-26 16:57:36 +11:00
parent 33347fa157
commit 314704a61a
27 changed files with 505 additions and 197 deletions
@@ -0,0 +1,36 @@
/*
* Copyright (C) 2017 Moez Bhatti <moez.bhatti@gmail.com>
*
* This file is part of QKSMS.
*
* QKSMS is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* QKSMS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
*/
package dev.octoshrimpy.quik.extensions
import android.content.Context
import android.net.Uri
fun Uri.resourceExists(context: Context): Boolean {
// check if resource at uri still exists
try {
return context.contentResolver.query(
this, null, null, null, null
)?.use {
it.moveToFirst()
} ?: false
}
catch (e: Exception) { /* nothing */ }
return false
}