Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videolan/vlc-android
  • thresh/vlc-android
  • Dekans/vlc-android
  • robUx4/vlc-android
  • tguillem/vlc-android
  • Corbax/vlc-android
  • judeosby/vlc-android
  • chouquette/vlc-android
  • washingtonmurphy93/vlc-android
  • wipawanbeadklang540/vlc-android
  • xcorail/vlc-android
  • Aza/vlc-android
  • Skantes/vlc-android
  • filipjares/vlc-android
  • kazemihabib/vlc-android
  • amq10x/vlc-android
  • qadrian370/vlc-android
  • shivanshs9/vlc-android
  • vitaliyg2/vlc-android
  • orgads/vlc-android
  • rom1v/vlc-android
  • evidence/vlc-android
  • lk888/vlc-android
  • Klaus81/vlc-android
  • EwoutH/vlc-android
  • XilasZ/vlc-android
  • pawelpablo1975/vlc-android
  • uae2ae/vlc-android
  • Garf/vlc-android
  • abetatsunori7/vlc-android
  • ePirat/vlc-android
  • magsoft/vlc-android
  • quink/vlc-android
  • Ektos974/vlc-android
  • CymGen30/vlc-android
  • b1ue/vlc-android
  • alessiavalenti8/vlc-android
  • bars27101982/vlc-android
  • billybanda18/vlc-android
  • dklvip/vlc-android
  • sherylynn/vlc-android
  • ramcoach5/vlc-android
  • takise/vlc-android
  • peibolovedie/vlc-android
  • AMHeijboer/vlc-android
  • dahburj/vlc-android
  • gobennyb/vlc-android
  • masripmasrip824/vlc-android
  • bubu/vlc-android
  • tmk907/vlc-android
  • gorbahaaa/vlc-android
  • govind3321/vlc-android
  • jamieboyer42818/vlc-android
  • mrtakilapop/vlc-android
  • kazikarter90/vlc-android
  • chunyie771/vlc-android
  • nop404/vlc-android
  • hcalzazperz/vlc-android
  • zagwojtek69/vlc-android
  • nikonnick24/vlc-android
  • gmohiuddin215/vlc-android
  • stheinthan31/vlc-android
  • rogelioloreto29/vlc-android
  • philippestcyr5/vlc-android
  • Happyheather20/vlc-android
  • jimbobmcgee/vlc-android
  • mohwie/vlc-android
  • HeartBeat1608/vlc-android
  • jahan/vlc-android
  • Kevo1987/vlc-android
  • rrangel3584/vlc-android
  • xfridrich/vlc-android
  • devswami23/vlc-android
  • Isira-Seneviratne/vlc-android
  • PartyPhone22/vlc-android
  • kmajeshkrishnan/vlc-android
  • ramirotorresjr/vlc-android
  • aaronsalas469/vlc-android
  • arnan.np31/vlc-android
  • hkosacki/vlc-android
  • mg0691872/vlc-android
  • louregni/vlc-android
  • ritmapp/vlc-android
  • diegofn/vlc-android
  • s-ayush2903/vlc-android
  • chrisbohn1984/vlc-android
  • alexandre-janniaux/vlc-android
  • optimumpr/vlc-android
  • chirag-jn/vlc-android
  • e9ab98e991ab/vlc-android
  • suvDev/vlc-android
  • killthelord/vlc-android
  • Phoenix/vlc-android
  • soriyallc/vlc-android
  • tda1009/vlc-android
  • rhstone/vlc-android
  • ltnokiago/vlc-android
  • elbrujo1987/vlc-android
  • m1s4k1/vlc-android
  • mdc/vlc-android
  • arnaudj/vlc-android
  • abhinavmarwaha/vlc-android
  • dali546/vlc-android
  • Jeffset/vlc-android
  • megan30/vlc-android
  • lizhengdao/vlc-android
  • YajTPG/vlc-android
  • halcyon/vlc-android
  • ilya.yanok/vlc-android
  • jeramydhallmon/vlc-android
  • tijoemecano77/vlc-android
  • cjcj125125/vlc-android
  • dejan2609/vlc-android
  • JATIN2111999/vlc-android
  • imrohitkumar/vlc-android
  • sagudev/vlc-android
  • ILoveLin/vlc-android
  • tfighiera/vlc-android
  • snehil101/vlc-android
  • MKornelsen/vlc-android
  • m/vlc-android
  • core1024/vlc-android
  • vadimdolgachev/vlc-android
  • Kk77539/vlc-android
  • linzj/vlc-android
  • dantalian-pv/vlc-android
  • admkhalid/vlc-android
  • yaron/vlc-android
  • kn21091974/vlc-android
  • mylove1302/vlc-android
  • roblav96/vlc-android
  • alabiaga/vlc-android
  • kmnaveen101/vlc-android
  • nikiforoff1407/vlc-android
  • Android-Jester/vlc-android
  • frieda.rtwski/vlc-android
  • glaciers7506/vlc-android
  • rahul-gill/vlc-android
  • gaoxugang/vlc-android
  • Rishavgupta12345/vlc-android
  • dinho991556460/vlc-android
  • lighterowl/vlc-android
  • mary-kate/vlc-android
  • adnank20216/vlc-android
  • anthonylgutierrez79/vlc-android
  • Heliottw/vlc-android
  • mu1zix.ft3/vlc-android
  • yvesmaltais1212/vlc-android
  • ereme/vlc-android
  • jhonypalomino829/vlc-android
  • mx1up/vlc-android
  • sjwaddy/vlc-android
  • MohitMandalia/vlc-android
  • temaershov/vlc-android
  • js6pak/vlc-android
  • mishikallu/vlc-android
  • irfanmumtaz008/vlc-android
  • smurfohrachie/vlc-android
  • Goooler/vlc-android
  • eldo203050/vlc-android
  • dejesuszeus99/vlc-android
  • mfkl/vlc-android
  • Samfun75/vlc-android
  • markg85/vlc-android-ipfs
  • doktamelek911/vlc-android
  • wikwity/vlc-android
  • aangelmaker/vlc-android
  • krawczykradek119/vlc-android
  • ylz18180813163/vlc-android
  • galaxy9sx3/vlc-android
  • huajie2020/vlc-android
  • XuanTung95/vlc-android
  • kl/vlc-android
  • melihyolcu83/vlc-android
  • rt1shnik/vlc-android
  • jerryboy307/vlc-android
  • ikeuzochukwu6/vlc-android
  • patrikgolis/vlc-android
  • Ismavv/vlc-android
  • clementosumo/vlc-android
  • joshlamp66/vlc-android
  • nkmoyonyathiericyounge/vlc-android
  • DanTm99/vlc-android
  • Jeffrow41/vlc-android
  • fromphfr/vlc-android
  • 16project/vlc-android
  • Tomas8874/vlc-android
  • fixxxer87/vlc-android
  • sanjay/vlc-android
  • franciscojrp/vlc-android
  • cashellauswaus23/vlc-android
  • hengwu0/vlc-android
  • naythu2020rain/vlc-android
  • TongtengInhole/vlc-android
  • pupdoggy666/vlc-android
  • jcj921013/vlc-android
  • Gc6026/vlc-android
  • crijojc/vlc-android
  • mdrewight/vlc-android
  • davidhaywood0782/vlc-android
  • jbschtt/vlc-android
  • macfarlandcamel/vlc-android
  • syazairi/vlc-android
  • Commander01/vlc-android
  • baileyterry014/vlc-android
  • rodrickfranklin38/vlc-android
  • diego1245hernb/vlc-android
  • anton.canada/vlc-android
  • egazaekb/vlc-android
  • Marissa111113/vlc-android
  • jeinerbruno2/vlc-android
  • wehnie13/vlc-android
  • ozill87/vlc-android
  • legionfso/vlc-android
  • anazahirajoel/vlc-android
  • naomirojas1227/vlc-android
  • xbao/vlc-android
  • antoni.kozubek/vlc-android
  • pajela8482/vlc-android
  • karlfandango55/vlc-android
  • ruanbester07/vlc-android
  • chigita73/vlc-android
  • giu.pat6/vlc-android
  • Aura/vlc-android
  • marcwabo/vlc-android
  • contact.adgrafix/vlc-android
  • exlaverdad/vlc-android
  • simon.marquis88/vlc-android
  • youngkinsamantha421/vlc-android
  • edgard1161/vlc-android
  • agzx77/vlc-android
  • ha7204993/vlc-android
  • alghazwani.jar.6090/vlc-android
  • zrowton1206/vlc-android
  • darek1979513/vlc-android
  • matthiaskett18198/vlc-android
  • kubadyr77/vlc-android
  • romanstudeny1982/vlc-android
  • kumar107375/vlc-android
  • schong0525/vlc-android
  • Kt/vlc-android
  • jovelyn.esconde125/vlc-android
  • corriemacbarnard/vlc-android
  • apisbg91/vlc-android
  • yyusea/vlc-android
  • protechq88/vlc-android
  • rmangaraman/vlc-android
  • soutomikel/vlc-android
  • goregladaleksej5/vlc-android
  • tao/vlc-android
  • aruiz595/vlc-android
  • horvathpeter1202/vlc-android
  • litteh82/vlc-android
  • kerriochoa96/vlc-android
  • skshemul2022/vlc-android
  • popy/vlc-android
  • mizadpanahdev/vlc-android
  • pinarim2035/vlc-android
  • davidgooch1127/vlc-android
  • NyanCatTW1/vlc-android
  • Pendynurcahyo/vlc-android
  • fcartegnie/vlc-android
  • xiaoxiao921/vlc-android
  • rjtoell/vlc-android
  • devanshu6445/vlc-android
  • DopeDo69/vlc-android
  • quimsical/vlc-android
  • nickita.koltsoff/vlc-android
  • zeestander8617/vlc-android
  • alexsonarin06/vlc-android
  • minh189999h/vlc-android
  • JonnycatMeow/vlc-android
  • pup.ragnarok.1984/vlc-android2
  • jlcalderon13/vlc-android
  • franciszekk51214/vlc-android
  • yinsheng996/vlc-android
  • KenN3RD/vlc-android
  • leogps/vlc-android
  • alicuteo0407/vlc-android
  • MessirVoland/vlc-android
  • brett2uk/vlc-android
  • thomas.hermes/vlc-android
  • dgyudin/vlc-android
  • anuoshemohammad/vlc-android
  • r7truong/vlc-android
  • aaa1115910/vlc-android
  • arunkennedy78/vlc-android
  • nicholaszarra0069/vlc-android
  • georgipetrovdochev/vlc-android
  • Nikhil-z/vlc-android
  • misb1033/vlc-android
  • ktcoooot1/vlc-android
  • manmuc5/vlc-android
  • ahwhatisinttaken/vlc-android
  • m.nozka90/vlc-android
  • kabeermuhammad124319/vlc-android
  • ANGELONCE/vlc-android
  • manstabuk/vlc-android
  • yajcoca/vlc-android
  • dreamscell83/vlc-android
  • oldsssteveo/vlc-android
  • c0ff330k/vlc-android
  • ZhangXinmin528/vlc-android
  • lacsimarnald09/vlc-android
  • boykaisaac758/vlc-android
  • ooseidesmond/vlc-android
  • andresbott/vlc-android
  • yolandawanttoplay/vlc-android
  • lapaz17/vlc-android
  • sillyearl0138/vlc-android
  • NF-Repo/vlc-android
  • aaasg4001/vlc-android
  • mongia.puneet/vlc-android
  • slablaykon/vlc-android
  • Shabgardtanha1111/vlc-android
  • Benjamin_Loison/vlc-android
  • ashishami2002/vlc-android
  • Niram7777/vlc-android
  • Yashraj254/vlc-android
  • Choucroute_melba/vlc-android
  • Soete/vlc-android
  • MangalK/vlc-android
  • mohak2003/vlc-android
  • advait-0/vlc-android
  • McLP/vlc-android
  • fhuber/vlc-android
  • sami-sweng/vlc-android
  • josiahcarlson/vlc-android
  • mzych/vlc-android
  • amarradi/vlc-android
