Bump dependencies, remove unused resources

This commit is contained in:
len 2016-09-29 19:53:59 +02:00
parent d352405ba6
commit 11ac4df5d7
8 changed files with 31 additions and 30 deletions

View File

@ -91,7 +91,7 @@ dependencies {
compile 'com.github.inorichi:ReactiveNetwork:69092ed' compile 'com.github.inorichi:ReactiveNetwork:69092ed'
// Android support library // Android support library
final support_library_version = '24.1.1' final support_library_version = '24.2.1'
compile "com.android.support:support-v4:$support_library_version" compile "com.android.support:support-v4:$support_library_version"
compile "com.android.support:appcompat-v7:$support_library_version" compile "com.android.support:appcompat-v7:$support_library_version"
compile "com.android.support:cardview-v7:$support_library_version" compile "com.android.support:cardview-v7:$support_library_version"
@ -104,7 +104,7 @@ dependencies {
// ReactiveX // ReactiveX
compile 'io.reactivex:rxandroid:1.2.1' compile 'io.reactivex:rxandroid:1.2.1'
compile 'io.reactivex:rxjava:1.1.10' compile 'io.reactivex:rxjava:1.2.0'
compile 'com.f2prateek.rx.preferences:rx-preferences:1.0.2' compile 'com.f2prateek.rx.preferences:rx-preferences:1.0.2'
// Network client // Network client
@ -121,13 +121,13 @@ dependencies {
// JSON // JSON
compile 'com.google.code.gson:gson:2.7' compile 'com.google.code.gson:gson:2.7'
compile 'com.github.salomonbrys.kotson:kotson:2.3.0' compile 'com.github.salomonbrys.kotson:kotson:2.4.0'
// YAML // YAML
compile 'com.github.bmoliveira:snake-yaml:v1.18-android' compile 'com.github.bmoliveira:snake-yaml:v1.18-android'
// JavaScript engine // JavaScript engine
compile 'com.squareup.duktape:duktape-android:0.9.5' compile 'com.squareup.duktape:duktape-android:1.0.0'
// Disk cache // Disk cache
compile 'com.jakewharton:disklrucache:2.0.2' compile 'com.jakewharton:disklrucache:2.0.2'
@ -157,19 +157,19 @@ dependencies {
compile 'jp.wasabeef:glide-transformations:2.0.1' compile 'jp.wasabeef:glide-transformations:2.0.1'
// Logging // Logging
compile 'com.jakewharton.timber:timber:4.3.0' compile 'com.jakewharton.timber:timber:4.3.1'
// Crash reports // Crash reports
compile 'ch.acra:acra:4.9.0' compile 'ch.acra:acra:4.9.0'
// UI // UI
compile 'com.dmitrymalkovich.android:material-design-dimens:1.2' compile 'com.dmitrymalkovich.android:material-design-dimens:1.4'
compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4' compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
compile 'eu.davidea:flexible-adapter:4.2.0' compile 'eu.davidea:flexible-adapter:4.2.0'
compile 'com.nononsenseapps:filepicker:2.5.2' compile 'com.nononsenseapps:filepicker:2.5.2'
compile 'com.github.amulyakhare:TextDrawable:558677e' compile 'com.github.amulyakhare:TextDrawable:558677e'
compile 'com.afollestad.material-dialogs:core:0.8.6.2' compile 'com.afollestad.material-dialogs:core:0.9.0.2'
compile 'net.xpece.android:support-preference:0.8.1' compile 'net.xpece.android:support-preference:1.0.3'
compile 'me.zhanghai.android.systemuihelper:library:1.0.0' compile 'me.zhanghai.android.systemuihelper:library:1.0.0'
compile 'de.hdodenhof:circleimageview:2.1.0' compile 'de.hdodenhof:circleimageview:2.1.0'

View File

@ -60,8 +60,7 @@ class CloudflareInterceptor(private val cookies: PersistentCookieStore) : Interc
.replace(Regex("""\s{3,}[a-z](?: = |\.).+"""), "") .replace(Regex("""\s{3,}[a-z](?: = |\.).+"""), "")
.replace("\n", "") .replace("\n", "")
// Duktape can only return strings, so the result has to be converted to string first val result = (duktape.evaluate(js) as Double).toInt()
val result = duktape.evaluate("$js.toString()").toInt()
val answer = "${result + domain.length}" val answer = "${result + domain.length}"

View File

@ -41,6 +41,8 @@ class BackupFragment : BaseRxFragment<BackupPresenter>() {
} }
override fun onViewCreated(view: View, savedState: Bundle?) { override fun onViewCreated(view: View, savedState: Bundle?) {
setToolbarTitle(getString(R.string.label_backup))
(activity as ActivityMixin).requestPermissionsOnMarshmallow() (activity as ActivityMixin).requestPermissionsOnMarshmallow()
subscriptions = SubscriptionList() subscriptions = SubscriptionList()

View File

@ -1,15 +1,10 @@
package eu.kanade.tachiyomi.ui.manga.info package eu.kanade.tachiyomi.ui.manga.info
import android.app.Activity
import android.content.Intent import android.content.Intent
import android.graphics.Bitmap import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.graphics.drawable.BitmapDrawable
import android.net.Uri import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.support.customtabs.CustomTabsIntent import android.support.customtabs.CustomTabsIntent
import android.support.design.widget.Snackbar
import android.util.SparseArray
import android.view.* import android.view.*
import com.afollestad.materialdialogs.MaterialDialog import com.afollestad.materialdialogs.MaterialDialog
import com.bumptech.glide.BitmapRequestBuilder import com.bumptech.glide.BitmapRequestBuilder
@ -22,7 +17,6 @@ import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.data.source.Source import eu.kanade.tachiyomi.data.source.Source
import eu.kanade.tachiyomi.data.source.online.OnlineSource import eu.kanade.tachiyomi.data.source.online.OnlineSource
import eu.kanade.tachiyomi.ui.base.fragment.BaseRxFragment import eu.kanade.tachiyomi.ui.base.fragment.BaseRxFragment
import eu.kanade.tachiyomi.ui.library.LibraryFragment
import eu.kanade.tachiyomi.ui.manga.MangaActivity import eu.kanade.tachiyomi.ui.manga.MangaActivity
import eu.kanade.tachiyomi.util.getResourceColor import eu.kanade.tachiyomi.util.getResourceColor
import eu.kanade.tachiyomi.util.toast import eu.kanade.tachiyomi.util.toast
@ -31,14 +25,10 @@ import jp.wasabeef.glide.transformations.CropSquareTransformation
import jp.wasabeef.glide.transformations.MaskTransformation import jp.wasabeef.glide.transformations.MaskTransformation
import jp.wasabeef.glide.transformations.RoundedCornersTransformation import jp.wasabeef.glide.transformations.RoundedCornersTransformation
import kotlinx.android.synthetic.main.fragment_manga_info.* import kotlinx.android.synthetic.main.fragment_manga_info.*
import kotlinx.android.synthetic.main.item_download.*
import nucleus.factory.RequiresPresenter import nucleus.factory.RequiresPresenter
import rx.Observable import rx.Observable
import rx.android.schedulers.AndroidSchedulers import rx.android.schedulers.AndroidSchedulers
import rx.schedulers.Schedulers import rx.schedulers.Schedulers
import timber.log.Timber
import java.io.IOException
import kotlin.concurrent.thread
/** /**
* Fragment that shows manga information. * Fragment that shows manga information.

View File

@ -7,9 +7,9 @@ import android.support.v4.content.ContextCompat
import android.support.v7.preference.XpPreferenceFragment import android.support.v7.preference.XpPreferenceFragment
import android.view.View import android.view.View
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.util.getResourceId
import net.xpece.android.support.preference.PreferenceIconHelper import net.xpece.android.support.preference.PreferenceIconHelper
import net.xpece.android.support.preference.PreferenceScreenNavigationStrategy import net.xpece.android.support.preference.PreferenceScreenNavigationStrategy
import net.xpece.android.support.preference.Util
import rx.subscriptions.CompositeSubscription import rx.subscriptions.CompositeSubscription
open class SettingsFragment : XpPreferenceFragment() { open class SettingsFragment : XpPreferenceFragment() {
@ -24,8 +24,8 @@ open class SettingsFragment : XpPreferenceFragment() {
lateinit var subscriptions: CompositeSubscription lateinit var subscriptions: CompositeSubscription
private val iconTint by lazy { ContextCompat.getColorStateList( private val iconTint by lazy { ContextCompat.getColorStateList(context,
context, Util.resolveResourceId(context, R.attr.colorAccent, 0)) context.theme.getResourceId(R.attr.colorAccent, 0))
} }
override final fun onCreatePreferences2(savedState: Bundle?, rootKey: String?) { override final fun onCreatePreferences2(savedState: Bundle?, rootKey: String?) {
@ -59,6 +59,7 @@ open class SettingsFragment : XpPreferenceFragment() {
@CallSuper @CallSuper
override fun onViewCreated(view: View, savedState: Bundle?) { override fun onViewCreated(view: View, savedState: Bundle?) {
super.onViewCreated(view, savedState)
listView.isFocusable = false listView.isFocusable = false
} }

View File

@ -2,18 +2,26 @@ package eu.kanade.tachiyomi.util
import android.content.res.Resources import android.content.res.Resources
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.support.annotation.AttrRes
import android.support.annotation.StringRes import android.support.annotation.StringRes
fun Resources.Theme.getResourceColor(@StringRes resource: Int) : Int { fun Resources.Theme.getResourceColor(@StringRes resource: Int): Int {
val typedArray = this.obtainStyledAttributes(intArrayOf(resource)) val typedArray = obtainStyledAttributes(intArrayOf(resource))
val attrValue = typedArray.getColor(0, 0) val attrValue = typedArray.getColor(0, 0)
typedArray.recycle() typedArray.recycle()
return attrValue return attrValue
} }
fun Resources.Theme.getResourceDrawable(@StringRes resource: Int) : Drawable { fun Resources.Theme.getResourceDrawable(@StringRes resource: Int): Drawable {
val typedArray = this.obtainStyledAttributes(intArrayOf(resource)) val typedArray = obtainStyledAttributes(intArrayOf(resource))
val attrValue = typedArray.getDrawable(0) val attrValue = typedArray.getDrawable(0)
typedArray.recycle() typedArray.recycle()
return attrValue return attrValue
}
fun Resources.Theme.getResourceId(@AttrRes resource: Int, fallback: Int): Int {
val typedArray = obtainStyledAttributes(intArrayOf(resource))
val attrValue = typedArray.getResourceId(0, fallback)
typedArray.recycle()
return attrValue
} }

View File

@ -226,9 +226,6 @@
<string name="manga_info_genres_label">Genres</string> <string name="manga_info_genres_label">Genres</string>
<string name="share_subject">Share…</string> <string name="share_subject">Share…</string>
<string name="share_text">Check out %1$s! at %2$s</string> <string name="share_text">Check out %1$s! at %2$s</string>
<string name="added_to_home_screen">Manga added to home screen</string>
<string name="icon_type">Icon type</string>
<string name="tachiyomi_icon">Tachiyomi icon</string>
<string name="circular_icon">Circular icon</string> <string name="circular_icon">Circular icon</string>
<string name="rounded_icon">Rounded icon</string> <string name="rounded_icon">Rounded icon</string>
<string name="square_icon">Square icon</string> <string name="square_icon">Square icon</string>

View File

@ -36,6 +36,8 @@
<item name="divider_drawable">@drawable/line_divider_light</item> <item name="divider_drawable">@drawable/line_divider_light</item>
<item name="text_color_primary">@color/textColorPrimaryLight</item> <item name="text_color_primary">@color/textColorPrimaryLight</item>
<item name="background_card">@color/dialogLight</item> <item name="background_card">@color/dialogLight</item>
<item name="asp_preferenceIconTint">?colorAccent</item>
<item name="asp_preferenceDialogIconTint">?colorAccent</item>
</style> </style>
<style name="Theme.Tachiyomi" parent="Theme.Base"> <style name="Theme.Tachiyomi" parent="Theme.Base">
@ -74,6 +76,8 @@
<item name="divider_drawable">@drawable/line_divider_dark</item> <item name="divider_drawable">@drawable/line_divider_dark</item>
<item name="text_color_primary">@color/textColorPrimaryDark</item> <item name="text_color_primary">@color/textColorPrimaryDark</item>
<item name="background_card">@color/dialogDark</item> <item name="background_card">@color/dialogDark</item>
<item name="asp_preferenceIconTint">?colorAccent</item>
<item name="asp_preferenceDialogIconTint">?colorAccent</item>
</style> </style>
<style name="Theme.Tachiyomi.Dark" parent="Theme.Base.Dark"> <style name="Theme.Tachiyomi.Dark" parent="Theme.Base.Dark">