Compare commits
	
		
			10 Commits
		
	
	
		
			v171901010
			...
			v171901027
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | e3460322b1 | ||
|  | 7e3288a076 | ||
|  | ddc754ec25 | ||
|  | 134a0766d6 | ||
|  | 69da932ab5 | ||
|  | 592fb6328a | ||
|  | a0aead6491 | ||
|  | 722b6cc06d | ||
|  | 6d7c4b40f6 | ||
|  | f538ed39fc | 
| @@ -112,7 +112,7 @@ dependencies { | |||||||
|     implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2' |     implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2' | ||||||
|  |  | ||||||
|     //multidex |     //multidex | ||||||
|     implementation 'androidx.multidex:multidex:2.0.0' |     implementation 'androidx.multidex:multidex:2.0.1' | ||||||
|  |  | ||||||
|     // About |     // About | ||||||
|     implementation('com.mikepenz:aboutlibraries:6.2.0@aar') { |     implementation('com.mikepenz:aboutlibraries:6.2.0@aar') { | ||||||
|   | |||||||
| @@ -1,5 +1,6 @@ | |||||||
| package apps.amine.bou.readerforselfoss | package apps.amine.bou.readerforselfoss | ||||||
|  |  | ||||||
|  | import android.content.Context | ||||||
| import android.content.Intent | import android.content.Intent | ||||||
| import android.os.Build | import android.os.Build | ||||||
| import android.os.Bundle | import android.os.Bundle | ||||||
| @@ -85,10 +86,12 @@ class AddSourceActivity : AppCompatActivity() { | |||||||
|  |  | ||||||
|         try { |         try { | ||||||
|             val prefs = PreferenceManager.getDefaultSharedPreferences(this) |             val prefs = PreferenceManager.getDefaultSharedPreferences(this) | ||||||
|  |             val settings = | ||||||
|  |                 getSharedPreferences(Config.settingsName, Context.MODE_PRIVATE) | ||||||
|             api = SelfossApi( |             api = SelfossApi( | ||||||
|                 this, |                 this, | ||||||
|                 this@AddSourceActivity, |                 this@AddSourceActivity, | ||||||
|                 prefs.getBoolean("isSelfSignedCert", false), |                 settings.getBoolean("isSelfSignedCert", false), | ||||||
|                 prefs.getString("api_timeout", "-1").toLong(), |                 prefs.getString("api_timeout", "-1").toLong(), | ||||||
|                 prefs.getBoolean("should_log_everything", false) |                 prefs.getBoolean("should_log_everything", false) | ||||||
|             ) |             ) | ||||||
|   | |||||||
| @@ -247,14 +247,18 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener { | |||||||
|                     val i = items.elementAtOrNull(position) |                     val i = items.elementAtOrNull(position) | ||||||
|  |  | ||||||
|                     if (i != null) { |                     if (i != null) { | ||||||
|                         val adapter = recyclerView.adapter |                         val adapter = recyclerView.adapter as ItemsAdapter<*> | ||||||
|  |  | ||||||
|                         when (adapter) { |                         val wasItemUnread = adapter.unreadItemStatusAtIndex(position) | ||||||
|                             is ItemCardAdapter -> adapter.handleItemAtIndex(position) |  | ||||||
|                             is ItemListAdapter -> adapter.handleItemAtIndex(position) |                         adapter.handleItemAtIndex(position) | ||||||
|  |  | ||||||
|  |                         if (wasItemUnread) { | ||||||
|  |                             badgeNew-- | ||||||
|  |                         } else { | ||||||
|  |                             badgeNew++ | ||||||
|                         } |                         } | ||||||
|  |  | ||||||
|                         badgeNew-- |  | ||||||
|                         reloadBadgeContent() |                         reloadBadgeContent() | ||||||
|  |  | ||||||
|                         val tagHashes = i.tags.tags.split(",").map { it.longHash() } |                         val tagHashes = i.tags.tags.split(",").map { it.longHash() } | ||||||
| @@ -515,7 +519,9 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener { | |||||||
|                         ) |                         ) | ||||||
|                     } |                     } | ||||||
|                 } else { |                 } else { | ||||||
|                     val filteredTags = maybeTags.filterNot { hiddenTags.contains(it.tag) } |                     val filteredTags = maybeTags | ||||||
|  |                         .filterNot { hiddenTags.contains(it.tag) } | ||||||
|  |                         .sortedBy { it.unread == 0 } | ||||||
|                     tagsBadge = filteredTags.map { |                     tagsBadge = filteredTags.map { | ||||||
|                         val gd = GradientDrawable() |                         val gd = GradientDrawable() | ||||||
|                         val color = try { |                         val color = try { | ||||||
| @@ -1348,12 +1354,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener { | |||||||
|                                         ).show() |                                         ).show() | ||||||
|                                         tabNewBadge.removeBadge() |                                         tabNewBadge.removeBadge() | ||||||
|  |  | ||||||
|  |                                         handleDrawerItems() | ||||||
|                                         tagsBadge = itemsByTag.map { |  | ||||||
|                                             (it.key to ((tagsBadge[it.key] ?: it.value) - it.value)) |  | ||||||
|                                         }.toMap() |  | ||||||
|  |  | ||||||
|                                         reloadTagsBadges() |  | ||||||
|  |  | ||||||
|                                         getElementsAccordingToTab() |                                         getElementsAccordingToTab() | ||||||
|                                     } else { |                                     } else { | ||||||
|   | |||||||
| @@ -1,5 +1,6 @@ | |||||||
| package apps.amine.bou.readerforselfoss | package apps.amine.bou.readerforselfoss | ||||||
|  |  | ||||||
|  | import android.content.Context | ||||||
| import android.content.SharedPreferences | import android.content.SharedPreferences | ||||||
| import android.graphics.drawable.ColorDrawable | import android.graphics.drawable.ColorDrawable | ||||||
| import android.os.Build | import android.os.Build | ||||||
| @@ -27,6 +28,7 @@ import apps.amine.bou.readerforselfoss.persistence.migrations.MIGRATION_2_3 | |||||||
| import apps.amine.bou.readerforselfoss.themes.AppColors | import apps.amine.bou.readerforselfoss.themes.AppColors | ||||||
| import apps.amine.bou.readerforselfoss.themes.Toppings | import apps.amine.bou.readerforselfoss.themes.Toppings | ||||||
| import apps.amine.bou.readerforselfoss.transformers.DepthPageTransformer | import apps.amine.bou.readerforselfoss.transformers.DepthPageTransformer | ||||||
|  | import apps.amine.bou.readerforselfoss.utils.Config | ||||||
| import apps.amine.bou.readerforselfoss.utils.maybeHandleSilentException | import apps.amine.bou.readerforselfoss.utils.maybeHandleSilentException | ||||||
| import apps.amine.bou.readerforselfoss.utils.network.isNetworkAccessible | import apps.amine.bou.readerforselfoss.utils.network.isNetworkAccessible | ||||||
| import apps.amine.bou.readerforselfoss.utils.persistence.toEntity | import apps.amine.bou.readerforselfoss.utils.persistence.toEntity | ||||||
| @@ -94,6 +96,9 @@ class ReaderActivity : AppCompatActivity() { | |||||||
|         supportActionBar?.setDisplayHomeAsUpEnabled(true) |         supportActionBar?.setDisplayHomeAsUpEnabled(true) | ||||||
|         supportActionBar?.setDisplayShowHomeEnabled(true) |         supportActionBar?.setDisplayShowHomeEnabled(true) | ||||||
|  |  | ||||||
|  |         val settings = | ||||||
|  |             getSharedPreferences(Config.settingsName, Context.MODE_PRIVATE) | ||||||
|  |  | ||||||
|         prefs = PreferenceManager.getDefaultSharedPreferences(this) |         prefs = PreferenceManager.getDefaultSharedPreferences(this) | ||||||
|         editor = prefs.edit() |         editor = prefs.edit() | ||||||
|  |  | ||||||
| @@ -105,7 +110,7 @@ class ReaderActivity : AppCompatActivity() { | |||||||
|         api = SelfossApi( |         api = SelfossApi( | ||||||
|             this, |             this, | ||||||
|             this@ReaderActivity, |             this@ReaderActivity, | ||||||
|             prefs.getBoolean("isSelfSignedCert", false), |             settings.getBoolean("isSelfSignedCert", false), | ||||||
|             prefs.getString("api_timeout", "-1").toLong(), |             prefs.getString("api_timeout", "-1").toLong(), | ||||||
|             prefs.getBoolean("should_log_everything", false) |             prefs.getBoolean("should_log_everything", false) | ||||||
|         ) |         ) | ||||||
|   | |||||||
| @@ -1,5 +1,6 @@ | |||||||
| package apps.amine.bou.readerforselfoss | package apps.amine.bou.readerforselfoss | ||||||
|  |  | ||||||
|  | import android.content.Context | ||||||
| import android.content.Intent | import android.content.Intent | ||||||
| import android.content.res.ColorStateList | import android.content.res.ColorStateList | ||||||
| import android.os.Build | import android.os.Build | ||||||
| @@ -13,6 +14,7 @@ import apps.amine.bou.readerforselfoss.api.selfoss.SelfossApi | |||||||
| import apps.amine.bou.readerforselfoss.api.selfoss.Source | import apps.amine.bou.readerforselfoss.api.selfoss.Source | ||||||
| import apps.amine.bou.readerforselfoss.themes.AppColors | import apps.amine.bou.readerforselfoss.themes.AppColors | ||||||
| import apps.amine.bou.readerforselfoss.themes.Toppings | import apps.amine.bou.readerforselfoss.themes.Toppings | ||||||
|  | import apps.amine.bou.readerforselfoss.utils.Config | ||||||
| import apps.amine.bou.readerforselfoss.utils.network.isNetworkAccessible | import apps.amine.bou.readerforselfoss.utils.network.isNetworkAccessible | ||||||
| import com.ftinc.scoop.Scoop | import com.ftinc.scoop.Scoop | ||||||
| import kotlinx.android.synthetic.main.activity_sources.* | import kotlinx.android.synthetic.main.activity_sources.* | ||||||
| @@ -54,12 +56,14 @@ class SourcesActivity : AppCompatActivity() { | |||||||
|         super.onResume() |         super.onResume() | ||||||
|         val mLayoutManager = LinearLayoutManager(this) |         val mLayoutManager = LinearLayoutManager(this) | ||||||
|  |  | ||||||
|  |         val settings = | ||||||
|  |             getSharedPreferences(Config.settingsName, Context.MODE_PRIVATE) | ||||||
|         val prefs = PreferenceManager.getDefaultSharedPreferences(this) |         val prefs = PreferenceManager.getDefaultSharedPreferences(this) | ||||||
|  |  | ||||||
|         val api = SelfossApi( |         val api = SelfossApi( | ||||||
|             this, |             this, | ||||||
|             this@SourcesActivity, |             this@SourcesActivity, | ||||||
|             prefs.getBoolean("isSelfSignedCert", false), |             settings.getBoolean("isSelfSignedCert", false), | ||||||
|             prefs.getString("api_timeout", "-1").toLong(), |             prefs.getString("api_timeout", "-1").toLong(), | ||||||
|             prefs.getBoolean("should_log_everything", false) |             prefs.getBoolean("should_log_everything", false) | ||||||
|         ) |         ) | ||||||
|   | |||||||
| @@ -132,15 +132,17 @@ abstract class ItemsAdapter<VH : RecyclerView.ViewHolder?> : RecyclerView.Adapte | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     fun handleItemAtIndex(position: Int) { |     fun handleItemAtIndex(position: Int) { | ||||||
|         val i = items[position] |         if (unreadItemStatusAtIndex(position)) { | ||||||
|  |  | ||||||
|         if (i.unread) { |  | ||||||
|             readItemAtIndex(position) |             readItemAtIndex(position) | ||||||
|         } else { |         } else { | ||||||
|             unreadItemAtIndex(position) |             unreadItemAtIndex(position) | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     fun unreadItemStatusAtIndex(position: Int): Boolean { | ||||||
|  |         return items[position].unread | ||||||
|  |     } | ||||||
|  |  | ||||||
|     private fun readItemAtIndex(position: Int) { |     private fun readItemAtIndex(position: Int) { | ||||||
|         val i = items[position] |         val i = items[position] | ||||||
|         items.remove(i) |         items.remove(i) | ||||||
|   | |||||||
| @@ -127,7 +127,13 @@ class ArticleFragment : Fragment() { | |||||||
|             font = prefs.getString("reader_font", "") |             font = prefs.getString("reader_font", "") | ||||||
|             if (font.isNotEmpty()) { |             if (font.isNotEmpty()) { | ||||||
|                 resId = context!!.resources.getIdentifier(font, "font", context!!.packageName) |                 resId = context!!.resources.getIdentifier(font, "font", context!!.packageName) | ||||||
|                 typeface = ResourcesCompat.getFont(context!!, resId)!! |                 typeface = try { | ||||||
|  |                     ResourcesCompat.getFont(context!!, resId)!! | ||||||
|  |                 } catch (e: java.lang.Exception) { | ||||||
|  |                     // ACRA.getErrorReporter().maybeHandleSilentException(Throwable("Font loading issue: ${e.message}"), context!!) | ||||||
|  |                     // Just to be sure | ||||||
|  |                     null | ||||||
|  |                 } | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             refreshAlignment() |             refreshAlignment() | ||||||
|   | |||||||
| @@ -36,7 +36,7 @@ | |||||||
|     <string name="tab_favs">"收藏夹"</string> |     <string name="tab_favs">"收藏夹"</string> | ||||||
|     <string name="action_about">"关于我们"</string> |     <string name="action_about">"关于我们"</string> | ||||||
|     <string name="marked_as_read">"已读"</string> |     <string name="marked_as_read">"已读"</string> | ||||||
|     <string name="marked_as_unread">"Item unread"</string> |     <string name="marked_as_unread">"未讀項目"</string> | ||||||
|     <string name="undo_string">"撤销"</string> |     <string name="undo_string">"撤销"</string> | ||||||
|     <string name="addStringNoUrl">"登录以添加数据源。"</string> |     <string name="addStringNoUrl">"登录以添加数据源。"</string> | ||||||
|     <string name="cant_get_sources">"无法获取数据列表。"</string> |     <string name="cant_get_sources">"无法获取数据列表。"</string> | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ | |||||||
|  |  | ||||||
| buildscript { | buildscript { | ||||||
|     ext { |     ext { | ||||||
|         kotlin_version = '1.2.51' |         kotlin_version = '1.3.0' | ||||||
|         android_version = '1.0.0' |         android_version = '1.0.0' | ||||||
|         lifecycle_version = '2.0.0' |         lifecycle_version = '2.0.0' | ||||||
|         room_version = '2.1.0-alpha01' |         room_version = '2.1.0-alpha01' | ||||||
| @@ -16,7 +16,7 @@ buildscript { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
|     dependencies { |     dependencies { | ||||||
|         classpath 'com.android.tools.build:gradle:3.2.1' |         classpath 'com.android.tools.build:gradle:3.3.0' | ||||||
|         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" |         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
							
								
								
									
										4
									
								
								gradle/wrapper/gradle-wrapper.properties
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								gradle/wrapper/gradle-wrapper.properties
									
									
									
									
										vendored
									
									
								
							| @@ -1,6 +1,6 @@ | |||||||
| #Tue Sep 25 20:41:54 CEST 2018 | #Mon Jan 14 20:50:06 CET 2019 | ||||||
| distributionBase=GRADLE_USER_HOME | distributionBase=GRADLE_USER_HOME | ||||||
| distributionPath=wrapper/dists | distributionPath=wrapper/dists | ||||||
| zipStoreBase=GRADLE_USER_HOME | zipStoreBase=GRADLE_USER_HOME | ||||||
| zipStorePath=wrapper/dists | zipStorePath=wrapper/dists | ||||||
| distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user