davidoskky
46e723a238
* Refactor Item addition and deletion * Metods to filter the items according to read and starred status * Remove displayed items only if displaying unread items * Remove unnecessary api calls on tab change and delegate item storage to SharedItems * Store articles in SharedItems when they get fetched * Add tag filtering * Mark items as read * Disable sorting function * Add function to get the unread status of an element. * Fetch items on pull gesture * Move marking as read logic in SharedItems. * Delegate item status to SharedItems * Allow changing unread status of items * Use full article position reference and not the relative one * Delegate marking items as unread to SharedItems * Delegate database addition of Items to SharedItems. * Function to only provide connectivity information * Better database management * Sort items by date * Provide information about item caching to SharedItems * Add missing imports * Update database after fetching articles * Add missing variable * Remove unused import * Use coroutines to access database * Use coroutines to simultaneously fetch articles. * Update database after fetching articles. * Don't block thread when accessing the database * Prevent crash if connectivity is lost while fetching articles * Show "Not connected" snackbar if there is no connection or connection is lost during download * Use coroutines in the background sync * Added function to get only new items * Introduced function to filter articles * Don't execute background sync if the option is disabled * Improve item filtering * Apply filters when they are selected on the UI * Handle infinite scroll * Incorrect parameters were passed * Simplify tab selection logic * Upgrade kotlin jvm to version 1.8 * On tab change fetch new items if the item list is not completely populated * Remove redundant assignations. * Fetch articles when changing tag, source or search if the list is not fully populated * Fetch only the article in the tab selected * Correct inconsistent position address * Disable swiping articles only if favorites are selected * Delegate badge count to SharedItems * Clear the database when the app starts in order to avoid accumulation and inconsistencies * Remove unused functions and variables * Do not overwrite fetched items with old copies from the database * Display "There's nothing here" only if there are no articles * Adapt function to read all articles to the new changes * Use IO Dispatcher for Database and Network computations * Adapt Background sync to the usage of SharedItems * Handle refresh gesture appropriately by refreshing the whole items list * Remove unused imports
162 lines
5.3 KiB
Groovy
162 lines
5.3 KiB
Groovy
buildscript {
|
|
}
|
|
|
|
def gitVersion() {
|
|
def process
|
|
def maybeTagOfCurrentCommit = 'git describe --contains HEAD'.execute()
|
|
if (maybeTagOfCurrentCommit.text.isEmpty()) {
|
|
println "No tag on current commit. Will take the latest one."
|
|
process = "git for-each-ref refs/tags --sort=-authordate --format='%(refname:short)' --count=1".execute()
|
|
} else {
|
|
println "Tag found on current commit"
|
|
process = 'git describe --contains HEAD'.execute()
|
|
}
|
|
return process.text.replaceAll("'", "").substring(1).replaceAll("\\.", "").trim()
|
|
}
|
|
|
|
def versionCodeFromGit() {
|
|
println "version code " + gitVersion()
|
|
return gitVersion().toInteger()
|
|
}
|
|
|
|
def versionNameFromGit() {
|
|
println "version name " + gitVersion()
|
|
return gitVersion()
|
|
}
|
|
|
|
apply plugin: 'com.android.application'
|
|
|
|
apply plugin: 'kotlin-android'
|
|
|
|
apply plugin: 'kotlin-kapt'
|
|
|
|
android {
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
}
|
|
compileSdkVersion 30
|
|
buildToolsVersion '30.0.3'
|
|
buildFeatures {
|
|
viewBinding true
|
|
}
|
|
defaultConfig {
|
|
applicationId "apps.amine.bou.readerforselfoss"
|
|
minSdkVersion 16
|
|
targetSdkVersion 30
|
|
versionCode versionCodeFromGit()
|
|
versionName versionNameFromGit()
|
|
|
|
// Enabling multidex support.
|
|
multiDexEnabled true
|
|
lintOptions {
|
|
abortOnError true
|
|
disable 'InvalidPackage'
|
|
}
|
|
vectorDrawables.useSupportLibrary = true
|
|
|
|
// tests
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
|
|
javaCompileOptions {
|
|
annotationProcessorOptions {
|
|
arguments = ["room.schemaLocation":
|
|
"$projectDir/schemas".toString()]
|
|
}
|
|
}
|
|
}
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled true
|
|
shrinkResources false
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'),
|
|
'proguard-rules.pro'
|
|
}
|
|
debug {
|
|
}
|
|
}
|
|
flavorDimensions "build"
|
|
productFlavors {
|
|
githubConfig {
|
|
versionNameSuffix '-github'
|
|
dimension "build"
|
|
}
|
|
}
|
|
kotlinOptions {
|
|
jvmTarget = '1.8'
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
// Testing
|
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0-alpha02'
|
|
androidTestImplementation 'androidx.test:runner:1.3.1-alpha02'
|
|
// Espresso-contrib for DatePicker, RecyclerView, Drawer actions, Accessibility checks, CountingIdlingResource
|
|
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.4.0-alpha02'
|
|
// Espresso-intents for validation and stubbing of Intents
|
|
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.4.0-alpha02'
|
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
// Android Support
|
|
implementation "androidx.appcompat:appcompat:1.3.0-alpha02"
|
|
implementation 'com.google.android.material:material:1.3.0-beta01'
|
|
implementation 'androidx.recyclerview:recyclerview:1.2.0-beta01'
|
|
implementation "androidx.legacy:legacy-support-v4:$android_version"
|
|
implementation 'androidx.vectordrawable:vectordrawable:1.2.0-alpha02'
|
|
implementation "androidx.browser:browser:1.3.0"
|
|
implementation "androidx.cardview:cardview:$android_version"
|
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.0-alpha2'
|
|
implementation 'org.jsoup:jsoup:1.13.1'
|
|
|
|
//multidex
|
|
implementation 'androidx.multidex:multidex:2.0.1'
|
|
|
|
// About
|
|
implementation('com.mikepenz:aboutlibraries:6.2.0@aar') {
|
|
transitive = true
|
|
}
|
|
|
|
// Async
|
|
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9'
|
|
|
|
// Retrofit + http logging + okhttp
|
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
|
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.0'
|
|
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
|
implementation 'com.burgstaller:okhttp-digest:1.12'
|
|
|
|
// Material-ish things
|
|
implementation 'com.ashokvarma.android:bottom-navigation-bar:2.1.0'
|
|
implementation 'com.github.jd-alexander:LikeButton:0.2.3'
|
|
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
|
|
|
|
// glide
|
|
implementation 'com.github.bumptech.glide:glide:4.1.1'
|
|
implementation 'com.github.bumptech.glide:okhttp3-integration:4.1.1'
|
|
|
|
// Drawer
|
|
implementation 'co.zsmb:materialdrawer-kt:2.0.2'
|
|
|
|
// Themes
|
|
implementation 'com.52inc:scoops:1.0.0'
|
|
implementation 'com.jaredrummler:colorpicker:1.0.2'
|
|
implementation 'com.github.rubensousa:floatingtoolbar:1.5.1'
|
|
|
|
// Pager
|
|
implementation 'me.relex:circleindicator:2.0.0@aar'
|
|
|
|
//PhotoView
|
|
implementation 'com.github.chrisbanes:PhotoView:2.0.0'
|
|
|
|
implementation 'androidx.core:core-ktx:1.5.0-alpha05'
|
|
|
|
implementation "androidx.lifecycle:lifecycle-livedata:2.3.0-rc01"
|
|
implementation "androidx.lifecycle:lifecycle-common-java8:2.3.0-rc01"
|
|
|
|
implementation "androidx.room:room-runtime:2.3.0-alpha04"
|
|
implementation "androidx.room:room-ktx:2.3.0-alpha04"
|
|
kapt "androidx.room:room-compiler:2.3.0-alpha04"
|
|
|
|
implementation "android.arch.work:work-runtime-ktx:$work_version"
|
|
}
|