Compare commits
11 Commits
v171811310
...
v171811315
Author | SHA1 | Date | |
---|---|---|---|
9b45365441 | |||
91a7464bce | |||
51add226eb | |||
332e9f5108 | |||
0b91087c07 | |||
ebbb1ba0f8 | |||
e9143ae852 | |||
42e8ecee78 | |||
4efd76fcbc | |||
fb1614070e | |||
c473dd7227 |
@ -1,5 +1,11 @@
|
|||||||
**1.7.x**
|
**1.7.x**
|
||||||
|
|
||||||
|
- Added experimental issue to set a default timeout. Should work for #238.
|
||||||
|
|
||||||
|
- Closing #220.
|
||||||
|
|
||||||
|
- Start of #238. "Add a quick shortcut to open the app on offline mode ?"
|
||||||
|
|
||||||
- Closes #216. Issue with selfoss version 2.19.
|
- Closes #216. Issue with selfoss version 2.19.
|
||||||
|
|
||||||
- Closes #179. Sync of read/unread/star/unstar items on background task or on app reload with network available.
|
- Closes #179. Sync of read/unread/star/unstar items on background task or on app reload with network available.
|
||||||
|
@ -75,7 +75,6 @@ android {
|
|||||||
buildConfigField "String", "LOGIN_URL", appLoginUrl
|
buildConfigField "String", "LOGIN_URL", appLoginUrl
|
||||||
buildConfigField "String", "LOGIN_USERNAME", appLoginUsername
|
buildConfigField "String", "LOGIN_USERNAME", appLoginUsername
|
||||||
buildConfigField "String", "LOGIN_PASSWORD", appLoginPassword
|
buildConfigField "String", "LOGIN_PASSWORD", appLoginPassword
|
||||||
applicationIdSuffix ".dev"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
flavorDimensions "build"
|
flavorDimensions "build"
|
||||||
|
@ -21,6 +21,9 @@
|
|||||||
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
|
<meta-data android:name="android.app.shortcuts"
|
||||||
|
android:resource="@xml/shortcuts" />
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".LoginActivity"
|
android:name=".LoginActivity"
|
||||||
|
@ -89,6 +89,7 @@ class AddSourceActivity : AppCompatActivity() {
|
|||||||
this,
|
this,
|
||||||
this@AddSourceActivity,
|
this@AddSourceActivity,
|
||||||
prefs.getBoolean("isSelfSignedCert", false),
|
prefs.getBoolean("isSelfSignedCert", false),
|
||||||
|
prefs.getString("api_timeout", "-1").toLong(),
|
||||||
prefs.getBoolean("should_log_everything", false)
|
prefs.getBoolean("should_log_everything", false)
|
||||||
)
|
)
|
||||||
} catch (e: IllegalArgumentException) {
|
} catch (e: IllegalArgumentException) {
|
||||||
|
@ -145,6 +145,9 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
private var badgeAll: Int = -1
|
private var badgeAll: Int = -1
|
||||||
private var badgeFavs: Int = -1
|
private var badgeFavs: Int = -1
|
||||||
|
|
||||||
|
private var fromTabShortcut: Boolean = false
|
||||||
|
private var offlineShortcut: Boolean = false
|
||||||
|
|
||||||
private lateinit var tagsBadge: Map<Long, Int>
|
private lateinit var tagsBadge: Map<Long, Int>
|
||||||
|
|
||||||
private lateinit var db: AppDatabase
|
private lateinit var db: AppDatabase
|
||||||
@ -161,6 +164,13 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
|
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
|
fromTabShortcut = intent.getIntExtra("shortcutTab", -1) != -1
|
||||||
|
offlineShortcut = intent.getBooleanExtra("startOffline", false)
|
||||||
|
|
||||||
|
if (fromTabShortcut) {
|
||||||
|
elementsShown = intent.getIntExtra("shortcutTab", UNREAD_SHOWN)
|
||||||
|
}
|
||||||
|
|
||||||
setContentView(R.layout.activity_home)
|
setContentView(R.layout.activity_home)
|
||||||
|
|
||||||
handleThemeBinding()
|
handleThemeBinding()
|
||||||
@ -185,6 +195,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
this,
|
this,
|
||||||
this@HomeActivity,
|
this@HomeActivity,
|
||||||
settings.getBoolean("isSelfSignedCert", false),
|
settings.getBoolean("isSelfSignedCert", false),
|
||||||
|
sharedPref.getString("api_timeout", "-1").toLong(),
|
||||||
shouldLogEverything
|
shouldLogEverything
|
||||||
)
|
)
|
||||||
items = ArrayList()
|
items = ArrayList()
|
||||||
@ -203,6 +214,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
R.color.refresh_progress_3
|
R.color.refresh_progress_3
|
||||||
)
|
)
|
||||||
swipeRefreshLayout.setOnRefreshListener {
|
swipeRefreshLayout.setOnRefreshListener {
|
||||||
|
offlineShortcut = false
|
||||||
allItems = ArrayList()
|
allItems = ArrayList()
|
||||||
lastFetchDone = false
|
lastFetchDone = false
|
||||||
handleDrawerItems()
|
handleDrawerItems()
|
||||||
@ -318,6 +330,10 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
|
|
||||||
bottomBar.setMode(BottomNavigationBar.MODE_SHIFTING)
|
bottomBar.setMode(BottomNavigationBar.MODE_SHIFTING)
|
||||||
bottomBar.setBackgroundStyle(BottomNavigationBar.BACKGROUND_STYLE_STATIC)
|
bottomBar.setBackgroundStyle(BottomNavigationBar.BACKGROUND_STYLE_STATIC)
|
||||||
|
|
||||||
|
if (fromTabShortcut) {
|
||||||
|
bottomBar.selectTab(elementsShown - 1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
@ -628,14 +644,6 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
false
|
false
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
drawer.addItem(DividerDrawerItem())
|
|
||||||
drawer.addItem(
|
|
||||||
SecondaryDrawerItem()
|
|
||||||
.withName(getString(R.string.drawer_item_tags))
|
|
||||||
.withIdentifier(DRAWER_ID_TAGS)
|
|
||||||
.withSelectable(false)
|
|
||||||
)
|
|
||||||
handleTags(maybeDrawerData.tags)
|
|
||||||
if (hiddenTags.isNotEmpty()) {
|
if (hiddenTags.isNotEmpty()) {
|
||||||
drawer.addItem(DividerDrawerItem())
|
drawer.addItem(DividerDrawerItem())
|
||||||
drawer.addItem(
|
drawer.addItem(
|
||||||
@ -647,6 +655,14 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
handleHiddenTags(maybeDrawerData.tags)
|
handleHiddenTags(maybeDrawerData.tags)
|
||||||
}
|
}
|
||||||
drawer.addItem(DividerDrawerItem())
|
drawer.addItem(DividerDrawerItem())
|
||||||
|
drawer.addItem(
|
||||||
|
SecondaryDrawerItem()
|
||||||
|
.withName(getString(R.string.drawer_item_tags))
|
||||||
|
.withIdentifier(DRAWER_ID_TAGS)
|
||||||
|
.withSelectable(false)
|
||||||
|
)
|
||||||
|
handleTags(maybeDrawerData.tags)
|
||||||
|
drawer.addItem(DividerDrawerItem())
|
||||||
drawer.addItem(
|
drawer.addItem(
|
||||||
SecondaryDrawerItem()
|
SecondaryDrawerItem()
|
||||||
.withName(getString(R.string.drawer_item_sources))
|
.withName(getString(R.string.drawer_item_sources))
|
||||||
@ -721,7 +737,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
var sources: List<Source>?
|
var sources: List<Source>?
|
||||||
|
|
||||||
fun sourcesApiCall() {
|
fun sourcesApiCall() {
|
||||||
if (this@HomeActivity.isNetworkAccessible(null)) {
|
if (this@HomeActivity.isNetworkAccessible(null, offlineShortcut)) {
|
||||||
api.sources.enqueue(object : Callback<List<Source>> {
|
api.sources.enqueue(object : Callback<List<Source>> {
|
||||||
override fun onResponse(
|
override fun onResponse(
|
||||||
call: Call<List<Source>>?,
|
call: Call<List<Source>>?,
|
||||||
@ -744,7 +760,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this@HomeActivity.isNetworkAccessible(null)) {
|
if (this@HomeActivity.isNetworkAccessible(null, offlineShortcut)) {
|
||||||
api.tags.enqueue(object : Callback<List<Tag>> {
|
api.tags.enqueue(object : Callback<List<Tag>> {
|
||||||
override fun onResponse(
|
override fun onResponse(
|
||||||
call: Call<List<Tag>>,
|
call: Call<List<Tag>>,
|
||||||
@ -875,7 +891,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
else -> Unit
|
else -> Unit
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this@HomeActivity.isNetworkAccessible(this@HomeActivity.findViewById(R.id.coordLayout))) {
|
if (this@HomeActivity.isNetworkAccessible(this@HomeActivity.findViewById(R.id.coordLayout), offlineShortcut)) {
|
||||||
when (position) {
|
when (position) {
|
||||||
0 -> getUnRead()
|
0 -> getUnRead()
|
||||||
1 -> getRead()
|
1 -> getRead()
|
||||||
@ -972,7 +988,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
handleListResult()
|
handleListResult()
|
||||||
doGetAccordingToTab()
|
doGetAccordingToTab()
|
||||||
} else {
|
} else {
|
||||||
if (this@HomeActivity.isNetworkAccessible(this@HomeActivity.findViewById(R.id.coordLayout))) {
|
if (this@HomeActivity.isNetworkAccessible(this@HomeActivity.findViewById(R.id.coordLayout), offlineShortcut)) {
|
||||||
doGetAccordingToTab()
|
doGetAccordingToTab()
|
||||||
getAndStoreAllItems()
|
getAndStoreAllItems()
|
||||||
}
|
}
|
||||||
@ -1031,7 +1047,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
swipeRefreshLayout.post { swipeRefreshLayout.isRefreshing = true }
|
swipeRefreshLayout.post { swipeRefreshLayout.isRefreshing = true }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this@HomeActivity.isNetworkAccessible(this@HomeActivity.findViewById(R.id.coordLayout))) {
|
if (this@HomeActivity.isNetworkAccessible(this@HomeActivity.findViewById(R.id.coordLayout), offlineShortcut)) {
|
||||||
call(maybeTagFilter?.tag, maybeSourceFilter?.id?.toLong(), maybeSearchFilter)
|
call(maybeTagFilter?.tag, maybeSourceFilter?.id?.toLong(), maybeSearchFilter)
|
||||||
.enqueue(object : Callback<List<Item>> {
|
.enqueue(object : Callback<List<Item>> {
|
||||||
override fun onResponse(
|
override fun onResponse(
|
||||||
@ -1161,7 +1177,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun reloadBadges() {
|
private fun reloadBadges() {
|
||||||
if (this@HomeActivity.isNetworkAccessible(null) && (displayUnreadCount || displayAllCount)) {
|
if (this@HomeActivity.isNetworkAccessible(null, offlineShortcut) && (displayUnreadCount || displayAllCount)) {
|
||||||
api.stats.enqueue(object : Callback<Stats> {
|
api.stats.enqueue(object : Callback<Stats> {
|
||||||
override fun onResponse(call: Call<Stats>, response: Response<Stats>) {
|
override fun onResponse(call: Call<Stats>, response: Response<Stats>) {
|
||||||
if (response.body() != null) {
|
if (response.body() != null) {
|
||||||
@ -1267,7 +1283,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
when (item.itemId) {
|
when (item.itemId) {
|
||||||
R.id.refresh -> {
|
R.id.refresh -> {
|
||||||
if (this@HomeActivity.isNetworkAccessible(null)) {
|
if (this@HomeActivity.isNetworkAccessible(null, offlineShortcut)) {
|
||||||
needsConfirmation(R.string.menu_home_refresh, R.string.refresh_dialog_message) {
|
needsConfirmation(R.string.menu_home_refresh, R.string.refresh_dialog_message) {
|
||||||
api.update().enqueue(object : Callback<String> {
|
api.update().enqueue(object : Callback<String> {
|
||||||
override fun onResponse(
|
override fun onResponse(
|
||||||
@ -1311,7 +1327,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
ACRA.getErrorReporter().maybeHandleSilentException(e, this@HomeActivity)
|
ACRA.getErrorReporter().maybeHandleSilentException(e, this@HomeActivity)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ids.isNotEmpty() && this@HomeActivity.isNetworkAccessible(null)) {
|
if (ids.isNotEmpty() && this@HomeActivity.isNetworkAccessible(null, offlineShortcut)) {
|
||||||
api.readAll(ids).enqueue(object : Callback<SuccessResponse> {
|
api.readAll(ids).enqueue(object : Callback<SuccessResponse> {
|
||||||
override fun onResponse(
|
override fun onResponse(
|
||||||
call: Call<SuccessResponse>,
|
call: Call<SuccessResponse>,
|
||||||
@ -1455,7 +1471,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this@HomeActivity.isNetworkAccessible(null)) {
|
if (this@HomeActivity.isNetworkAccessible(null, offlineShortcut)) {
|
||||||
thread {
|
thread {
|
||||||
val actions = db.actionsDao().actions()
|
val actions = db.actionsDao().actions()
|
||||||
|
|
||||||
|
@ -195,6 +195,7 @@ class LoginActivity : AppCompatActivity() {
|
|||||||
this,
|
this,
|
||||||
this@LoginActivity,
|
this@LoginActivity,
|
||||||
isWithSelfSignedCert,
|
isWithSelfSignedCert,
|
||||||
|
-1L,
|
||||||
isWithSelfSignedCert
|
isWithSelfSignedCert
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -95,6 +95,7 @@ class ReaderActivity : AppCompatActivity() {
|
|||||||
this,
|
this,
|
||||||
this@ReaderActivity,
|
this@ReaderActivity,
|
||||||
prefs.getBoolean("isSelfSignedCert", false),
|
prefs.getBoolean("isSelfSignedCert", false),
|
||||||
|
prefs.getString("api_timeout", "-1").toLong(),
|
||||||
prefs.getBoolean("should_log_everything", false)
|
prefs.getBoolean("should_log_everything", false)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -60,6 +60,7 @@ class SourcesActivity : AppCompatActivity() {
|
|||||||
this,
|
this,
|
||||||
this@SourcesActivity,
|
this@SourcesActivity,
|
||||||
prefs.getBoolean("isSelfSignedCert", false),
|
prefs.getBoolean("isSelfSignedCert", false),
|
||||||
|
prefs.getString("api_timeout", "-1").toLong(),
|
||||||
prefs.getBoolean("should_log_everything", false)
|
prefs.getBoolean("should_log_everything", false)
|
||||||
)
|
)
|
||||||
var items: ArrayList<Source> = ArrayList()
|
var items: ArrayList<Source> = ArrayList()
|
||||||
|
@ -18,11 +18,13 @@ import retrofit2.Call
|
|||||||
import retrofit2.Retrofit
|
import retrofit2.Retrofit
|
||||||
import retrofit2.converter.gson.GsonConverterFactory
|
import retrofit2.converter.gson.GsonConverterFactory
|
||||||
import java.util.concurrent.ConcurrentHashMap
|
import java.util.concurrent.ConcurrentHashMap
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
class SelfossApi(
|
class SelfossApi(
|
||||||
c: Context,
|
c: Context,
|
||||||
callingActivity: Activity?,
|
callingActivity: Activity?,
|
||||||
isWithSelfSignedCert: Boolean,
|
isWithSelfSignedCert: Boolean,
|
||||||
|
timeout: Long,
|
||||||
shouldLog: Boolean
|
shouldLog: Boolean
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@ -38,16 +40,25 @@ class SelfossApi(
|
|||||||
this
|
this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun OkHttpClient.Builder.maybeWithSettingsTimeout(timeout: Long): OkHttpClient.Builder =
|
||||||
|
if (timeout != -1L) {
|
||||||
|
this.readTimeout(timeout, TimeUnit.SECONDS)
|
||||||
|
.connectTimeout(timeout, TimeUnit.SECONDS)
|
||||||
|
} else {
|
||||||
|
this
|
||||||
|
}
|
||||||
|
|
||||||
fun Credentials.createAuthenticator(): DispatchingAuthenticator =
|
fun Credentials.createAuthenticator(): DispatchingAuthenticator =
|
||||||
DispatchingAuthenticator.Builder()
|
DispatchingAuthenticator.Builder()
|
||||||
.with("digest", DigestAuthenticator(this))
|
.with("digest", DigestAuthenticator(this))
|
||||||
.with("basic", BasicAuthenticator(this))
|
.with("basic", BasicAuthenticator(this))
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
fun DispatchingAuthenticator.getHttpClien(isWithSelfSignedCert: Boolean): OkHttpClient.Builder {
|
fun DispatchingAuthenticator.getHttpClien(isWithSelfSignedCert: Boolean, timeout: Long): OkHttpClient.Builder {
|
||||||
val authCache = ConcurrentHashMap<String, CachingAuthenticator>()
|
val authCache = ConcurrentHashMap<String, CachingAuthenticator>()
|
||||||
return OkHttpClient
|
return OkHttpClient
|
||||||
.Builder()
|
.Builder()
|
||||||
|
.maybeWithSettingsTimeout(timeout)
|
||||||
.maybeWithSelfSigned(isWithSelfSignedCert)
|
.maybeWithSelfSigned(isWithSelfSignedCert)
|
||||||
.authenticator(CachingAuthenticatorDecorator(this, authCache))
|
.authenticator(CachingAuthenticatorDecorator(this, authCache))
|
||||||
.addInterceptor(AuthenticationCacheInterceptor(authCache))
|
.addInterceptor(AuthenticationCacheInterceptor(authCache))
|
||||||
@ -78,7 +89,7 @@ class SelfossApi(
|
|||||||
HttpLoggingInterceptor.Level.NONE
|
HttpLoggingInterceptor.Level.NONE
|
||||||
}
|
}
|
||||||
|
|
||||||
val httpClient = authenticator.getHttpClien(isWithSelfSignedCert)
|
val httpClient = authenticator.getHttpClien(isWithSelfSignedCert, timeout)
|
||||||
|
|
||||||
httpClient.addInterceptor(logging)
|
httpClient.addInterceptor(logging)
|
||||||
|
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
package apps.amine.bou.readerforselfoss.background
|
package apps.amine.bou.readerforselfoss.background
|
||||||
|
|
||||||
import android.app.NotificationManager
|
import android.app.NotificationManager
|
||||||
|
import android.app.PendingIntent
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
import android.preference.PreferenceManager
|
import android.preference.PreferenceManager
|
||||||
import androidx.core.app.NotificationCompat
|
import androidx.core.app.NotificationCompat
|
||||||
import androidx.core.app.NotificationCompat.PRIORITY_DEFAULT
|
import androidx.core.app.NotificationCompat.PRIORITY_DEFAULT
|
||||||
@ -9,6 +11,7 @@ import androidx.core.app.NotificationCompat.PRIORITY_LOW
|
|||||||
import androidx.room.Room
|
import androidx.room.Room
|
||||||
import androidx.work.Worker
|
import androidx.work.Worker
|
||||||
import androidx.work.WorkerParameters
|
import androidx.work.WorkerParameters
|
||||||
|
import apps.amine.bou.readerforselfoss.MainActivity
|
||||||
import apps.amine.bou.readerforselfoss.R
|
import apps.amine.bou.readerforselfoss.R
|
||||||
import apps.amine.bou.readerforselfoss.api.selfoss.Item
|
import apps.amine.bou.readerforselfoss.api.selfoss.Item
|
||||||
import apps.amine.bou.readerforselfoss.api.selfoss.SelfossApi
|
import apps.amine.bou.readerforselfoss.api.selfoss.SelfossApi
|
||||||
@ -50,7 +53,6 @@ class LoadingWorker(val context: Context, params: WorkerParameters) : Worker(con
|
|||||||
val settings =
|
val settings =
|
||||||
this.context.getSharedPreferences(Config.settingsName, Context.MODE_PRIVATE)
|
this.context.getSharedPreferences(Config.settingsName, Context.MODE_PRIVATE)
|
||||||
val sharedPref = PreferenceManager.getDefaultSharedPreferences(this.context)
|
val sharedPref = PreferenceManager.getDefaultSharedPreferences(this.context)
|
||||||
val shouldLogEverything = sharedPref.getBoolean("should_log_everything", false)
|
|
||||||
val notifyNewItems = sharedPref.getBoolean("notify_new_items", false)
|
val notifyNewItems = sharedPref.getBoolean("notify_new_items", false)
|
||||||
|
|
||||||
db = Room.databaseBuilder(
|
db = Room.databaseBuilder(
|
||||||
@ -62,7 +64,8 @@ class LoadingWorker(val context: Context, params: WorkerParameters) : Worker(con
|
|||||||
this.context,
|
this.context,
|
||||||
null,
|
null,
|
||||||
settings.getBoolean("isSelfSignedCert", false),
|
settings.getBoolean("isSelfSignedCert", false),
|
||||||
shouldLogEverything
|
sharedPref.getString("api_timeout", "-1").toLong(),
|
||||||
|
sharedPref.getBoolean("should_log_everything", false)
|
||||||
)
|
)
|
||||||
|
|
||||||
api.allItems().enqueue(object : Callback<List<Item>> {
|
api.allItems().enqueue(object : Callback<List<Item>> {
|
||||||
@ -85,11 +88,19 @@ class LoadingWorker(val context: Context, params: WorkerParameters) : Worker(con
|
|||||||
|
|
||||||
val newSize = apiItems.filter { it.unread }.size
|
val newSize = apiItems.filter { it.unread }.size
|
||||||
if (notifyNewItems && newSize > 0) {
|
if (notifyNewItems && newSize > 0) {
|
||||||
|
|
||||||
|
val intent = Intent(context, MainActivity::class.java).apply {
|
||||||
|
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
|
||||||
|
}
|
||||||
|
val pendingIntent: PendingIntent = PendingIntent.getActivity(context, 0, intent, 0)
|
||||||
|
|
||||||
val newItemsNotification = NotificationCompat.Builder(applicationContext, Config.newItemsChannelId)
|
val newItemsNotification = NotificationCompat.Builder(applicationContext, Config.newItemsChannelId)
|
||||||
.setContentTitle(context.getString(R.string.new_items_notification_title))
|
.setContentTitle(context.getString(R.string.new_items_notification_title))
|
||||||
.setContentText(context.getString(R.string.new_items_notification_text, newSize))
|
.setContentText(context.getString(R.string.new_items_notification_text, newSize))
|
||||||
.setPriority(PRIORITY_DEFAULT)
|
.setPriority(PRIORITY_DEFAULT)
|
||||||
.setChannelId(Config.newItemsChannelId)
|
.setChannelId(Config.newItemsChannelId)
|
||||||
|
.setContentIntent(pendingIntent)
|
||||||
|
.setAutoCancel(true)
|
||||||
.setSmallIcon(R.drawable.ic_fiber_new_black_24dp)
|
.setSmallIcon(R.drawable.ic_fiber_new_black_24dp)
|
||||||
|
|
||||||
Timer("", false).schedule(4000) {
|
Timer("", false).schedule(4000) {
|
||||||
|
@ -114,6 +114,7 @@ class ArticleFragment : Fragment() {
|
|||||||
context!!,
|
context!!,
|
||||||
activity!!,
|
activity!!,
|
||||||
settings.getBoolean("isSelfSignedCert", false),
|
settings.getBoolean("isSelfSignedCert", false),
|
||||||
|
prefs.getString("api_timeout", "-1").toLong(),
|
||||||
prefs.getBoolean("should_log_everything", false)
|
prefs.getBoolean("should_log_everything", false)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -136,6 +136,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||||||
|| GeneralPreferenceFragment.class.getName().equals(fragmentName)
|
|| GeneralPreferenceFragment.class.getName().equals(fragmentName)
|
||||||
|| ArticleViewerPreferenceFragment.class.getName().equals(fragmentName)
|
|| ArticleViewerPreferenceFragment.class.getName().equals(fragmentName)
|
||||||
|| OfflinePreferenceFragment.class.getName().equals(fragmentName)
|
|| OfflinePreferenceFragment.class.getName().equals(fragmentName)
|
||||||
|
|| ExperimentalPreferenceFragment.class.getName().equals(fragmentName)
|
||||||
|| DebugPreferenceFragment.class.getName().equals(fragmentName)
|
|| DebugPreferenceFragment.class.getName().equals(fragmentName)
|
||||||
|| LinksPreferenceFragment.class.getName().equals(fragmentName)
|
|| LinksPreferenceFragment.class.getName().equals(fragmentName)
|
||||||
|| ThemePreferenceFragment.class.getName().equals(fragmentName);
|
|| ThemePreferenceFragment.class.getName().equals(fragmentName);
|
||||||
@ -384,6 +385,26 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
||||||
|
public static class ExperimentalPreferenceFragment extends PreferenceFragment {
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
addPreferencesFromResource(R.xml.pref_experimental);
|
||||||
|
setHasOptionsMenu(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
int id = item.getItemId();
|
||||||
|
if (id == android.R.id.home) {
|
||||||
|
getActivity().finish();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
@ -11,15 +11,16 @@ import com.google.android.material.snackbar.Snackbar
|
|||||||
|
|
||||||
var snackBarShown = false
|
var snackBarShown = false
|
||||||
var view: View? = null
|
var view: View? = null
|
||||||
|
lateinit var s: Snackbar
|
||||||
|
|
||||||
fun Context.isNetworkAccessible(v: View?): Boolean {
|
fun Context.isNetworkAccessible(v: View?, overrideOffline: Boolean = false): Boolean {
|
||||||
val cm = this.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
|
val cm = this.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
|
||||||
val activeNetwork: NetworkInfo? = cm.activeNetworkInfo
|
val activeNetwork: NetworkInfo? = cm.activeNetworkInfo
|
||||||
val networkIsAccessible = activeNetwork != null && activeNetwork.isConnectedOrConnecting
|
val networkIsAccessible = activeNetwork != null && activeNetwork.isConnectedOrConnecting
|
||||||
|
|
||||||
if (v != null && !networkIsAccessible && (!snackBarShown || v != view)) {
|
if (v != null && (!networkIsAccessible || overrideOffline) && (!snackBarShown || v != view)) {
|
||||||
view = v
|
view = v
|
||||||
val s = Snackbar
|
s = Snackbar
|
||||||
.make(
|
.make(
|
||||||
v,
|
v,
|
||||||
R.string.no_network_connectivity,
|
R.string.no_network_connectivity,
|
||||||
@ -37,5 +38,8 @@ fun Context.isNetworkAccessible(v: View?): Boolean {
|
|||||||
s.show()
|
s.show()
|
||||||
snackBarShown = true
|
snackBarShown = true
|
||||||
}
|
}
|
||||||
return networkIsAccessible
|
if (snackBarShown && networkIsAccessible && !overrideOffline) {
|
||||||
|
s.dismiss()
|
||||||
|
}
|
||||||
|
return if(overrideOffline) overrideOffline else networkIsAccessible
|
||||||
}
|
}
|
BIN
app/src/main/res/drawable-hdpi/ic_action_lab.png
Normal file
BIN
app/src/main/res/drawable-hdpi/ic_action_lab.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 683 B |
BIN
app/src/main/res/drawable-mdpi/ic_action_lab.png
Normal file
BIN
app/src/main/res/drawable-mdpi/ic_action_lab.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 409 B |
BIN
app/src/main/res/drawable-xhdpi/ic_action_lab.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_action_lab.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 871 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_action_lab.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/ic_action_lab.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/ic_action_lab.png
Normal file
BIN
app/src/main/res/drawable-xxxhdpi/ic_action_lab.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -161,8 +161,9 @@
|
|||||||
<string name="loading_notification_title">Cargando...</string>
|
<string name="loading_notification_title">Cargando...</string>
|
||||||
<string name="loading_notification_text">Selfoss está sincronizando tus artículos</string>
|
<string name="loading_notification_text">Selfoss está sincronizando tus artículos</string>
|
||||||
<string name="notification_channel_sync">Notificación de sincronización</string>
|
<string name="notification_channel_sync">Notificación de sincronización</string>
|
||||||
<string name="new_items_channel_sync">New items notification</string>
|
<string name="new_items_channel_sync">Notificación de elementos nuevos</string>
|
||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">¡Nuevos artículos!</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d artículos cargados.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notificarme cuando se sincronicen nuevos artículos.</string>
|
||||||
|
<string name="shortcut_offline">Sin conexión</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">Nouveaux articles !</string>
|
<string name="new_items_notification_title">Nouveaux articles !</string>
|
||||||
<string name="new_items_notification_text">%1$d nouveaux articles synchronisés.</string>
|
<string name="new_items_notification_text">%1$d nouveaux articles synchronisés.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notification quand des nouveaux articles sont synchronisés.</string>
|
<string name="pref_switch_notify_new_items">Notification quand des nouveaux articles sont synchronisés.</string>
|
||||||
|
<string name="shortcut_offline">Hors ligne</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -161,8 +161,9 @@
|
|||||||
<string name="loading_notification_title">Cargando...</string>
|
<string name="loading_notification_title">Cargando...</string>
|
||||||
<string name="loading_notification_text">Selfoss está sincronizando os teus ar tigos</string>
|
<string name="loading_notification_text">Selfoss está sincronizando os teus ar tigos</string>
|
||||||
<string name="notification_channel_sync">Notificación de sincronización</string>
|
<string name="notification_channel_sync">Notificación de sincronización</string>
|
||||||
<string name="new_items_channel_sync">New items notification</string>
|
<string name="new_items_channel_sync">Notificación de actualizacións</string>
|
||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">Novo(s) elemento(s)!</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d novos elementos cargados.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notificarme cando se sincronicen novos elementos.</string>
|
||||||
|
<string name="shortcut_offline">Sen conexión</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,5 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -165,4 +165,7 @@
|
|||||||
<string name="new_items_notification_title">New items !</string>
|
<string name="new_items_notification_title">New items !</string>
|
||||||
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
<string name="new_items_notification_text">%1$d new items loaded.</string>
|
||||||
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
|
||||||
|
<string name="shortcut_offline">Offline</string>
|
||||||
|
<string name="pref_api_timeout">Api Timeout</string>
|
||||||
|
<string name="pref_header_experimental">Experimental</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
59
app/src/main/res/xml-v25/shortcuts.xml
Normal file
59
app/src/main/res/xml-v25/shortcuts.xml
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<shortcut
|
||||||
|
android:shortcutId="new"
|
||||||
|
android:enabled="true"
|
||||||
|
android:icon="@drawable/ic_fiber_new_black_24dp"
|
||||||
|
android:shortcutShortLabel="@string/tab_new">
|
||||||
|
<intent
|
||||||
|
android:action="android.intent.action.VIEW"
|
||||||
|
android:targetPackage="apps.amine.bou.readerforselfoss"
|
||||||
|
android:targetClass="apps.amine.bou.readerforselfoss.HomeActivity">
|
||||||
|
<extra
|
||||||
|
android:name="shortcutTab"
|
||||||
|
android:value="1" />
|
||||||
|
</intent>
|
||||||
|
</shortcut>
|
||||||
|
<shortcut
|
||||||
|
android:shortcutId="read"
|
||||||
|
android:enabled="true"
|
||||||
|
android:icon="@drawable/ic_archive_black_24dp"
|
||||||
|
android:shortcutShortLabel="@string/tab_read">
|
||||||
|
<intent
|
||||||
|
android:action="android.intent.action.VIEW"
|
||||||
|
android:targetPackage="apps.amine.bou.readerforselfoss"
|
||||||
|
android:targetClass="apps.amine.bou.readerforselfoss.HomeActivity">
|
||||||
|
<extra
|
||||||
|
android:name="shortcutTab"
|
||||||
|
android:value="2" />
|
||||||
|
</intent>
|
||||||
|
</shortcut>
|
||||||
|
<shortcut
|
||||||
|
android:shortcutId="favs"
|
||||||
|
android:enabled="true"
|
||||||
|
android:icon="@drawable/ic_favorite_black_24dp"
|
||||||
|
android:shortcutShortLabel="@string/tab_favs">
|
||||||
|
<intent
|
||||||
|
android:action="android.intent.action.VIEW"
|
||||||
|
android:targetPackage="apps.amine.bou.readerforselfoss"
|
||||||
|
android:targetClass="apps.amine.bou.readerforselfoss.HomeActivity">
|
||||||
|
<extra
|
||||||
|
android:name="shortcutTab"
|
||||||
|
android:value="3" />
|
||||||
|
</intent>
|
||||||
|
</shortcut>
|
||||||
|
<shortcut
|
||||||
|
android:shortcutId="offline"
|
||||||
|
android:enabled="true"
|
||||||
|
android:icon="@drawable/ic_signal_wifi_statusbar_not_connected"
|
||||||
|
android:shortcutShortLabel="@string/shortcut_offline">
|
||||||
|
<intent
|
||||||
|
android:action="android.intent.action.VIEW"
|
||||||
|
android:targetPackage="apps.amine.bou.readerforselfoss"
|
||||||
|
android:targetClass="apps.amine.bou.readerforselfoss.HomeActivity">
|
||||||
|
<extra
|
||||||
|
android:name="startOffline"
|
||||||
|
android:value="true" />
|
||||||
|
</intent>
|
||||||
|
</shortcut>
|
||||||
|
</shortcuts>
|
9
app/src/main/res/xml/pref_experimental.xml
Normal file
9
app/src/main/res/xml/pref_experimental.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<EditTextPreference
|
||||||
|
android:inputType="number"
|
||||||
|
android:key="api_timeout"
|
||||||
|
android:selectAllOnFocus="true"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:title="@string/pref_api_timeout" />
|
||||||
|
|
||||||
|
</PreferenceScreen>
|
@ -32,4 +32,9 @@
|
|||||||
android:icon="@drawable/ic_info_black_24"
|
android:icon="@drawable/ic_info_black_24"
|
||||||
android:title="@string/pref_header_links"/>
|
android:title="@string/pref_header_links"/>
|
||||||
|
|
||||||
|
<header
|
||||||
|
android:fragment="apps.amine.bou.readerforselfoss.settings.SettingsActivity$ExperimentalPreferenceFragment"
|
||||||
|
android:icon="@drawable/ic_action_lab"
|
||||||
|
android:title="@string/pref_header_experimental"/>
|
||||||
|
|
||||||
</preference-headers>
|
</preference-headers>
|
||||||
|
4
build.sh
4
build.sh
@ -5,7 +5,9 @@ TODAYS_VERSION="1"
|
|||||||
|
|
||||||
VERSION="${BASE_VERSION//./}$(date '+%y%m%j')$TODAYS_VERSION"
|
VERSION="${BASE_VERSION//./}$(date '+%y%m%j')$TODAYS_VERSION"
|
||||||
|
|
||||||
./version.sh ${VERSION} $1
|
PARAMS_EXCEPT_PUBLISH=$(echo $1 | sed 's/\-\-publish//')
|
||||||
|
|
||||||
|
./version.sh ${VERSION} ${PARAMS_EXCEPT_PUBLISH}
|
||||||
|
|
||||||
if [[ "$@" == *'--publish'* ]]
|
if [[ "$@" == *'--publish'* ]]
|
||||||
then
|
then
|
||||||
|
Reference in New Issue
Block a user