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