mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-06-07 16:29:55 +00:00
Update: Theme Touch Up
Update: Increased Text Size in App Page
This commit is contained in:
parent
0fafcfe3cd
commit
a35646c2e5
@ -11,7 +11,6 @@ import android.graphics.Canvas
|
|||||||
import android.graphics.Paint
|
import android.graphics.Paint
|
||||||
import android.graphics.Rect
|
import android.graphics.Rect
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.graphics.drawable.GradientDrawable
|
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Parcel
|
import android.os.Parcel
|
||||||
import android.text.SpannableStringBuilder
|
import android.text.SpannableStringBuilder
|
||||||
@ -54,7 +53,7 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int)
|
|||||||
StableRecyclerAdapter<ProductAdapter.ViewType, RecyclerView.ViewHolder>() {
|
StableRecyclerAdapter<ProductAdapter.ViewType, RecyclerView.ViewHolder>() {
|
||||||
companion object {
|
companion object {
|
||||||
private const val GRID_SPACING_OUTER_DP = 16
|
private const val GRID_SPACING_OUTER_DP = 16
|
||||||
private const val GRID_SPACING_INNER_DP = 4
|
private const val GRID_SPACING_INNER_DP = 8
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Callbacks {
|
interface Callbacks {
|
||||||
@ -326,8 +325,10 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int)
|
|||||||
val actionTintCancel = action.context.getColorFromAttr(R.attr.colorError)
|
val actionTintCancel = action.context.getColorFromAttr(R.attr.colorError)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
if (Android.sdk(22)) {
|
action.apply {
|
||||||
action.setTextColor(action.context.getColorFromAttr(android.R.attr.textColor))
|
setTextSizeScaled(15)
|
||||||
|
setTextColor(action.context.getColorFromAttr(R.attr.colorOnPrimary))
|
||||||
|
height = itemView.resources.sizeScaled(48)
|
||||||
}
|
}
|
||||||
val (progressIcon, defaultIcon) = Utils.getDefaultApplicationIcons(icon.context)
|
val (progressIcon, defaultIcon) = Utils.getDefaultApplicationIcons(icon.context)
|
||||||
this.progressIcon = progressIcon
|
this.progressIcon = progressIcon
|
||||||
@ -355,7 +356,7 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int)
|
|||||||
init {
|
init {
|
||||||
itemView as TextView
|
itemView as TextView
|
||||||
itemView.typeface = TypefaceExtra.medium
|
itemView.typeface = TypefaceExtra.medium
|
||||||
itemView.setTextSizeScaled(14)
|
itemView.setTextSizeScaled(15)
|
||||||
itemView.setTextColor(itemView.context.getColorFromAttr(android.R.attr.textColor))
|
itemView.setTextColor(itemView.context.getColorFromAttr(android.R.attr.textColor))
|
||||||
itemView.background =
|
itemView.background =
|
||||||
ResourcesCompat.getDrawable(
|
ResourcesCompat.getDrawable(
|
||||||
@ -363,6 +364,7 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int)
|
|||||||
R.drawable.background_border,
|
R.drawable.background_border,
|
||||||
context.theme
|
context.theme
|
||||||
)
|
)
|
||||||
|
itemView.backgroundTintList = itemView.context.getColorFromAttr(R.attr.colorSurface)
|
||||||
itemView.gravity = Gravity.CENTER
|
itemView.gravity = Gravity.CENTER
|
||||||
itemView.isAllCaps = true
|
itemView.isAllCaps = true
|
||||||
itemView.layoutParams = RecyclerView.LayoutParams(
|
itemView.layoutParams = RecyclerView.LayoutParams(
|
||||||
@ -382,7 +384,7 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int)
|
|||||||
|
|
||||||
init {
|
init {
|
||||||
itemView as TextView
|
itemView as TextView
|
||||||
itemView.setTextSizeScaled(14)
|
itemView.setTextSizeScaled(15)
|
||||||
itemView.setTextColor(itemView.context.getColorFromAttr(android.R.attr.textColor))
|
itemView.setTextColor(itemView.context.getColorFromAttr(android.R.attr.textColor))
|
||||||
itemView.resources.sizeScaled(16).let { itemView.setPadding(it, it, it, it) }
|
itemView.resources.sizeScaled(16).let { itemView.setPadding(it, it, it, it) }
|
||||||
itemView.movementMethod = ClickableMovementMethod
|
itemView.movementMethod = ClickableMovementMethod
|
||||||
@ -518,19 +520,18 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int)
|
|||||||
compatibility
|
compatibility
|
||||||
)
|
)
|
||||||
|
|
||||||
val setStatusActive: (Boolean) -> Unit
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
status.background =
|
status.apply {
|
||||||
GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, null).apply {
|
background =
|
||||||
setStatusActive = { active ->
|
ResourcesCompat.getDrawable(
|
||||||
color = itemView.context.getColorFromAttr(
|
itemView.resources,
|
||||||
if (active)
|
R.drawable.background_border,
|
||||||
android.R.attr.colorAccent else android.R.attr.textColorSecondary
|
itemView.context.theme
|
||||||
)
|
)
|
||||||
}
|
backgroundTintList = itemView.context.getColorFromAttr(R.attr.colorSurface)
|
||||||
cornerRadius = itemView.resources.sizeScaled(2).toFloat()
|
setPadding(15, 5, 15, 5)
|
||||||
}
|
setTextColor(itemView.context.getColorFromAttr(R.attr.colorPrimary))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -546,8 +547,8 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int)
|
|||||||
val title = TextView(itemView.context)
|
val title = TextView(itemView.context)
|
||||||
title.gravity = Gravity.CENTER
|
title.gravity = Gravity.CENTER
|
||||||
title.typeface = TypefaceExtra.light
|
title.typeface = TypefaceExtra.light
|
||||||
title.setTextColor(context.getColorFromAttr(android.R.attr.textColorPrimary))
|
title.setTextColor(context.getColorFromAttr(R.attr.colorPrimary))
|
||||||
title.setTextSizeScaled(20)
|
title.setTextSizeScaled(24)
|
||||||
title.setText(R.string.application_not_found)
|
title.setText(R.string.application_not_found)
|
||||||
itemView.addView(
|
itemView.addView(
|
||||||
title,
|
title,
|
||||||
@ -556,8 +557,8 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int)
|
|||||||
)
|
)
|
||||||
val packageName = TextView(itemView.context)
|
val packageName = TextView(itemView.context)
|
||||||
packageName.gravity = Gravity.CENTER
|
packageName.gravity = Gravity.CENTER
|
||||||
packageName.setTextColor(context.getColorFromAttr(android.R.attr.textColorPrimary))
|
packageName.setTextColor(context.getColorFromAttr(R.attr.colorPrimary))
|
||||||
packageName.setTextSizeScaled(16)
|
packageName.setTextSizeScaled(18)
|
||||||
itemView.addView(
|
itemView.addView(
|
||||||
packageName,
|
packageName,
|
||||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||||
@ -1133,7 +1134,6 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int)
|
|||||||
item.product.icon, item.product.metadataIcon, item.repository
|
item.product.icon, item.product.metadataIcon, item.repository
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
transformations(RoundedCornersTransformation(4.toPx))
|
|
||||||
placeholder(holder.progressIcon)
|
placeholder(holder.progressIcon)
|
||||||
error(holder.defaultIcon)
|
error(holder.defaultIcon)
|
||||||
}
|
}
|
||||||
@ -1150,7 +1150,10 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int)
|
|||||||
holder.version.text =
|
holder.version.text =
|
||||||
version?.let { context.getString(R.string.version_FORMAT, it) }
|
version?.let { context.getString(R.string.version_FORMAT, it) }
|
||||||
?: context.getString(R.string.unknown)
|
?: context.getString(R.string.unknown)
|
||||||
holder.packageName.text = item.product.packageName
|
holder.packageName.apply {
|
||||||
|
text = item.product.packageName
|
||||||
|
setTextSizeScaled(15)
|
||||||
|
}
|
||||||
val action = action
|
val action = action
|
||||||
holder.action.visibility = if (action == null) View.GONE else View.VISIBLE
|
holder.action.visibility = if (action == null) View.GONE else View.VISIBLE
|
||||||
if (action != null) {
|
if (action != null) {
|
||||||
@ -1366,7 +1369,6 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int)
|
|||||||
holder.version.text =
|
holder.version.text =
|
||||||
context.getString(R.string.version_FORMAT, item.release.version)
|
context.getString(R.string.version_FORMAT, item.release.version)
|
||||||
holder.version.setTextColor(primarySecondaryColor)
|
holder.version.setTextColor(primarySecondaryColor)
|
||||||
holder.setStatusActive(!grayOut)
|
|
||||||
holder.status.visibility = if (installed || suggested) View.VISIBLE else View.GONE
|
holder.status.visibility = if (installed || suggested) View.VISIBLE else View.GONE
|
||||||
holder.status.setText(
|
holder.status.setText(
|
||||||
when {
|
when {
|
||||||
|
@ -70,7 +70,7 @@ class ProductsAdapter(private val onClick: (ProductItem) -> Unit) :
|
|||||||
itemView.gravity = Gravity.CENTER
|
itemView.gravity = Gravity.CENTER
|
||||||
itemView.resources.sizeScaled(20).let { itemView.setPadding(it, it, it, it) }
|
itemView.resources.sizeScaled(20).let { itemView.setPadding(it, it, it, it) }
|
||||||
itemView.typeface = TypefaceExtra.light
|
itemView.typeface = TypefaceExtra.light
|
||||||
itemView.setTextColor(context.getColorFromAttr(android.R.attr.textColorPrimary))
|
itemView.setTextColor(context.getColorFromAttr(android.R.attr.colorPrimary))
|
||||||
itemView.setTextSizeScaled(20)
|
itemView.setTextSizeScaled(20)
|
||||||
itemView.layoutParams = RecyclerView.LayoutParams(
|
itemView.layoutParams = RecyclerView.LayoutParams(
|
||||||
RecyclerView.LayoutParams.MATCH_PARENT,
|
RecyclerView.LayoutParams.MATCH_PARENT,
|
||||||
@ -179,7 +179,7 @@ class ProductsAdapter(private val onClick: (ProductItem) -> Unit) :
|
|||||||
text = productItem.installedVersion.nullIfEmpty() ?: productItem.version
|
text = productItem.installedVersion.nullIfEmpty() ?: productItem.version
|
||||||
if (background != null) {
|
if (background != null) {
|
||||||
setPadding(0, 0, 0, 0)
|
setPadding(0, 0, 0, 0)
|
||||||
setTextColor(holder.status.context.getColorFromAttr(android.R.attr.textColorPrimary))
|
setTextColor(holder.status.context.getColorFromAttr(android.R.attr.colorPrimary))
|
||||||
background = null
|
background = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -202,7 +202,7 @@ class ScreenshotsFragment() : DialogFragment() {
|
|||||||
|
|
||||||
val placeholder =
|
val placeholder =
|
||||||
itemView.context.getDrawableCompat(R.drawable.ic_photo_camera).mutate()
|
itemView.context.getDrawableCompat(R.drawable.ic_photo_camera).mutate()
|
||||||
placeholder.setTint(itemView.context.getColorFromAttr(android.R.attr.textColorPrimary).defaultColor
|
placeholder.setTint(itemView.context.getColorFromAttr(R.attr.colorSurface).defaultColor
|
||||||
.let { ColorUtils.blendARGB(0x00ffffff and it, it, 0.25f) })
|
.let { ColorUtils.blendARGB(0x00ffffff and it, it, 0.25f) })
|
||||||
this.placeholder = PaddingDrawable(placeholder, 4f)
|
this.placeholder = PaddingDrawable(placeholder, 4f)
|
||||||
}
|
}
|
||||||
|
@ -300,11 +300,11 @@ class TabsFragment : ScreenFragment() {
|
|||||||
this.adapter = adapter
|
this.adapter = adapter
|
||||||
addItemDecoration(DividerItemDecoration(context, adapter::configureDivider))
|
addItemDecoration(DividerItemDecoration(context, adapter::configureDivider))
|
||||||
setBackgroundResource(R.drawable.background_border)
|
setBackgroundResource(R.drawable.background_border)
|
||||||
setBackgroundColor(context.getColorFromAttr(R.attr.colorSurface).defaultColor)
|
|
||||||
elevation = resources.sizeScaled(4).toFloat()
|
elevation = resources.sizeScaled(4).toFloat()
|
||||||
content.addView(this, FrameLayout.LayoutParams.MATCH_PARENT, 0)
|
content.addView(this, FrameLayout.LayoutParams.MATCH_PARENT, 0)
|
||||||
visibility = View.GONE
|
visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
sectionsList.backgroundTintList = context?.getColorFromAttr(R.attr.colorSurface)
|
||||||
this.sectionsList = sectionsList
|
this.sectionsList = sectionsList
|
||||||
|
|
||||||
var lastContentHeight = -1
|
var lastContentHeight = -1
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<item android:alpha="0.3" android:color="@color/green200" android:state_enabled="false" />
|
<item android:alpha="0.3" android:color="@color/green100" android:state_enabled="false" />
|
||||||
|
|
||||||
<item android:color="@color/green200" />
|
<item android:color="@color/green100" />
|
||||||
|
|
||||||
</selector>
|
</selector>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -79,22 +80,21 @@
|
|||||||
android:textColor="?android:attr/textColorSecondary"
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
<ProgressBar
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
android:id="@+id/progress"
|
android:id="@+id/progress"
|
||||||
style="@android:style/Widget.Material.ProgressBar.Horizontal"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginBottom="2dp"
|
android:layout_marginBottom="2dp"
|
||||||
android:indeterminateTint="?attr/colorPrimary" />
|
app:trackCornerRadius="2dp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<Button
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/action"
|
android:id="@+id/action"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
android:background="@drawable/background_border" />
|
app:cornerRadius="8dp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<color name="green50">#E8F5E9</color>
|
<color name="green50">#E8F5E9</color>
|
||||||
|
<color name="green100">#A3EBB7</color>
|
||||||
<color name="green200">#6EC898</color>
|
<color name="green200">#6EC898</color>
|
||||||
<color name="green300">#58C189</color>
|
<color name="green300">#58C189</color>
|
||||||
<color name="green400">#3EDA86</color>
|
<color name="green400">#3EDA86</color>
|
||||||
@ -13,5 +14,5 @@
|
|||||||
|
|
||||||
<color name="white">#FFFFFF</color>
|
<color name="white">#FFFFFF</color>
|
||||||
<color name="grey_light">#333333</color>
|
<color name="grey_light">#333333</color>
|
||||||
<color name="grey_dark">#595959</color>
|
<color name="grey_dark">#2C2C2C</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
<item name="colorOnBackground">@color/green200</item>
|
<item name="colorOnBackground">@color/green200</item>
|
||||||
<item name="android:colorAccent">@color/accent_dark</item>
|
<item name="android:colorAccent">@color/accent_dark</item>
|
||||||
<item name="colorError">@color/error_dark</item>
|
<item name="colorError">@color/error_dark</item>
|
||||||
<item name="android:textColorPrimary">@color/green400</item>
|
<item name="android:textColorPrimary">@color/green200</item>
|
||||||
<item name="android:textColor">@color/white</item>
|
<item name="android:textColor">@color/white</item>
|
||||||
<item name="android:fastScrollThumbDrawable">@drawable/scrollbar_thumb</item>
|
<item name="android:fastScrollThumbDrawable">@drawable/scrollbar_thumb</item>
|
||||||
<item name="android:fastScrollTrackDrawable">@drawable/scrollbar_track</item>
|
<item name="android:fastScrollTrackDrawable">@drawable/scrollbar_track</item>
|
||||||
@ -45,7 +45,7 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.Main.Amoled" parent="Theme.Material3.Dark.NoActionBar">
|
<style name="Theme.Main.Amoled" parent="Theme.Material3.Dark.NoActionBar">
|
||||||
<item name="colorPrimary">@color/green200</item>
|
<item name="colorPrimary">@color/green100</item>
|
||||||
<item name="colorOnPrimary">@color/black</item>
|
<item name="colorOnPrimary">@color/black</item>
|
||||||
<item name="colorSurface">@color/black</item>
|
<item name="colorSurface">@color/black</item>
|
||||||
<item name="colorOnSurface">@color/green50</item>
|
<item name="colorOnSurface">@color/green50</item>
|
||||||
@ -54,7 +54,7 @@
|
|||||||
<item name="colorOnBackground">@color/green50</item>
|
<item name="colorOnBackground">@color/green50</item>
|
||||||
<item name="android:colorAccent">@color/accent_dark</item>
|
<item name="android:colorAccent">@color/accent_dark</item>
|
||||||
<item name="colorError">@color/error_dark</item>
|
<item name="colorError">@color/error_dark</item>
|
||||||
<item name="android:textColorPrimary">@color/green400</item>
|
<item name="android:textColorPrimary">@color/green100</item>
|
||||||
<item name="android:textColor">@color/white</item>
|
<item name="android:textColor">@color/white</item>
|
||||||
<item name="android:fastScrollThumbDrawable">@drawable/scrollbar_thumb</item>
|
<item name="android:fastScrollThumbDrawable">@drawable/scrollbar_thumb</item>
|
||||||
<item name="android:fastScrollTrackDrawable">@drawable/scrollbar_track</item>
|
<item name="android:fastScrollTrackDrawable">@drawable/scrollbar_track</item>
|
||||||
@ -76,6 +76,7 @@
|
|||||||
<style name="Theme.Alert" parent="ThemeOverlay.Material3.MaterialAlertDialog.Centered">
|
<style name="Theme.Alert" parent="ThemeOverlay.Material3.MaterialAlertDialog.Centered">
|
||||||
<item name="colorPrimary">?attr/colorOnSurface</item>
|
<item name="colorPrimary">?attr/colorOnSurface</item>
|
||||||
<item name="android:backgroundTint">?attr/colorSurface</item>
|
<item name="android:backgroundTint">?attr/colorSurface</item>
|
||||||
|
<item name="colorOnSurfaceVariant">?attr/colorOnSurface</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.Switch" parent="Widget.Material3.CompoundButton.Switch">
|
<style name="Theme.Switch" parent="Widget.Material3.CompoundButton.Switch">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user