Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
FreshRSS-Android
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
30
Issues
30
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Christophe Henry
FreshRSS-Android
Commits
c34e36d1
Commit
c34e36d1
authored
Apr 16, 2019
by
Christophe Henry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Solves
#18
: Setup a linter
- Also fixes lint issues
parent
b8e436d8
Changes
64
Hide whitespace changes
Inline
Side-by-side
Showing
64 changed files
with
289 additions
and
241 deletions
+289
-241
CONTRIBUTING.md
CONTRIBUTING.md
+7
-0
app/build.gradle
app/build.gradle
+31
-3
app/src/main/AndroidManifest.xml
app/src/main/AndroidManifest.xml
+2
-7
app/src/main/java/fr/chenry/android/freshrss/FreshRSSApplication.kt
...in/java/fr/chenry/android/freshrss/FreshRSSApplication.kt
+1
-1
app/src/main/java/fr/chenry/android/freshrss/components/subscriptionarticles/webviewutils/MailIntent.kt
...omponents/subscriptionarticles/webviewutils/MailIntent.kt
+2
-2
app/src/main/java/fr/chenry/android/freshrss/components/subscriptionarticles/webviewutils/WebViewClient.kt
...onents/subscriptionarticles/webviewutils/WebViewClient.kt
+1
-1
app/src/main/java/fr/chenry/android/freshrss/components/subscriptions/SubscriptionSection.kt
.../freshrss/components/subscriptions/SubscriptionSection.kt
+1
-1
app/src/main/java/fr/chenry/android/freshrss/components/subscriptions/adapters/AbstractSubscriptionViewItem.kt
...ts/subscriptions/adapters/AbstractSubscriptionViewItem.kt
+1
-1
app/src/main/java/fr/chenry/android/freshrss/components/subscriptions/adapters/SubscriptionViewHeaderItem.kt
...ents/subscriptions/adapters/SubscriptionViewHeaderItem.kt
+1
-1
app/src/main/java/fr/chenry/android/freshrss/store/Store.kt
app/src/main/java/fr/chenry/android/freshrss/store/Store.kt
+1
-1
app/src/main/java/fr/chenry/android/freshrss/store/api/Endpoints.kt
...in/java/fr/chenry/android/freshrss/store/api/Endpoints.kt
+1
-1
app/src/main/java/fr/chenry/android/freshrss/store/api/models/ContentItem.kt
...r/chenry/android/freshrss/store/api/models/ContentItem.kt
+1
-1
app/src/main/java/fr/chenry/android/freshrss/store/api/models/SerDeser.kt
...a/fr/chenry/android/freshrss/store/api/models/SerDeser.kt
+1
-1
app/src/main/java/fr/chenry/android/freshrss/store/api/models/SubscriptionApiItem.kt
.../android/freshrss/store/api/models/SubscriptionApiItem.kt
+1
-1
app/src/main/java/fr/chenry/android/freshrss/store/api/models/Tags.kt
.../java/fr/chenry/android/freshrss/store/api/models/Tags.kt
+1
-1
app/src/main/java/fr/chenry/android/freshrss/store/api/models/UnreadCounts.kt
.../chenry/android/freshrss/store/api/models/UnreadCounts.kt
+1
-1
app/src/main/java/fr/chenry/android/freshrss/store/database/FreshRSSDabatabase.kt
...nry/android/freshrss/store/database/FreshRSSDabatabase.kt
+1
-1
app/src/main/java/fr/chenry/android/freshrss/store/database/models/Account.kt
.../chenry/android/freshrss/store/database/models/Account.kt
+1
-1
app/src/main/java/fr/chenry/android/freshrss/store/database/models/Article.kt
.../chenry/android/freshrss/store/database/models/Article.kt
+1
-1
app/src/main/java/fr/chenry/android/freshrss/store/database/models/SubscriptionCategory.kt
...id/freshrss/store/database/models/SubscriptionCategory.kt
+1
-1
app/src/main/java/fr/chenry/android/freshrss/store/viewmodels/AccountVM.kt
.../fr/chenry/android/freshrss/store/viewmodels/AccountVM.kt
+1
-1
app/src/main/java/fr/chenry/android/freshrss/store/viewmodels/SubscriptionArticleVM.kt
...ndroid/freshrss/store/viewmodels/SubscriptionArticleVM.kt
+1
-1
app/src/main/java/fr/chenry/android/freshrss/store/viewmodels/SubscriptionArticlesVM.kt
...droid/freshrss/store/viewmodels/SubscriptionArticlesVM.kt
+1
-1
app/src/main/java/fr/chenry/android/freshrss/utils/InstanceUrl.kt
...main/java/fr/chenry/android/freshrss/utils/InstanceUrl.kt
+1
-1
app/src/main/java/fr/chenry/android/freshrss/utils/KotlinExtensions.kt
...java/fr/chenry/android/freshrss/utils/KotlinExtensions.kt
+1
-1
app/src/main/java/fr/chenry/android/freshrss/utils/LollipopFixedWebView.kt
.../fr/chenry/android/freshrss/utils/LollipopFixedWebView.kt
+1
-1
app/src/main/java/fr/chenry/android/freshrss/utils/NotificationHelper.kt
...va/fr/chenry/android/freshrss/utils/NotificationHelper.kt
+0
-1
app/src/main/java/fr/chenry/android/freshrss/utils/SquaredImageView.kt
...java/fr/chenry/android/freshrss/utils/SquaredImageView.kt
+1
-1
app/src/main/java/fr/chenry/android/freshrss/utils/Try.kt
app/src/main/java/fr/chenry/android/freshrss/utils/Try.kt
+1
-1
app/src/main/res/drawable-v24/ic_launcher_foreground.xml
app/src/main/res/drawable-v24/ic_launcher_foreground.xml
+12
-11
app/src/main/res/drawable/grey_circle_background.xml
app/src/main/res/drawable/grey_circle_background.xml
+7
-3
app/src/main/res/drawable/ic_favorites_black_24dp.xml
app/src/main/res/drawable/ic_favorites_black_24dp.xml
+8
-7
app/src/main/res/drawable/ic_home_black_24dp.xml
app/src/main/res/drawable/ic_home_black_24dp.xml
+9
-8
app/src/main/res/drawable/ic_is_read_24dp.xml
app/src/main/res/drawable/ic_is_read_24dp.xml
+10
-5
app/src/main/res/drawable/ic_is_unread_24dp.xml
app/src/main/res/drawable/ic_is_unread_24dp.xml
+11
-5
app/src/main/res/drawable/ic_keyboard_arrow_next_black_24dp.xml
...c/main/res/drawable/ic_keyboard_arrow_next_black_24dp.xml
+8
-7
app/src/main/res/drawable/ic_launcher_background.xml
app/src/main/res/drawable/ic_launcher_background.xml
+9
-8
app/src/main/res/drawable/ic_launcher_foreground.xml
app/src/main/res/drawable/ic_launcher_foreground.xml
+12
-11
app/src/main/res/drawable/ic_rss_feed_black_24dp.xml
app/src/main/res/drawable/ic_rss_feed_black_24dp.xml
+9
-8
app/src/main/res/drawable/ic_unread_black_24dp.xml
app/src/main/res/drawable/ic_unread_black_24dp.xml
+8
-7
app/src/main/res/drawable/ic_web_black_24dp.xml
app/src/main/res/drawable/ic_web_black_24dp.xml
+8
-7
app/src/main/res/drawable/red_circle_background.xml
app/src/main/res/drawable/red_circle_background.xml
+7
-3
app/src/main/res/layout/activity_login.xml
app/src/main/res/layout/activity_login.xml
+7
-23
app/src/main/res/layout/activity_main.xml
app/src/main/res/layout/activity_main.xml
+1
-2
app/src/main/res/layout/activity_start.xml
app/src/main/res/layout/activity_start.xml
+1
-1
app/src/main/res/layout/fragment_subscription.xml
app/src/main/res/layout/fragment_subscription.xml
+8
-11
app/src/main/res/layout/fragment_subscription_article.xml
app/src/main/res/layout/fragment_subscription_article.xml
+8
-8
app/src/main/res/layout/fragment_subscription_article_detail.xml
.../main/res/layout/fragment_subscription_article_detail.xml
+6
-4
app/src/main/res/layout/fragment_subscription_articles.xml
app/src/main/res/layout/fragment_subscription_articles.xml
+2
-4
app/src/main/res/layout/fragment_subscriptions.xml
app/src/main/res/layout/fragment_subscriptions.xml
+4
-5
app/src/main/res/layout/fragment_waiting.xml
app/src/main/res/layout/fragment_waiting.xml
+8
-7
app/src/main/res/menu/article_actionbar.xml
app/src/main/res/menu/article_actionbar.xml
+2
-1
app/src/main/res/menu/subscriptions_bottom_navigation.xml
app/src/main/res/menu/subscriptions_bottom_navigation.xml
+1
-3
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
+2
-2
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
+3
-4
app/src/main/res/navigation/nav_graph.xml
app/src/main/res/navigation/nav_graph.xml
+13
-12
app/src/main/res/values/colors.xml
app/src/main/res/values/colors.xml
+7
-4
app/src/main/res/values/dimens.xml
app/src/main/res/values/dimens.xml
+1
-1
app/src/main/res/values/strings.xml
app/src/main/res/values/strings.xml
+2
-9
app/src/main/res/values/styles.xml
app/src/main/res/values/styles.xml
+10
-4
app/src/test/java/fr/chenry/android/freshrss/components/subscriptions/SubscriptionSectionTest.kt
...shrss/components/subscriptions/SubscriptionSectionTest.kt
+1
-1
app/src/test/java/fr/chenry/android/freshrss/store/api/InstanceUrlTest.kt
...a/fr/chenry/android/freshrss/store/api/InstanceUrlTest.kt
+1
-1
build.gradle
build.gradle
+11
-7
freshrss.xmlformat.prefs
freshrss.xmlformat.prefs
+6
-0
No files found.
CONTRIBUTING.md
View file @
c34e36d1
...
...
@@ -65,6 +65,13 @@ you have the knowledge.
If you are not a developer, you can contribute by localizing the application in your language.
Please read the
[
Android localization guide
](
https://developer.android.com/guide/topics/resources/localization
)
.
## Running tests and linter
Ensure you ran the linters:
```
./gradlew spotlessApply lintFix
```
# Contributors
...
...
app/build.gradle
View file @
c34e36d1
apply
plugin:
"com.android.application"
apply
plugin:
"kotlin-android"
apply
plugin:
"kotlin-android-extensions"
apply
plugin:
"kotlinx-serialization"
apply
plugin:
"kotlin-kapt"
apply
plugin:
"androidx.navigation.safeargs.kotlin"
apply
plugin:
"com.diffplug.gradle.spotless"
android
{
def
schema_location
=
"$projectDir/src/main/java/fr/chenry/android/freshrss/store/database/migrations"
.
toString
()
...
...
@@ -60,6 +60,32 @@ android {
}
}
configurations
{
ktlint
}
spotless
{
format
"misc"
,
{
target
"**/*.gradle"
,
"**/*.md"
,
"**/.gitignore"
,
"**/*.kt"
trimTrailingWhitespace
()
endWithNewline
()
}
kotlin
{
ktlint
().
userData
([
"trim_trailing_whitespace"
:
true
,
"insert_final_newline"
:
true
,
"max_line_length"
:
120
,
])
}
format
"xml"
,
{
target
fileTree
(
"."
)
{
include
"**/*.xml"
exclude
"**/build/**"
}
eclipseWtp
(
"xml"
).
configFile
"$rootDir/freshrss.xmlformat.prefs"
.
toString
()
}
}
dependencies
{
def
lifecycle_version
=
"2.0.0"
def
room_version
=
"2.1.0-alpha04"
...
...
@@ -72,6 +98,9 @@ dependencies {
def
android_support_version
=
"28.0.0"
def
android_navigation
=
"1.0.0"
// Linter
ktlint
"com.github.shyiko:ktlint:0.31.0"
implementation
"androidx.legacy:legacy-support-v4:1.0.0"
implementation
fileTree
(
include:
[
"*.jar"
],
dir:
"libs"
)
...
...
@@ -98,7 +127,7 @@ dependencies {
implementation
"androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
implementation
"androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
implementation
"androidx.lifecycle:lifecycle-reactivestreams-ktx:$lifecycle_version"
annotationProcessor
"androidx.lifecycle:lifecycle-compiler:$lifecycle_version"
kapt
"androidx.lifecycle:lifecycle-compiler:$lifecycle_version"
androidTestImplementation
"androidx.arch.core:core-testing:$lifecycle_version"
// Room
...
...
@@ -133,7 +162,6 @@ dependencies {
implementation
"eu.davidea:flexible-adapter:5.1.0"
implementation
"eu.davidea:flexible-adapter-ui:1.0.0"
// Tests
testImplementation
"junit:junit:4.12"
androidTestImplementation
"androidx.test:runner:$test_runnner_version"
...
...
app/src/main/AndroidManifest.xml
View file @
c34e36d1
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:dist=
"http://schemas.android.com/apk/distribution"
xmlns:tools=
"http://schemas.android.com/tools"
package=
"fr.chenry.android.freshrss"
>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.FOREGROUND_SERVICE"
/>
<dist:module
dist:instant=
"true"
/>
<application
android:name=
".FreshRSSApplication"
android:allowBackup=
"true"
...
...
@@ -29,13 +27,11 @@
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<service
android:name=
".RefresherService"
android:enabled=
"true"
android:exported=
"false"
>
</service>
<activity
android:name=
".activities.LoginActivity"
android:label=
"@string/app_name"
...
...
@@ -51,5 +47,4 @@
</intent-filter>
</activity>
</application>
</manifest>
\ No newline at end of file
app/src/main/java/fr/chenry/android/freshrss/FreshRSSApplication.kt
View file @
c34e36d1
...
...
@@ -98,4 +98,4 @@ class FreshRSSApplication: Application() {
}
}
}
}
\ No newline at end of file
}
app/src/main/java/fr/chenry/android/freshrss/components/subscriptionarticles/webviewutils/MailIntent.kt
View file @
c34e36d1
...
...
@@ -4,7 +4,7 @@ import android.content.Intent
class
MailIntent
(
address
:
String
,
subject
:
String
=
""
,
body
:
String
=
""
,
cc
:
String
=
""
):
Intent
(
ACTION_SEND
)
{
init
{
putExtra
(
EXTRA_EMAIL
,
arrayOf
(
address
))
putExtra
(
EXTRA_TEXT
,
body
)
...
...
@@ -12,4 +12,4 @@ class MailIntent(address: String, subject: String = "", body: String = "", cc: S
putExtra
(
EXTRA_CC
,
cc
)
type
=
"message/rfc822"
}
}
\ No newline at end of file
}
app/src/main/java/fr/chenry/android/freshrss/components/subscriptionarticles/webviewutils/WebViewClient.kt
View file @
c34e36d1
...
...
@@ -23,4 +23,4 @@ class FRSSWebViewClient(private val fragment: Fragment, private val sourceUrl: U
return
true
}
}
\ No newline at end of file
}
app/src/main/java/fr/chenry/android/freshrss/components/subscriptions/SubscriptionSection.kt
View file @
c34e36d1
...
...
@@ -22,4 +22,4 @@ enum class SubscriptionSection(val navigationButtonId: Int): Parcelable {
else
->
ALL
}
}
}
\ No newline at end of file
}
app/src/main/java/fr/chenry/android/freshrss/components/subscriptions/adapters/AbstractSubscriptionViewItem.kt
View file @
c34e36d1
...
...
@@ -67,4 +67,4 @@ class SubscriptionCategoryViewItem(val subscriptionCategory: SubscriptionCategor
if
(
other
!
is
SubscriptionCategoryViewItem
)
false
else
subscriptionCategory
==
other
.
subscriptionCategory
override
fun
hashCode
():
Int
=
subscriptionCategory
.
hashCode
()
}
\ No newline at end of file
}
app/src/main/java/fr/chenry/android/freshrss/components/subscriptions/adapters/SubscriptionViewHeaderItem.kt
View file @
c34e36d1
...
...
@@ -48,4 +48,4 @@ open class SubscriptionViewHeaderItem(val title: String):
object
SubscriptionCategoryViewHeaderItem
:
SubscriptionViewHeaderItem
(
FreshRSSApplication
.
getStringR
(
R
.
string
.
subscription_categories
))
\ No newline at end of file
SubscriptionViewHeaderItem
(
FreshRSSApplication
.
getStringR
(
R
.
string
.
subscription_categories
))
app/src/main/java/fr/chenry/android/freshrss/store/Store.kt
View file @
c34e36d1
...
...
@@ -110,4 +110,4 @@ object Store {
}
}
}
}
\ No newline at end of file
}
app/src/main/java/fr/chenry/android/freshrss/store/api/Endpoints.kt
View file @
c34e36d1
...
...
@@ -9,4 +9,4 @@ class Endpoints(private val base: String) {
val
tagEndpoint
=
"${this.base}/reader/api/0/tag/list"
val
unreadItemsEndpoint
=
"${this.base}/reader/api/0/stream/contents/user/-/state/com.google/reading-list"
val
editTagEnpoint
=
"${this.base}/reader/api/0/edit-tag"
}
\ No newline at end of file
}
app/src/main/java/fr/chenry/android/freshrss/store/api/models/ContentItem.kt
View file @
c34e36d1
...
...
@@ -37,4 +37,4 @@ data class ContentItemOrigin(
data class
Summary
(
val
content
:
String
)
data class
Href
(
val
href
:
String
)
\ No newline at end of file
data class
Href
(
val
href
:
String
)
app/src/main/java/fr/chenry/android/freshrss/store/api/models/SerDeser.kt
View file @
c34e36d1
...
...
@@ -17,4 +17,4 @@ class MilliSecTimestampDeserializer: LocalDateTimeDeserializer() {
val
tz
=
if
(
_format
.
isTimezoneExplicit
)
_format
.
timeZone
else
DateTimeZone
.
forTimeZone
(
ctxt
?.
timeZone
)
return
LocalDateTime
(
p
?.
valueAsString
?.
toLongOrNull
()
?:
0
,
tz
)
}
}
\ No newline at end of file
}
app/src/main/java/fr/chenry/android/freshrss/store/api/models/SubscriptionApiItem.kt
View file @
c34e36d1
...
...
@@ -27,4 +27,4 @@ data class SubscriptionCategoryApiItem(
class
HtmlEntitiesDeserializer
:
StringDeserializer
()
{
override
fun
deserialize
(
p
:
JsonParser
?,
ctxt
:
DeserializationContext
?)
=
super
.
deserialize
(
p
,
ctxt
).
unescapeHtml4
()
}
\ No newline at end of file
}
app/src/main/java/fr/chenry/android/freshrss/store/api/models/Tags.kt
View file @
c34e36d1
...
...
@@ -17,4 +17,4 @@ object TagsDeserializer: ResponseDeserializable<List<String>> {
listOf
()
}
}
}
\ No newline at end of file
}
app/src/main/java/fr/chenry/android/freshrss/store/api/models/UnreadCounts.kt
View file @
c34e36d1
...
...
@@ -5,4 +5,4 @@ data class UnreadCountsHandler(val max: Int, val unreadcounts: List<UnreadCount>
data class
UnreadCount
(
val
id
:
String
,
val
count
:
Int
)
\ No newline at end of file
)
app/src/main/java/fr/chenry/android/freshrss/store/database/FreshRSSDabatabase.kt
View file @
c34e36d1
...
...
@@ -83,4 +83,4 @@ abstract class FreshRSSDabatabase: RoomDatabase() {
getSubscriptionCategoriesDAO
().
insertAll
(
subscriptionCategories
)
fun
getCategoriesById
(
ids
:
List
<
String
>)
=
getSubscriptionCategoriesDAO
().
byIds
(
ids
)
fun
getAllCategories
()
=
getSubscriptionCategoriesDAO
().
all
()
}
\ No newline at end of file
}
app/src/main/java/fr/chenry/android/freshrss/store/database/models/Account.kt
View file @
c34e36d1
...
...
@@ -48,4 +48,4 @@ interface AuthTokensDAO {
@Query
(
"SELECT * FROM accounts"
)
fun
getAuthTokens
():
Flowable
<
List
<
Account
>>
}
\ No newline at end of file
}
app/src/main/java/fr/chenry/android/freshrss/store/database/models/Article.kt
View file @
c34e36d1
...
...
@@ -79,4 +79,4 @@ interface ArticlesDAO {
@Query
(
"SELECT * FROM articles WHERE streamId = :streamId AND readStatus = :readStatus"
)
fun
getByStreamIdAndUnread
(
streamId
:
StreamId
,
readStatus
:
String
=
ReadStatus
.
UNREAD
.
name
):
LiveData
<
Articles
>
}
\ No newline at end of file
}
app/src/main/java/fr/chenry/android/freshrss/store/database/models/SubscriptionCategory.kt
View file @
c34e36d1
...
...
@@ -35,4 +35,4 @@ interface SubscriptionCategoriesDAO {
@Query
(
"SELECT * FROM subscription_categories"
)
fun
all
():
Flowable
<
SubscriptionCategories
>
}
\ No newline at end of file
}
app/src/main/java/fr/chenry/android/freshrss/store/viewmodels/AccountVM.kt
View file @
c34e36d1
...
...
@@ -17,4 +17,4 @@ class AccountVM: ViewModel() {
source
.
observeForever
{
if
(
it
.
isNotEmpty
())
value
=
it
.
first
()}
}
}
}
\ No newline at end of file
}
app/src/main/java/fr/chenry/android/freshrss/store/viewmodels/SubscriptionArticleVM.kt
View file @
c34e36d1
...
...
@@ -29,4 +29,4 @@ class SubscriptionArticleVMF(private val articleId: ItemId): ViewModelProvider.N
@Suppress
(
"UNCHECKED_CAST"
)
return
SubscriptionArticleVM
(
articleId
)
as
T
}
}
\ No newline at end of file
}
app/src/main/java/fr/chenry/android/freshrss/store/viewmodels/SubscriptionArticlesVM.kt
View file @
c34e36d1
...
...
@@ -35,4 +35,4 @@ class SubscriptionArticlesVMF(private val streamId: String, private val readStat
@Suppress
(
"UNCHECKED_CAST"
)
return
SubscriptionArticlesVM
(
streamId
,
readStatus
)
as
T
}
}
\ No newline at end of file
}
app/src/main/java/fr/chenry/android/freshrss/utils/InstanceUrl.kt
View file @
c34e36d1
...
...
@@ -48,4 +48,4 @@ class InstanceUrl(val protocole: String, base: String) {
return
InstanceUrl
(
authorizedProtocols
[
0
],
url
)
}
}
}
\ No newline at end of file
}
app/src/main/java/fr/chenry/android/freshrss/utils/KotlinExtensions.kt
View file @
c34e36d1
...
...
@@ -104,4 +104,4 @@ fun <V, E> Promise<V, E>.getOrDefault(default: V) = try {
}
fun
<
T
:
Any
>
T
?.
whenNotNull
(
body
:
(
T
)
->
Unit
)
=
if
(
this
!==
null
)
body
(
this
).
let
{
this
}
else
this
fun
<
T
:
Any
>
T
?.
whenNull
(
body
:
()
->
Unit
)
=
this
?:
body
().
let
{
this
}
\ No newline at end of file
fun
<
T
:
Any
>
T
?.
whenNull
(
body
:
()
->
Unit
)
=
this
?:
body
().
let
{
this
}
app/src/main/java/fr/chenry/android/freshrss/utils/LollipopFixedWebView.kt
View file @
c34e36d1
...
...
@@ -26,4 +26,4 @@ class LollipopFixedWebView: WebView {
companion
object
{
fun
getFixedContext
(
context
:
Context
):
Context
=
context
.
createConfigurationContext
(
Configuration
())
}
}
\ No newline at end of file
}
app/src/main/java/fr/chenry/android/freshrss/utils/NotificationHelper.kt
View file @
c34e36d1
...
...
@@ -34,4 +34,3 @@ enum class NotificationChanels(nameResourceId: Int, descriptionResourceId: Int,
}
}
}
app/src/main/java/fr/chenry/android/freshrss/utils/SquaredImageView.kt
View file @
c34e36d1
...
...
@@ -29,4 +29,4 @@ class SquaredImageView(context: Context, attrs: AttributeSet?, defStyleAttr: Int
return
max
(
measuredWidth
,
maxWidth
).
let
{
setMeasuredDimension
(
it
,
it
)}
}
}
\ No newline at end of file
}
app/src/main/java/fr/chenry/android/freshrss/utils/Try.kt
View file @
c34e36d1
...
...
@@ -23,4 +23,4 @@ class Try<T: Any>(body: () -> T) {
fun
orElseDo
(
body
:
()
->
Unit
)
=
if
(!
isSuccess
)
body
()
else
Unit
fun
getOrDefault
(
default
:
T
)
=
if
(
isSuccess
)
value
else
default
fun
getOrNull
()
=
if
(
isSuccess
)
value
else
null
}
\ No newline at end of file
}
app/src/main/res/drawable-v24/ic_launcher_foreground.xml
View file @
c34e36d1
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:height=
"108dp"
android:viewportHeight=
"108"
android:viewportWidth=
"108"
android:width=
"108dp"
>
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:height=
"108dp"
android:viewportHeight=
"108"
android:viewportWidth=
"108"
android:width=
"108dp"
>
<path
android:pathData=
"M54,54m-8.25,0a8.25,8.25 0,1 1,16.5 0a8.25,8.25 0,1 1,-16.5 0"
android:strokeWidth=
"0.25"
android:fillColor=
"@color/logo_grey"
/>
android:fillColor=
"@color/logo_grey"
/>
<path
android:pathData=
"M22.807,54A31.193,31.193 0,1 1,54 85.193"
android:strokeAlpha=
"0.3"
android:strokeWidth=
"6.075"
android:fillColor=
"#00000000"
android:strokeColor=
"@color/logo_grey"
/>
android:strokeColor=
"@color/logo_grey"
/>
<path
android:pathData=
"m34.101,54a19.899,19.899 0,1 1,19.899 19.899"
android:strokeAlpha=
"0.3"
android:strokeWidth=
"6.075"
android:strokeColor=
"@color/logo_grey"
/>
android:strokeColor=
"@color/logo_grey"
/>
<path
android:pathData=
"M54,22.807A31.193,31.193 0,0 1,85.193 54"
android:strokeWidth=
"6.075"
android:fillColor=
"#00000000"
android:strokeColor=
"@color/logo_grey"
/>
android:strokeColor=
"@color/logo_grey"
/>
<path
android:pathData=
"m54,34.101a19.899,19.899 0,0 1,19.899 19.899"
android:strokeWidth=
"6.075"
android:fillColor=
"#00000000"
android:strokeColor=
"@color/logo_grey"
/>
</vector>
android:strokeColor=
"@color/logo_grey"
/>
</vector>
\ No newline at end of file
app/src/main/res/drawable/grey_circle_background.xml
View file @
c34e36d1
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<corners
android:radius=
"@dimen/badge_radius"
/>
<solid
android:color=
"@color/alert_inactive"
/>
<size
android:width=
"@dimen/badge_width"
android:height=
"@dimen/badge_height"
/>
<solid
android:color=
"@color/alert_inactive"
/>
<size
android:width=
"@dimen/badge_width"
android:height=
"@dimen/badge_height"
/>
</shape>
\ No newline at end of file
app/src/main/res/drawable/ic_favorites_black_24dp.xml
View file @
c34e36d1
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24.0"
android:viewportHeight=
"24.0"
>
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24.0"
android:viewportHeight=
"24.0"
>
<path
android:fillColor=
"#FF000000"
android:pathData=
"M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z"
/>
</vector>
android:pathData=
"M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z"
/>
</vector>
\ No newline at end of file
app/src/main/res/drawable/ic_home_black_24dp.xml
View file @
c34e36d1
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24.0"
android:viewportHeight=
"24.0"
>
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24.0"
android:viewportHeight=
"24.0"
>
<path
android:fillColor=
"#FF000000"
android:pathData=
"M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z"
/>
</vector>
android:fillColor=
"#FF000000"
android:pathData=
"M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z"
/>
</vector>
\ No newline at end of file
app/src/main/res/drawable/ic_is_read_24dp.xml
View file @
c34e36d1
<vector
android:height=
"24dp"
android:viewportHeight=
"25"
android:viewportWidth=
"24"
android:width=
"24dp"
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<path
android:fillColor=
"#FFF"
<vector
android:height=
"24dp"
android:viewportHeight=
"25"
android:viewportWidth=
"24"
android:width=
"24dp"
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<path
android:fillColor=
"#FFF"
android:pathData=
"
M20,4
L4,4
...
...
@@ -29,5 +34,5 @@
L20,6
L20.3,4
L12,0z
"
/>
</vector>
"
/>
</vector>
\ No newline at end of file
app/src/main/res/drawable/ic_is_unread_24dp.xml
View file @
c34e36d1
<vector
android:height=
"24dp"
android:tint=
"#FFFFFF"
android:viewportHeight=
"24.0"
android:viewportWidth=
"24.0"
android:width=
"24dp"
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<path
android:fillColor=
"#FFF"
android:pathData=
"M20,4L4,4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2zM20,18L4,18L4,8l8,5 8,-5v10zM12,11L4,6h16l-8,5z"
/>
</vector>
<vector
android:height=
"24dp"
android:tint=
"#FFFFFF"
android:viewportHeight=
"24.0"
android:viewportWidth=
"24.0"
android:width=
"24dp"
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<path
android:fillColor=
"#FFF"
android:pathData=
"M20,4L4,4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2zM20,18L4,18L4,8l8,5 8,-5v10zM12,11L4,6h16l-8,5z"
/>
</vector>
\ No newline at end of file
app/src/main/res/drawable/ic_keyboard_arrow_next_black_24dp.xml
View file @
c34e36d1
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24.0"
android:viewportHeight=
"24.0"
>
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24.0"
android:viewportHeight=
"24.0"
>
<path
android:fillColor=
"#FF000000"
android:pathData=
"M8.59,16.34l4.58,-4.59 -4.58,-4.59L10,5.75l6,6 -6,6z"
/>
</vector>
android:pathData=
"M8.59,16.34l4.58,-4.59 -4.58,-4.59L10,5.75l6,6 -6,6z"
/>
</vector>
\ No newline at end of file
app/src/main/res/drawable/ic_launcher_background.xml
View file @
c34e36d1
<?xml version="1.0" encoding="utf-8"?>
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:height=
"108dp"
android:width=
"108dp"
android:viewportHeight=
"108"
android:viewportWidth=
"108"
>
<path
android:fillColor=
"@color/logo_obsidian"
android:pathData=
"M0,0h108v108h-108z"
/>
</vector>
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:height=
"108dp"
android:width=
"108dp"
android:viewportHeight=
"108"
android:viewportWidth=
"108"
>
<path
android:fillColor=
"@color/logo_obsidian"
android:pathData=
"M0,0h108v108h-108z"
/>
</vector>
\ No newline at end of file
app/src/main/res/drawable/ic_launcher_foreground.xml
View file @
c34e36d1
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"108dp"
android:height=
"108dp"
android:viewportWidth=
"108"
android:viewportHeight=
"108"
>
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"108dp"
android:height=
"108dp"
android:viewportWidth=
"108"
android:viewportHeight=
"108"
>
<path
android:pathData=
"M54,54m-8.25,0a8.25,8.25 0,1 1,16.5 0a8.25,8.25 0,1 1,-16.5 0"
android:strokeWidth=
"0.25"
android:fillColor=
"#c5c6ca"
/>
android:fillColor=
"#c5c6ca"
/>
<path
android:pathData=
"M22.807,54A31.193,31.193 0,1 1,54 85.193"
android:strokeAlpha=
"0.3"
android:strokeWidth=
"6.075"
android:fillColor=
"#00000000"
android:strokeColor=
"#c5c6ca"
/>
android:strokeColor=
"#c5c6ca"
/>
<path
android:pathData=
"m34.101,54a19.899,19.899 0,1 1,19.899 19.899"
android:strokeAlpha=
"0.3"
android:strokeWidth=
"6.075"
android:fillColor=
"#00000000"
android:strokeColor=
"#c5c6ca"
/>
android:strokeColor=
"#c5c6ca"
/>
<path
android:pathData=
"M54,22.807A31.193,31.193 0,0 1,85.193 54"
android:strokeWidth=
"6.075"
android:fillColor=
"#00000000"
android:strokeColor=
"#c5c6ca"
/>
android:strokeColor=
"#c5c6ca"
/>
<path
android:pathData=
"m54,34.101a19.899,19.899 0,0 1,19.899 19.899"
android:strokeWidth=
"6.075"
android:fillColor=
"#00000000"
android:strokeColor=
"#c5c6ca"
/>
</vector>
android:strokeColor=
"#c5c6ca"
/>
</vector>
\ No newline at end of file
app/src/main/res/drawable/ic_rss_feed_black_24dp.xml
View file @
c34e36d1
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24.0"
android:viewportHeight=
"24.0"
>
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24.0"
android:viewportHeight=
"24.0"
>
<path
android:fillColor=
"#FF000000"
android:pathData=
"M6.18,17.82m-2.18,0a2.18,2.18 0,1 1,4.36 0a2.18,2.18 0,1 1,-4.36 0"
/>
android:pathData=
"M6.18,17.82m-2.18,0a2.18,2.18 0,1 1,4.36 0a2.18,2.18 0,1 1,-4.36 0"
/>
<path
android:fillColor=
"#FF000000"
android:pathData=
"M4,4.44v2.83c7.03,0 12.73,5.7 12.73,12.73h2.83c0,-8.59 -6.97,-15.56 -15.56,-15.56zM4,10.1v2.83c3.9,0 7.07,3.17 7.07,7.07h2.83c0,-5.47 -4.43,-9.9 -9.9,-9.9z"
/>
</vector>
android:pathData=
"M4,4.44v2.83c7.03,0 12.73,5.7 12.73,12.73h2.83c0,-8.59 -6.97,-15.56 -15.56,-15.56zM4,10.1v2.83c3.9,0 7.07,3.17 7.07,7.07h2.83c0,-5.47 -4.43,-9.9 -9.9,-9.9z"
/>
</vector>
\ No newline at end of file
app/src/main/res/drawable/ic_unread_black_24dp.xml
View file @
c34e36d1
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24.0"
android:viewportHeight=
"24.0"
>
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24.0"
android:viewportHeight=
"24.0"
>
<path
android:fillColor=
"#FF000000"
android:pathData=
"M20,4L4,4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2zM20,8l-8,5 -8,-5L4,6l8,5 8,-5v2z"
/>
</vector>
android:pathData=
"M20,4L4,4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2zM20,8l-8,5 -8,-5L4,6l8,5 8,-5v2z"
/>
</vector>
\ No newline at end of file
app/src/main/res/drawable/ic_web_black_24dp.xml
View file @
c34e36d1
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24.0"
android:viewportHeight=
"24.0"
>
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24.0"
android:viewportHeight=
"24.0"
>
<path
android:fillColor=
"#FFF"
android:pathData=
"M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM18.92,8h-2.95c-0.32,-1.25 -0.78,-2.45 -1.38,-3.56 1.84,0.63 3.37,1.91 4.33,3.56zM12,4.04c0.83,1.2 1.48,2.53 1.91,3.96h-3.82c0.43,-1.43 1.08,-2.76 1.91,-3.96zM4.26,14C4.1,13.36 4,12.69 4,12s0.1,-1.36 0.26,-2h3.38c-0.08,0.66 -0.14,1.32 -0.14,2 0,0.68 0.06,1.34 0.14,2L4.26,14zM5.08,16h2.95c0.32,1.25 0.78,2.45 1.38,3.56 -1.84,-0.63 -3.37,-1.9 -4.33,-3.56zM8.03,8L5.08,8c0.96,-1.66 2.49,-2.93 4.33,-3.56C8.81,5.55 8.35,6.75 8.03,8zM12,19.96c-0.83,-1.2 -1.48,-2.53 -1.91,-3.96h3.82c-0.43,1.43 -1.08,2.76 -1.91,3.96zM14.34,14L9.66,14c-0.09,-0.66 -0.16,-1.32 -0.16,-2 0,-0.68 0.07,-1.35 0.16,-2h4.68c0.09,0.65 0.16,1.32 0.16,2 0,0.68 -0.07,1.34 -0.16,2zM14.59,19.56c0.6,-1.11 1.06,-2.31 1.38,-3.56h2.95c-0.96,1.65 -2.49,2.93 -4.33,3.56zM16.36,14c0.08,-0.66 0.14,-1.32 0.14,-2 0,-0.68 -0.06,-1.34 -0.14,-2h3.38c0.16,0.64 0.26,1.31 0.26,2s-0.1,1.36 -0.26,2h-3.38z"
/>
</vector>
android:pathData=
"M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM18.92,8h-2.95c-0.32,-1.25 -0.78,-2.45 -1.38,-3.56 1.84,0.63 3.37,1.91 4.33,3.56zM12,4.04c0.83,1.2 1.48,2.53 1.91,3.96h-3.82c0.43,-1.43 1.08,-2.76 1.91,-3.96zM4.26,14C4.1,13.36 4,12.69 4,12s0.1,-1.36 0.26,-2h3.38c-0.08,0.66 -0.14,1.32 -0.14,2 0,0.68 0.06,1.34 0.14,2L4.26,14zM5.08,16h2.95c0.32,1.25 0.78,2.45 1.38,3.56 -1.84,-0.63 -3.37,-1.9 -4.33,-3.56zM8.03,8L5.08,8c0.96,-1.66 2.49,-2.93 4.33,-3.56C8.81,5.55 8.35,6.75 8.03,8zM12,19.96c-0.83,-1.2 -1.48,-2.53 -1.91,-3.96h3.82c-0.43,1.43 -1.08,2.76 -1.91,3.96zM14.34,14L9.66,14c-0.09,-0.66 -0.16,-1.32 -0.16,-2 0,-0.68 0.07,-1.35 0.16,-2h4.68c0.09,0.65 0.16,1.32 0.16,2 0,0.68 -0.07,1.34 -0.16,2zM14.59,19.56c0.6,-1.11 1.06,-2.31 1.38,-3.56h2.95c-0.96,1.65 -2.49,2.93 -4.33,3.56zM16.36,14c0.08,-0.66 0.14,-1.32 0.14,-2 0,-0.68 -0.06,-1.34 -0.14,-2h3.38c0.16,0.64 0.26,1.31 0.26,2s-0.1,1.36 -0.26,2h-3.38z"
/>
</vector>
\ No newline at end of file
app/src/main/res/drawable/red_circle_background.xml
View file @
c34e36d1
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<corners
android:radius=
"@dimen/badge_radius"
/>
<solid
android:color=
"@color/alert"
/>
<size
android:width=
"@dimen/badge_width"
android:height=
"@dimen/badge_height"
/>
<solid
android:color=
"@color/alert"
/>
<size
android:width=
"@dimen/badge_width"
android:height=
"@dimen/badge_height"
/>
</shape>
\ No newline at end of file
app/src/main/res/layout/activity_login.xml
View file @
c34e36d1
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
...
...
@@ -10,25 +11,20 @@
android:paddingRight=
"@dimen/activity_horizontal_margin"