330 results
Show changes
Commits on Source (870)
Showing
with 360 additions and 162 deletions
......@@ -15,6 +15,9 @@ medialibrary/jni/libs
medialibrary/.libs
medialibrary/prefix
# Remote access
remoteaccess/**
# Android .so
/android-libs/**/*.so
.modules/
......
......@@ -3,7 +3,7 @@
This default template purpose is to be used to report a bug you found in VLC for Android.
To use a different template, follow the instructions here: https://code.videolan.org/videolan/vlc-android/-/wikis/Create-an-issue-and-use-a-template
To use a different template, select it from the "Description" drop-down above. If you're having trouble finding it, see https://code.videolan.org/videolan/vlc-android/-/wikis/Create-an-issue-and-use-a-template.
If you want to ask for a new feature, please use the "VLC for Android - Feature Request.md" template above.
......
......@@ -5,8 +5,17 @@ host = https://app.transifex.com
file_filter = application/resources/src/main/res/values-<lang>/strings.xml
source_file = application/resources/src/main/res/values/strings.xml
type = ANDROID
minimum_perc = 0
minimum_perc = 50
resource_name = android
replace_edited_strings = false
keep_translations = false
lang_map = zh_CN: zh-rCN, zh_TW: zh-rTW, zgh: zgh-rMA, en_GB: en-rGB, es_MX: es-rMX, pt_BR: pt-rBR, pt_PT: pt
[o:yaron:p:vlc-trans:r:android_store]
file_filter = buildsystem/automation/framing/locale/<lang>.po
source_file = buildsystem/automation/framing/locale/en.po
type = PO
minimum_perc = 100
resource_name = android (Store screenshots)
replace_edited_strings = false
keep_translations = false
\ No newline at end of file
Changes between 3.5.4 and 3.6.0 Beta 1:
Changes between 3.6.4 Beta 3 and 3.6.4 Beta 4:
------------------
* New default playback setting
* New feedback section in the about screen
* Resume playback and player behavior fixes
* Remove the reporter from the app launcher
* Add a quick play setting to play files without parsing
* Remote access: fix some mini player layout
* Remote access: always show the volume bar
* Remote access: fix the streams playback
* Fix some subtitles download issues
* Android auto behavior improvements
* Fix the equalizer navigation with DPAD
* Crash and behavior fixes
Changes between 3.6.4 Beta 2 and 3.6.4 Beta 3:
------------------
* New bookmark navigation
* Fix the resume behavior
* TV audio player improvements
* Crash and behavior fixes
Changes between 3.6.4 Beta 1 and 3.6.4 Beta 2:
------------------
* Fix a permission issue
* Add a confirmation when overwriting playlists
Changes between 3.6.3 and 3.6.4 Beta 1:
------------------
* Improve the playback speed feature
* Subtitle download fixes
* Fix some permission issues
* Widget state improvement
* UI and crash fixes
Changes between 3.6.2 and 3.6.3:
------------------
* Fix SMB navigation
* Cast only audio setting
* Behavior and crash fixes
Changes between 3.6.1 and 3.6.2:
------------------
* Update the remote access dependency to fix a crash loop
* Fix a bug making the video played twice
Changes between 3.6.0 and 3.6.1:
------------------
* Behavior and crash fixes
Changes between 3.6.0 Beta 6 and 3.6.0:
------------------
* Improve the orientation user experience in the video player
* Behavior and crash fixes
Changes between 3.6.0 Beta 5 and 3.6.0 Beta 6:
------------------
* Fix the remote access not included in the app bundle
Changes between 3.6.0 Beta 4 and 3.6.0 Beta 5:
------------------
* Allow deleting files on TV
* Multiple remote access improvements
* Fix 360 videos
* Behavior and UI fixes
* Crash fixes
Changes between 3.6.0 Beta 3 and 3.6.0 Beta 4:
------------------
* Fix subtitles download
* Improve the permission management
* Allow renaming a playlist
* Fix some language issues
* Behavior and UI fixes
* Crash fixes
Changes between 3.6.0 Beta 2 and 3.6.0 Beta 3:
------------------
* Fix custom PiP
* UI fixes
* Crash fixes
Changes between 3.5.7 and 3.6.0 Beta 2:
------------------
* Remote access: take control of your VLC for Android from any device
* Favorite any media and filter your medialibrary content by favorite
* Video player: tap to fast play
* Warning for metered connections
* PiP improvements
* Audio player chapter navigation
* UI improvements
* Crash fixes
Changes between 3.5.6 and 3.5.7:
------------------
* Fix crash when downloading subtitles
Changes between 3.5.5 and 3.5.6:
------------------
* Fix crash on startup
Changes between 3.5.4 and 3.5.5:
------------------
* Target Android 34
* This release is empty. Its sole purpose is to unlock the Play Store releases
Changes between 3.5.4 Beta 2 and 3.5.4:
------------------
* Fix media controls not working after some time on Android 13
......
......@@ -143,7 +143,8 @@ Issues without relevant information will be ignored, we cannot help in this case
## Support
- For usage support, use the in-app feedback option in the `About` screen
- Android mailing list: android@videolan.org
- bugtracker: https://code.videolan.org/videolan/vlc-android/issues
- IRC: *#videolan* channel on [freenode](http://freenode.net/)
- VideoLAN forum: https://forum.videolan.org/
- IRC: *#videolan* channel on [libera](https://libera.chat/)
- VideoLAN forum: https://forum.videolan.org/viewforum.php?f=35
......@@ -17,6 +17,10 @@ android {
}
}
packaging {
resources.excludes.add("META-INF/versions/9/OSGI-INF/MANIFEST.MF")
}
dataBinding {
enabled = true
}
......@@ -62,18 +66,35 @@ android {
}
}
}
androidComponents {
beforeVariants(selector().withBuildType("vlcBundle")) { variantBuilder ->
variantBuilder.minSdk = 30
}
beforeVariants(selector().withBuildType("vlcBundleAmazon")) { variantBuilder ->
variantBuilder.minSdk = 17
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
kotlinOptions.freeCompilerArgs = ['-Xno-param-assertions']
defaultConfig.minSdkVersion rootProject.ext.minSdkVersion
}
signedRelease {
initWith release
signingConfig = signingConfigs.release
matchingFallbacks = ['release']
}
vlcBundle {
initWith release
matchingFallbacks = ['release']
}
vlcBundleAmazon {
initWith release
matchingFallbacks = ['release']
}
debug {
applicationIdSuffix ".debug"
jniDebuggable true
......@@ -91,6 +112,12 @@ android {
manifest.srcFile 'flavors/release/AndroidManifest.xml'
}
bundle {
language {
enableSplit = false
}
}
splits {
abi {
def isReleaseBuild = false
......@@ -110,7 +137,7 @@ android {
}
}
def abiCodes = ['x86': 5, 'x86_64': 8, 'armeabi-v7a': 4, 'arm64-v8a': 7]
def abiCodes = ['armeabi-v7a': 5, 'arm64-v8a': 6, 'x86': 7, 'x86_64': 8]
lint {
abortOnError false
disable 'MissingTranslation', 'ExtraTranslation'
......@@ -123,7 +150,12 @@ android {
def outputAbi = output.getFilter(com.android.build.OutputFile.ABI)
def abiName = System.getenv('GRADLE_ABI')?.toLowerCase() ?: "all"
if (outputAbi != null) abiName = outputAbi
output.versionCodeOverride = 10000000 + defaultConfig.versionCode + abiCodes.get(abiName, 0)
def versionCode = abiCodes.get(abiName, 0)
if (variant.buildType.name == "vlcBundle") {
versionCode = 9
}
output.versionCodeOverride = 10000000 + defaultConfig.versionCode + versionCode
def outputName = "VLC-Android-"
outputName += variant.versionName.replace(" ", "-")
if (variant.buildType.name == "debug") outputName += "-debug"
......@@ -137,9 +169,9 @@ android {
dependencies {
implementation project(':application:vlc-android')
implementation project(':application:television')
implementation project(':application:webserver')
implementation project(':application:remote-access-server')
testImplementation project(':application:television')
testImplementation project(':application:webserver')
testImplementation project(':application:remote-access-server')
androidTestImplementation "androidx.test.espresso:espresso-contrib:$rootProject.espressoVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$rootProject.espressoVersion"
......@@ -149,7 +181,7 @@ dependencies {
testImplementation "androidx.arch.core:core-testing:$rootProject.ext.archVersion"
androidTestImplementation "androidx.arch.core:core-testing:$rootProject.ext.archVersion"
androidTestImplementation "androidx.test.ext:junit:$rootProject.ext.junitExtVersion"
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:$rootProject.ext.desugarLib"
androidTestUtil "androidx.test:orchestrator:$rootProject.ext.orchestrator"
testImplementation "androidx.test:core:$rootProject.ext.testCore"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$rootProject.ext.kotlinx_version"
......
......@@ -26,26 +26,36 @@ package org.videolan.vlc
import android.content.Intent
import android.content.pm.ActivityInfo
import android.net.Uri
import android.os.SystemClock
import android.util.Log
import androidx.core.view.get
import androidx.recyclerview.widget.RecyclerView
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.Espresso.pressBack
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.contrib.RecyclerViewActions
import androidx.test.espresso.matcher.ViewMatchers.*
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.rule.ActivityTestRule
import androidx.test.uiautomator.UiDevice
import androidx.viewpager.widget.ViewPager
import org.hamcrest.core.AllOf
import org.junit.ClassRule
import org.junit.Rule
import org.junit.Test
import org.videolan.medialibrary.MLServiceLocator
import org.videolan.medialibrary.interfaces.media.MediaWrapper
import org.videolan.resources.EXTRA_FOR_ESPRESSO
import org.videolan.resources.EXTRA_TARGET
import org.videolan.tools.Settings
import org.videolan.vlc.gui.MainActivity
import org.videolan.vlc.gui.helpers.UiTools.isTablet
import org.videolan.vlc.gui.view.TitleListView
import org.videolan.vlc.util.DpadHelper.pressHome
import org.videolan.vlc.util.DpadHelper.pressPip
import org.videolan.vlc.util.DpadHelper.pressStop
import org.videolan.vlc.util.DummyMediaWrapperProvider
import org.videolan.vlc.util.ScreenshotUtil
import org.videolan.vlc.util.UiUtils.waitId
import org.videolan.vlc.util.UiUtils.waitUntilLoaded
......@@ -69,23 +79,38 @@ class PhoneScreenhotsInstrumentedTest : BaseUITest() {
fun testTakeScreenshot() {
onView(isRoot()).perform(waitId(R.id.audio_list, 5000))
//Audio
// ScreenshotUtil.takeScreenshot("01_trash")
waitUntilLoaded { activity.findViewById(R.id.audio_list) }
onView(withId(R.id.sliding_tabs)).perform(TabsMatcher(0))
waitUntilLoaded { activity.findViewById(R.id.audio_list) }
SystemClock.sleep(1500)
waitUntilLoaded { activity.findViewById<ViewPager>(R.id.pager).get(0).findViewById(R.id.audio_list) }
SystemClock.sleep(500)
ScreenshotUtil.takeScreenshot(3, "audio_list")
ScreenshotUtil.takeScreenshot(2, "audio_list")
onView(withId(R.id.sliding_tabs)).perform(TabsMatcher(2))
SystemClock.sleep(500)
waitUntilLoaded { activity.findViewById(R.id.audio_list) }
waitUntilLoaded { activity.findViewById<ViewPager>(R.id.pager).get(2).findViewById(R.id.audio_list) }
SystemClock.sleep(1500)
//We use the audio list as PiP background. The PiP img is static
ScreenshotUtil.takeScreenshot(7,"pip_video")
onView(withId(R.id.ml_menu_last_playlist)).perform(click())
onView(isRoot()).perform(waitId(R.id.audio_media_switcher, 5000))
onView(withId(R.id.audio_media_switcher)).perform(click())
SystemClock.sleep(300)
ScreenshotUtil.takeScreenshot(6,"audio_player_playlist")
activity.slideUpOrDownAudioPlayer()
SystemClock.sleep(1500)
waitUntilLoaded { activity.findViewById(R.id.songs_list) }
SystemClock.sleep(1500)
ScreenshotUtil.takeScreenshot(4,"audio_player_playlist")
onView(withId(R.id.playlist_switch)).perform(click())
ScreenshotUtil.takeScreenshot(5,"audio_player")
ScreenshotUtil.takeScreenshot(3,"audio_player")
onView(withId(R.id.playlist_switch)).perform(click())
onView(withId(R.id.adv_function)).perform(click())
waitUntilLoaded { activity.findViewById(R.id.options_list) }
onView(withId(R.id.options_list))
.perform(RecyclerViewActions.actionOnItemAtPosition<RecyclerView.ViewHolder>(3, click()))
waitId(R.id.equalizer_bands, 5000)
ScreenshotUtil.takeScreenshot(9,"equalizer")
pressBack()
//close audio player
onView(withId(R.id.header)).perform(click())
pressStop()
......@@ -97,6 +122,7 @@ class PhoneScreenhotsInstrumentedTest : BaseUITest() {
.perform(click())
Log.d("Espresso", "0")
waitUntilLoaded { activity.findViewById(R.id.video_grid) }
SystemClock.sleep(1500)
Log.d("Espresso", "1")
ScreenshotUtil.takeScreenshot(1, "video_list")
......@@ -106,34 +132,23 @@ class PhoneScreenhotsInstrumentedTest : BaseUITest() {
onView(rvMatcher.atPosition(2)).perform(click())
Log.d("Espresso", "3")
rotateLandscape()
onView(isRoot()).perform(orientationLandscape())
onView(isRoot()).perform(waitId(R.id.player_root, 5000))
SystemClock.sleep(1500)
onView(withId(R.id.player_root)).perform(click())
SystemClock.sleep(500)
ScreenshotUtil.takeScreenshot(2, "video_player")
onView(withId(R.id.player_overlay_adv_function)).perform(ForceClickAction())
SystemClock.sleep(500)
ScreenshotUtil.takeScreenshot(7,"video_player_advanced_options")
disableRotateLandscape()
SystemClock.sleep(500)
onView(withRecyclerView(R.id.options_list).atPositionOnView(4, R.id.option_title)).perform(click())
// ScreenshotUtil.takeScreenshot(9,"video_player_equalizer")
pressBack()
onView(withId(R.id.player_overlay_adv_function)).perform(ForceClickAction())
onView(withRecyclerView(R.id.options_list).atPositionOnView(6, R.id.option_title)).perform(click())
pressHome()
pressPip()
ScreenshotUtil.takeScreenshot(8,"pip")
ScreenshotUtil.takeScreenshot(6, "video_player")
}
@Test
fun testTakeScreenshotBrowser() {
onView(AllOf.allOf(withId(R.id.nav_directories), withEffectiveVisibility(Visibility.VISIBLE)))
.perform(click())
ScreenshotUtil.takeScreenshot(4,"browser")
waitUntilLoaded { activity.findViewById<TitleListView>(R.id.network_browser_entry).findViewById(R.id.list) }
ScreenshotUtil.takeScreenshot(5,"browser")
}
private fun rotateLandscape() = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()).setOrientationLeft()
......@@ -150,11 +165,31 @@ class PhoneScreenhotsInstrumentedTest : BaseUITest() {
Settings.getInstance(context).edit().putBoolean("auto_rescan", false).putBoolean("audio_resume_card", false).commit()
val intent = Intent().apply {
putExtra(EXTRA_TARGET, R.id.nav_audio)
putParcelableArrayListExtra(
EXTRA_FOR_ESPRESSO, arrayListOf(
MLServiceLocator.getAbstractMediaWrapper(
Uri.parse("upnp://test/mock"), 0L, 0F, 0L, MediaWrapper.TYPE_ALL,
null, "My NAS", -1, -1, "",
"", -1, "", "",
0, 0, "/storage/emulated/0/Download/upnp2.png",
0, 0, 0,
0, 0L, 0L,
0L
),
MLServiceLocator.getAbstractMediaWrapper(
Uri.parse("upnp://test/mock"), 0L, 0F, 0L, MediaWrapper.TYPE_ALL,
null, "My SMB server", -1, -1, "",
"", -1, "", "",
0, 0, "/storage/emulated/0/Download/upnp1.png",
0, 0, 0,
0, 0L, 0L,
0L
)
)
)
}
activityTestRule.launchActivity(intent)
activity = activityTestRule.activity
if (activity.isTablet()) {
activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
}
}
}
......@@ -391,9 +391,9 @@ class FileBrowserFragmentUITest : BaseUITest() {
onView(withRecyclerView(R.id.network_list).atPosition(0)).perform(click())
onView(withId(R.id.ml_menu_save))
.check(matches(withActionIconDrawable(R.drawable.ic_am_favorite_outline)))
.check(matches(withActionIconDrawable(R.drawable.ic_fav_add)))
.perform(click())
.check(matches(withActionIconDrawable(R.drawable.ic_am_favorite)))
.check(matches(withActionIconDrawable(R.drawable.ic_fav_remove)))
onView(isRoot()).perform(pressBack())
onView(isRoot()).perform(pressBack())
......@@ -414,9 +414,9 @@ class FileBrowserFragmentUITest : BaseUITest() {
onView(withRecyclerView(R.id.network_list).atPosition(3)).perform(click())
onView(withId(R.id.ml_menu_save))
.check(matches(withActionIconDrawable(R.drawable.ic_am_favorite)))
.check(matches(withActionIconDrawable(R.drawable.ic_fav_remove)))
.perform(click())
.check(matches(withActionIconDrawable(R.drawable.ic_am_favorite_outline)))
.check(matches(withActionIconDrawable(R.drawable.ic_fav_add)))
onView(isRoot()).perform(pressBack())
......
......@@ -6,11 +6,12 @@ import androidx.test.espresso.intent.rule.IntentsTestRule
import androidx.test.filters.SdkSuppress
import org.junit.Rule
import org.junit.Test
import org.videolan.tools.KEY_AOUT
import org.videolan.tools.KEY_PLAYBACK_SPEED_PERSIST
import org.videolan.tools.RESUME_PLAYBACK
import org.videolan.vlc.PreferenceMatchers.withKey
import org.videolan.vlc.R
import org.videolan.vlc.onPreferenceRow
import org.videolan.tools.KEY_PLAYBACK_SPEED_PERSIST
import org.videolan.tools.RESUME_PLAYBACK
class PreferencesAudioUITest: BasePreferenceUITest() {
@get:Rule
......@@ -31,12 +32,6 @@ class PreferencesAudioUITest: BasePreferenceUITest() {
checkToggleWorks(key, settings)
}
@Test
fun checkSavePlaybackSpeedSetting() {
val key = KEY_PLAYBACK_SPEED_PERSIST
checkToggleWorks(key, settings)
}
@Test
fun checkPersistentAudioPlaybackSetting() {
val key = "audio_task_removed"
......@@ -77,7 +72,7 @@ class PreferencesAudioUITest: BasePreferenceUITest() {
@Test
fun checkAudioOutputModeSetting() {
// TODO: Fails due to android bug in scrolling
val key = "aout"
val key = KEY_AOUT
checkModeChanged(key, "0", "0", MAP_AOUT)
checkModeChanged(key, "1", "0", MAP_AOUT)
......
......@@ -102,7 +102,7 @@ class PreferencesUIUITest: BasePreferenceUITest() {
@Test
fun checkVideoPlaylistMode() {
val key = FORCE_PLAY_ALL_VIDEO
val key = PLAYLIST_MODE_VIDEO
checkToggleWorks(key, settings)
}
......
......@@ -6,11 +6,15 @@ import androidx.test.espresso.intent.rule.IntentsTestRule
import androidx.test.filters.SdkSuppress
import org.junit.Rule
import org.junit.Test
import org.videolan.tools.*
import org.videolan.tools.ENABLE_BRIGHTNESS_GESTURE
import org.videolan.tools.ENABLE_DOUBLE_TAP_SEEK
import org.videolan.tools.ENABLE_SEEK_BUTTONS
import org.videolan.tools.ENABLE_VOLUME_GESTURE
import org.videolan.tools.POPUP_FORCE_LEGACY
import org.videolan.tools.POPUP_KEEPSCREEN
import org.videolan.vlc.PreferenceMatchers.withKey
import org.videolan.vlc.R
import org.videolan.vlc.onPreferenceRow
import org.videolan.vlc.util.*
class PreferencesVideoUITest: BasePreferenceUITest() {
@get:Rule
......@@ -25,24 +29,12 @@ class PreferencesVideoUITest: BasePreferenceUITest() {
.perform(click())
}
@Test
fun checkPersistentBrightnessSetting() {
val key = SAVE_BRIGHTNESS
checkToggleWorks(key, settings, default = false)
}
@Test
fun checkAudioIndividualDelaySetting() {
val key = "save_individual_audio_delay"
checkToggleWorks(key, settings, default = false)
}
@Test
fun checkPersistentSpeedSetting() {
val key = KEY_PLAYBACK_SPEED_PERSIST
checkToggleWorks(key, settings, default = false)
}
@Test
fun checkVideoTitleOnTransitionSetting() {
val key = "video_transition_show"
......
......@@ -25,8 +25,6 @@ import androidx.core.net.toUri
import org.videolan.libvlc.interfaces.IMedia
import org.videolan.resources.TYPE_LOCAL_FAV
import org.videolan.resources.TYPE_NETWORK_FAV
import org.videolan.resources.opensubtitles.OpenSubtitle
import org.videolan.resources.opensubtitles.QueryParameters
import org.videolan.vlc.gui.dialogs.State
import org.videolan.vlc.gui.dialogs.SubtitleItem
......@@ -75,12 +73,12 @@ object TestUtil {
mediaPath: String,
subLanguageID: String,
movieReleaseName: String): org.videolan.vlc.mediadb.models.ExternalSub {
return org.videolan.vlc.mediadb.models.ExternalSub(idSubtitle, subtitlePath, mediaPath, subLanguageID, movieReleaseName)
return org.videolan.vlc.mediadb.models.ExternalSub(idSubtitle, subtitlePath, mediaPath, subLanguageID, movieReleaseName, false)
}
fun createExternalSubsForMedia(mediaPath: String, mediaName: String, count: Int): List<org.videolan.vlc.mediadb.models.ExternalSub> {
return (0 until count).map {
org.videolan.vlc.mediadb.models.ExternalSub(it.toString(), "${fakeSubUri}$mediaName$it", mediaPath, "en", mediaName)
org.videolan.vlc.mediadb.models.ExternalSub(it.toString(), "${fakeSubUri}$mediaName$it", mediaPath, "en", mediaName, false)
}
}
......@@ -110,26 +108,6 @@ object TestUtil {
mediaUri: Uri,
subLanguageID: String,
movieReleaseName: String,
zipDownloadLink: String): SubtitleItem = SubtitleItem(idSubtitle, mediaUri, subLanguageID, movieReleaseName, State.Downloading, zipDownloadLink)
zipDownloadLink: String): SubtitleItem = SubtitleItem(idSubtitle, -1L, mediaUri, subLanguageID, movieReleaseName, State.Downloading, zipDownloadLink, false, 0F, 0L, "")
fun createDownloadingSubtitleItem(
idSubtitle: String,
mediaPath: String,
subLanguageID: String,
movieReleaseName: String,
zipDownloadLink: String): SubtitleItem = createDownloadingSubtitleItem(idSubtitle, mediaPath.toUri(), subLanguageID, movieReleaseName, zipDownloadLink)
fun createOpenSubtitle(
idSubtitle: String,
subLanguageID: String,
movieReleaseName: String,
zipDownloadLink: String) = OpenSubtitle(
idSubtitle = idSubtitle, subLanguageID = subLanguageID, movieReleaseName = movieReleaseName, zipDownloadLink = zipDownloadLink,
idMovie = "", idMovieImdb = "", idSubMovieFile = "", idSubtitleFile = "", infoFormat = "", infoOther = "", infoReleaseGroup = "",
userID = "", iSO639 = "", movieFPS = "", languageName = "", subActualCD = "", subSumVotes = "", subAuthorComment = "", subComments = "",
score = 0.0, seriesEpisode = "", seriesIMDBParent = "", seriesSeason = "", subAddDate = "", subAutoTranslation = "", subBad = "", subDownloadLink = "",
subDownloadsCnt = "", subEncoding = "", subFeatured = "", subFileName = "", subForeignPartsOnly = "", subFormat = "", subFromTrusted = "", subHash = "",
subHD = "", subHearingImpaired = "", subLastTS = "", subRating = "", subSize = "", subSumCD = "", subtitlesLink = "", subTranslator = "", subTSGroup = "",
subTSGroupHash = "", movieByteSize = "", movieHash = "", movieTimeMS = "", queryParameters = QueryParameters("", "", ""), queryNumber = "",
userNickName = "", userRank = "", matchedBy = "", movieImdbRating = "", movieKind = "", movieName = "", movieNameEng = "", movieYear = "")
}
......@@ -20,11 +20,14 @@
package org.videolan.mobile.app
import android.annotation.TargetApi
import android.app.Activity
import android.app.Application
import android.app.Application.ActivityLifecycleCallbacks
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.os.Build
import android.os.Bundle
import kotlinx.coroutines.DEBUG_PROPERTY_NAME
import kotlinx.coroutines.DEBUG_PROPERTY_VALUE_ON
import kotlinx.coroutines.Dispatchers
......@@ -45,17 +48,20 @@ import org.videolan.resources.VLCInstance
import org.videolan.resources.util.startRemoteAccess
import org.videolan.tools.AppScope
import org.videolan.tools.KEY_ENABLE_REMOTE_ACCESS
import org.videolan.tools.KEY_INCOGNITO
import org.videolan.tools.KEY_PERSISTENT_INCOGNITO
import org.videolan.tools.Settings
import org.videolan.tools.putSingle
import org.videolan.vlc.BuildConfig
import org.videolan.vlc.gui.SendCrashActivity
import org.videolan.vlc.gui.helpers.NotificationHelper
import org.videolan.vlc.util.DialogDelegate
import org.videolan.vlc.util.NetworkConnectionManager
import org.videolan.vlc.util.VersionMigration
import org.videolan.vlc.widget.MiniPlayerAppWidgetProvider
interface AppDelegate {
val appContextProvider : AppContextProvider
fun Context.setupApplication()
fun Application.setupApplication()
}
class AppSetupDelegate : AppDelegate,
......@@ -66,7 +72,7 @@ class AppSetupDelegate : AppDelegate,
override val appContextProvider = AppContextProvider
@TargetApi(Build.VERSION_CODES.O)
override fun Context.setupApplication() {
override fun Application.setupApplication() {
appContextProvider.init(this)
NotificationHelper.createNotificationChannels(this)
......@@ -75,8 +81,8 @@ class AppSetupDelegate : AppDelegate,
FactoryManager.registerFactory(ILibVLCFactory.factoryId, LibVLCFactory())
System.setProperty(DEBUG_PROPERTY_NAME, DEBUG_PROPERTY_VALUE_ON)
val settings = Settings.getInstance(this)
if (BuildConfig.DEBUG) {
Settings.getInstance(this)
if (Settings.showTvUi) {
// Register movipedia to resume tv shows/movies
setupContentResolvers()
......@@ -85,12 +91,33 @@ class AppSetupDelegate : AppDelegate,
setupIndexers()
}
}
AppContextProvider.setLocale(Settings.getInstance(this).getString("set_locale", ""))
//App restarted, leave the incognito mode
if (!settings.getBoolean(KEY_PERSISTENT_INCOGNITO, true))
settings.putSingle(KEY_INCOGNITO, false)
AppContextProvider.setLocale(settings.getString("set_locale", ""))
//Initiate Kotlinx Dispatchers in a thread to prevent ANR
backgroundInit()
if (Settings.getInstance(this).getBoolean(KEY_ENABLE_REMOTE_ACCESS, false))
if (settings.getBoolean(KEY_ENABLE_REMOTE_ACCESS, false))
startRemoteAccess()
registerActivityLifecycleCallbacks(object : ActivityLifecycleCallbacks {
override fun onActivityResumed(activity: Activity) {
AppContextProvider.currentActivity = activity
}
override fun onActivityPaused(activity: Activity) {
AppContextProvider.currentActivity = null
}
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {}
override fun onActivityStarted(activity: Activity) {}
override fun onActivityStopped(activity: Activity) {}
override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {}
override fun onActivityDestroyed(activity: Activity) {}
})
}
// init operations executed in background threads
......@@ -100,11 +127,12 @@ class AppSetupDelegate : AppDelegate,
if (!VLCInstance.testCompatibleCPU(AppContextProvider.appContext)) return@innerLaunch
Dialog.setCallbacks(VLCInstance.getInstance(this@backgroundInit), DialogDelegate)
}
packageManager.setComponentEnabledSetting(ComponentName(this@backgroundInit, SendCrashActivity::class.java),
if (BuildConfig.BETA) PackageManager.COMPONENT_ENABLED_STATE_ENABLED else PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP)
if (!AndroidDevices.isAndroidTv) sendBroadcast(Intent(MiniPlayerAppWidgetProvider.ACTION_WIDGET_INIT).apply {
component = ComponentName(appContextProvider.appContext, MiniPlayerAppWidgetProvider::class.java)
})
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
NetworkConnectionManager.start(AppContextProvider.appContext)
}
}
}
......@@ -7,8 +7,8 @@ import android.content.IntentFilter
import kotlinx.coroutines.launch
import org.videolan.moviepedia.MediaScraper
import org.videolan.resources.ACTION_CONTENT_INDEXING
import org.videolan.resources.util.registerReceiverCompat
import org.videolan.tools.AppScope
import org.videolan.tools.localBroadcastManager
internal interface IIndexersDelegate {
fun Context.setupIndexers()
......@@ -17,7 +17,7 @@ internal interface IIndexersDelegate {
internal class IndexersDelegate : BroadcastReceiver(), IIndexersDelegate {
override fun Context.setupIndexers() {
localBroadcastManager.registerReceiver(this@IndexersDelegate, IntentFilter(ACTION_CONTENT_INDEXING))
registerReceiverCompat(this@IndexersDelegate, IntentFilter(ACTION_CONTENT_INDEXING), false)
}
override fun onReceive(context: Context?, intent: Intent?) {
......
......@@ -60,10 +60,15 @@ android {
initWith debug
matchingFallbacks = ['debug']
}
vlcBundle {
initWith release
matchingFallbacks = ['release']
}
}
namespace 'org.videolan.vlc.donations'
buildFeatures {
aidl true
buildConfig true
}
}
......
......@@ -41,8 +41,15 @@ android {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
vlcBundle {
initWith release
matchingFallbacks = ['release']
}
}
namespace 'org.videolan.liveplotgraph'
buildFeatures {
buildConfig true
}
}
......
......@@ -53,6 +53,10 @@ android {
initWith debug
matchingFallbacks = ['debug']
}
vlcBundle {
initWith release
matchingFallbacks = ['release']
}
}
namespace 'org.videolan.vlc.mediadb'
......
......@@ -33,7 +33,7 @@ import org.videolan.vlc.mediadb.models.*
private const val DB_NAME = "vlc_database"
@Database(entities = [ExternalSub::class, Slave::class, BrowserFav::class, CustomDirectory::class, Widget::class], version = 35, exportSchema = false)
@Database(entities = [ExternalSub::class, Slave::class, BrowserFav::class, CustomDirectory::class, Widget::class], version = 36, exportSchema = false)
@TypeConverters(Converters::class)
abstract class MediaDatabase: RoomDatabase() {
abstract fun externalSubDao(): ExternalSubDao
......@@ -55,7 +55,7 @@ private fun buildDatabase(context: Context) = Room.databaseBuilder(context.appli
migration_21_22, migration_22_23, migration_23_24, migration_24_25,
migration_25_26, migration_26_27, migration_27_28, migration_28_29,
migration_29_30, migration_30_31, migration_31_32, migration_32_33,
migration_33_34, migration_34_35)
migration_33_34, migration_34_35, migration_35_36)
.addCallback(object : RoomDatabase.Callback() {
override fun onCreate(db: SupportSQLiteDatabase) { if (!AndroidDevices.isTv) populateDB(context) }
})
......
......@@ -57,199 +57,206 @@ fun dropUnnecessaryTables(database: SupportSQLiteDatabase) {
}
val migration_1_2 = object:Migration(1, 2) {
override fun migrate(database: SupportSQLiteDatabase) {}
override fun migrate(db: SupportSQLiteDatabase) {}
}
val migration_2_3 = object:Migration(2, 3) {
override fun migrate(database: SupportSQLiteDatabase) {}
override fun migrate(db: SupportSQLiteDatabase) {}
}
val migration_3_4 = object:Migration(3, 4) {
override fun migrate(database: SupportSQLiteDatabase) {}
override fun migrate(db: SupportSQLiteDatabase) {}
}
val migration_4_5 = object:Migration(4, 5) {
override fun migrate(database: SupportSQLiteDatabase) { }
override fun migrate(db: SupportSQLiteDatabase) { }
}
val migration_5_6 = object:Migration(5, 6) {
override fun migrate(database: SupportSQLiteDatabase) { }
override fun migrate(db: SupportSQLiteDatabase) { }
}
val migration_6_7 = object:Migration(6, 7) {
override fun migrate(database: SupportSQLiteDatabase) { }
override fun migrate(db: SupportSQLiteDatabase) { }
}
val migration_7_8 = object:Migration(7, 8) {
override fun migrate(database: SupportSQLiteDatabase) { }
override fun migrate(db: SupportSQLiteDatabase) { }
}
val migration_8_9 = object:Migration(8, 9) {
override fun migrate(database: SupportSQLiteDatabase) { }
override fun migrate(db: SupportSQLiteDatabase) { }
}
val migration_9_10 = object:Migration(9, 10) {
override fun migrate(database: SupportSQLiteDatabase) { }
override fun migrate(db: SupportSQLiteDatabase) { }
}
val migration_10_11 = object:Migration(10, 11) {
override fun migrate(database: SupportSQLiteDatabase) { }
override fun migrate(db: SupportSQLiteDatabase) { }
}
val migration_11_12 = object:Migration(11, 12) {
override fun migrate(database: SupportSQLiteDatabase) { }
override fun migrate(db: SupportSQLiteDatabase) { }
}
val migration_12_13 = object:Migration(12, 13) {
override fun migrate(database: SupportSQLiteDatabase) {
override fun migrate(db: SupportSQLiteDatabase) {
}
}
val migration_13_14 = object:Migration(13, 14) {
override fun migrate(database: SupportSQLiteDatabase) { }
override fun migrate(db: SupportSQLiteDatabase) { }
}
val migration_14_15 = object:Migration(14, 15) {
override fun migrate(database: SupportSQLiteDatabase) { }
override fun migrate(db: SupportSQLiteDatabase) { }
}
val migration_15_16 = object:Migration(15, 16) {
override fun migrate(database: SupportSQLiteDatabase) { }
override fun migrate(db: SupportSQLiteDatabase) { }
}
val migration_16_17 = object:Migration(16, 17) {
override fun migrate(database: SupportSQLiteDatabase) { }
override fun migrate(db: SupportSQLiteDatabase) { }
}
val migration_17_18 = object:Migration(17, 18) {
override fun migrate(database: SupportSQLiteDatabase) {
override fun migrate(db: SupportSQLiteDatabase) {
}
}
val migration_18_19 = object:Migration(18, 19) {
override fun migrate(database: SupportSQLiteDatabase) { }
override fun migrate(db: SupportSQLiteDatabase) { }
}
val migration_19_20 = object:Migration(19, 20) {
override fun migrate(database: SupportSQLiteDatabase) { }
override fun migrate(db: SupportSQLiteDatabase) { }
}
val migration_20_21 = object:Migration(20, 21) {
override fun migrate(database: SupportSQLiteDatabase) { }
override fun migrate(db: SupportSQLiteDatabase) { }
}
val migration_21_22 = object:Migration(21, 22) {
override fun migrate(database: SupportSQLiteDatabase) { }
override fun migrate(db: SupportSQLiteDatabase) { }
}
val migration_22_23 = object:Migration(22, 23) {
override fun migrate(database: SupportSQLiteDatabase) { }
override fun migrate(db: SupportSQLiteDatabase) { }
}
val migration_23_24 = object:Migration(23, 24) {
override fun migrate(database: SupportSQLiteDatabase) {
database.execSQL("DROP TABLE IF EXISTS $FAV_TABLE_NAME;")
database.execSQL("CREATE TABLE IF NOT EXISTS $FAV_TABLE_NAME ( uri TEXT PRIMARY KEY NOT NULL, title TEXT NOT NULL, icon_url TEXT);")
override fun migrate(db: SupportSQLiteDatabase) {
db.execSQL("DROP TABLE IF EXISTS $FAV_TABLE_NAME;")
db.execSQL("CREATE TABLE IF NOT EXISTS $FAV_TABLE_NAME ( uri TEXT PRIMARY KEY NOT NULL, title TEXT NOT NULL, icon_url TEXT);")
}
}
val migration_24_25 = object:Migration(24, 25) {
override fun migrate(database: SupportSQLiteDatabase) {
database.execSQL("CREATE TABLE IF NOT EXISTS $EXTERNAL_SUBTITLES_TABLE_NAME ( uri TEXT PRIMARY KEY NOT NULL, media_name TEXT NOT NULL);")
override fun migrate(db: SupportSQLiteDatabase) {
db.execSQL("CREATE TABLE IF NOT EXISTS $EXTERNAL_SUBTITLES_TABLE_NAME ( uri TEXT PRIMARY KEY NOT NULL, media_name TEXT NOT NULL);")
}
}
val migration_25_26 = object:Migration(25, 26) {
override fun migrate(database: SupportSQLiteDatabase) {
database.execSQL("CREATE TABLE IF NOT EXISTS $SLAVES_TABLE_NAME ( slave_media_mrl TEXT PRIMARY KEY NOT NULL, slave_type INTEGER NOT NULL, slave_priority INTEGER, slave_uri TEXT NOT NULL);")
override fun migrate(db: SupportSQLiteDatabase) {
db.execSQL("CREATE TABLE IF NOT EXISTS $SLAVES_TABLE_NAME ( slave_media_mrl TEXT PRIMARY KEY NOT NULL, slave_type INTEGER NOT NULL, slave_priority INTEGER, slave_uri TEXT NOT NULL);")
}
}
val migration_26_27 = object:Migration(26, 27) {
override fun migrate(database: SupportSQLiteDatabase) {
dropUnnecessaryTables(database)
override fun migrate(db: SupportSQLiteDatabase) {
dropUnnecessaryTables(db)
val slavesTableNameTemp = "${SLAVES_TABLE_NAME}_TEMP"
database.execSQL("UPDATE $SLAVES_TABLE_NAME SET slave_priority=2 WHERE slave_priority IS NULL;")
database.execSQL("CREATE TABLE IF NOT EXISTS $slavesTableNameTemp ( slave_media_mrl TEXT PRIMARY KEY NOT NULL, slave_type INTEGER NOT NULL, slave_priority INTEGER NOT NULL, slave_uri TEXT NOT NULL);")
database.execSQL("INSERT INTO $slavesTableNameTemp(slave_media_mrl, slave_type, slave_priority, slave_uri) SELECT slave_media_mrl, slave_type, slave_priority, slave_uri FROM $SLAVES_TABLE_NAME")
database.execSQL("DROP TABLE $SLAVES_TABLE_NAME")
database.execSQL("ALTER TABLE $slavesTableNameTemp RENAME TO $SLAVES_TABLE_NAME")
db.execSQL("UPDATE $SLAVES_TABLE_NAME SET slave_priority=2 WHERE slave_priority IS NULL;")
db.execSQL("CREATE TABLE IF NOT EXISTS $slavesTableNameTemp ( slave_media_mrl TEXT PRIMARY KEY NOT NULL, slave_type INTEGER NOT NULL, slave_priority INTEGER NOT NULL, slave_uri TEXT NOT NULL);")
db.execSQL("INSERT INTO $slavesTableNameTemp(slave_media_mrl, slave_type, slave_priority, slave_uri) SELECT slave_media_mrl, slave_type, slave_priority, slave_uri FROM $SLAVES_TABLE_NAME")
db.execSQL("DROP TABLE $SLAVES_TABLE_NAME")
db.execSQL("ALTER TABLE $slavesTableNameTemp RENAME TO $SLAVES_TABLE_NAME")
// Add a type column and set its value to 0 (till this version all favs were network favs)
database.execSQL("ALTER TABLE $FAV_TABLE_NAME ADD COLUMN type INTEGER NOT NULL DEFAULT 0;")
db.execSQL("ALTER TABLE $FAV_TABLE_NAME ADD COLUMN type INTEGER NOT NULL DEFAULT 0;")
}
}
val migration_27_28 = object:Migration(27, 28) {
override fun migrate(database: SupportSQLiteDatabase) {
override fun migrate(db: SupportSQLiteDatabase) {
val preferences = Settings.getInstance(AppContextProvider.appContext)
val customPaths = preferences.getString("custom_paths", "")
var oldPaths : List<String>? = null
if (!customPaths.isNullOrEmpty()) oldPaths = customPaths.split(":")
database.execSQL("CREATE TABLE IF NOT EXISTS $CUSTOM_DIRECTORY_TABLE_NAME(path TEXT PRIMARY KEY NOT NULL);")
db.execSQL("CREATE TABLE IF NOT EXISTS $CUSTOM_DIRECTORY_TABLE_NAME(path TEXT PRIMARY KEY NOT NULL);")
oldPaths?.forEach {
database.execSQL("INSERT INTO $CUSTOM_DIRECTORY_TABLE_NAME(path) VALUES (\"$it\")")
db.execSQL("INSERT INTO $CUSTOM_DIRECTORY_TABLE_NAME(path) VALUES (\"$it\")")
}
}
}
val migration_28_29 = object:Migration(28, 29) {
override fun migrate(database: SupportSQLiteDatabase) {
override fun migrate(db: SupportSQLiteDatabase) {
// Drop old External Subtitle Table
database.execSQL("DROP TABLE IF EXISTS $EXTERNAL_SUBTITLES_TABLE_NAME;")
database.execSQL("CREATE TABLE IF NOT EXISTS `${EXTERNAL_SUBTITLES_TABLE_NAME}` (`idSubtitle` TEXT NOT NULL, `subtitlePath` TEXT NOT NULL, `mediaPath` TEXT NOT NULL, `subLanguageID` TEXT NOT NULL, `movieReleaseName` TEXT NOT NULL, PRIMARY KEY(`mediaPath`, `idSubtitle`))")
db.execSQL("DROP TABLE IF EXISTS $EXTERNAL_SUBTITLES_TABLE_NAME;")
db.execSQL("CREATE TABLE IF NOT EXISTS `${EXTERNAL_SUBTITLES_TABLE_NAME}` (`idSubtitle` TEXT NOT NULL, `subtitlePath` TEXT NOT NULL, `mediaPath` TEXT NOT NULL, `subLanguageID` TEXT NOT NULL, `movieReleaseName` TEXT NOT NULL, PRIMARY KEY(`mediaPath`, `idSubtitle`))")
}
}
val migration_29_30 = object:Migration(29, 30) {
override fun migrate(database: SupportSQLiteDatabase) {
override fun migrate(db: SupportSQLiteDatabase) {
// Insert the new whatsapp path
val uri = AndroidDevices.MediaFolders.WHATSAPP_VIDEOS_FILE_URI_A11
database.execSQL("INSERT INTO $FAV_TABLE_NAME(uri, type, title, icon_url) VALUES (\"$uri\", 1, \"${uri.lastPathSegment}\", null)")
db.execSQL("INSERT INTO $FAV_TABLE_NAME(uri, type, title, icon_url) VALUES (\"$uri\", 1, \"${uri.lastPathSegment}\", null)")
}
}
val migration_30_31 = object:Migration(30, 31) {
override fun migrate(database: SupportSQLiteDatabase) {
database.execSQL("CREATE TABLE IF NOT EXISTS `${WIDGET_TABLE_NAME}` ( `id` INTEGER PRIMARY KEY NOT NULL, `width` INTEGER NOT NULL, `height` INTEGER NOT NULL, `theme` INTEGER NOT NULL, `light_theme` INTEGER NOT NULL, `background_color` INTEGER NOT NULL, `foreground_color` INTEGER NOT NULL, `forward_delay` INTEGER NOT NULL, `rewind_delay` INTEGER NOT NULL, `opacity` INTEGER NOT NULL, `show_configure` INTEGER NOT NULL);")
override fun migrate(db: SupportSQLiteDatabase) {
db.execSQL("CREATE TABLE IF NOT EXISTS `${WIDGET_TABLE_NAME}` ( `id` INTEGER PRIMARY KEY NOT NULL, `width` INTEGER NOT NULL, `height` INTEGER NOT NULL, `theme` INTEGER NOT NULL, `light_theme` INTEGER NOT NULL, `background_color` INTEGER NOT NULL, `foreground_color` INTEGER NOT NULL, `forward_delay` INTEGER NOT NULL, `rewind_delay` INTEGER NOT NULL, `opacity` INTEGER NOT NULL, `show_configure` INTEGER NOT NULL);")
}
}
val migration_31_32 = object:Migration(31, 32) {
override fun migrate(database: SupportSQLiteDatabase) {
database.execSQL("ALTER TABLE $WIDGET_TABLE_NAME ADD COLUMN show_seek INTEGER NOT NULL DEFAULT 0;")
override fun migrate(db: SupportSQLiteDatabase) {
db.execSQL("ALTER TABLE $WIDGET_TABLE_NAME ADD COLUMN show_seek INTEGER NOT NULL DEFAULT 0;")
}
}
val migration_32_33 = object:Migration(32, 33) {
override fun migrate(database: SupportSQLiteDatabase) {
database.execSQL("ALTER TABLE $WIDGET_TABLE_NAME ADD COLUMN show_cover INTEGER NOT NULL DEFAULT 0;")
override fun migrate(db: SupportSQLiteDatabase) {
db.execSQL("ALTER TABLE $WIDGET_TABLE_NAME ADD COLUMN show_cover INTEGER NOT NULL DEFAULT 0;")
}
}
val migration_33_34 = object:Migration(33, 34) {
override fun migrate(database: SupportSQLiteDatabase) {
database.execSQL("ALTER TABLE $WIDGET_TABLE_NAME ADD COLUMN type INTEGER NOT NULL DEFAULT 0;")
override fun migrate(db: SupportSQLiteDatabase) {
db.execSQL("ALTER TABLE $WIDGET_TABLE_NAME ADD COLUMN type INTEGER NOT NULL DEFAULT 0;")
}
}
val migration_34_35 = object:Migration(34, 35) {
override fun migrate(database: SupportSQLiteDatabase) {
override fun migrate(db: SupportSQLiteDatabase) {
val slavesTableNameTemp = "${SLAVES_TABLE_NAME}_TEMP"
database.execSQL("CREATE TABLE IF NOT EXISTS $slavesTableNameTemp (" +
db.execSQL("CREATE TABLE IF NOT EXISTS $slavesTableNameTemp (" +
"slave_media_mrl TEXT NOT NULL, " +
"slave_type INTEGER NOT NULL, " +
"slave_priority INTEGER NOT NULL, " +
"slave_uri TEXT NOT NULL, " +
"PRIMARY KEY (slave_media_mrl, slave_uri));")
database.execSQL("INSERT INTO $slavesTableNameTemp(slave_media_mrl, slave_type, slave_priority, slave_uri) SELECT slave_media_mrl, slave_type, slave_priority, slave_uri FROM $SLAVES_TABLE_NAME")
db.execSQL("INSERT INTO $slavesTableNameTemp(slave_media_mrl, slave_type, slave_priority, slave_uri) SELECT slave_media_mrl, slave_type, slave_priority, slave_uri FROM $SLAVES_TABLE_NAME")
db.execSQL("DROP TABLE $SLAVES_TABLE_NAME")
db.execSQL("ALTER TABLE $slavesTableNameTemp RENAME TO $SLAVES_TABLE_NAME")
}
}
val migration_35_36 = object:Migration(35, 36) {
override fun migrate(db: SupportSQLiteDatabase) {
db.execSQL("ALTER TABLE $EXTERNAL_SUBTITLES_TABLE_NAME ADD COLUMN `hearingImpaired` INTEGER DEFAULT 0 not null")
database.execSQL("DROP TABLE $SLAVES_TABLE_NAME")
database.execSQL("ALTER TABLE $slavesTableNameTemp RENAME TO $SLAVES_TABLE_NAME")
}
}
......
......@@ -20,6 +20,7 @@
package org.videolan.vlc.mediadb.models
import androidx.room.ColumnInfo
import androidx.room.Entity
@Entity(tableName = "external_subtitles_table", primaryKeys = ["mediaPath", "idSubtitle"])
......@@ -28,5 +29,7 @@ data class ExternalSub (
val subtitlePath: String,
val mediaPath: String,
val subLanguageID: String,
val movieReleaseName: String
val movieReleaseName: String,
@ColumnInfo(defaultValue = "0")
val hearingImpaired: Boolean
)