mirror of
https://github.com/nextcloud/android.git
synced 2024-12-19 23:42:03 +03:00
Merge remote-tracking branch 'origin/master' into dev
This commit is contained in:
commit
545ebf0fe1
9 changed files with 37 additions and 40 deletions
|
@ -3,7 +3,7 @@ import org.gradle.internal.jvm.Jvm
|
|||
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.1.3'
|
||||
classpath 'com.android.tools.build:gradle:7.3.0'
|
||||
classpath 'com.hiya:jacoco-android:0.2'
|
||||
classpath 'com.github.spotbugs.snom:spotbugs-gradle-plugin:5.0.11'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
|
@ -73,6 +73,11 @@ android {
|
|||
// install this NDK version and Cmake to produce smaller APKs. Build will still work if not installed
|
||||
ndkVersion "${ndkEnv.get("NDK_VERSION")}"
|
||||
|
||||
|
||||
namespace 'com.owncloud.android'
|
||||
testNamespace "${namespace}.test"
|
||||
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 30
|
||||
|
@ -247,7 +252,7 @@ dependencies {
|
|||
}
|
||||
implementation 'com.caverock:androidsvg:1.4'
|
||||
implementation 'androidx.annotation:annotation:1.4.0'
|
||||
implementation 'com.vanniktech:emoji-google:0.15.0'
|
||||
implementation 'com.vanniktech:emoji-google:0.9.0'
|
||||
|
||||
implementation "com.github.cotechde.hwsecurity:hwsecurity-fido:$fidoVersion"
|
||||
implementation "com.github.cotechde.hwsecurity:hwsecurity-fido2:$fidoVersion"
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
-->
|
||||
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="${applicationId}.test"
|
||||
android:sharedUserId="${applicationId}.uid">
|
||||
|
||||
</manifest>
|
||||
|
|
|
@ -17,8 +17,7 @@
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.owncloud.android">
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<application
|
||||
android:name=".MainApp"
|
||||
|
|
|
@ -19,8 +19,7 @@
|
|||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.owncloud.android">
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<application
|
||||
android:name=".MainApp"
|
||||
|
|
|
@ -18,8 +18,7 @@
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.owncloud.android">
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" />
|
||||
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
|
||||
|
|
|
@ -59,8 +59,6 @@ import com.owncloud.android.utils.theme.ThemeTextInputUtils
|
|||
import com.vanniktech.emoji.EmojiManager
|
||||
import com.vanniktech.emoji.EmojiPopup
|
||||
import com.vanniktech.emoji.google.GoogleEmojiProvider
|
||||
import com.vanniktech.emoji.installDisableKeyboardInput
|
||||
import com.vanniktech.emoji.installForceSingleEmoji
|
||||
import java.util.Calendar
|
||||
import java.util.Locale
|
||||
import javax.inject.Inject
|
||||
|
@ -171,18 +169,18 @@ class SetStatusDialogFragment :
|
|||
binding.setStatus.setOnClickListener { setStatusMessage() }
|
||||
binding.emoji.setOnClickListener { popup.show() }
|
||||
|
||||
popup = EmojiPopup(
|
||||
view, binding.emoji,
|
||||
onEmojiClickListener = {
|
||||
popup = EmojiPopup.Builder
|
||||
.fromRootView(view)
|
||||
.setOnEmojiClickListener { _, _ ->
|
||||
popup.dismiss()
|
||||
binding.emoji.clearFocus()
|
||||
val imm: InputMethodManager = context?.getSystemService(Context.INPUT_METHOD_SERVICE) as
|
||||
InputMethodManager
|
||||
imm.hideSoftInputFromWindow(binding.emoji.windowToken, 0)
|
||||
}
|
||||
)
|
||||
binding.emoji.installDisableKeyboardInput(popup)
|
||||
binding.emoji.installForceSingleEmoji()
|
||||
.build(binding.emoji)
|
||||
binding.emoji.disableKeyboardInput(popup)
|
||||
binding.emoji.forceSingleEmoji()
|
||||
|
||||
val adapter = ArrayAdapter<String>(requireContext(), android.R.layout.simple_spinner_item)
|
||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
package com.owncloud.android.utils
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.ContentResolver
|
||||
import android.content.ContentValues
|
||||
import android.os.Build
|
||||
|
@ -64,6 +65,7 @@ class FileExportUtils {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressLint("Recycle") // handled inside copy method
|
||||
@RequiresApi(Build.VERSION_CODES.Q)
|
||||
private fun exportFileAndroid10AndAbove(
|
||||
fileName: String,
|
||||
|
@ -139,30 +141,28 @@ class FileExportUtils {
|
|||
|
||||
@Throws(IllegalStateException::class)
|
||||
private fun copy(ocFile: OCFile?, file: File?, contentResolver: ContentResolver, outputStream: FileOutputStream) {
|
||||
try {
|
||||
val inputStream = if (ocFile != null) {
|
||||
contentResolver.openInputStream(ocFile.storageUri)
|
||||
} else if (file != null) {
|
||||
FileInputStream(file)
|
||||
} else {
|
||||
error("ocFile and file both may not be null")
|
||||
}
|
||||
outputStream.use { fos ->
|
||||
try {
|
||||
val inputStream = when {
|
||||
ocFile != null -> contentResolver.openInputStream(ocFile.storageUri)
|
||||
file != null -> FileInputStream(file)
|
||||
else -> error("ocFile and file both may not be null")
|
||||
}!!
|
||||
|
||||
copyStream(inputStream!!, outputStream)
|
||||
} catch (e: IOException) {
|
||||
Log_OC.e(this, "Cannot write file", e)
|
||||
inputStream.use { fis ->
|
||||
copyStream(fis, fos)
|
||||
}
|
||||
} catch (e: IOException) {
|
||||
Log_OC.e(this, "Cannot write file", e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun copyStream(inputStream: InputStream, outputStream: FileOutputStream) {
|
||||
inputStream.use { input ->
|
||||
outputStream.use { output ->
|
||||
val buffer = ByteArray(COPY_BUFFER_SIZE)
|
||||
var len: Int
|
||||
while (input.read(buffer).also { len = it } != -1) {
|
||||
output.write(buffer, 0, len)
|
||||
}
|
||||
}
|
||||
val buffer = ByteArray(COPY_BUFFER_SIZE)
|
||||
var len: Int
|
||||
while (inputStream.read(buffer).also { len = it } != -1) {
|
||||
outputStream.write(buffer, 0, len)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
*/
|
||||
package com.owncloud.android.utils.svg;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.graphics.drawable.PictureDrawable;
|
||||
import android.os.Build;
|
||||
import android.widget.ImageView;
|
||||
|
@ -19,7 +18,6 @@ import com.bumptech.glide.request.RequestListener;
|
|||
import com.bumptech.glide.request.target.ImageViewTarget;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
||||
public class SvgSoftwareLayerSetter<T> implements RequestListener<T, PictureDrawable> {
|
||||
|
||||
@Override
|
||||
|
@ -40,4 +38,4 @@ public class SvgSoftwareLayerSetter<T> implements RequestListener<T, PictureDraw
|
|||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,5 +1,5 @@
|
|||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
|
Loading…
Reference in a new issue