From 95183dde6bb57f6f4f9d3879a03aa85def2bb967 Mon Sep 17 00:00:00 2001 From: LooKeR Date: Wed, 27 Oct 2021 00:41:20 +0530 Subject: [PATCH] Update: Move to androidx.material/appcompat Auto Format of code --- README.md | 9 +- .../droidify/installer/DefaultInstaller.kt | 2 +- .../droidify/screen/EditRepositoryFragment.kt | 14 +-- .../looker/droidify/screen/ProductAdapter.kt | 105 ++++++++---------- .../looker/droidify/screen/ProductFragment.kt | 6 +- .../looker/droidify/screen/ProductsAdapter.kt | 32 +++--- .../droidify/screen/RepositoriesAdapter.kt | 4 +- .../droidify/screen/RepositoriesFragment.kt | 6 +- .../droidify/screen/RepositoryFragment.kt | 26 ++--- .../looker/droidify/screen/ScreenActivity.kt | 4 +- .../droidify/screen/SettingsFragment.kt | 61 +++++----- .../looker/droidify/screen/TabsFragment.kt | 25 ++--- .../droidify/utility/extension/Resources.kt | 4 +- .../widget/ClickableMovementMethod.kt | 67 ----------- src/main/res/drawable/ic_add.xml | 6 +- src/main/res/drawable/ic_arrow_down.xml | 6 +- src/main/res/drawable/ic_bug_report.xml | 6 +- src/main/res/drawable/ic_cancel.xml | 10 +- src/main/res/drawable/ic_code.xml | 4 +- src/main/res/drawable/ic_copyright.xml | 6 +- src/main/res/drawable/ic_delete.xml | 6 +- src/main/res/drawable/ic_donate_regular.xml | 6 +- src/main/res/drawable/ic_download.xml | 6 +- src/main/res/drawable/ic_edit.xml | 6 +- src/main/res/drawable/ic_email.xml | 6 +- src/main/res/drawable/ic_history.xml | 6 +- src/main/res/drawable/ic_launch.xml | 8 +- src/main/res/drawable/ic_new_releases.xml | 6 +- .../drawable/ic_perm_device_information.xml | 6 +- src/main/res/drawable/ic_person.xml | 6 +- src/main/res/drawable/ic_photo_camera.xml | 8 +- src/main/res/drawable/ic_save.xml | 6 +- src/main/res/drawable/ic_search.xml | 6 +- src/main/res/drawable/ic_sort.xml | 8 +- src/main/res/drawable/ic_sync.xml | 6 +- src/main/res/drawable/ic_tune.xml | 6 +- src/main/res/layout/edit_repository.xml | 20 ++-- src/main/res/layout/fragment.xml | 4 +- src/main/res/layout/link_item.xml | 12 +- src/main/res/layout/permissions_item.xml | 6 +- src/main/res/layout/preference_item.xml | 12 +- src/main/res/layout/product_header_item.xml | 22 ++-- src/main/res/layout/product_item.xml | 18 +-- src/main/res/layout/release_info.xml | 16 +-- src/main/res/layout/release_item.xml | 34 +++--- src/main/res/layout/repository_item.xml | 6 +- src/main/res/layout/section_item.xml | 6 +- src/main/res/layout/switch_item.xml | 4 +- src/main/res/layout/tabs_toolbar.xml | 16 +-- src/main/res/layout/title_text_item.xml | 8 +- 50 files changed, 305 insertions(+), 384 deletions(-) delete mode 100644 src/main/kotlin/com/looker/droidify/widget/ClickableMovementMethod.kt diff --git a/README.md b/README.md index 2830cb38..8260c07b 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,11 @@ Material-ify with Droid-ify. [Get it on IzzyDroid](https://android.izzysoft.de/repo/apk/com.looker.droidify) +alt="Get it on IzzyDroid" +width="48%">](https://android.izzysoft.de/repo/apk/com.looker.droidify) [Get it on F-Droid](https://f-droid.org/packages/com.looker.droidify) - +alt="Get it on F-Droid" +width="48%">](https://f-droid.org/packages/com.looker.droidify) ## Description diff --git a/src/main/kotlin/com/looker/droidify/installer/DefaultInstaller.kt b/src/main/kotlin/com/looker/droidify/installer/DefaultInstaller.kt index 0b1c0406..14bc9f55 100644 --- a/src/main/kotlin/com/looker/droidify/installer/DefaultInstaller.kt +++ b/src/main/kotlin/com/looker/droidify/installer/DefaultInstaller.kt @@ -44,7 +44,7 @@ class DefaultInstaller(context: Context) : BaseInstaller(context) { } } - private fun mDefaultUninstaller(packageName: String){ + private fun mDefaultUninstaller(packageName: String) { val uri = Uri.fromParts("package", packageName, null) val intent = Intent() intent.data = uri diff --git a/src/main/kotlin/com/looker/droidify/screen/EditRepositoryFragment.kt b/src/main/kotlin/com/looker/droidify/screen/EditRepositoryFragment.kt index c0a6d62d..5e15f3e0 100644 --- a/src/main/kotlin/com/looker/droidify/screen/EditRepositoryFragment.kt +++ b/src/main/kotlin/com/looker/droidify/screen/EditRepositoryFragment.kt @@ -13,11 +13,11 @@ import android.util.Base64 import android.view.MenuItem import android.view.View import android.view.ViewGroup -import android.widget.EditText -import android.widget.FrameLayout import androidx.appcompat.app.AlertDialog import androidx.fragment.app.DialogFragment +import com.google.android.material.circularreveal.CircularRevealFrameLayout import com.google.android.material.dialog.MaterialAlertDialogBuilder +import com.google.android.material.textfield.TextInputEditText import com.looker.droidify.R import com.looker.droidify.database.Database import com.looker.droidify.entity.Repository @@ -57,11 +57,11 @@ class EditRepositoryFragment() : ScreenFragment() { } private class Layout(view: View) { - val address = view.findViewById(R.id.address)!! + val address = view.findViewById(R.id.address)!! val addressMirror = view.findViewById(R.id.address_mirror)!! - val fingerprint = view.findViewById(R.id.fingerprint)!! - val username = view.findViewById(R.id.username)!! - val password = view.findViewById(R.id.password)!! + val fingerprint = view.findViewById(R.id.fingerprint)!! + val username = view.findViewById(R.id.username)!! + val password = view.findViewById(R.id.password)!! val overlay = view.findViewById(R.id.overlay)!! val skip = view.findViewById(R.id.skip)!! } @@ -99,7 +99,7 @@ class EditRepositoryFragment() : ScreenFragment() { true } - val content = view.findViewById(R.id.fragment_content)!! + val content = view.findViewById(R.id.fragment_content)!! errorColorFilter = PorterDuffColorFilter( content.context .getColorFromAttr(R.attr.colorError).defaultColor, PorterDuff.Mode.SRC_IN diff --git a/src/main/kotlin/com/looker/droidify/screen/ProductAdapter.kt b/src/main/kotlin/com/looker/droidify/screen/ProductAdapter.kt index 708ad1e2..cab1e3d7 100644 --- a/src/main/kotlin/com/looker/droidify/screen/ProductAdapter.kt +++ b/src/main/kotlin/com/looker/droidify/screen/ProductAdapter.kt @@ -22,8 +22,8 @@ import android.view.Gravity import android.view.MotionEvent import android.view.View import android.view.ViewGroup -import android.widget.* import androidx.appcompat.content.res.AppCompatResources +import androidx.appcompat.widget.LinearLayoutCompat import androidx.core.content.res.ResourcesCompat import androidx.core.net.toUri import androidx.core.text.HtmlCompat @@ -33,8 +33,11 @@ import androidx.recyclerview.widget.RecyclerView import coil.load import com.google.android.material.button.MaterialButton import com.google.android.material.card.MaterialCardView +import com.google.android.material.circularreveal.CircularRevealFrameLayout import com.google.android.material.divider.MaterialDivider import com.google.android.material.imageview.ShapeableImageView +import com.google.android.material.progressindicator.LinearProgressIndicator +import com.google.android.material.snackbar.Snackbar import com.google.android.material.switchmaterial.SwitchMaterial import com.google.android.material.textview.MaterialTextView import com.looker.droidify.R @@ -49,7 +52,6 @@ import com.looker.droidify.utility.Utils import com.looker.droidify.utility.extension.android.* import com.looker.droidify.utility.extension.resources.* import com.looker.droidify.utility.extension.text.* -import com.looker.droidify.widget.ClickableMovementMethod import com.looker.droidify.widget.StableRecyclerAdapter import java.lang.ref.WeakReference import java.util.* @@ -323,12 +325,12 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int) private class HeaderViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { val icon = itemView.findViewById(R.id.icon)!! - val name = itemView.findViewById(R.id.name)!! - val packageName = itemView.findViewById(R.id.package_name)!! + val name = itemView.findViewById(R.id.name)!! + val packageName = itemView.findViewById(R.id.package_name)!! val action = itemView.findViewById(R.id.action)!! val statusLayout = itemView.findViewById(R.id.status_layout)!! - val status = itemView.findViewById(R.id.status)!! - val progress = itemView.findViewById(R.id.progress)!! + val status = itemView.findViewById(R.id.status)!! + val progress = itemView.findViewById(R.id.progress)!! val progressIcon: Drawable val defaultIcon: Drawable @@ -340,7 +342,6 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int) init { action.apply { - setTextSizeScaled(15) setTextColor(action.context.getColorFromAttr(R.attr.colorOnPrimary)) height = itemView.resources.sizeScaled(48) } @@ -351,7 +352,7 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int) } private class ReleaseInfoViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { - val targetBlock = itemView.findViewById(R.id.sdk_block)!! + val targetBlock = itemView.findViewById(R.id.sdk_block)!! val divider1 = itemView.findViewById(R.id.divider1)!! val targetSdk = itemView.findViewById(R.id.sdk)!! val version = itemView.findViewById(R.id.version)!! @@ -369,16 +370,17 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int) } private class SectionViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { - val title = itemView.findViewById(R.id.title)!! + val title = itemView.findViewById(R.id.title)!! val icon = itemView.findViewById(R.id.icon)!! } - private class ExpandViewHolder(context: Context) : RecyclerView.ViewHolder(TextView(context)) { - val text: TextView - get() = itemView as TextView + private class ExpandViewHolder(context: Context) : + RecyclerView.ViewHolder(MaterialTextView(context)) { + val text: MaterialTextView + get() = itemView as MaterialTextView init { - itemView as TextView + itemView as MaterialTextView itemView.typeface = TypefaceExtra.medium itemView.setTextSizeScaled(14) itemView.setTextColor(itemView.context.getColorFromAttr(android.R.attr.textColor)) @@ -402,16 +404,16 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int) } } - private class TextViewHolder(context: Context) : RecyclerView.ViewHolder(TextView(context)) { - val text: TextView - get() = itemView as TextView + private class TextViewHolder(context: Context) : + RecyclerView.ViewHolder(MaterialTextView(context)) { + val text: MaterialTextView + get() = itemView as MaterialTextView init { - itemView as TextView + itemView as MaterialTextView itemView.setTextSizeScaled(15) itemView.setTextColor(itemView.context.getColorFromAttr(android.R.attr.textColor)) itemView.resources.sizeScaled(16).let { itemView.setPadding(it, it, it, it) } - itemView.movementMethod = ClickableMovementMethod itemView.layoutParams = RecyclerView.LayoutParams( RecyclerView.LayoutParams.MATCH_PARENT, RecyclerView.LayoutParams.WRAP_CONTENT @@ -437,8 +439,8 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int) } val icon = itemView.findViewById(R.id.icon)!! - val text = itemView.findViewById(R.id.text)!! - val link = itemView.findViewById(R.id.link)!! + val text = itemView.findViewById(R.id.text)!! + val link = itemView.findViewById(R.id.link)!! init { val margin = measurement.invalidate(itemView.resources) { @@ -461,7 +463,7 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int) } val icon = itemView.findViewById(R.id.icon)!! - val text = itemView.findViewById(R.id.text)!! + val text = itemView.findViewById(R.id.text)!! init { val margin = measurement.invalidate(itemView.resources) { @@ -478,7 +480,7 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int) } private class ScreenshotViewHolder(context: Context) : - RecyclerView.ViewHolder(FrameLayout(context)) { + RecyclerView.ViewHolder(CircularRevealFrameLayout(context)) { val image: ShapeableImageView val placeholder: Drawable @@ -487,7 +489,7 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int) var gridCount = -1 init { - itemView as FrameLayout + itemView as CircularRevealFrameLayout itemView.foreground = AppCompatResources.getDrawable(itemView.context, R.drawable.bg_item_rounded_ripple) val surfaceColor = @@ -503,17 +505,12 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int) } val radius = image.context.resources.getDimension(R.dimen.shape_medium_corner) - val shapeAppearanceModel = image.shapeAppearanceModel.toBuilder() .setAllCornerSizes(radius) .build() image.shapeAppearanceModel = shapeAppearanceModel image.setBackgroundColor(surfaceColor) - itemView.addView( - image, - FrameLayout.LayoutParams.MATCH_PARENT, - FrameLayout.LayoutParams.WRAP_CONTENT - ) + itemView.addView(image) itemView.layoutParams = RecyclerView.LayoutParams( RecyclerView.LayoutParams.MATCH_PARENT, RecyclerView.LayoutParams.WRAP_CONTENT @@ -528,13 +525,13 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int) private class ReleaseViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { val dateFormat = DateFormat.getDateFormat(itemView.context)!! - val version = itemView.findViewById(R.id.version)!! - val status = itemView.findViewById(R.id.status)!! - val source = itemView.findViewById(R.id.source)!! - val added = itemView.findViewById(R.id.added)!! - val size = itemView.findViewById(R.id.size)!! - val signature = itemView.findViewById(R.id.signature)!! - val compatibility = itemView.findViewById(R.id.compatibility)!! + val version = itemView.findViewById(R.id.version)!! + val status = itemView.findViewById(R.id.status)!! + val source = itemView.findViewById(R.id.source)!! + val added = itemView.findViewById(R.id.added)!! + val size = itemView.findViewById(R.id.size)!! + val signature = itemView.findViewById(R.id.signature)!! + val compatibility = itemView.findViewById(R.id.compatibility)!! val statefulViews: Sequence get() = sequenceOf( @@ -565,15 +562,15 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int) } private class EmptyViewHolder(context: Context) : - RecyclerView.ViewHolder(LinearLayout(context)) { - val packageName: TextView + RecyclerView.ViewHolder(LinearLayoutCompat(context)) { + val packageName: MaterialTextView init { - itemView as LinearLayout - itemView.orientation = LinearLayout.VERTICAL + itemView as LinearLayoutCompat + itemView.orientation = LinearLayoutCompat.VERTICAL itemView.gravity = Gravity.CENTER itemView.resources.sizeScaled(20).let { itemView.setPadding(it, it, it, it) } - val title = TextView(itemView.context) + val title = MaterialTextView(itemView.context) title.gravity = Gravity.CENTER title.typeface = TypefaceExtra.light title.setTextColor(context.getColorFromAttr(R.attr.colorPrimary)) @@ -581,17 +578,17 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int) title.setText(R.string.application_not_found) itemView.addView( title, - LinearLayout.LayoutParams.MATCH_PARENT, - LinearLayout.LayoutParams.WRAP_CONTENT + LinearLayoutCompat.LayoutParams.MATCH_PARENT, + LinearLayoutCompat.LayoutParams.WRAP_CONTENT ) - val packageName = TextView(itemView.context) + val packageName = MaterialTextView(itemView.context) packageName.gravity = Gravity.CENTER packageName.setTextColor(context.getColorFromAttr(R.attr.colorPrimary)) packageName.setTextSizeScaled(18) itemView.addView( packageName, - LinearLayout.LayoutParams.MATCH_PARENT, - LinearLayout.LayoutParams.WRAP_CONTENT + LinearLayoutCompat.LayoutParams.MATCH_PARENT, + LinearLayoutCompat.LayoutParams.WRAP_CONTENT ) itemView.layoutParams = RecyclerView.LayoutParams( RecyclerView.LayoutParams.MATCH_PARENT, @@ -1103,12 +1100,12 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int) itemView.setOnClickListener { val linkItem = items[adapterPosition] as Item.LinkItem if (linkItem.uri?.let { callbacks.onUriClick(it, false) } != true) { - linkItem.displayLink?.let { copyLinkToClipboard(itemView.context, it) } + linkItem.displayLink?.let { copyLinkToClipboard(itemView, it) } } } itemView.setOnLongClickListener { val linkItem = items[adapterPosition] as Item.LinkItem - linkItem.displayLink?.let { copyLinkToClipboard(itemView.context, it) } + linkItem.displayLink?.let { copyLinkToClipboard(itemView, it) } true } } @@ -1262,7 +1259,7 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int) context.startActivity(Intent(Intent.ACTION_VIEW, product?.source?.toUri())) } holder.dev.setOnLongClickListener { - product?.source?.let { copyLinkToClipboard(context, it) } + product?.source?.let { copyLinkToClipboard(holder.dev, it) } true } } @@ -1552,15 +1549,11 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int) return builder } - private fun copyLinkToClipboard(context: Context, link: String) { + private fun copyLinkToClipboard(view: View, link: String) { val clipboardManager = - context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager + view.context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager clipboardManager.setPrimaryClip(ClipData.newPlainText(null, link)) - Toast.makeText( - context, - context.getString(R.string.link_copied_to_clipboard), - Toast.LENGTH_SHORT - ).show() + Snackbar.make(view, R.string.link_copied_to_clipboard, Snackbar.LENGTH_SHORT).show() } private class LinkSpan(private val url: String, productAdapter: ProductAdapter) : diff --git a/src/main/kotlin/com/looker/droidify/screen/ProductFragment.kt b/src/main/kotlin/com/looker/droidify/screen/ProductFragment.kt index fd9f3a37..19840369 100644 --- a/src/main/kotlin/com/looker/droidify/screen/ProductFragment.kt +++ b/src/main/kotlin/com/looker/droidify/screen/ProductFragment.kt @@ -9,13 +9,13 @@ import android.os.Bundle import android.provider.Settings import android.view.MenuItem import android.view.View -import android.widget.FrameLayout import androidx.appcompat.app.AlertDialog import androidx.fragment.app.DialogFragment import androidx.lifecycle.lifecycleScope import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import com.google.android.material.circularreveal.CircularRevealFrameLayout import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.looker.droidify.R import com.looker.droidify.content.ProductPreferences @@ -108,7 +108,7 @@ class ProductFragment() : ScreenFragment(), ProductAdapter.Callbacks { } } - val content = view.findViewById(R.id.fragment_content)!! + val content = view.findViewById(R.id.fragment_content)!! content.addView(RecyclerView(content.context).apply { id = android.R.id.list val columns = (resources.configuration.screenWidthDp / 120).coerceIn(3, 5) @@ -129,7 +129,7 @@ class ProductFragment() : ScreenFragment(), ProductAdapter.Callbacks { ?.let(adapter::restoreState) layoutManagerState = savedInstanceState?.getParcelable(STATE_LAYOUT_MANAGER) recyclerView = this - }, FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT) + }) var first = true productDisposable = Observable.just(Unit) diff --git a/src/main/kotlin/com/looker/droidify/screen/ProductsAdapter.kt b/src/main/kotlin/com/looker/droidify/screen/ProductsAdapter.kt index 4eb1b426..84fccbbd 100644 --- a/src/main/kotlin/com/looker/droidify/screen/ProductsAdapter.kt +++ b/src/main/kotlin/com/looker/droidify/screen/ProductsAdapter.kt @@ -7,13 +7,13 @@ import android.view.Gravity import android.view.View import android.view.ViewGroup import android.view.animation.AnimationUtils -import android.widget.FrameLayout -import android.widget.ProgressBar -import android.widget.TextView import androidx.recyclerview.widget.RecyclerView import coil.load import coil.transform.RoundedCornersTransformation +import com.google.android.material.circularreveal.CircularRevealFrameLayout import com.google.android.material.imageview.ShapeableImageView +import com.google.android.material.progressindicator.CircularProgressIndicator +import com.google.android.material.textview.MaterialTextView import com.looker.droidify.R import com.looker.droidify.content.Preferences import com.looker.droidify.database.Database @@ -32,9 +32,9 @@ class ProductsAdapter(private val onClick: (ProductItem) -> Unit) : enum class ViewType { PRODUCT, LOADING, EMPTY } private class ProductViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { - val name = itemView.findViewById(R.id.name)!! - val status = itemView.findViewById(R.id.status)!! - val summary = itemView.findViewById(R.id.summary)!! + val name = itemView.findViewById(R.id.name)!! + val status = itemView.findViewById(R.id.status)!! + val summary = itemView.findViewById(R.id.summary)!! val icon = itemView.findViewById(R.id.icon)!! val progressIcon: Drawable @@ -48,14 +48,11 @@ class ProductsAdapter(private val onClick: (ProductItem) -> Unit) : } private class LoadingViewHolder(context: Context) : - RecyclerView.ViewHolder(FrameLayout(context)) { + RecyclerView.ViewHolder(CircularRevealFrameLayout(context)) { init { - itemView as FrameLayout - val progressBar = ProgressBar(itemView.context) - itemView.addView(progressBar, FrameLayout.LayoutParams( - FrameLayout.LayoutParams.WRAP_CONTENT, - FrameLayout.LayoutParams.WRAP_CONTENT - ).apply { gravity = Gravity.CENTER }) + itemView as CircularRevealFrameLayout + val progressBar = CircularProgressIndicator(itemView.context) + itemView.addView(progressBar) itemView.layoutParams = RecyclerView.LayoutParams( RecyclerView.LayoutParams.MATCH_PARENT, RecyclerView.LayoutParams.MATCH_PARENT @@ -63,12 +60,13 @@ class ProductsAdapter(private val onClick: (ProductItem) -> Unit) : } } - private class EmptyViewHolder(context: Context) : RecyclerView.ViewHolder(TextView(context)) { - val text: TextView - get() = itemView as TextView + private class EmptyViewHolder(context: Context) : + RecyclerView.ViewHolder(MaterialTextView(context)) { + val text: MaterialTextView + get() = itemView as MaterialTextView init { - itemView as TextView + itemView as MaterialTextView itemView.gravity = Gravity.CENTER itemView.resources.sizeScaled(20).let { itemView.setPadding(it, it, it, it) } itemView.typeface = TypefaceExtra.light diff --git a/src/main/kotlin/com/looker/droidify/screen/RepositoriesAdapter.kt b/src/main/kotlin/com/looker/droidify/screen/RepositoriesAdapter.kt index 1c980072..245b6f58 100644 --- a/src/main/kotlin/com/looker/droidify/screen/RepositoriesAdapter.kt +++ b/src/main/kotlin/com/looker/droidify/screen/RepositoriesAdapter.kt @@ -2,9 +2,9 @@ package com.looker.droidify.screen import android.view.View import android.view.ViewGroup -import android.widget.TextView import androidx.recyclerview.widget.RecyclerView import com.google.android.material.switchmaterial.SwitchMaterial +import com.google.android.material.textview.MaterialTextView import com.looker.droidify.R import com.looker.droidify.database.Database import com.looker.droidify.entity.Repository @@ -19,7 +19,7 @@ class RepositoriesAdapter( enum class ViewType { REPOSITORY } private class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { - val name = itemView.findViewById(R.id.name)!! + val name = itemView.findViewById(R.id.name)!! val enabled = itemView.findViewById(R.id.enabled)!! var listenSwitch = true diff --git a/src/main/kotlin/com/looker/droidify/screen/RepositoriesFragment.kt b/src/main/kotlin/com/looker/droidify/screen/RepositoriesFragment.kt index 90791a95..e2077156 100644 --- a/src/main/kotlin/com/looker/droidify/screen/RepositoriesFragment.kt +++ b/src/main/kotlin/com/looker/droidify/screen/RepositoriesFragment.kt @@ -6,9 +6,9 @@ import android.view.LayoutInflater import android.view.MenuItem import android.view.View import android.view.ViewGroup -import android.widget.FrameLayout import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import com.google.android.material.circularreveal.CircularRevealFrameLayout import com.looker.droidify.R import com.looker.droidify.database.CursorOwner import com.looker.droidify.service.Connection @@ -26,7 +26,7 @@ class RepositoriesFragment : ScreenFragment(), CursorOwner.Callback { savedInstanceState: Bundle? ): View { val view = inflater.inflate(R.layout.fragment, container, false).apply { - val content = findViewById(R.id.fragment_content)!! + val content = findViewById(R.id.fragment_content)!! content.addView(RecyclerView(content.context).apply { id = android.R.id.list layoutManager = LinearLayoutManager(context) @@ -38,7 +38,7 @@ class RepositoriesFragment : ScreenFragment(), CursorOwner.Callback { syncConnection.binder?.setEnabled(repository, isEnabled) == true }) recyclerView = this - }, FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT) + }) } this.toolbar = view.findViewById(R.id.toolbar) return view diff --git a/src/main/kotlin/com/looker/droidify/screen/RepositoryFragment.kt b/src/main/kotlin/com/looker/droidify/screen/RepositoryFragment.kt index 5275f2a9..19d06b75 100644 --- a/src/main/kotlin/com/looker/droidify/screen/RepositoryFragment.kt +++ b/src/main/kotlin/com/looker/droidify/screen/RepositoryFragment.kt @@ -8,10 +8,10 @@ import android.text.style.TypefaceSpan import android.view.MenuItem import android.view.View import android.view.ViewGroup -import android.widget.FrameLayout -import android.widget.LinearLayout -import android.widget.TextView +import androidx.appcompat.widget.LinearLayoutCompat import androidx.core.widget.NestedScrollView +import com.google.android.material.circularreveal.CircularRevealFrameLayout +import com.google.android.material.textview.MaterialTextView import com.looker.droidify.R import com.looker.droidify.database.Database import com.looker.droidify.service.Connection @@ -39,7 +39,7 @@ class RepositoryFragment() : ScreenFragment() { private val repositoryId: Long get() = requireArguments().getLong(EXTRA_REPOSITORY_ID) - private var layout: LinearLayout? = null + private var layout: LinearLayoutCompat? = null private val syncConnection = Connection(SyncService::class.java) private var repositoryDisposable: Disposable? = null @@ -76,17 +76,13 @@ class RepositoryFragment() : ScreenFragment() { } } - val content = view.findViewById(R.id.fragment_content)!! + val content = view.findViewById(R.id.fragment_content)!! val scroll = NestedScrollView(content.context) scroll.id = android.R.id.list scroll.isFillViewport = true - content.addView( - scroll, - FrameLayout.LayoutParams.MATCH_PARENT, - FrameLayout.LayoutParams.MATCH_PARENT - ) - val layout = LinearLayout(scroll.context) - layout.orientation = LinearLayout.VERTICAL + content.addView(scroll) + val layout = LinearLayoutCompat(scroll.context) + layout.orientation = LinearLayoutCompat.VERTICAL resources.sizeScaled(8).let { layout.setPadding(0, it, 0, it) } this.layout = layout scroll.addView( @@ -164,12 +160,12 @@ class RepositoryFragment() : ScreenFragment() { } } - private fun LinearLayout.addTitleText(titleResId: Int, text: CharSequence) { + private fun LinearLayoutCompat.addTitleText(titleResId: Int, text: CharSequence) { if (text.isNotEmpty()) { val layout = inflate(R.layout.title_text_item) - val titleView = layout.findViewById(R.id.title)!! + val titleView = layout.findViewById(R.id.title)!! titleView.setText(titleResId) - val textView = layout.findViewById(R.id.text)!! + val textView = layout.findViewById(R.id.text)!! textView.text = text addView(layout) } diff --git a/src/main/kotlin/com/looker/droidify/screen/ScreenActivity.kt b/src/main/kotlin/com/looker/droidify/screen/ScreenActivity.kt index 4c5a9e6f..518bb288 100644 --- a/src/main/kotlin/com/looker/droidify/screen/ScreenActivity.kt +++ b/src/main/kotlin/com/looker/droidify/screen/ScreenActivity.kt @@ -5,11 +5,11 @@ import android.os.Bundle import android.os.Parcel import android.view.ViewGroup import android.view.inputmethod.InputMethodManager -import android.widget.FrameLayout import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.widget.Toolbar import androidx.fragment.app.Fragment import androidx.lifecycle.lifecycleScope +import com.google.android.material.circularreveal.CircularRevealFrameLayout import com.looker.droidify.R import com.looker.droidify.content.Preferences import com.looker.droidify.database.CursorOwner @@ -74,7 +74,7 @@ abstract class ScreenActivity : AppCompatActivity() { super.onCreate(savedInstanceState) addContentView( - FrameLayout(this).apply { id = R.id.main_content }, + CircularRevealFrameLayout(this).apply { id = R.id.main_content }, ViewGroup.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT diff --git a/src/main/kotlin/com/looker/droidify/screen/SettingsFragment.kt b/src/main/kotlin/com/looker/droidify/screen/SettingsFragment.kt index 07a2254c..7b9c83e7 100644 --- a/src/main/kotlin/com/looker/droidify/screen/SettingsFragment.kt +++ b/src/main/kotlin/com/looker/droidify/screen/SettingsFragment.kt @@ -9,14 +9,17 @@ import android.text.InputType import android.view.View import android.view.ViewGroup import android.view.WindowManager -import android.widget.* import androidx.appcompat.app.AlertDialog +import androidx.appcompat.widget.LinearLayoutCompat import androidx.core.net.toUri import androidx.core.widget.NestedScrollView import androidx.fragment.app.DialogFragment import androidx.fragment.app.Fragment +import com.google.android.material.circularreveal.CircularRevealFrameLayout import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.switchmaterial.SwitchMaterial +import com.google.android.material.textfield.TextInputEditText +import com.google.android.material.textview.MaterialTextView import com.looker.droidify.BuildConfig import com.looker.droidify.R import com.looker.droidify.content.Preferences @@ -34,7 +37,7 @@ class SettingsFragment : ScreenFragment() { screenActivity.onToolbarCreated(toolbar) toolbar.setTitle(R.string.settings) - val content = view.findViewById(R.id.fragment_content)!! + val content = view.findViewById(R.id.fragment_content)!! val scroll = NestedScrollView(content.context) scroll.id = R.id.preferences_list scroll.isFillViewport = true @@ -43,14 +46,14 @@ class SettingsFragment : ScreenFragment() { ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT ) - val scrollLayout = FrameLayout(content.context) + val scrollLayout = CircularRevealFrameLayout(content.context) scroll.addView( scrollLayout, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT ) - val preferences = LinearLayout(scrollLayout.context) - preferences.orientation = LinearLayout.VERTICAL + val preferences = LinearLayoutCompat(scrollLayout.context) + preferences.orientation = LinearLayoutCompat.VERTICAL scrollLayout.addView( preferences, ViewGroup.LayoutParams.MATCH_PARENT, @@ -134,9 +137,9 @@ class SettingsFragment : ScreenFragment() { updatePreference(null) } - private fun LinearLayout.addText(title: String, summary: String) { - val text = TextView(context) - val subText = TextView(context) + private fun LinearLayoutCompat.addText(title: String, summary: String) { + val text = MaterialTextView(context) + val subText = MaterialTextView(context) text.text = title subText.text = summary text.textSize = 16F @@ -145,13 +148,13 @@ class SettingsFragment : ScreenFragment() { resources.sizeScaled(16).let { subText.setPadding(it, 5, 5, 25) } addView( text, - LinearLayout.LayoutParams.MATCH_PARENT, - LinearLayout.LayoutParams.WRAP_CONTENT + LinearLayoutCompat.LayoutParams.MATCH_PARENT, + LinearLayoutCompat.LayoutParams.WRAP_CONTENT ) addView( subText, - LinearLayout.LayoutParams.MATCH_PARENT, - LinearLayout.LayoutParams.WRAP_CONTENT + LinearLayoutCompat.LayoutParams.MATCH_PARENT, + LinearLayoutCompat.LayoutParams.WRAP_CONTENT ) } @@ -187,8 +190,11 @@ class SettingsFragment : ScreenFragment() { } } - private fun LinearLayout.addCategory(title: String, callback: LinearLayout.() -> Unit) { - val text = TextView(context) + private fun LinearLayoutCompat.addCategory( + title: String, + callback: LinearLayoutCompat.() -> Unit + ) { + val text = MaterialTextView(context) text.typeface = TypefaceExtra.medium text.setTextSizeScaled(14) text.setTextColor(text.context.getColorFromAttr(android.R.attr.colorAccent)) @@ -196,13 +202,13 @@ class SettingsFragment : ScreenFragment() { resources.sizeScaled(16).let { text.setPadding(it, it, it, 0) } addView( text, - LinearLayout.LayoutParams.MATCH_PARENT, - LinearLayout.LayoutParams.WRAP_CONTENT + LinearLayoutCompat.LayoutParams.MATCH_PARENT, + LinearLayoutCompat.LayoutParams.WRAP_CONTENT ) callback() } - private fun LinearLayout.addPreference( + private fun LinearLayoutCompat.addPreference( key: Preferences.Key, title: String, summaryProvider: () -> String, dialogProvider: ((Context) -> AlertDialog)? ): Preference { @@ -212,7 +218,7 @@ class SettingsFragment : ScreenFragment() { return preference } - private fun LinearLayout.addSwitch( + private fun LinearLayoutCompat.addSwitch( key: Preferences.Key, title: String, summary: String @@ -223,22 +229,21 @@ class SettingsFragment : ScreenFragment() { preference.setCallback { preference.check.isChecked = Preferences[key] } } - private fun LinearLayout.addEdit( + private fun LinearLayoutCompat.addEdit( key: Preferences.Key, title: String, valueToString: (T) -> String, - stringToValue: (String) -> T?, configureEdit: (EditText) -> Unit + stringToValue: (String) -> T?, configureEdit: (TextInputEditText) -> Unit ) { addPreference(key, title, { valueToString(Preferences[key]) }) { it -> val scroll = NestedScrollView(it) scroll.resources.sizeScaled(20).let { scroll.setPadding(it, 0, it, 0) } - val edit = EditText(it) + val edit = TextInputEditText(it) configureEdit(edit) edit.id = android.R.id.edit - edit.setTextSizeScaled(16) edit.resources.sizeScaled(16) .let { edit.setPadding(edit.paddingLeft, it, edit.paddingRight, it) } edit.setText(valueToString(Preferences[key])) edit.hint = edit.text.toString() - edit.setSelection(edit.text.length) + edit.text?.let { editable -> edit.setSelection(editable.length) } edit.requestFocus() scroll.addView( edit, @@ -260,11 +265,11 @@ class SettingsFragment : ScreenFragment() { } } - private fun LinearLayout.addEditString(key: Preferences.Key, title: String) { + private fun LinearLayoutCompat.addEditString(key: Preferences.Key, title: String) { addEdit(key, title, { it }, { it }, { }) } - private fun LinearLayout.addEditInt( + private fun LinearLayoutCompat.addEditInt( key: Preferences.Key, title: String, range: IntRange? @@ -280,7 +285,7 @@ class SettingsFragment : ScreenFragment() { } } - private fun > LinearLayout.addEnumeration( + private fun > LinearLayoutCompat.addEnumeration( key: Preferences.Key, title: String, valueToString: (T) -> String @@ -310,8 +315,8 @@ class SettingsFragment : ScreenFragment() { private val dialogProvider: ((Context) -> AlertDialog)? ) { val view = parent.inflate(R.layout.preference_item) - val title = view.findViewById(R.id.title)!! - val summary = view.findViewById(R.id.summary)!! + val title = view.findViewById(R.id.title)!! + val summary = view.findViewById(R.id.summary)!! val check = view.findViewById(R.id.check)!! private var callback: (() -> Unit)? = null diff --git a/src/main/kotlin/com/looker/droidify/screen/TabsFragment.kt b/src/main/kotlin/com/looker/droidify/screen/TabsFragment.kt index e001fadf..d8a48aa2 100644 --- a/src/main/kotlin/com/looker/droidify/screen/TabsFragment.kt +++ b/src/main/kotlin/com/looker/droidify/screen/TabsFragment.kt @@ -6,16 +6,17 @@ import android.os.Bundle import android.view.* import android.view.animation.AccelerateInterpolator import android.view.animation.DecelerateInterpolator -import android.widget.* import androidx.appcompat.widget.SearchView import androidx.fragment.app.Fragment import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import androidx.viewpager2.adapter.FragmentStateAdapter import androidx.viewpager2.widget.ViewPager2 +import com.google.android.material.circularreveal.CircularRevealFrameLayout import com.google.android.material.imageview.ShapeableImageView import com.google.android.material.tabs.TabLayout import com.google.android.material.tabs.TabLayoutMediator +import com.google.android.material.textview.MaterialTextView import com.looker.droidify.R import com.looker.droidify.content.Preferences import com.looker.droidify.database.Database @@ -48,7 +49,7 @@ class TabsFragment : ScreenFragment() { val tabs = view.findViewById(R.id.tabs)!! val sectionLayout = view.findViewById(R.id.section_layout)!! val sectionChange = view.findViewById(R.id.section_change)!! - val sectionName = view.findViewById(R.id.section_name)!! + val sectionName = view.findViewById(R.id.section_name)!! val sectionIcon = view.findViewById(R.id.section_icon)!! } @@ -176,7 +177,7 @@ class TabsFragment : ScreenFragment() { searchQuery = savedInstanceState?.getString(STATE_SEARCH_QUERY).orEmpty() productFragments.forEach { it.setSearchQuery(searchQuery) } - val toolbarExtra = view.findViewById(R.id.toolbar_extra)!! + val toolbarExtra = view.findViewById(R.id.toolbar_extra)!! toolbarExtra.addView(toolbarExtra.inflate(R.layout.tabs_toolbar)) val layout = Layout(view) this.layout = layout @@ -197,7 +198,7 @@ class TabsFragment : ScreenFragment() { } } - val content = view.findViewById(R.id.fragment_content)!! + val content = view.findViewById(R.id.fragment_content)!! viewPager = ViewPager2(content.context).apply { id = R.id.fragment_pager @@ -208,11 +209,7 @@ class TabsFragment : ScreenFragment() { .Source.values()[position] ) } - content.addView( - this, - FrameLayout.LayoutParams.MATCH_PARENT, - FrameLayout.LayoutParams.MATCH_PARENT - ) + content.addView(this) registerOnPageChangeCallback(pageChangeCallback) offscreenPageLimit = 1 } @@ -263,7 +260,7 @@ class TabsFragment : ScreenFragment() { background = context.getDrawableCompat(R.drawable.background_border) backgroundTintList = context.getColorFromAttr(R.attr.colorSurface) elevation = resources.sizeScaled(4).toFloat() - content.addView(this, FrameLayout.LayoutParams.MATCH_PARENT, 0) + content.addView(this) val margins = resources.sizeScaled(8) (layoutParams as ViewGroup.MarginLayoutParams).setMargins(margins, margins, margins, 0) visibility = View.GONE @@ -516,12 +513,12 @@ class TabsFragment : ScreenFragment() { enum class ViewType { SECTION } private class SectionViewHolder(context: Context) : - RecyclerView.ViewHolder(TextView(context)) { - val title: TextView - get() = itemView as TextView + RecyclerView.ViewHolder(MaterialTextView(context)) { + val title: MaterialTextView + get() = itemView as MaterialTextView init { - itemView as TextView + itemView as MaterialTextView itemView.gravity = Gravity.CENTER_VERTICAL itemView.resources.sizeScaled(16).let { itemView.setPadding(it, 0, it, 0) } itemView.setTextColor(context.getColorFromAttr(android.R.attr.textColor)) diff --git a/src/main/kotlin/com/looker/droidify/utility/extension/Resources.kt b/src/main/kotlin/com/looker/droidify/utility/extension/Resources.kt index d1026f98..60e6e160 100644 --- a/src/main/kotlin/com/looker/droidify/utility/extension/Resources.kt +++ b/src/main/kotlin/com/looker/droidify/utility/extension/Resources.kt @@ -13,10 +13,10 @@ import android.util.Xml import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import android.widget.TextView import androidx.core.content.ContextCompat import coil.util.CoilUtils import com.google.android.material.imageview.ShapeableImageView +import com.google.android.material.textview.MaterialTextView import com.looker.droidify.utility.extension.android.Android import org.xmlpull.v1.XmlPullParser import kotlin.math.roundToInt @@ -88,7 +88,7 @@ fun Resources.sizeScaled(size: Int): Int { return (size * displayMetrics.density).roundToInt() } -fun TextView.setTextSizeScaled(size: Int) { +fun MaterialTextView.setTextSizeScaled(size: Int) { val realSize = (size * resources.displayMetrics.scaledDensity).roundToInt() setTextSize(TypedValue.COMPLEX_UNIT_PX, realSize.toFloat()) } diff --git a/src/main/kotlin/com/looker/droidify/widget/ClickableMovementMethod.kt b/src/main/kotlin/com/looker/droidify/widget/ClickableMovementMethod.kt deleted file mode 100644 index 5bf9329a..00000000 --- a/src/main/kotlin/com/looker/droidify/widget/ClickableMovementMethod.kt +++ /dev/null @@ -1,67 +0,0 @@ -package com.looker.droidify.widget - -import android.text.Selection -import android.text.Spannable -import android.text.method.MovementMethod -import android.text.style.ClickableSpan -import android.view.KeyEvent -import android.view.MotionEvent -import android.widget.TextView - -object ClickableMovementMethod : MovementMethod { - override fun initialize(widget: TextView, text: Spannable) { - Selection.removeSelection(text) - } - - override fun onTouchEvent(widget: TextView, text: Spannable, event: MotionEvent): Boolean { - val action = event.action - val down = action == MotionEvent.ACTION_DOWN - val up = action == MotionEvent.ACTION_UP - return (down || up) && run { - val x = event.x.toInt() - widget.totalPaddingLeft + widget.scrollX - val y = event.y.toInt() - widget.totalPaddingTop + widget.scrollY - val layout = widget.layout - val line = layout.getLineForVertical(y) - val offset = layout.getOffsetForHorizontal(line, x.toFloat()) - val span = text.getSpans(offset, offset, ClickableSpan::class.java)?.firstOrNull() - if (span != null) { - if (down) { - Selection.setSelection(text, text.getSpanStart(span), text.getSpanEnd(span)) - } else { - span.onClick(widget) - } - true - } else { - Selection.removeSelection(text) - false - } - } - } - - override fun onKeyDown( - widget: TextView, - text: Spannable, - keyCode: Int, - event: KeyEvent - ): Boolean = false - - override fun onKeyUp( - widget: TextView, - text: Spannable, - keyCode: Int, - event: KeyEvent - ): Boolean = false - - override fun onKeyOther(view: TextView, text: Spannable, event: KeyEvent): Boolean = false - override fun onTakeFocus(widget: TextView, text: Spannable, direction: Int) = Unit - override fun onTrackballEvent(widget: TextView, text: Spannable, event: MotionEvent): Boolean = - false - - override fun onGenericMotionEvent( - widget: TextView, - text: Spannable, - event: MotionEvent - ): Boolean = false - - override fun canSelectArbitrarily(): Boolean = false -} diff --git a/src/main/res/drawable/ic_add.xml b/src/main/res/drawable/ic_add.xml index 97a3f6f5..a96a2cb2 100644 --- a/src/main/res/drawable/ic_add.xml +++ b/src/main/res/drawable/ic_add.xml @@ -1,11 +1,11 @@ + android:viewportHeight="24"> + android:pathData="M18,13h-5v5c0,0.55 -0.45,1 -1,1s-1,-0.45 -1,-1v-5H6c-0.55,0 -1,-0.45 -1,-1s0.45,-1 1,-1h5V6c0,-0.55 0.45,-1 1,-1s1,0.45 1,1v5h5c0.55,0 1,0.45 1,1s-0.45,1 -1,1z" /> \ No newline at end of file diff --git a/src/main/res/drawable/ic_arrow_down.xml b/src/main/res/drawable/ic_arrow_down.xml index 73df37c2..1992fdb1 100644 --- a/src/main/res/drawable/ic_arrow_down.xml +++ b/src/main/res/drawable/ic_arrow_down.xml @@ -1,10 +1,10 @@ + android:viewportHeight="24"> + android:pathData="M15.88,9.29L12,13.17 8.12,9.29c-0.39,-0.39 -1.02,-0.39 -1.41,0 -0.39,0.39 -0.39,1.02 0,1.41l4.59,4.59c0.39,0.39 1.02,0.39 1.41,0l4.59,-4.59c0.39,-0.39 0.39,-1.02 0,-1.41 -0.39,-0.38 -1.03,-0.39 -1.42,0z" /> \ No newline at end of file diff --git a/src/main/res/drawable/ic_bug_report.xml b/src/main/res/drawable/ic_bug_report.xml index 2b81fb09..b105dd7e 100644 --- a/src/main/res/drawable/ic_bug_report.xml +++ b/src/main/res/drawable/ic_bug_report.xml @@ -1,10 +1,10 @@ + android:viewportHeight="24"> + android:pathData="M19,8h-1.81c-0.45,-0.78 -1.07,-1.45 -1.82,-1.96l0.93,-0.93c0.39,-0.39 0.39,-1.02 0,-1.41 -0.39,-0.39 -1.02,-0.39 -1.41,0l-1.47,1.47C12.96,5.06 12.49,5 12,5s-0.96,0.06 -1.41,0.17L9.11,3.7c-0.39,-0.39 -1.02,-0.39 -1.41,0 -0.39,0.39 -0.39,1.02 0,1.41l0.92,0.93C7.88,6.55 7.26,7.22 6.81,8L5,8c-0.55,0 -1,0.45 -1,1s0.45,1 1,1h1.09c-0.05,0.33 -0.09,0.66 -0.09,1v1L5,12c-0.55,0 -1,0.45 -1,1s0.45,1 1,1h1v1c0,0.34 0.04,0.67 0.09,1L5,16c-0.55,0 -1,0.45 -1,1s0.45,1 1,1h1.81c1.04,1.79 2.97,3 5.19,3s4.15,-1.21 5.19,-3L19,18c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1h-1.09c0.05,-0.33 0.09,-0.66 0.09,-1v-1h1c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1h-1v-1c0,-0.34 -0.04,-0.67 -0.09,-1L19,10c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1zM13,16h-2c-0.55,0 -1,-0.45 -1,-1s0.45,-1 1,-1h2c0.55,0 1,0.45 1,1s-0.45,1 -1,1zM13,12h-2c-0.55,0 -1,-0.45 -1,-1s0.45,-1 1,-1h2c0.55,0 1,0.45 1,1s-0.45,1 -1,1z" /> \ No newline at end of file diff --git a/src/main/res/drawable/ic_cancel.xml b/src/main/res/drawable/ic_cancel.xml index 9514954d..1307bb27 100644 --- a/src/main/res/drawable/ic_cancel.xml +++ b/src/main/res/drawable/ic_cancel.xml @@ -1,10 +1,10 @@ - + android:viewportHeight="24"> + diff --git a/src/main/res/drawable/ic_code.xml b/src/main/res/drawable/ic_code.xml index 8dff452f..e0f22ee9 100644 --- a/src/main/res/drawable/ic_code.xml +++ b/src/main/res/drawable/ic_code.xml @@ -1,9 +1,9 @@ + android:viewportHeight="24"> diff --git a/src/main/res/drawable/ic_copyright.xml b/src/main/res/drawable/ic_copyright.xml index 4d2ba161..7d4ab6b5 100644 --- a/src/main/res/drawable/ic_copyright.xml +++ b/src/main/res/drawable/ic_copyright.xml @@ -1,10 +1,10 @@ + android:viewportHeight="24"> + android:pathData="M10.08,10.86c0.05,-0.33 0.16,-0.62 0.3,-0.87s0.34,-0.46 0.59,-0.62c0.24,-0.15 0.54,-0.22 0.91,-0.23 0.23,0.01 0.44,0.05 0.63,0.13 0.2,0.09 0.38,0.21 0.52,0.36s0.25,0.33 0.34,0.53 0.13,0.42 0.14,0.64h1.79c-0.02,-0.47 -0.11,-0.9 -0.28,-1.29s-0.4,-0.73 -0.7,-1.01 -0.66,-0.5 -1.08,-0.66 -0.88,-0.23 -1.39,-0.23c-0.65,0 -1.22,0.11 -1.7,0.34s-0.88,0.53 -1.2,0.92 -0.56,0.84 -0.71,1.36S8,11.29 8,11.87v0.27c0,0.58 0.08,1.12 0.23,1.64s0.39,0.97 0.71,1.35 0.72,0.69 1.2,0.91c0.48,0.22 1.05,0.34 1.7,0.34 0.47,0 0.91,-0.08 1.32,-0.23s0.77,-0.36 1.08,-0.63 0.56,-0.58 0.74,-0.94 0.29,-0.74 0.3,-1.15h-1.79c-0.01,0.21 -0.06,0.4 -0.15,0.58s-0.21,0.33 -0.36,0.46 -0.32,0.23 -0.52,0.3c-0.19,0.07 -0.39,0.09 -0.6,0.1 -0.36,-0.01 -0.66,-0.08 -0.89,-0.23 -0.25,-0.16 -0.45,-0.37 -0.59,-0.62s-0.25,-0.55 -0.3,-0.88 -0.08,-0.67 -0.08,-1v-0.27c0,-0.35 0.03,-0.68 0.08,-1.01zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z" /> \ No newline at end of file diff --git a/src/main/res/drawable/ic_delete.xml b/src/main/res/drawable/ic_delete.xml index 7549c707..7d2b589c 100644 --- a/src/main/res/drawable/ic_delete.xml +++ b/src/main/res/drawable/ic_delete.xml @@ -2,11 +2,11 @@ + android:viewportHeight="24"> + android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V9c0,-1.1 -0.9,-2 -2,-2H8c-1.1,0 -2,0.9 -2,2v10zM18,4h-2.5l-0.71,-0.71c-0.18,-0.18 -0.44,-0.29 -0.7,-0.29H9.91c-0.26,0 -0.52,0.11 -0.7,0.29L8.5,4H6c-0.55,0 -1,0.45 -1,1s0.45,1 1,1h12c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1z" /> \ No newline at end of file diff --git a/src/main/res/drawable/ic_donate_regular.xml b/src/main/res/drawable/ic_donate_regular.xml index a979dedc..0291015e 100644 --- a/src/main/res/drawable/ic_donate_regular.xml +++ b/src/main/res/drawable/ic_donate_regular.xml @@ -1,10 +1,10 @@ + android:viewportHeight="24"> + android:pathData="M11.8,10.9c-2.27,-0.59 -3,-1.2 -3,-2.15 0,-1.09 1.01,-1.85 2.7,-1.85 1.42,0 2.13,0.54 2.39,1.4 0.12,0.4 0.45,0.7 0.87,0.7h0.3c0.66,0 1.13,-0.65 0.9,-1.27 -0.42,-1.18 -1.4,-2.16 -2.96,-2.54V4.5c0,-0.83 -0.67,-1.5 -1.5,-1.5S10,3.67 10,4.5v0.66c-1.94,0.42 -3.5,1.68 -3.5,3.61 0,2.31 1.91,3.46 4.7,4.13 2.5,0.6 3,1.48 3,2.41 0,0.69 -0.49,1.79 -2.7,1.79 -1.65,0 -2.5,-0.59 -2.83,-1.43 -0.15,-0.39 -0.49,-0.67 -0.9,-0.67h-0.28c-0.67,0 -1.14,0.68 -0.89,1.3 0.57,1.39 1.9,2.21 3.4,2.53v0.67c0,0.83 0.67,1.5 1.5,1.5s1.5,-0.67 1.5,-1.5v-0.65c1.95,-0.37 3.5,-1.5 3.5,-3.55 0,-2.84 -2.43,-3.81 -4.7,-4.4z" /> \ No newline at end of file diff --git a/src/main/res/drawable/ic_download.xml b/src/main/res/drawable/ic_download.xml index 1807116c..1b533f74 100644 --- a/src/main/res/drawable/ic_download.xml +++ b/src/main/res/drawable/ic_download.xml @@ -1,10 +1,10 @@ + android:viewportHeight="24"> + android:pathData="M16.59,9H15V4c0,-0.55 -0.45,-1 -1,-1h-4c-0.55,0 -1,0.45 -1,1v5H7.41c-0.89,0 -1.34,1.08 -0.71,1.71l4.59,4.59c0.39,0.39 1.02,0.39 1.41,0l4.59,-4.59c0.63,-0.63 0.19,-1.71 -0.7,-1.71zM5,19c0,0.55 0.45,1 1,1h12c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1H6c-0.55,0 -1,0.45 -1,1z" /> \ No newline at end of file diff --git a/src/main/res/drawable/ic_edit.xml b/src/main/res/drawable/ic_edit.xml index d7f4cc00..df4d6f5a 100644 --- a/src/main/res/drawable/ic_edit.xml +++ b/src/main/res/drawable/ic_edit.xml @@ -1,10 +1,10 @@ + android:viewportHeight="24"> + android:pathData="M3,17.46v3.04c0,0.28 0.22,0.5 0.5,0.5h3.04c0.13,0 0.26,-0.05 0.35,-0.15L17.81,9.94l-3.75,-3.75L3.15,17.1c-0.1,0.1 -0.15,0.22 -0.15,0.36zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z" /> diff --git a/src/main/res/drawable/ic_email.xml b/src/main/res/drawable/ic_email.xml index 9a076dc7..c5335005 100644 --- a/src/main/res/drawable/ic_email.xml +++ b/src/main/res/drawable/ic_email.xml @@ -1,10 +1,10 @@ + android:viewportHeight="24"> + android:pathData="M20,4L4,4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2zM19.6,8.25l-7.07,4.42c-0.32,0.2 -0.74,0.2 -1.06,0L4.4,8.25c-0.25,-0.16 -0.4,-0.43 -0.4,-0.72 0,-0.67 0.73,-1.07 1.3,-0.72L12,11l6.7,-4.19c0.57,-0.35 1.3,0.05 1.3,0.72 0,0.29 -0.15,0.56 -0.4,0.72z" /> \ No newline at end of file diff --git a/src/main/res/drawable/ic_history.xml b/src/main/res/drawable/ic_history.xml index 248bd87a..1559bf44 100644 --- a/src/main/res/drawable/ic_history.xml +++ b/src/main/res/drawable/ic_history.xml @@ -1,10 +1,10 @@ + android:viewportHeight="24"> + android:pathData="M13.26,3C8.17,2.86 4,6.95 4,12L2.21,12c-0.45,0 -0.67,0.54 -0.35,0.85l2.79,2.8c0.2,0.2 0.51,0.2 0.71,0l2.79,-2.8c0.31,-0.31 0.09,-0.85 -0.36,-0.85L6,12c0,-3.9 3.18,-7.05 7.1,-7 3.72,0.05 6.85,3.18 6.9,6.9 0.05,3.91 -3.1,7.1 -7,7.1 -1.61,0 -3.1,-0.55 -4.28,-1.48 -0.4,-0.31 -0.96,-0.28 -1.32,0.08 -0.42,0.42 -0.39,1.13 0.08,1.49C9,20.29 10.91,21 13,21c5.05,0 9.14,-4.17 9,-9.26 -0.13,-4.69 -4.05,-8.61 -8.74,-8.74zM12.75,8c-0.41,0 -0.75,0.34 -0.75,0.75v3.68c0,0.35 0.19,0.68 0.49,0.86l3.12,1.85c0.36,0.21 0.82,0.09 1.03,-0.26 0.21,-0.36 0.09,-0.82 -0.26,-1.03l-2.88,-1.71v-3.4c0,-0.4 -0.34,-0.74 -0.75,-0.74z" /> \ No newline at end of file diff --git a/src/main/res/drawable/ic_launch.xml b/src/main/res/drawable/ic_launch.xml index 890668cb..309f38e7 100644 --- a/src/main/res/drawable/ic_launch.xml +++ b/src/main/res/drawable/ic_launch.xml @@ -1,11 +1,11 @@ + android:viewportWidth="24" + android:viewportHeight="24"> + android:pathData="M18,19H6c-0.55,0 -1,-0.45 -1,-1V6c0,-0.55 0.45,-1 1,-1h5c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1H5c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2v-6c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1v5c0,0.55 -0.45,1 -1,1zM14,4c0,0.55 0.45,1 1,1h2.59l-9.13,9.13c-0.39,0.39 -0.39,1.02 0,1.41 0.39,0.39 1.02,0.39 1.41,0L19,6.41V9c0,0.55 0.45,1 1,1s1,-0.45 1,-1V3h-6c-0.55,0 -1,0.45 -1,1z" /> \ No newline at end of file diff --git a/src/main/res/drawable/ic_new_releases.xml b/src/main/res/drawable/ic_new_releases.xml index d330567b..1506f84d 100644 --- a/src/main/res/drawable/ic_new_releases.xml +++ b/src/main/res/drawable/ic_new_releases.xml @@ -1,11 +1,11 @@ + android:viewportHeight="24"> + android:pathData="M22.42,11.34l-1.86,-2.12 0.26,-2.81c0.05,-0.5 -0.29,-0.96 -0.77,-1.07l-2.76,-0.63 -1.44,-2.43c-0.26,-0.43 -0.79,-0.61 -1.25,-0.41L12,3 9.41,1.89c-0.46,-0.2 -1,-0.02 -1.25,0.41L6.71,4.72l-2.75,0.62c-0.49,0.11 -0.83,0.56 -0.78,1.07l0.26,2.8 -1.86,2.13c-0.33,0.38 -0.33,0.94 0,1.32l1.86,2.12 -0.26,2.82c-0.05,0.5 0.29,0.96 0.77,1.07l2.76,0.63 1.44,2.42c0.26,0.43 0.79,0.61 1.26,0.41L12,21l2.59,1.11c0.46,0.2 1,0.02 1.25,-0.41l1.44,-2.43 2.76,-0.63c0.49,-0.11 0.82,-0.57 0.77,-1.07l-0.26,-2.81 1.86,-2.12c0.34,-0.36 0.34,-0.92 0.01,-1.3zM13,17h-2v-2h2v2zM12,13c-0.55,0 -1,-0.45 -1,-1L11,8c0,-0.55 0.45,-1 1,-1s1,0.45 1,1v4c0,0.55 -0.45,1 -1,1z" /> \ No newline at end of file diff --git a/src/main/res/drawable/ic_perm_device_information.xml b/src/main/res/drawable/ic_perm_device_information.xml index 1c97f120..afb247be 100644 --- a/src/main/res/drawable/ic_perm_device_information.xml +++ b/src/main/res/drawable/ic_perm_device_information.xml @@ -1,10 +1,10 @@ + android:viewportHeight="24"> + android:pathData="M13,7h-2v2h2L13,7zM12,11c-0.55,0 -1,0.45 -1,1v4c0,0.55 0.45,1 1,1s1,-0.45 1,-1v-4c0,-0.55 -0.45,-1 -1,-1zM17,1.01L7,1c-1.1,0 -2,0.9 -2,2v18c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2L19,3c0,-1.1 -0.9,-1.99 -2,-1.99zM17,19L7,19L7,5h10v14z" /> \ No newline at end of file diff --git a/src/main/res/drawable/ic_person.xml b/src/main/res/drawable/ic_person.xml index 5cc8ea2a..c72dc466 100644 --- a/src/main/res/drawable/ic_person.xml +++ b/src/main/res/drawable/ic_person.xml @@ -1,10 +1,10 @@ + android:viewportHeight="24"> + android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v1c0,0.55 0.45,1 1,1h14c0.55,0 1,-0.45 1,-1v-1c0,-2.66 -5.33,-4 -8,-4z" /> \ No newline at end of file diff --git a/src/main/res/drawable/ic_photo_camera.xml b/src/main/res/drawable/ic_photo_camera.xml index b131691d..7892d1ab 100644 --- a/src/main/res/drawable/ic_photo_camera.xml +++ b/src/main/res/drawable/ic_photo_camera.xml @@ -1,13 +1,13 @@ + android:viewportHeight="24"> + android:pathData="M12,12m-3,0a3,3 0,1 1,6 0a3,3 0,1 1,-6 0" /> + android:pathData="M20,4h-3.17l-1.24,-1.35c-0.37,-0.41 -0.91,-0.65 -1.47,-0.65L9.88,2c-0.56,0 -1.1,0.24 -1.48,0.65L7.17,4L4,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z" /> \ No newline at end of file diff --git a/src/main/res/drawable/ic_save.xml b/src/main/res/drawable/ic_save.xml index 6c2b54df..48f4960e 100644 --- a/src/main/res/drawable/ic_save.xml +++ b/src/main/res/drawable/ic_save.xml @@ -1,10 +1,10 @@ + android:viewportHeight="24"> + android:pathData="M17.59,3.59c-0.38,-0.38 -0.89,-0.59 -1.42,-0.59L5,3c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2L21,7.83c0,-0.53 -0.21,-1.04 -0.59,-1.41l-2.82,-2.83zM12,19c-1.66,0 -3,-1.34 -3,-3s1.34,-3 3,-3 3,1.34 3,3 -1.34,3 -3,3zM13,9L7,9c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2h6c1.1,0 2,0.9 2,2s-0.9,2 -2,2z" /> \ No newline at end of file diff --git a/src/main/res/drawable/ic_search.xml b/src/main/res/drawable/ic_search.xml index 0066ae0c..7f2e9a10 100644 --- a/src/main/res/drawable/ic_search.xml +++ b/src/main/res/drawable/ic_search.xml @@ -1,10 +1,10 @@ + android:viewportHeight="24"> + android:pathData="M15.5,14h-0.79l-0.28,-0.27c1.2,-1.4 1.82,-3.31 1.48,-5.34 -0.47,-2.78 -2.79,-5 -5.59,-5.34 -4.23,-0.52 -7.79,3.04 -7.27,7.27 0.34,2.8 2.56,5.12 5.34,5.59 2.03,0.34 3.94,-0.28 5.34,-1.48l0.27,0.28v0.79l4.25,4.25c0.41,0.41 1.08,0.41 1.49,0 0.41,-0.41 0.41,-1.08 0,-1.49L15.5,14zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z" /> \ No newline at end of file diff --git a/src/main/res/drawable/ic_sort.xml b/src/main/res/drawable/ic_sort.xml index d8fba26c..5dd9e168 100644 --- a/src/main/res/drawable/ic_sort.xml +++ b/src/main/res/drawable/ic_sort.xml @@ -1,11 +1,11 @@ + android:viewportWidth="24" + android:viewportHeight="24"> + android:pathData="M4,18h4c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1L4,16c-0.55,0 -1,0.45 -1,1s0.45,1 1,1zM3,7c0,0.55 0.45,1 1,1h16c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1L4,6c-0.55,0 -1,0.45 -1,1zM4,13h10c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1L4,11c-0.55,0 -1,0.45 -1,1s0.45,1 1,1z" /> \ No newline at end of file diff --git a/src/main/res/drawable/ic_sync.xml b/src/main/res/drawable/ic_sync.xml index 6decc9c6..571bcba7 100644 --- a/src/main/res/drawable/ic_sync.xml +++ b/src/main/res/drawable/ic_sync.xml @@ -1,10 +1,10 @@ + android:viewportHeight="24"> + android:pathData="M12,4L12,2.21c0,-0.45 -0.54,-0.67 -0.85,-0.35l-2.8,2.79c-0.2,0.2 -0.2,0.51 0,0.71l2.79,2.79c0.32,0.31 0.86,0.09 0.86,-0.36L12,6c3.31,0 6,2.69 6,6 0,0.79 -0.15,1.56 -0.44,2.25 -0.15,0.36 -0.04,0.77 0.23,1.04 0.51,0.51 1.37,0.33 1.64,-0.34 0.37,-0.91 0.57,-1.91 0.57,-2.95 0,-4.42 -3.58,-8 -8,-8zM12,18c-3.31,0 -6,-2.69 -6,-6 0,-0.79 0.15,-1.56 0.44,-2.25 0.15,-0.36 0.04,-0.77 -0.23,-1.04 -0.51,-0.51 -1.37,-0.33 -1.64,0.34C4.2,9.96 4,10.96 4,12c0,4.42 3.58,8 8,8v1.79c0,0.45 0.54,0.67 0.85,0.35l2.79,-2.79c0.2,-0.2 0.2,-0.51 0,-0.71l-2.79,-2.79c-0.31,-0.31 -0.85,-0.09 -0.85,0.36L12,18z" /> \ No newline at end of file diff --git a/src/main/res/drawable/ic_tune.xml b/src/main/res/drawable/ic_tune.xml index 333be657..7dca7bb8 100644 --- a/src/main/res/drawable/ic_tune.xml +++ b/src/main/res/drawable/ic_tune.xml @@ -1,10 +1,10 @@ + android:viewportHeight="24"> + android:pathData="M3,18c0,0.55 0.45,1 1,1h5v-2L4,17c-0.55,0 -1,0.45 -1,1zM3,6c0,0.55 0.45,1 1,1h9L13,5L4,5c-0.55,0 -1,0.45 -1,1zM13,20v-1h7c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1h-7v-1c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1v4c0,0.55 0.45,1 1,1s1,-0.45 1,-1zM7,10v1L4,11c-0.55,0 -1,0.45 -1,1s0.45,1 1,1h3v1c0,0.55 0.45,1 1,1s1,-0.45 1,-1v-4c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1zM21,12c0,-0.55 -0.45,-1 -1,-1h-9v2h9c0.55,0 1,-0.45 1,-1zM16,9c0.55,0 1,-0.45 1,-1L17,7h3c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1h-3L17,4c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1v4c0,0.55 0.45,1 1,1z" /> \ No newline at end of file diff --git a/src/main/res/layout/edit_repository.xml b/src/main/res/layout/edit_repository.xml index 51257793..242d553f 100644 --- a/src/main/res/layout/edit_repository.xml +++ b/src/main/res/layout/edit_repository.xml @@ -11,7 +11,7 @@ android:layout_height="match_parent" android:fillViewport="true"> - - @@ -48,7 +48,7 @@ android:visibility="gone" tools:ignore="ContentDescription" /> - + - + - - - -