mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-13 22:00:30 +05:30
Merge pull request #921 from Bnyro/master
use date as version for debug builds
This commit is contained in:
commit
4cfa4d8fb7
@ -21,6 +21,17 @@ android {
|
||||
viewBinding true
|
||||
}
|
||||
|
||||
applicationVariants.all { variant ->
|
||||
// use the date as version for debug builds
|
||||
if (variant.name == 'debug') {
|
||||
variant.outputs.each { output ->
|
||||
def date = getDate()
|
||||
output.versionCodeOverride = date
|
||||
output.versionNameOverride = date
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled true
|
||||
@ -92,3 +103,9 @@ dependencies {
|
||||
implementation libs.cronet.okhttp
|
||||
implementation libs.coil
|
||||
}
|
||||
|
||||
static def getDate() {
|
||||
def date = new Date()
|
||||
def formattedDate = date.format('yyyyMMddHH')
|
||||
return Integer.parseInt(formattedDate)
|
||||
}
|
@ -61,4 +61,4 @@
|
||||
}
|
||||
],
|
||||
"elementType": "File"
|
||||
}
|
||||
}
|
||||
|
@ -5,8 +5,8 @@ import android.app.Service
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.IBinder
|
||||
import android.util.Log
|
||||
import androidx.annotation.Nullable
|
||||
import com.github.libretube.PLAYER_NOTIFICATION_ID
|
||||
|
||||
class ClosingService : Service() {
|
||||
private val TAG = "ClosingService"
|
||||
@ -20,10 +20,9 @@ class ClosingService : Service() {
|
||||
override fun onTaskRemoved(rootIntent: Intent?) {
|
||||
super.onTaskRemoved(rootIntent)
|
||||
|
||||
// destroy all notifications (especially the player notification)
|
||||
// destroy the player notification when the app gets destroyed
|
||||
val nManager = this.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
||||
nManager.cancelAll()
|
||||
Log.e(TAG, "closed")
|
||||
nManager.cancel(PLAYER_NOTIFICATION_ID)
|
||||
|
||||
// Destroy the service
|
||||
stopSelf()
|
||||
|
Loading…
Reference in New Issue
Block a user