mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-31 06:17:57 +01:00 
			
		
		
		
	Bump dependencies, remove unused resources
This commit is contained in:
		| @@ -60,8 +60,7 @@ class CloudflareInterceptor(private val cookies: PersistentCookieStore) : Interc | ||||
|                     .replace(Regex("""\s{3,}[a-z](?: = |\.).+"""), "") | ||||
|                     .replace("\n", "") | ||||
|  | ||||
|             // Duktape can only return strings, so the result has to be converted to string first | ||||
|             val result = duktape.evaluate("$js.toString()").toInt() | ||||
|             val result = (duktape.evaluate(js) as Double).toInt() | ||||
|  | ||||
|             val answer = "${result + domain.length}" | ||||
|  | ||||
|   | ||||
| @@ -41,6 +41,8 @@ class BackupFragment : BaseRxFragment<BackupPresenter>() { | ||||
|     } | ||||
|  | ||||
|     override fun onViewCreated(view: View, savedState: Bundle?) { | ||||
|         setToolbarTitle(getString(R.string.label_backup)) | ||||
|  | ||||
|         (activity as ActivityMixin).requestPermissionsOnMarshmallow() | ||||
|         subscriptions = SubscriptionList() | ||||
|  | ||||
|   | ||||
| @@ -1,15 +1,10 @@ | ||||
| package eu.kanade.tachiyomi.ui.manga.info | ||||
|  | ||||
| import android.app.Activity | ||||
| import android.content.Intent | ||||
| import android.graphics.Bitmap | ||||
| import android.graphics.BitmapFactory | ||||
| import android.graphics.drawable.BitmapDrawable | ||||
| import android.net.Uri | ||||
| import android.os.Bundle | ||||
| import android.support.customtabs.CustomTabsIntent | ||||
| import android.support.design.widget.Snackbar | ||||
| import android.util.SparseArray | ||||
| import android.view.* | ||||
| import com.afollestad.materialdialogs.MaterialDialog | ||||
| 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.online.OnlineSource | ||||
| 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.util.getResourceColor | ||||
| 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.RoundedCornersTransformation | ||||
| import kotlinx.android.synthetic.main.fragment_manga_info.* | ||||
| import kotlinx.android.synthetic.main.item_download.* | ||||
| import nucleus.factory.RequiresPresenter | ||||
| import rx.Observable | ||||
| import rx.android.schedulers.AndroidSchedulers | ||||
| import rx.schedulers.Schedulers | ||||
| import timber.log.Timber | ||||
| import java.io.IOException | ||||
| import kotlin.concurrent.thread | ||||
|  | ||||
| /** | ||||
|  * Fragment that shows manga information. | ||||
|   | ||||
| @@ -7,9 +7,9 @@ import android.support.v4.content.ContextCompat | ||||
| import android.support.v7.preference.XpPreferenceFragment | ||||
| import android.view.View | ||||
| import eu.kanade.tachiyomi.R | ||||
| import eu.kanade.tachiyomi.util.getResourceId | ||||
| import net.xpece.android.support.preference.PreferenceIconHelper | ||||
| import net.xpece.android.support.preference.PreferenceScreenNavigationStrategy | ||||
| import net.xpece.android.support.preference.Util | ||||
| import rx.subscriptions.CompositeSubscription | ||||
|  | ||||
| open class SettingsFragment : XpPreferenceFragment() { | ||||
| @@ -24,8 +24,8 @@ open class SettingsFragment : XpPreferenceFragment() { | ||||
|  | ||||
|     lateinit var subscriptions: CompositeSubscription | ||||
|  | ||||
|     private val iconTint by lazy { ContextCompat.getColorStateList( | ||||
|             context, Util.resolveResourceId(context, R.attr.colorAccent, 0)) | ||||
|     private val iconTint by lazy { ContextCompat.getColorStateList(context, | ||||
|             context.theme.getResourceId(R.attr.colorAccent, 0)) | ||||
|     } | ||||
|  | ||||
|     override final fun onCreatePreferences2(savedState: Bundle?, rootKey: String?) { | ||||
| @@ -59,6 +59,7 @@ open class SettingsFragment : XpPreferenceFragment() { | ||||
|  | ||||
|     @CallSuper | ||||
|     override fun onViewCreated(view: View, savedState: Bundle?) { | ||||
|         super.onViewCreated(view, savedState) | ||||
|         listView.isFocusable = false | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -2,18 +2,26 @@ package eu.kanade.tachiyomi.util | ||||
|  | ||||
| import android.content.res.Resources | ||||
| import android.graphics.drawable.Drawable | ||||
| import android.support.annotation.AttrRes | ||||
| import android.support.annotation.StringRes | ||||
|  | ||||
| fun Resources.Theme.getResourceColor(@StringRes resource: Int) : Int { | ||||
|     val typedArray = this.obtainStyledAttributes(intArrayOf(resource)) | ||||
| fun Resources.Theme.getResourceColor(@StringRes resource: Int): Int { | ||||
|     val typedArray = obtainStyledAttributes(intArrayOf(resource)) | ||||
|     val attrValue = typedArray.getColor(0, 0) | ||||
|     typedArray.recycle() | ||||
|     return attrValue | ||||
| } | ||||
|  | ||||
| fun Resources.Theme.getResourceDrawable(@StringRes resource: Int) : Drawable { | ||||
|     val typedArray = this.obtainStyledAttributes(intArrayOf(resource)) | ||||
| fun Resources.Theme.getResourceDrawable(@StringRes resource: Int): Drawable { | ||||
|     val typedArray = obtainStyledAttributes(intArrayOf(resource)) | ||||
|     val attrValue = typedArray.getDrawable(0) | ||||
|     typedArray.recycle() | ||||
|     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 | ||||
| } | ||||
		Reference in New Issue
	
	Block a user