Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
9
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
Mark Murphy
cw-android-q
Commits
9d8e57e4
Commit
9d8e57e4
authored
Jun 13, 2019
by
Mark Murphy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweaks to support Q Beta 4
parent
e67f44bc
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
38 additions
and
38 deletions
+38
-38
ConferenceVideos/build.gradle
ConferenceVideos/build.gradle
+1
-1
ConferenceVideos/src/main/java/com/commonsware/android/conferencevideos/MainActivity.kt
.../com/commonsware/android/conferencevideos/MainActivity.kt
+4
-3
ConferenceVideos/src/main/java/com/commonsware/android/conferencevideos/VideoRepository.kt
...m/commonsware/android/conferencevideos/VideoRepository.kt
+4
-3
ExifTest/build.gradle
ExifTest/build.gradle
+1
-1
ExifTest/src/main/java/com/commonsware/android/q/exif/MainActivity.kt
.../main/java/com/commonsware/android/q/exif/MainActivity.kt
+2
-3
ExifTest/src/main/java/com/commonsware/android/q/exif/MainMotor.kt
...src/main/java/com/commonsware/android/q/exif/MainMotor.kt
+2
-2
SecureCheqFallback/build.gradle
SecureCheqFallback/build.gradle
+1
-1
SecureCheqFallback/src/main/java/com/commonsware/android/q/auth/check/MainActivity.kt
...java/com/commonsware/android/q/auth/check/MainActivity.kt
+2
-2
ShareTargets/src/main/AndroidManifest.xml
ShareTargets/src/main/AndroidManifest.xml
+1
-1
StorageExplorer/build.gradle
StorageExplorer/build.gradle
+12
-12
StorageExplorer/src/main/AndroidManifest.xml
StorageExplorer/src/main/AndroidManifest.xml
+1
-1
StorageExplorer/src/main/java/com/commonsware/android/storage/MainActivity.kt
...main/java/com/commonsware/android/storage/MainActivity.kt
+3
-4
TypeInfo/build.gradle
TypeInfo/build.gradle
+3
-3
TypeInfo/src/main/java/com/commonsware/android/q/typeinfo/TypeRecord.kt
...ain/java/com/commonsware/android/q/typeinfo/TypeRecord.kt
+1
-1
No files found.
ConferenceVideos/build.gradle
View file @
9d8e57e4
...
...
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
apply
plugin:
'kotlin-android-extensions'
android
{
compileSdkVersion
'android-Q'
compileSdkVersion
29
defaultConfig
{
applicationId
"com.commonsware.android.conferencevideos"
...
...
ConferenceVideos/src/main/java/com/commonsware/android/conferencevideos/MainActivity.kt
View file @
9d8e57e4
...
...
@@ -18,11 +18,11 @@ package com.commonsware.android.conferencevideos
import
android.Manifest
import
android.content.Intent
import
android.os.Build
import
android.os.Bundle
import
android.view.LayoutInflater
import
android.view.ViewGroup
import
android.widget.Toast
import
androidx.core.os.BuildCompat
import
androidx.lifecycle.Observer
import
androidx.recyclerview.widget.*
import
com.commonsware.android.conferencevideos.databinding.RowBinding
...
...
@@ -32,8 +32,9 @@ import org.koin.androidx.viewmodel.ext.android.viewModel
class
MainActivity
:
AbstractPermissionActivity
()
{
private
val
motor
:
MainMotor
by
viewModel
()
override
val
desiredPermissions
=
if
(
BuildCompat
.
isAtLeastQ
())
arrayOf
()
else
arrayOf
(
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
)
override
val
desiredPermissions
=
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
Q
)
arrayOf
()
else
arrayOf
(
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
)
override
fun
onPermissionDenied
()
{
Toast
.
makeText
(
this
,
getString
(
R
.
string
.
msg_toast
),
Toast
.
LENGTH_LONG
)
...
...
ConferenceVideos/src/main/java/com/commonsware/android/conferencevideos/VideoRepository.kt
View file @
9d8e57e4
...
...
@@ -21,10 +21,10 @@ import android.content.ContentValues
import
android.content.Context
import
android.media.MediaScannerConnection
import
android.net.Uri
import
android.os.Build
import
android.os.Environment
import
android.provider.MediaStore
import
androidx.core.content.FileProvider
import
androidx.core.os.BuildCompat
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.withContext
import
okhttp3.OkHttpClient
...
...
@@ -40,7 +40,7 @@ private const val AUTHORITY = "${BuildConfig.APPLICATION_ID}.provider"
class
VideoRepository
(
private
val
context
:
Context
)
{
private
val
ok
=
OkHttpClient
()
private
val
collection
=
if
(
Build
Compat
.
isAtLeastQ
()
)
MediaStore
.
Video
.
Media
.
getContentUri
(
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
Q
)
MediaStore
.
Video
.
Media
.
getContentUri
(
MediaStore
.
VOLUME_EXTERNAL
)
else
MediaStore
.
Video
.
Media
.
EXTERNAL_CONTENT_URI
...
...
@@ -63,7 +63,7 @@ class VideoRepository(private val context: Context) {
}
suspend
fun
download
(
filename
:
String
):
Uri
=
if
(
Build
Compat
.
isAtLeastQ
()
)
downloadQ
(
filename
)
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
Q
)
downloadQ
(
filename
)
else
downloadLegacy
(
filename
)
private
suspend
fun
downloadQ
(
filename
:
String
):
Uri
=
...
...
@@ -74,6 +74,7 @@ class VideoRepository(private val context: Context) {
if
(
response
.
isSuccessful
)
{
val
values
=
ContentValues
().
apply
{
put
(
MediaStore
.
Video
.
Media
.
DISPLAY_NAME
,
filename
)
put
(
MediaStore
.
Video
.
Media
.
RELATIVE_PATH
,
"Movies/ConferenceVideos"
)
put
(
MediaStore
.
Video
.
Media
.
MIME_TYPE
,
"video/mp4"
)
put
(
MediaStore
.
Video
.
Media
.
IS_PENDING
,
1
)
}
...
...
ExifTest/build.gradle
View file @
9d8e57e4
...
...
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
apply
plugin:
'kotlin-android-extensions'
android
{
compileSdkVersion
'android-Q'
compileSdkVersion
29
defaultConfig
{
applicationId
"com.commonsware.android.q.exif"
...
...
ExifTest/src/main/java/com/commonsware/android/q/exif/MainActivity.kt
View file @
9d8e57e4
...
...
@@ -20,14 +20,13 @@ import android.Manifest
import
android.app.Activity
import
android.content.Intent
import
android.content.pm.PackageManager
import
android.os.Build
import
android.os.Bundle
import
android.view.Menu
import
android.view.MenuItem
import
android.widget.Toast
import
androidx.appcompat.app.AppCompatActivity
import
androidx.core.os.BuildCompat
import
androidx.databinding.DataBindingUtil
import
com.commonsware.android.q.exif.databinding.ActivityMainBinding
import
org.koin.androidx.viewmodel.ext.android.viewModel
private
const
val
REQUEST_OPEN
=
1337
...
...
@@ -103,7 +102,7 @@ class MainActivity : AppCompatActivity() {
}
private
fun
requestMediaPerm
()
{
val
perms
=
if
(
Build
Compat
.
isAtLeastQ
()
)
{
val
perms
=
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
Q
)
{
arrayOf
(
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
Manifest
.
permission
.
ACCESS_MEDIA_LOCATION
...
...
ExifTest/src/main/java/com/commonsware/android/q/exif/MainMotor.kt
View file @
9d8e57e4
...
...
@@ -19,9 +19,9 @@ package com.commonsware.android.q.exif
import
android.content.Context
import
android.media.MediaScannerConnection
import
android.net.Uri
import
android.os.Build
import
android.os.Environment
import
android.provider.MediaStore
import
androidx.core.os.BuildCompat
import
androidx.exifinterface.media.ExifInterface
import
androidx.lifecycle.LiveData
import
androidx.lifecycle.MutableLiveData
...
...
@@ -45,7 +45,7 @@ class MainMotor(private val context: Context) : ViewModel() {
private
val
_countEvents
=
MutableLiveData
<
Event
<
Int
>>()
val
countEvents
:
LiveData
<
Event
<
Int
>>
=
_countEvents
private
val
collection
=
if
(
Build
Compat
.
isAtLeastQ
()
)
MediaStore
.
Images
.
Media
.
getContentUri
(
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
Q
)
MediaStore
.
Images
.
Media
.
getContentUri
(
MediaStore
.
VOLUME_EXTERNAL
)
else
MediaStore
.
Images
.
Media
.
EXTERNAL_CONTENT_URI
...
...
SecureCheqFallback/build.gradle
View file @
9d8e57e4
...
...
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
apply
plugin:
'kotlin-android-extensions'
android
{
compileSdkVersion
'android-Q'
compileSdkVersion
29
defaultConfig
{
applicationId
"com.commonsware.android.q.auth.checkfallback"
...
...
SecureCheqFallback/src/main/java/com/commonsware/android/q/auth/check/MainActivity.kt
View file @
9d8e57e4
...
...
@@ -23,12 +23,12 @@ import android.content.Intent
import
android.content.pm.PackageManager
import
android.graphics.drawable.Drawable
import
android.hardware.biometrics.BiometricPrompt
import
android.os.Build
import
android.os.Bundle
import
android.os.CancellationSignal
import
android.widget.Toast
import
androidx.appcompat.app.AppCompatActivity
import
androidx.core.graphics.drawable.DrawableCompat
import
androidx.core.os.BuildCompat
import
androidx.vectordrawable.graphics.drawable.VectorDrawableCompat
import
kotlinx.android.synthetic.main.activity_main.*
...
...
@@ -64,7 +64,7 @@ class MainActivity : AppCompatActivity() {
.
setDescription
(
"This is the description"
)
.
setSubtitle
(
"This is the subtitle"
)
.
apply
{
if
(
Build
Compat
.
isAtLeastQ
()
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
Q
)
{
setDeviceCredentialAllowed
(
true
)
}
else
{
setNegativeButton
(
...
...
ShareTargets/src/main/AndroidManifest.xml
View file @
9d8e57e4
...
...
@@ -27,7 +27,7 @@
<meta-data
android:name=
"android.app.shortcuts"
android:resource=
"@xml/sh
ortcu
ts"
/>
android:resource=
"@xml/sh
are_targe
ts"
/>
</activity>
<activity
android:name=
".ShareActivity"
>
<intent-filter>
...
...
StorageExplorer/build.gradle
View file @
9d8e57e4
...
...
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
apply
plugin:
'kotlin-android-extensions'
android
{
compileSdkVersion
"android-Q"
compileSdkVersion
29
defaultConfig
{
applicationId
"com.commonsware.android.storage"
...
...
@@ -21,7 +21,7 @@ android {
}
}
flavorDimensions
"target"
,
"perm"
,
"
sandbox
"
flavorDimensions
"target"
,
"perm"
,
"
legacy
"
productFlavors
{
p
{
...
...
@@ -32,8 +32,8 @@ android {
q
{
dimension
"target"
applicationIdSuffix
".q"
minSdkVersion
"Q"
targetSdkVersion
"Q"
minSdkVersion
29
targetSdkVersion
29
}
perm
{
...
...
@@ -48,16 +48,16 @@ android {
buildConfigField
"boolean"
,
"REQUEST_RUNTIME_PERMISSIONS"
,
"false"
}
sandbox
{
dimension
"sandbox"
applicationIdSuffix
".sandbox"
resValue
"bool"
,
"useSandbox"
,
"true"
}
normal
{
dimension
"
sandbox
"
dimension
"
legacy
"
applicationIdSuffix
".normal"
resValue
"bool"
,
"useSandbox"
,
"false"
resValue
"bool"
,
"useLegacy"
,
"false"
}
legacy
{
dimension
"legacy"
applicationIdSuffix
".legacy"
resValue
"bool"
,
"useLegacy"
,
"true"
}
}
}
...
...
StorageExplorer/src/main/AndroidManifest.xml
View file @
9d8e57e4
...
...
@@ -12,7 +12,7 @@
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
tools:ignore=
"GoogleAppIndexingWarning"
android:
allow
ExternalStorage
Sandbox
=
"@bool/use
Sandbox
"
>
android:
requestLegacy
ExternalStorage=
"@bool/use
Legacy
"
>
<activity
android:name=
".MainActivity"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
...
...
StorageExplorer/src/main/java/com/commonsware/android/storage/MainActivity.kt
View file @
9d8e57e4
...
...
@@ -28,7 +28,6 @@ import android.view.Menu
import
android.view.MenuItem
import
android.widget.Toast
import
androidx.appcompat.app.ActionBarDrawerToggle
import
androidx.core.os.BuildCompat
import
androidx.core.view.GravityCompat
import
androidx.documentfile.provider.DocumentFile
import
androidx.drawerlayout.widget.DrawerLayout
...
...
@@ -88,9 +87,9 @@ class MainActivity : AbstractPermissionActivity() {
navTo
(
R
.
id
.
nav_internal_files
)
val
msg
=
if
(
Build
Compat
.
isAtLeastQ
()
&&
Environment
.
isExternalStorage
Sandboxed
())
"This app has
sandboxed
external storage"
else
"This app has normal external storage"
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
Q
&&
Environment
.
isExternalStorage
Legacy
())
"This app has
legacy
external storage"
else
"This app has
Q-
normal external storage"
Toast
.
makeText
(
this
,
msg
,
Toast
.
LENGTH_LONG
).
show
()
}
...
...
TypeInfo/build.gradle
View file @
9d8e57e4
...
...
@@ -3,12 +3,12 @@ apply plugin: 'kotlin-android'
apply
plugin:
'kotlin-android-extensions'
android
{
compileSdkVersion
'android-Q'
compileSdkVersion
29
defaultConfig
{
applicationId
"com.commonsware.android.q.typeinfo"
minSdkVersion
'Q'
targetSdkVersion
'Q'
minSdkVersion
29
targetSdkVersion
29
versionCode
1
versionName
"1.0"
}
...
...
TypeInfo/src/main/java/com/commonsware/android/q/typeinfo/TypeRecord.kt
View file @
9d8e57e4
...
...
@@ -25,7 +25,7 @@ data class TypeRecord(
val
description
:
CharSequence
,
val
icon
:
Icon
)
{
constructor
(
type
:
String
,
typeInfo
:
ContentResolver
.
TypeInfo
)
:
this
(
constructor
(
type
:
String
,
typeInfo
:
ContentResolver
.
Mime
TypeInfo
)
:
this
(
type
,
typeInfo
.
label
,
typeInfo
.
contentDescription
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment