From ac220ab7c3c2e35de3942e6e6325636cf93fd079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Be=C5=88o?= Date: Sun, 28 Feb 2021 14:56:21 +0100 Subject: [PATCH] Correct typos in whole project and create a dictionary --- .gitignore | 5 +- .idea/dictionaries/benji.xml | 57 +++++++++++++++++++ CONTRIBUTORS.md | 2 +- MIGRATION.md | 12 ++-- README.md | 2 +- .../fastadapter/app/AdvancedSampleActivity.kt | 4 +- .../fastadapter/app/DiffUtilActivity.kt | 2 +- ...pandableMultiselectDeleteSampleActivity.kt | 4 +- app/src/main/res/values/strings.xml | 2 +- .../mikepenz/fastadapter/utils/AdapterUtil.kt | 2 +- .../mikepenz/fastadapter/utils/SubItemUtil.kt | 4 +- .../fastadapter/paged/PagedItemListImpl.kt | 2 +- .../EndlessRecyclerOnTopScrollListener.kt | 2 +- .../fastadapter/helpers/ActionModeHelper.kt | 4 +- .../fastadapter/helpers/HeaderHelper.kt | 6 +- .../helpers/RangeSelectorHelper.kt | 10 ++-- .../com/mikepenz/fastadapter/FastAdapter.kt | 2 +- .../fastadapter/adapters/ItemFilter.kt | 2 +- .../fastadapter/adapters/ModelAdapter.kt | 4 +- .../fastadapter/items/AbstractItem.kt | 2 +- .../mikepenz/fastadapter/items/BaseItem.kt | 2 +- .../fastadapter/select/SelectExtension.kt | 8 +-- .../utils/ComparableItemListImpl.kt | 4 +- 23 files changed, 101 insertions(+), 43 deletions(-) create mode 100644 .idea/dictionaries/benji.xml diff --git a/.gitignore b/.gitignore index 0dd3e68b3..b150f9953 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,7 @@ proguard/ #IntelliJ files *.iml -.idea/ +.idea/* +!.idea/dictionaries -*.DS_STORE \ No newline at end of file +*.DS_STORE diff --git a/.idea/dictionaries/benji.xml b/.idea/dictionaries/benji.xml new file mode 100644 index 000000000..24664f8e9 --- /dev/null +++ b/.idea/dictionaries/benji.xml @@ -0,0 +1,57 @@ + + + + aleksander + alireza + bergander + chaudhary + claide + configureondemand + ctor + descr + detekt + expandables + fabianterhorst + fastadapter + flisar + gagan + gulko + hookable + iconics + identifiables + isegran + jasonsparc + jetpack + jvmargs + kapt + kramdown + mielczarek + mikepenz + mopub + multiselect + octokit + paypal + penz + performant + rchardet + rects + rexml + rubengees + shubham + snackbar + spek + stickyheadersrecyclerview + subitem + subitems + sublists + swipeable + terhorst + timehop + unselect + unswipe + unswiped + usecases + viewholder + + + \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index e51b935c9..f8f355696 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,4 +1,4 @@ -FastAdapter contributors (sorted alphabeticaly) +FastAdapter contributors (sorted alphabetically) ============================================ * **[Fabian Terhorst](https://github.com/FabianTerhorst)** diff --git a/MIGRATION.md b/MIGRATION.md index ed7ac3e96..c03db5ec9 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -24,8 +24,8 @@ override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int, pa #### v4.x.y -v4 is a huge release changing most of the codebase to Kotlin. This comes with many refactors, and as a result of that with many breaking API changes. -We put a lot of focus on type safety with this release, as such this release is a lot more strict and tries to prevent as many potential bad type mixups as possible. +v4 is a huge release changing most of the codebase to Kotlin. This comes with many refactorings, and as a result of that with many breaking API changes. +We put a lot of focus on type safety with this release, as such this release is a lot more strict and tries to prevent as many potential bad type mix-ups as possible. * For compatibility, most existing static fields and functions remain static in Java. For newer functions, accessing from Java may require using the `Companion` class. For instance, `FastAdapter.example()` becomes `FastAdapter.Companion.example()` * The `IItem` interface now requires a type specification. E.g. `IItem` @@ -57,7 +57,7 @@ If you have any issues during the migration, or any questions come up please ope * Further details about migrating to androidX and a overview can be found on the official docs. https://developer.android.com/topic/libraries/support-library/refactor #### v3.2.4 -* Adjusted the `set(int position, Item item, int preItemCount)` to include the `preItemCount` to corretly notify the adapter about the changed element. +* Adjusted the `set(int position, Item item, int preItemCount)` to include the `preItemCount` to correctly notify the adapter about the changed element. #### v3.2.3 * The `ActionModeHelper` requires a `FastAdapter` with the `SelectExtension` applied. This is done in current versions via `withSelectable(true)`. Make sure this is called before creating the `ActionModeHelper`. @@ -156,17 +156,17 @@ public ViewHolder getViewHolder(View v) { **SHORT OVERVIEW** * If you have items implemented by using the interface you have to implement the new methods (**unbindView**) -* If you have expandable items make sure to adjust the Model type definitions as metioned below. Check out the `AbstractExpandableItem` to simplify this for you +* If you have expandable items make sure to adjust the Model type definitions as mentioned below. Check out the `AbstractExpandableItem` to simplify this for you * If you use the `MaterialDrawer`, the `AboutLibraries` in your project, please make sure to update them so the changed interfaces do not cause conflicts **DETAILED** * New `unbindView` method was added to the `IItem` --> This method is called when the current item is no longer set and before the `ViewHolder` is used for the next item * You should move your view resetting logic here, or for example glide image loading canceling * `IExpandable` Model types changes - * it is now required to define the type which will be used for the subItems. This can be an implementation or `ISubItem`. We now require this, as we will keep the references between childs, and parents. + * it is now required to define the type which will be used for the subItems. This can be an implementation or `ISubItem`. We now require this, as we will keep the references between children, and parents. * this allows more optimizations, and many additional usecases * New `ISubItem` interface added - * items serving as subitems, have to implement this. + * items serving as subItems, have to implement this. * New `AbstractExpandableItem` added, which combines `IExpandable` and `ISubItem` with an `AbstractItem` to simplify your life * A new `SubItemUtil` was introduced which simplifies some use cases when working with expandable / collapsing lists diff --git a/README.md b/README.md index 258d5b1dd..c322559bd 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # FastAdapter The FastAdapter is here to simplify creating adapters for RecyclerViews. Don't worry about the adapter anymore. Just write the logic for how your view/item should look like, and you are done. -It's blazingly fast, minimizing the code you need to write, and is easy to extend. +It's blazing fast, minimizing the code you need to write, and is easy to extend. ------- diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/AdvancedSampleActivity.kt b/app/src/main/java/com/mikepenz/fastadapter/app/AdvancedSampleActivity.kt index 09007397d..d3eaa6f78 100644 --- a/app/src/main/java/com/mikepenz/fastadapter/app/AdvancedSampleActivity.kt +++ b/app/src/main/java/com/mikepenz/fastadapter/app/AdvancedSampleActivity.kt @@ -28,7 +28,7 @@ import java.util.* import java.util.concurrent.atomic.AtomicLong /** - * This sample showcases compatibility the awesome Sticky-Headers library by timehop + * This sample showcases compatibility with the awesome Sticky-Headers library by timehop * https://github.com/timehop/sticky-headers-recyclerview */ class AdvancedSampleActivity : AppCompatActivity() { @@ -82,7 +82,7 @@ class AdvancedSampleActivity : AppCompatActivity() { if (item is IExpandable<*> && item.subItems.isNotEmpty()) { true } else { - //handle the longclick actions + //handle the long click actions val actionMode = mActionModeHelper?.onLongClick(this@AdvancedSampleActivity, position) if (actionMode != null) { //we want color our CAB diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/DiffUtilActivity.kt b/app/src/main/java/com/mikepenz/fastadapter/app/DiffUtilActivity.kt index 65498e29e..867960e13 100644 --- a/app/src/main/java/com/mikepenz/fastadapter/app/DiffUtilActivity.kt +++ b/app/src/main/java/com/mikepenz/fastadapter/app/DiffUtilActivity.kt @@ -63,7 +63,7 @@ class DiffUtilActivity : AppCompatActivity() { override fun onSaveInstanceState(_outState: Bundle) { var outState = _outState - //add the values which need to be saved from the adapter to the bundel + //add the values which need to be saved from the adapter to the bundle outState = fastItemAdapter.saveInstanceState(outState) super.onSaveInstanceState(outState) } diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/ExpandableMultiselectDeleteSampleActivity.kt b/app/src/main/java/com/mikepenz/fastadapter/app/ExpandableMultiselectDeleteSampleActivity.kt index ea5c6342a..fc6449ec4 100644 --- a/app/src/main/java/com/mikepenz/fastadapter/app/ExpandableMultiselectDeleteSampleActivity.kt +++ b/app/src/main/java/com/mikepenz/fastadapter/app/ExpandableMultiselectDeleteSampleActivity.kt @@ -128,7 +128,7 @@ class ExpandableMultiselectDeleteSampleActivity : AppCompatActivity() { .identifier = (i + 1).toLong() //.withIsExpanded(true) don't use this in such a setup, use adapter.expand() to expand all items instead - //add subitems so we can showcase the collapsible functionality + //add subItems so we can showcase the collapsible functionality val subItems = LinkedList>() for (ii in 1..5) { val sampleItem = SimpleSubItem() @@ -159,7 +159,7 @@ class ExpandableMultiselectDeleteSampleActivity : AppCompatActivity() { val headerItem = item.parent if (headerItem != null) { val pos = fastItemAdapter.getAdapterPosition(headerItem) - // Important: notify the header directly, not via the notifyadapterItemChanged! + // Important: notify the header directly, not via the notifyAdapterItemChanged! // we just want to update the view and we are sure, nothing else has to be done fastItemAdapter.notifyItemChanged(pos) } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5603e4086..2e18e729c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -45,6 +45,6 @@ Diff Util Sample Diff Util, refresh list using DiffUtil Open Source - Suche + Search UNDO diff --git a/fastadapter-extensions-expandable/src/main/java/com/mikepenz/fastadapter/utils/AdapterUtil.kt b/fastadapter-extensions-expandable/src/main/java/com/mikepenz/fastadapter/utils/AdapterUtil.kt index 89fb471e6..d6de09099 100644 --- a/fastadapter-extensions-expandable/src/main/java/com/mikepenz/fastadapter/utils/AdapterUtil.kt +++ b/fastadapter-extensions-expandable/src/main/java/com/mikepenz/fastadapter/utils/AdapterUtil.kt @@ -53,7 +53,7 @@ object AdapterUtil { * Gets all items (including sub items) from the FastAdapter * * @param fastAdapter the FastAdapter - * @return a list of all items including the whole subItem hirachy + * @return a list of all items including the whole subItem hierarchy */ @JvmStatic fun getAllItems(fastAdapter: FastAdapter): List where Item : GenericItem, Item : IExpandable<*> { val size = fastAdapter.itemCount diff --git a/fastadapter-extensions-expandable/src/main/java/com/mikepenz/fastadapter/utils/SubItemUtil.kt b/fastadapter-extensions-expandable/src/main/java/com/mikepenz/fastadapter/utils/SubItemUtil.kt index 2e640cd11..9a5456182 100644 --- a/fastadapter-extensions-expandable/src/main/java/com/mikepenz/fastadapter/utils/SubItemUtil.kt +++ b/fastadapter-extensions-expandable/src/main/java/com/mikepenz/fastadapter/utils/SubItemUtil.kt @@ -165,7 +165,7 @@ object SubItemUtil { } /** - * Select or unselect all sub itmes underneath an expandable item + * Select or unselect all sub items underneath an expandable item * * @param adapter the adapter instance * @param header the header who's children should be selected or deselected @@ -176,7 +176,7 @@ object SubItemUtil { } /** - * Select or unselect all sub itmes underneath an expandable item + * Select or unselect all sub items underneath an expandable item * * @param adapter the adapter instance * @param header the header who's children should be selected or deselected diff --git a/fastadapter-extensions-paged/src/main/java/com/mikepenz/fastadapter/paged/PagedItemListImpl.kt b/fastadapter-extensions-paged/src/main/java/com/mikepenz/fastadapter/paged/PagedItemListImpl.kt index b3552010f..b11ed3eb5 100644 --- a/fastadapter-extensions-paged/src/main/java/com/mikepenz/fastadapter/paged/PagedItemListImpl.kt +++ b/fastadapter-extensions-paged/src/main/java/com/mikepenz/fastadapter/paged/PagedItemListImpl.kt @@ -203,7 +203,7 @@ open class PagedItemListImpl( /** * Returns the default placeholder interceptor * - * Note if your PagedItemList should contain placeholder, you have to provide a logic what the adapter should show while in placeholding state + * Note if your PagedItemList should contain placeholder, you have to provide a logic what the adapter should show while in placeholder state */ internal fun getDefaultPlaceholderInterceptor(): (Int) -> Item { return { throw RuntimeException("No item found at position") } diff --git a/fastadapter-extensions-scroll/src/main/java/com/mikepenz/fastadapter/scroll/EndlessRecyclerOnTopScrollListener.kt b/fastadapter-extensions-scroll/src/main/java/com/mikepenz/fastadapter/scroll/EndlessRecyclerOnTopScrollListener.kt index 46e1673c5..a8e01d6e8 100644 --- a/fastadapter-extensions-scroll/src/main/java/com/mikepenz/fastadapter/scroll/EndlessRecyclerOnTopScrollListener.kt +++ b/fastadapter-extensions-scroll/src/main/java/com/mikepenz/fastadapter/scroll/EndlessRecyclerOnTopScrollListener.kt @@ -51,7 +51,7 @@ abstract class EndlessRecyclerOnTopScrollListener : RecyclerView.OnScrollListene super.onScrolled(recyclerView, dx, dy) if (!::_layoutManager.isInitialized) { this._layoutManager = recyclerView.layoutManager as LinearLayoutManager? - ?: throw RuntimeException("A layoutmanager is required") + ?: throw RuntimeException("A LayoutManager is required") } if (visibleThreshold == RecyclerView.NO_POSITION) { diff --git a/fastadapter-extensions-utils/src/main/java/com/mikepenz/fastadapter/helpers/ActionModeHelper.kt b/fastadapter-extensions-utils/src/main/java/com/mikepenz/fastadapter/helpers/ActionModeHelper.kt index aacdaa47d..0d9bcad58 100644 --- a/fastadapter-extensions-utils/src/main/java/com/mikepenz/fastadapter/helpers/ActionModeHelper.kt +++ b/fastadapter-extensions-utils/src/main/java/com/mikepenz/fastadapter/helpers/ActionModeHelper.kt @@ -88,7 +88,7 @@ class ActionModeHelper { /** * Implements the basic behavior of a CAB and multi select behavior, - * including logics if the clicked item is collapsible + * including logic if the clicked item is collapsible * * @param item the current item * @return null if nothing was done, or a boolean to inform if the event was consumed @@ -99,7 +99,7 @@ class ActionModeHelper { /** * Implements the basic behavior of a CAB and multi select behavior, - * including logics if the clicked item is collapsible + * including logic if the clicked item is collapsible * * @param act the current Activity * @param item the current item diff --git a/fastadapter-extensions-utils/src/main/java/com/mikepenz/fastadapter/helpers/HeaderHelper.kt b/fastadapter-extensions-utils/src/main/java/com/mikepenz/fastadapter/helpers/HeaderHelper.kt index a630b6d3e..7f3afae84 100644 --- a/fastadapter-extensions-utils/src/main/java/com/mikepenz/fastadapter/helpers/HeaderHelper.kt +++ b/fastadapter-extensions-utils/src/main/java/com/mikepenz/fastadapter/helpers/HeaderHelper.kt @@ -31,9 +31,9 @@ class HeaderHelper { } /** - * Call this when your list order has changed or was updated, and you have to readd the headres + * Call this when your list order has changed or was updated, and you have to read the headers * - * @param items the list which will get the headers added inbetween + * @param items the list which will get the headers added in-between */ fun apply(items: MutableList) { //If the list is empty avoid sorting and adding headers. @@ -69,7 +69,7 @@ class HeaderHelper { interface GroupingFunction { /** * @param currentItem the current item we check - * @param nextItem the item comming after the current item + * @param nextItem the item coming after the current item * @param currentPosition the current position of the currentItem * @return the HeaderItem we want to add after the currentItem */ diff --git a/fastadapter-extensions-utils/src/main/java/com/mikepenz/fastadapter/helpers/RangeSelectorHelper.kt b/fastadapter-extensions-utils/src/main/java/com/mikepenz/fastadapter/helpers/RangeSelectorHelper.kt index de7516bff..d8c50487a 100644 --- a/fastadapter-extensions-utils/src/main/java/com/mikepenz/fastadapter/helpers/RangeSelectorHelper.kt +++ b/fastadapter-extensions-utils/src/main/java/com/mikepenz/fastadapter/helpers/RangeSelectorHelper.kt @@ -31,7 +31,7 @@ open class RangeSelectorHelper(private val fastAdapter: Fast } /** - * Enable this, if you want the range selector to correclty handle sub items as well + * Enable this, if you want the range selector to correctly handle sub items as well * * @param supportSubItems true, if sub items are supported, false otherwise * @return this, for supporting function call chaining @@ -44,7 +44,7 @@ open class RangeSelectorHelper(private val fastAdapter: Fast /** * The provided payload will be passed to the adapters notify function, if one is provided * - * @param payload the paylaod that should be passed to the adapter on selection state change + * @param payload the payload that should be passed to the adapter on selection state change * @return this, for supporting function call chaining */ fun withPayload(payload: Any): RangeSelectorHelper<*> { @@ -100,10 +100,10 @@ open class RangeSelectorHelper(private val fastAdapter: Fast } /** - * Selects all items in a range, from and to indizes are inclusive + * Selects all items in a range, from and to indices are inclusive * - * @param from the from index - * @param to the to index + * @param _from the from index + * @param _to the to index * @param select true, if the provided range should be selected, false otherwise * @param skipHeaders true, if you do not want to process headers, false otherwise */ diff --git a/fastadapter/src/main/java/com/mikepenz/fastadapter/FastAdapter.kt b/fastadapter/src/main/java/com/mikepenz/fastadapter/FastAdapter.kt index 12f28bcaa..d936b3e2c 100644 --- a/fastadapter/src/main/java/com/mikepenz/fastadapter/FastAdapter.kt +++ b/fastadapter/src/main/java/com/mikepenz/fastadapter/FastAdapter.kt @@ -327,7 +327,7 @@ open class FastAdapter : RecyclerView.Adapter(private val itemAdapter: ModelA itemAdapter.setInternal(results.values as List, false, null) } - //only fire when we are filtered, not in onreset + //only fire when we are filtered, not in onReset if (originalItems != null) { itemFilterListener?.itemsFiltered(constraint, results.values as List) } diff --git a/fastadapter/src/main/java/com/mikepenz/fastadapter/adapters/ModelAdapter.kt b/fastadapter/src/main/java/com/mikepenz/fastadapter/adapters/ModelAdapter.kt index 0c348a6e1..766a0d8c0 100644 --- a/fastadapter/src/main/java/com/mikepenz/fastadapter/adapters/ModelAdapter.kt +++ b/fastadapter/src/main/java/com/mikepenz/fastadapter/adapters/ModelAdapter.kt @@ -38,7 +38,7 @@ open class ModelAdapter( } /** - * defines if this adapter is currently activly shown in the list + * defines if this adapter is currently actively shown in the list */ var active: Boolean = true set(value) { @@ -413,7 +413,7 @@ open class ModelAdapter( position: Int ): Boolean { if (identifier == item.identifier) { - //if it's a subitem remove it from the parent + //if it's a subItem remove it from the parent (item as? IExpandable<*>?)?.let { expandable -> //a sub item which is not in the list can be instantly deleted expandable.parent?.subItems?.remove(item) diff --git a/fastadapter/src/main/java/com/mikepenz/fastadapter/items/AbstractItem.kt b/fastadapter/src/main/java/com/mikepenz/fastadapter/items/AbstractItem.kt index acf7556f8..f7526b9c6 100644 --- a/fastadapter/src/main/java/com/mikepenz/fastadapter/items/AbstractItem.kt +++ b/fastadapter/src/main/java/com/mikepenz/fastadapter/items/AbstractItem.kt @@ -21,7 +21,7 @@ abstract class AbstractItem : BaseItem(), IIte /** * This method is called by generateView(Context ctx), generateView(Context ctx, ViewGroup parent) and getViewHolder(ViewGroup parent) - * it will generate the View from the layout, overwrite this if you want to implement your view creation programatically + * it will generate the View from the layout, overwrite this if you want to implement your view creation programmatically */ open fun createView(ctx: Context, parent: ViewGroup?): View { return LayoutInflater.from(ctx).inflate(layoutRes, parent, false) diff --git a/fastadapter/src/main/java/com/mikepenz/fastadapter/items/BaseItem.kt b/fastadapter/src/main/java/com/mikepenz/fastadapter/items/BaseItem.kt index 0797d1b62..20c9aaf0a 100644 --- a/fastadapter/src/main/java/com/mikepenz/fastadapter/items/BaseItem.kt +++ b/fastadapter/src/main/java/com/mikepenz/fastadapter/items/BaseItem.kt @@ -105,7 +105,7 @@ abstract class BaseItemFactory : IItemVHFactory(private val fastAdapter: FastAdapter(private val fastAdapter: FastAdapter(private val fastAdapter: FastAdapter @JvmOverloads constructor( items: MutableList = ArrayList() ) : DefaultItemListImpl(items) { - /** @return the defined Comparator used for this ItemAdaper */ + /** @return the defined Comparator used for this ItemAdapter */ var comparator: Comparator? = comparator private set /** - * Define a comparator which will be used to sort the list "everytime" it is altered + * Define a comparator which will be used to sort the list "every time" it is altered * NOTE this will only sort if you "set" a new list or "add" new items (not if you provide a position for the add function) * * @param comparator used to sort the list