Compare commits
	
		
			8 Commits
		
	
	
		
			v171811310
			...
			v171811311
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					332e9f5108 | ||
| 
						 | 
					0b91087c07 | ||
| 
						 | 
					ebbb1ba0f8 | ||
| 
						 | 
					e9143ae852 | ||
| 
						 | 
					42e8ecee78 | ||
| 
						 | 
					4efd76fcbc | ||
| 
						 | 
					fb1614070e | ||
| 
						 | 
					c473dd7227 | 
@@ -1,5 +1,9 @@
 | 
			
		||||
**1.7.x**
 | 
			
		||||
 | 
			
		||||
- 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 #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_USERNAME", appLoginUsername
 | 
			
		||||
            buildConfigField "String", "LOGIN_PASSWORD", appLoginPassword
 | 
			
		||||
            applicationIdSuffix ".dev"
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    flavorDimensions "build"
 | 
			
		||||
 
 | 
			
		||||
@@ -21,6 +21,9 @@
 | 
			
		||||
 | 
			
		||||
                <category android:name="android.intent.category.LAUNCHER" />
 | 
			
		||||
            </intent-filter>
 | 
			
		||||
 | 
			
		||||
            <meta-data android:name="android.app.shortcuts"
 | 
			
		||||
                android:resource="@xml/shortcuts" />
 | 
			
		||||
        </activity>
 | 
			
		||||
        <activity
 | 
			
		||||
            android:name=".LoginActivity"
 | 
			
		||||
 
 | 
			
		||||
@@ -145,6 +145,9 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
 | 
			
		||||
    private var badgeAll: 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 db: AppDatabase
 | 
			
		||||
@@ -161,6 +164,13 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
 | 
			
		||||
 | 
			
		||||
        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)
 | 
			
		||||
 | 
			
		||||
        handleThemeBinding()
 | 
			
		||||
