mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-30 22:07:57 +01:00 
			
		
		
		
	Move page indicator to bottom center, and use a shadow instead of a background. Other category in catalogue list is now placed at the end
This commit is contained in:
		| @@ -56,7 +56,7 @@ class LocalSource(private val context: Context) : CatalogueSource { | ||||
|     } | ||||
|  | ||||
|     override val id = ID | ||||
|     override val name = "LocalSource" | ||||
|     override val name = context.getString(R.string.local_source) | ||||
|     override val lang = "" | ||||
|     override val supportsLatest = true | ||||
|  | ||||
|   | ||||
| @@ -51,7 +51,14 @@ class CatalogueMainPresenter( | ||||
|     fun loadSources() { | ||||
|         sourceSubscription?.unsubscribe() | ||||
|  | ||||
|         val map = TreeMap<String, MutableList<CatalogueSource>> { d1, d2 -> d1.compareTo(d2) } | ||||
|         val map = TreeMap<String, MutableList<CatalogueSource>> { d1, d2 -> | ||||
|             // Catalogues without a lang defined will be placed at the end | ||||
|             when { | ||||
|                 d1 == "" && d2 != "" -> 1 | ||||
|                 d2 == "" && d1 != "" -> -1 | ||||
|                 else -> d1.compareTo(d2) | ||||
|             } | ||||
|         } | ||||
|         val byLang = sources.groupByTo(map, { it.lang }) | ||||
|         val sourceItems = byLang.flatMap { | ||||
|             val langItem = LangItem(it.key) | ||||
|   | ||||
| @@ -0,0 +1,17 @@ | ||||
| package eu.kanade.tachiyomi.ui.reader | ||||
|  | ||||
| import android.content.Context | ||||
| import android.graphics.Canvas | ||||
| import android.support.v7.widget.AppCompatTextView | ||||
| import android.util.AttributeSet | ||||
|  | ||||
| class PageIndicatorTextView(context: Context, attrs: AttributeSet? = null) : | ||||
|         AppCompatTextView(context, attrs) { | ||||
|  | ||||
|     override fun onDraw(canvas: Canvas) { | ||||
|         // We want the shadow to look like an outline | ||||
|         for (i in 0..5) { | ||||
|             super.onDraw(canvas) | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -8,7 +8,6 @@ import android.graphics.Color | ||||
| import android.os.Build | ||||
| import android.os.Build.VERSION_CODES.KITKAT | ||||
| import android.os.Bundle | ||||
| import android.support.v4.content.ContextCompat | ||||
| import android.view.* | ||||
| import android.view.WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS | ||||
| import android.view.animation.Animation | ||||
| @@ -513,12 +512,8 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() { | ||||
|         val rootView = window.decorView.rootView | ||||
|         if (theme == BLACK_THEME) { | ||||
|             rootView.setBackgroundColor(Color.BLACK) | ||||
|             page_number.setTextColor(ContextCompat.getColor(this, R.color.textColorPrimaryDark)) | ||||
|             page_number.setBackgroundColor(ContextCompat.getColor(this, R.color.pageNumberBackgroundDark)) | ||||
|         } else { | ||||
|             rootView.setBackgroundColor(Color.WHITE) | ||||
|             page_number.setTextColor(ContextCompat.getColor(this, R.color.textColorPrimaryLight)) | ||||
|             page_number.setBackgroundColor(ContextCompat.getColor(this, R.color.pageNumberBackgroundLight)) | ||||
|         } | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -38,10 +38,10 @@ class PTSansTextView @JvmOverloads constructor(context: Context, attrs: Attribut | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     override fun draw(canvas: Canvas) { | ||||
|     override fun onDraw(canvas: Canvas) { | ||||
|         // Draw two times for a more visible shadow around the text | ||||
|         super.draw(canvas) | ||||
|         super.draw(canvas) | ||||
|         super.onDraw(canvas) | ||||
|         super.onDraw(canvas) | ||||
|     } | ||||
|  | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user