eol build for izzy repo

This commit is contained in:
Matthieu 2021-05-15 11:58:28 +02:00
parent 1cf85fc624
commit 41c1432b39
5 changed files with 25 additions and 3 deletions

View File

@ -24,8 +24,8 @@ android {
applicationId "com.h.pixeldroid"
minSdkVersion 23
targetSdkVersion 30
versionCode 10
versionName "1.0.alpha9"
versionCode 999
versionName "1.0.alpha9.eol"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments clearPackageData: 'true'

View File

@ -1,5 +1,6 @@
package com.h.pixeldroid
import android.app.AlertDialog
import android.content.Context
import android.content.Intent
import android.graphics.drawable.Drawable
@ -30,6 +31,7 @@ import com.h.pixeldroid.utils.db.entities.HomeStatusDatabaseEntity
import com.h.pixeldroid.utils.db.entities.PublicFeedStatusDatabaseEntity
import com.h.pixeldroid.utils.db.entities.UserDatabaseEntity
import com.h.pixeldroid.utils.hasInternet
import com.h.pixeldroid.utils.openUrl
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.mikepenz.materialdrawer.iconics.iconicsIcon
import com.mikepenz.materialdrawer.model.PrimaryDrawerItem
@ -91,6 +93,12 @@ class MainActivity : BaseActivity() {
}
)
setupTabs(tabs)
AlertDialog.Builder(this).apply {
setMessage("PixelDroid is now published on the main F-Droid repo. The version from the IzzyOnDroid repo is very out of date. Press OK to go to the main F-Droid repo to get the new and improved version, and don't forget to uninstall this version.")
setPositiveButton(android.R.string.ok) { _, _ -> openUrl("https://f-droid.org/en/packages/org.pixeldroid.app/")}
setNegativeButton(android.R.string.cancel) { _, _ -> }
}.show()
}
}

View File

@ -1,8 +1,11 @@
package com.h.pixeldroid.utils.db
import android.database.Cursor
import androidx.room.Database
import androidx.room.RoomDatabase
import androidx.room.TypeConverters
import androidx.room.migration.Migration
import androidx.sqlite.db.SupportSQLiteDatabase
import com.h.pixeldroid.utils.db.dao.*
import com.h.pixeldroid.utils.db.dao.feedContent.NotificationDao
import com.h.pixeldroid.utils.db.dao.feedContent.posts.HomePostDao
@ -29,4 +32,13 @@ abstract class AppDatabase : RoomDatabase() {
abstract fun homePostDao(): HomePostDao
abstract fun publicPostDao(): PublicPostDao
abstract fun notificationDao(): NotificationDao
}
val MIGRATION_2_3 = object : Migration(2, 3) {
override fun migrate(database: SupportSQLiteDatabase) {
database.execSQL("ALTER TABLE instances ADD COLUMN maxPhotoSize INTEGER NOT NULL DEFAULT 8000")
database.execSQL("ALTER TABLE instances RENAME COLUMN max_toot_chars TO maxStatusChars")
database.execSQL("ALTER TABLE instances ADD COLUMN maxVideoSize INTEGER NOT NULL DEFAULT 40000")
database.execSQL("ALTER TABLE instances ADD COLUMN albumLimit INTEGER NOT NULL DEFAULT 4")
}
}

View File

@ -15,6 +15,7 @@ data class InstanceDatabaseEntity (
var maxVideoSize: Int = DEFAULT_MAX_VIDEO_SIZE,
// How many photos can go into an album. Default limit for Pixelfed and Mastodon is 4
var albumLimit: Int = DEFAULT_ALBUM_LIMIT,
var thumbnail: String = ""
) {
companion object{
// Default max number of chars for Mastodon: used when their is no other value supplied by

View File

@ -3,6 +3,7 @@ package com.h.pixeldroid.utils.di
import android.content.Context
import androidx.room.Room
import com.h.pixeldroid.utils.db.AppDatabase
import com.h.pixeldroid.utils.db.MIGRATION_2_3
import dagger.Module
import dagger.Provides
import javax.inject.Singleton
@ -16,6 +17,6 @@ class DatabaseModule(private val context: Context) {
return Room.databaseBuilder(
context,
AppDatabase::class.java, "pixeldroid"
).allowMainThreadQueries().build()
).addMigrations(MIGRATION_2_3).allowMainThreadQueries().build()
}
}