@@ -203,6 +213,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
 | 
			
		||||
            R.color.refresh_progress_3
 | 
			
		||||
        )
 | 
			
		||||
        swipeRefreshLayout.setOnRefreshListener {
 | 
			
		||||
            offlineShortcut = false
 | 
			
		||||
            allItems = ArrayList()
 | 
			
		||||
            lastFetchDone = false
 | 
			
		||||
            handleDrawerItems()
 | 
			
		||||
@@ -318,6 +329,10 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
 | 
			
		||||
 | 
			
		||||
        bottomBar.setMode(BottomNavigationBar.MODE_SHIFTING)
 | 
			
		||||
        bottomBar.setBackgroundStyle(BottomNavigationBar.BACKGROUND_STYLE_STATIC)
 | 
			
		||||
 | 
			
		||||
        if (fromTabShortcut) {
 | 
			
		||||
            bottomBar.selectTab(elementsShown - 1)
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    override fun onResume() {
 | 
			
		||||
@@ -628,14 +643,6 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
 | 
			
		||||
                            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()) {
 | 
			
		||||
                    drawer.addItem(DividerDrawerItem())
 | 
			
		||||
                    drawer.addItem(
 | 
			
		||||
@@ -647,6 +654,14 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
 | 
			
		||||
                    handleHiddenTags(maybeDrawerData.tags)
 | 
			
		||||
                }
 | 
			
		||||
                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(
 | 
			
		||||
                    SecondaryDrawerItem()
 | 
			
		||||
                        .withName(getString(R.string.drawer_item_sources))
 | 
			
		||||
@@ -721,7 +736,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
 | 
			
		||||
            var sources: List<Source>?
 | 
			
		||||
 | 
			
		||||
            fun sourcesApiCall() {
 | 
			
		||||
                if (this@HomeActivity.isNetworkAccessible(null)) {
 | 
			
		||||
                if (this@HomeActivity.isNetworkAccessible(null, offlineShortcut)) {
 | 
			
		||||
                    api.sources.enqueue(object : Callback<List<Source>> {
 | 
			
		||||
                        override fun onResponse(
 | 
			
		||||
                            call: Call<List<Source>>?,
 | 
			
		||||
@@ -744,7 +759,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (this@HomeActivity.isNetworkAccessible(null)) {
 | 
			
		||||
            if (this@HomeActivity.isNetworkAccessible(null, offlineShortcut)) {
 | 
			
		||||
                api.tags.enqueue(object : Callback<List<Tag>> {
 | 
			
		||||
                    override fun onResponse(
 | 
			
		||||
                        call: Call<List<Tag>>,
 | 
			
		||||
@@ -875,7 +890,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
 | 
			
		||||
                                    else -> Unit
 | 
			
		||||
                                }
 | 
			
		||||
                            } else {
 | 
			
		||||
                                if (this@HomeActivity.isNetworkAccessible(this@HomeActivity.findViewById(R.id.coordLayout))) {
 | 
			
		||||
                                if (this@HomeActivity.isNetworkAccessible(this@HomeActivity.findViewById(R.id.coordLayout), offlineShortcut)) {
 | 
			
		||||
                                    when (position) {
 | 
			
		||||
                                        0 -> getUnRead()
 | 
			
		||||
                                        1 -> getRead()
 | 
			
		||||
@@ -972,7 +987,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
 | 
			
		||||
                        handleListResult()
 | 
			
		||||
                        doGetAccordingToTab()
 | 
			
		||||
                    } else {
 | 
			
		||||
                        if (this@HomeActivity.isNetworkAccessible(this@HomeActivity.findViewById(R.id.coordLayout))) {
 | 
			
		||||
                        if (this@HomeActivity.isNetworkAccessible(this@HomeActivity.findViewById(R.id.coordLayout), offlineShortcut)) {
 | 
			
		||||
                            doGetAccordingToTab()
 | 
			
		||||
                            getAndStoreAllItems()
 | 
			
		||||
                        }
 | 
			
		||||
@@ -1031,7 +1046,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
 | 
			
		||||
            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)
 | 
			
		||||
                .enqueue(object : Callback<List<Item>> {
 | 
			
		||||
                    override fun onResponse(
 | 
			
		||||
@@ -1161,7 +1176,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private fun reloadBadges() {
 | 
			
		||||
        if (this@HomeActivity.isNetworkAccessible(null) && (displayUnreadCount || displayAllCount)) {
 | 
			
		||||
        if (this@HomeActivity.isNetworkAccessible(null, offlineShortcut) && (displayUnreadCount || displayAllCount)) {
 | 
			
		||||
            api.stats.enqueue(object : Callback<Stats> {
 | 
			
		||||
                override fun onResponse(call: Call<Stats>, response: Response<Stats>) {
 | 
			
		||||
                    if (response.body() != null) {
 | 
			
		||||
@@ -1267,7 +1282,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
 | 
			
		||||
    override fun onOptionsItemSelected(item: MenuItem): Boolean {
 | 
			
		||||
        when (item.itemId) {
 | 
			
		||||
            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) {
 | 
			
		||||
                        api.update().enqueue(object : Callback<String> {
 | 
			
		||||
                            override fun onResponse(
 | 
			
		||||
@@ -1311,7 +1326,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
 | 
			
		||||
                            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> {
 | 
			
		||||
                                override fun onResponse(
 | 
			
		||||
                                    call: Call<SuccessResponse>,
 | 
			
		||||
@@ -1455,7 +1470,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
 | 
			
		||||
           })
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (this@HomeActivity.isNetworkAccessible(null)) {
 | 
			
		||||
        if (this@HomeActivity.isNetworkAccessible(null, offlineShortcut)) {
 | 
			
		||||
            thread {
 | 
			
		||||
                val actions = db.actionsDao().actions()
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,9 @@
 | 
			
		||||
package apps.amine.bou.readerforselfoss.background
 | 
			
		||||
 | 
			
		||||
import android.app.NotificationManager
 | 
			
		||||
import android.app.PendingIntent
 | 
			
		||||
import android.content.Context
 | 
			
		||||
import android.content.Intent
 | 
			
		||||
import android.preference.PreferenceManager
 | 
			
		||||
import androidx.core.app.NotificationCompat
 | 
			
		||||
import androidx.core.app.NotificationCompat.PRIORITY_DEFAULT
 | 
			
		||||
@@ -9,6 +11,7 @@ import androidx.core.app.NotificationCompat.PRIORITY_LOW
 | 
			
		||||
import androidx.room.Room
 | 
			
		||||
import androidx.work.Worker
 | 
			
		||||
import androidx.work.WorkerParameters
 | 
			
		||||
import apps.amine.bou.readerforselfoss.MainActivity
 | 
			
		||||
import apps.amine.bou.readerforselfoss.R
 | 
			
		||||
import apps.amine.bou.readerforselfoss.api.selfoss.Item
 | 
			
		||||
import apps.amine.bou.readerforselfoss.api.selfoss.SelfossApi
 | 
			
		||||
@@ -85,11 +88,19 @@ class LoadingWorker(val context: Context, params: WorkerParameters) : Worker(con
 | 
			
		||||
 | 
			
		||||
                            val newSize = apiItems.filter { it.unread }.size
 | 
			
		||||
                            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)
 | 
			
		||||
                                    .setContentTitle(context.getString(R.string.new_items_notification_title))
 | 
			
		||||
                                    .setContentText(context.getString(R.string.new_items_notification_text, newSize))
 | 
			
		||||
                                    .setPriority(PRIORITY_DEFAULT)
 | 
			
		||||
                                    .setChannelId(Config.newItemsChannelId)
 | 
			
		||||
                                    .setContentIntent(pendingIntent)
 | 
			
		||||
                                    .setAutoCancel(true)
 | 
			
		||||
                                    .setSmallIcon(R.drawable.ic_fiber_new_black_24dp)
 | 
			
		||||
 | 
			
		||||
                                Timer("", false).schedule(4000) {
 | 
			
		||||
 
 | 
			
		||||
@@ -11,15 +11,16 @@ import com.google.android.material.snackbar.Snackbar
 | 
			
		||||
 | 
			
		||||
var snackBarShown = false
 | 
			
		||||
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 activeNetwork: NetworkInfo? = cm.activeNetworkInfo
 | 
			
		||||
    val networkIsAccessible = activeNetwork != null && activeNetwork.isConnectedOrConnecting
 | 
			
		||||
 | 
			
		||||
    if (v != null && !networkIsAccessible && (!snackBarShown || v != view)) {
 | 
			
		||||
    if (v != null && (!networkIsAccessible || overrideOffline) && (!snackBarShown || v != view)) {
 | 
			
		||||
        view = v
 | 
			
		||||
        val s = Snackbar
 | 
			
		||||
        s = Snackbar
 | 
			
		||||
            .make(
 | 
			
		||||
                v,
 | 
			
		||||
                R.string.no_network_connectivity,
 | 
			
		||||
@@ -37,5 +38,8 @@ fun Context.isNetworkAccessible(v: View?): Boolean {
 | 
			
		||||
        s.show()
 | 
			
		||||
        snackBarShown = true
 | 
			
		||||
    }
 | 
			
		||||
    return networkIsAccessible
 | 
			
		||||
    if (snackBarShown && networkIsAccessible && !overrideOffline) {
 | 
			
		||||
        s.dismiss()
 | 
			
		||||
    }
 | 
			
		||||
    return if(overrideOffline) overrideOffline else networkIsAccessible
 | 
			
		||||
}
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">Nouveaux articles !</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="shortcut_offline">Hors ligne</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -165,4 +165,5 @@
 | 
			
		||||
    <string name="new_items_notification_title">New items !</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="shortcut_offline">Offline</string>
 | 
			
		||||
</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>
 | 
			
		||||
		Reference in New Issue
	
	Block a user