diff --git a/.gitignore b/.gitignore index 63cb77a0e..fef17507d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,21 @@ *.iml .gradle /local.properties -.idea +/.idea/caches +/.idea/libraries +/.idea/gradle.xml +/.idea/kotlinc.xml +/.idea/misc.xml +/.idea/inspectionProfiles +/.idea/modules.xml +/.idea/compiler.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml .DS_Store /build +**/build /captures .externalNativeBuild +.cxx +local.properties \ No newline at end of file diff --git a/LICENSE b/LICENSE index 91eb029d7..224ef0cfe 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 CraZyLegenD +Copyright (c) 2020 funkymuse Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 08bb3dde0..2ca258ca7 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ### Android extensions and helper classes for easier Kotlin development [![](https://jitpack.io/v/FunkyMuse/KAHelpers.svg)](https://jitpack.io/#FunkyMuse/KAHelpers) -[![Kotlin](https://img.shields.io/badge/Kotlin-1.9.0-blue.svg)](https://kotlinlang.org) [![Platform](https://img.shields.io/badge/Platform-Android-green.svg)](https://developer.android.com/guide/) [![sad](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)]( https://twitter.com/intent/tweet?url=https%3A%2F%2Ftwitter.com%2Fintent%2Ftweet%3Fhttps%3A%2F%2Fgithub.com%2FCraZyLegenD%2FSet-Of-Useful-Kotlin-Extensions-and-Helpers&text=Kotlin%20Extensions%20and%20Class%20Helpers) +[![Kotlin](https://img.shields.io/badge/Kotlin-1.9.0-blue.svg)](https://kotlinlang.org) [![Platform](https://img.shields.io/badge/Platform-Android-green.svg)](https://developer.android.com/guide/) [![sad](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)]( https://twitter.com/intent/tweet?url=https%3A%2F%2Ftwitter.com%2Fintent%2Ftweet%3Fhttps%3A%2F%2Fgithub.com%2Ffunkymuse%2FSet-Of-Useful-Kotlin-Extensions-and-Helpers&text=Kotlin%20Extensions%20and%20Class%20Helpers) ![API](https://img.shields.io/badge/Min%20API-23-green) ![API](https://img.shields.io/badge/Compiled%20API-33-green) diff --git a/accessibility/build.gradle b/accessibility/build.gradle deleted file mode 100644 index 5d0a33595..000000000 --- a/accessibility/build.gradle +++ /dev/null @@ -1,7 +0,0 @@ -dependencies { - implementation libs.androidx.core.ktx -} - -android { - namespace 'com.crazylegend.accessibility' -} \ No newline at end of file diff --git a/accessibility/build.gradle.kts b/accessibility/build.gradle.kts new file mode 100644 index 000000000..d69ae4b11 --- /dev/null +++ b/accessibility/build.gradle.kts @@ -0,0 +1,6 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} +dependencies { + implementation(libs.androidx.core.ktx) +} \ No newline at end of file diff --git a/accessibility/src/androidTest/java/com/crazylegend/accessibility/ExampleInstrumentedTest.kt b/accessibility/src/androidTest/java/com/crazylegend/accessibility/ExampleInstrumentedTest.kt deleted file mode 100644 index e8e77898a..000000000 --- a/accessibility/src/androidTest/java/com/crazylegend/accessibility/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,24 +0,0 @@ -package com.crazylegend.accessibility - -import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.ext.junit.runners.AndroidJUnit4 - -import org.junit.Test -import org.junit.runner.RunWith - -import org.junit.Assert.* - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("com.crazylegend.accesssibility.test", appContext.packageName) - } -} \ No newline at end of file diff --git a/accessibility/src/main/AndroidManifest.xml b/accessibility/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/accessibility/src/main/AndroidManifest.xml +++ b/accessibility/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/accessibility/src/main/java/com/crazylegend/accessibility/AccessibilityExtensions.kt b/accessibility/src/main/java/com/funkymuse/accessibility/AccessibilityExtensions.kt similarity index 94% rename from accessibility/src/main/java/com/crazylegend/accessibility/AccessibilityExtensions.kt rename to accessibility/src/main/java/com/funkymuse/accessibility/AccessibilityExtensions.kt index b0c7fc271..2fc3ac27f 100644 --- a/accessibility/src/main/java/com/crazylegend/accessibility/AccessibilityExtensions.kt +++ b/accessibility/src/main/java/com/funkymuse/accessibility/AccessibilityExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.accessibility +package com.funkymuse.accessibility import android.accessibilityservice.AccessibilityService import android.content.ComponentName @@ -11,10 +11,6 @@ import android.view.accessibility.AccessibilityNodeInfo import androidx.core.content.getSystemService import androidx.core.os.bundleOf -/** - * Created by crazy on 10/20/20 to long live and prosper ! - */ - /** * Based on {@link com.android.settingslib.accessibility.AccessibilityUtils#getEnabledServicesFromSettings(Context,int)} * @see AccessibilityUtils @@ -65,6 +61,6 @@ fun logViewHierarchy(nodeInfo: AccessibilityNodeInfo, depth: Int = 0, callback(spacerString, nodeInfo) for (i in 0 until nodeInfo.childCount) { - logViewHierarchy(nodeInfo.getChild(i), depth + 1, callback) + com.funkymuse.accessibility.logViewHierarchy(nodeInfo.getChild(i), depth + 1, callback) } } \ No newline at end of file diff --git a/accessibility/src/test/java/com/crazylegend/accessibility/ExampleUnitTest.kt b/accessibility/src/test/java/com/crazylegend/accessibility/ExampleUnitTest.kt deleted file mode 100644 index 0ab1fef3c..000000000 --- a/accessibility/src/test/java/com/crazylegend/accessibility/ExampleUnitTest.kt +++ /dev/null @@ -1,17 +0,0 @@ -package com.crazylegend.accessibility - -import org.junit.Test - -import org.junit.Assert.* - -/** - * Example local unit test, which will execute on the development machine (host). - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -class ExampleUnitTest { - @Test - fun addition_isCorrect() { - assertEquals(4, 2 + 2) - } -} \ No newline at end of file diff --git a/activity/build.gradle b/activity/build.gradle deleted file mode 100644 index 015edf012..000000000 --- a/activity/build.gradle +++ /dev/null @@ -1,10 +0,0 @@ -dependencies { - implementation "androidx.activity:activity-ktx:$activity" - implementation "androidx.appcompat:appcompat:$appCompat" - implementation project(path: ':common') - -} - -android { - namespace 'com.crazylegend.activity' -} \ No newline at end of file diff --git a/activity/build.gradle.kts b/activity/build.gradle.kts new file mode 100644 index 000000000..e92fdab21 --- /dev/null +++ b/activity/build.gradle.kts @@ -0,0 +1,8 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} +dependencies { + implementation(libs.androidx.activity.ktx) + implementation(libs.androidx.appcompat) + implementation(projects.common) +} \ No newline at end of file diff --git a/activity/src/androidTest/java/com/crazylegend/activity/ExampleInstrumentedTest.kt b/activity/src/androidTest/java/com/crazylegend/activity/ExampleInstrumentedTest.kt deleted file mode 100644 index fb6ee35b9..000000000 --- a/activity/src/androidTest/java/com/crazylegend/activity/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,24 +0,0 @@ -package com.crazylegend.activity - -import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.ext.junit.runners.AndroidJUnit4 - -import org.junit.Test -import org.junit.runner.RunWith - -import org.junit.Assert.* - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("com.crazylegend.activity.test", appContext.packageName) - } -} \ No newline at end of file diff --git a/activity/src/main/AndroidManifest.xml b/activity/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/activity/src/main/AndroidManifest.xml +++ b/activity/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/activity/src/main/java/com/crazylegend/activity/ActivityExtensions.kt b/activity/src/main/java/com/funkymuse/activity/ActivityExtensions.kt similarity index 96% rename from activity/src/main/java/com/crazylegend/activity/ActivityExtensions.kt rename to activity/src/main/java/com/funkymuse/activity/ActivityExtensions.kt index f2c237c57..9a7b020ec 100644 --- a/activity/src/main/java/com/crazylegend/activity/ActivityExtensions.kt +++ b/activity/src/main/java/com/funkymuse/activity/ActivityExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.activity +package com.funkymuse.activity import android.Manifest.permission.WRITE_SETTINGS import android.annotation.SuppressLint @@ -11,7 +11,12 @@ import android.content.ContextWrapper import android.content.Intent import android.content.pm.ActivityInfo import android.content.res.Configuration -import android.graphics.* +import android.graphics.Bitmap +import android.graphics.BitmapFactory +import android.graphics.Canvas +import android.graphics.Color +import android.graphics.Point +import android.graphics.Rect import android.graphics.drawable.ColorDrawable import android.net.Uri import android.os.Build @@ -19,10 +24,18 @@ import android.os.Bundle import android.os.Handler import android.provider.Settings import android.util.DisplayMetrics -import android.view.* +import android.view.PixelCopy +import android.view.View import android.view.View.GONE +import android.view.Window +import android.view.WindowManager import android.view.inputmethod.InputMethodManager -import androidx.annotation.* +import androidx.annotation.ColorInt +import androidx.annotation.DrawableRes +import androidx.annotation.RequiresApi +import androidx.annotation.RequiresPermission +import androidx.annotation.StringRes +import androidx.annotation.UiThread import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.content.res.AppCompatResources @@ -32,10 +45,6 @@ import androidx.core.content.getSystemService import androidx.fragment.app.FragmentActivity -/** - * Created by hristijan on 2/22/19 to long live and prosper ! - */ - /** * Hide keyboard for an activity. */ diff --git a/activity/src/main/java/com/crazylegend/activity/ActivityExtensions2.kt b/activity/src/main/java/com/funkymuse/activity/ActivityExtensions2.kt similarity index 98% rename from activity/src/main/java/com/crazylegend/activity/ActivityExtensions2.kt rename to activity/src/main/java/com/funkymuse/activity/ActivityExtensions2.kt index 9dbcb384a..de3e7ae6e 100644 --- a/activity/src/main/java/com/crazylegend/activity/ActivityExtensions2.kt +++ b/activity/src/main/java/com/funkymuse/activity/ActivityExtensions2.kt @@ -1,4 +1,4 @@ -package com.crazylegend.activity +package com.funkymuse.activity import android.app.Activity import android.content.Context @@ -15,9 +15,7 @@ import androidx.annotation.DrawableRes import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.FragmentActivity -/** - * Created by crazy on 9/7/20 to long live and prosper ! - */ + fun AppCompatActivity.showBackButton() { this.supportActionBar?.setDisplayHomeAsUpEnabled(true) diff --git a/activity/src/main/java/com/crazylegend/activity/ActivityUtils.kt b/activity/src/main/java/com/funkymuse/activity/ActivityUtils.kt similarity index 97% rename from activity/src/main/java/com/crazylegend/activity/ActivityUtils.kt rename to activity/src/main/java/com/funkymuse/activity/ActivityUtils.kt index 5c2f0ed76..3cdb9bff7 100644 --- a/activity/src/main/java/com/crazylegend/activity/ActivityUtils.kt +++ b/activity/src/main/java/com/funkymuse/activity/ActivityUtils.kt @@ -1,4 +1,4 @@ -package com.crazylegend.activity +package com.funkymuse.activity import android.annotation.SuppressLint import android.app.Activity @@ -11,9 +11,7 @@ import android.view.View import android.view.WindowManager -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ + fun Activity.enableImmersiveMode() { val window = window diff --git a/activity/src/test/java/com/crazylegend/activity/ExampleUnitTest.kt b/activity/src/test/java/com/crazylegend/activity/ExampleUnitTest.kt deleted file mode 100644 index 8b32687b5..000000000 --- a/activity/src/test/java/com/crazylegend/activity/ExampleUnitTest.kt +++ /dev/null @@ -1,17 +0,0 @@ -package com.crazylegend.activity - -import org.junit.Test - -import org.junit.Assert.* - -/** - * Example local unit test, which will execute on the development machine (host). - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -class ExampleUnitTest { - @Test - fun addition_isCorrect() { - assertEquals(4, 2 + 2) - } -} \ No newline at end of file diff --git a/animations/build.gradle b/animations/build.gradle deleted file mode 100644 index 9fe7a4431..000000000 --- a/animations/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ -dependencies { - implementation project(path: ':view') - implementation "androidx.core:core-ktx:$coreKTX" - implementation "androidx.interpolator:interpolator:$interpolator" - implementation "androidx.transition:transition:$transition" - implementation "androidx.recyclerview:recyclerview:$recyclerview" - -} - -android { - namespace 'com.crazylegend.animations' -} \ No newline at end of file diff --git a/animations/build.gradle.kts b/animations/build.gradle.kts new file mode 100644 index 000000000..87e033bb6 --- /dev/null +++ b/animations/build.gradle.kts @@ -0,0 +1,11 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(projects.view) + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.interpolator) + implementation(libs.androidx.transition) + implementation(libs.androidx.recyclerview) +} \ No newline at end of file diff --git a/animations/src/androidTest/java/com/crazylegend/animations/ExampleInstrumentedTest.kt b/animations/src/androidTest/java/com/crazylegend/animations/ExampleInstrumentedTest.kt deleted file mode 100644 index 9f90d85df..000000000 --- a/animations/src/androidTest/java/com/crazylegend/animations/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,24 +0,0 @@ -package com.crazylegend.animations - -import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.ext.junit.runners.AndroidJUnit4 - -import org.junit.Test -import org.junit.runner.RunWith - -import org.junit.Assert.* - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("com.crazylegend.animations.test", appContext.packageName) - } -} \ No newline at end of file diff --git a/animations/src/main/AndroidManifest.xml b/animations/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/animations/src/main/AndroidManifest.xml +++ b/animations/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/animations/src/main/java/com/crazylegend/animations/AnimUtils.kt b/animations/src/main/java/com/funkymuse/animations/AnimUtils.kt similarity index 88% rename from animations/src/main/java/com/crazylegend/animations/AnimUtils.kt rename to animations/src/main/java/com/funkymuse/animations/AnimUtils.kt index b0e3dfb8e..20e535cd3 100644 --- a/animations/src/main/java/com/crazylegend/animations/AnimUtils.kt +++ b/animations/src/main/java/com/funkymuse/animations/AnimUtils.kt @@ -1,13 +1,11 @@ -package com.crazylegend.animations +package com.funkymuse.animations import android.animation.AnimatorSet import android.animation.TimeInterpolator import android.view.animation.AccelerateInterpolator -/** - * Created by hristijan on 10/7/19 to long live and prosper ! - */ + const val ANIM_translationY_CONST = "translationY" const val ANIM_translationX_CONST = "translationX" diff --git a/animations/src/main/java/com/crazylegend/animations/AnimationConsts.kt b/animations/src/main/java/com/funkymuse/animations/AnimationConsts.kt similarity index 98% rename from animations/src/main/java/com/crazylegend/animations/AnimationConsts.kt rename to animations/src/main/java/com/funkymuse/animations/AnimationConsts.kt index ef635d180..668d104af 100644 --- a/animations/src/main/java/com/crazylegend/animations/AnimationConsts.kt +++ b/animations/src/main/java/com/funkymuse/animations/AnimationConsts.kt @@ -1,4 +1,4 @@ -package com.crazylegend.animations +package com.funkymuse.animations import android.animation.Animator import android.animation.AnimatorListenerAdapter @@ -16,12 +16,10 @@ import androidx.annotation.ColorRes import androidx.interpolator.view.animation.FastOutLinearInInterpolator import androidx.interpolator.view.animation.FastOutSlowInInterpolator import androidx.interpolator.view.animation.LinearOutSlowInInterpolator -import com.crazylegend.view.dp +import com.funkymuse.view.dp import kotlin.math.hypot -/** - * Created by crazy on 1/16/20 to long live and prosper ! - */ + object AnimationConstants { const val LICKETY_SPLIT = 150L const val SHORT = 250L diff --git a/animations/src/main/java/com/crazylegend/animations/Animations.kt b/animations/src/main/java/com/funkymuse/animations/Animations.kt similarity index 75% rename from animations/src/main/java/com/crazylegend/animations/Animations.kt rename to animations/src/main/java/com/funkymuse/animations/Animations.kt index 7515a8760..444b58713 100644 --- a/animations/src/main/java/com/crazylegend/animations/Animations.kt +++ b/animations/src/main/java/com/funkymuse/animations/Animations.kt @@ -1,25 +1,29 @@ -package com.crazylegend.animations +package com.funkymuse.animations -import android.animation.* +import android.animation.Animator +import android.animation.AnimatorListenerAdapter +import android.animation.ObjectAnimator +import android.animation.ValueAnimator import android.content.Context import android.view.View import android.view.ViewAnimationUtils import android.view.ViewGroup import android.view.ViewPropertyAnimator -import android.view.animation.* -import android.widget.* +import android.view.animation.Animation +import android.view.animation.AnimationUtils +import android.view.animation.DecelerateInterpolator +import android.view.animation.TranslateAnimation +import android.widget.RelativeLayout +import android.widget.TextView import androidx.annotation.RequiresApi import androidx.annotation.StringRes -import com.crazylegend.view.invisible -import com.crazylegend.view.visible +import com.funkymuse.setofusefulkotlinextensions.animations.R +import com.funkymuse.view.invisible +import com.funkymuse.view.visible import kotlin.math.hypot import kotlin.math.max -/** - * Created by Hristijan on 2/4/19 to long live and prosper ! - */ - fun slideLeftRight(toHideView: View, fromView: View, toShowView: View, switchViews: Boolean) { if (switchViews) { @@ -27,7 +31,10 @@ fun slideLeftRight(toHideView: View, fromView: View, toShowView: View, switchVie toShowView.visibility = View.VISIBLE } val params = - RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT) + RelativeLayout.LayoutParams( + ViewGroup.LayoutParams.WRAP_CONTENT, + RelativeLayout.LayoutParams.WRAP_CONTENT + ) params.addRule(RelativeLayout.LEFT_OF, toShowView.id) val marginLayoutParams = fromView.layoutParams as ViewGroup.MarginLayoutParams marginLayoutParams.setMargins(0, 0, -20, 0) @@ -40,13 +47,17 @@ fun slideLeftRight(toHideView: View, fromView: View, toShowView: View, switchVie translateAnimation.fillAfter = true toHideView.startAnimation(translateAnimation) - val translateAnimationRight = TranslateAnimation((-fromView.width / 2).toFloat(), 0f, 0f, 0f) + val translateAnimationRight = + TranslateAnimation((-fromView.width / 2).toFloat(), 0f, 0f, 0f) translateAnimationRight.duration = 1000 translateAnimationRight.fillAfter = true toShowView.startAnimation(translateAnimationRight) } else { val params = - RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT) + RelativeLayout.LayoutParams( + ViewGroup.LayoutParams.WRAP_CONTENT, + RelativeLayout.LayoutParams.WRAP_CONTENT + ) params.addRule(RelativeLayout.LEFT_OF, toHideView.id) val marginLayoutParams = fromView.layoutParams as ViewGroup.MarginLayoutParams marginLayoutParams.setMargins(0, 0, -20, 0) @@ -59,7 +70,8 @@ fun slideLeftRight(toHideView: View, fromView: View, toShowView: View, switchVie // toShowView.setVisibility(View.GONE); - val translateAnimationRight = TranslateAnimation((-fromView.width / 2).toFloat(), 0f, 0f, 0f) + val translateAnimationRight = + TranslateAnimation((-fromView.width / 2).toFloat(), 0f, 0f, 0f) translateAnimationRight.duration = 1000 translateAnimationRight.fillAfter = true toHideView.startAnimation(translateAnimationRight) @@ -141,13 +153,13 @@ fun View.rightToLeft(context: Context) { fun View.circularReveal( - x: Int = 0, - y: Int = 0, - offset: Long = 0L, - radius: Float = -1.0f, - duration: Long = 500L, - onStart: (() -> Unit)? = null, - onFinish: (() -> Unit)? = null + x: Int = 0, + y: Int = 0, + offset: Long = 0L, + radius: Float = -1.0f, + duration: Long = 500L, + onStart: (() -> Unit)? = null, + onFinish: (() -> Unit)? = null ) { if (!isAttachedToWindow) { onStart?.invoke() @@ -158,8 +170,8 @@ fun View.circularReveal( val r = if (radius >= 0) radius else max( - hypot(x.toDouble(), y.toDouble()), - hypot((width - x.toDouble()), (height - y.toDouble())) + hypot(x.toDouble(), y.toDouble()), + hypot((width - x.toDouble()), (height - y.toDouble())) ).toFloat() val anim = ViewAnimationUtils.createCircularReveal(this, x, y, 0f, r).setDuration(duration) @@ -181,13 +193,13 @@ fun View.circularReveal( fun View.circularHide( - x: Int = 0, - y: Int = 0, - offset: Long = 0L, - radius: Float = -1.0f, - duration: Long = 500L, - onStart: (() -> Unit)? = null, - onFinish: (() -> Unit)? = null + x: Int = 0, + y: Int = 0, + offset: Long = 0L, + radius: Float = -1.0f, + duration: Long = 500L, + onStart: (() -> Unit)? = null, + onFinish: (() -> Unit)? = null ) { if (!isAttachedToWindow) { onStart?.invoke() @@ -197,7 +209,12 @@ fun View.circularHide( } val r = if (radius >= 0) radius - else hypot(x.toDouble(), y.toDouble()).coerceAtLeast(hypot((width - x.toDouble()), (height - y.toDouble()))).toFloat() + else hypot(x.toDouble(), y.toDouble()).coerceAtLeast( + hypot( + (width - x.toDouble()), + (height - y.toDouble()) + ) + ).toFloat() val anim = ViewAnimationUtils.createCircularReveal(this, x, y, r, 0f).setDuration(duration) anim.startDelay = offset @@ -215,10 +232,10 @@ fun View.circularHide( } fun View.fadeIn( - offset: Long = 0L, - duration: Long = 200L, - onStart: (() -> Unit)? = null, - onFinish: (() -> Unit)? = null + offset: Long = 0L, + duration: Long = 200L, + onStart: (() -> Unit)? = null, + onFinish: (() -> Unit)? = null ) { if (!isAttachedToWindow) { onStart?.invoke() @@ -241,10 +258,10 @@ fun View.fadeIn( } fun View.fadeOut( - offset: Long = 0L, - duration: Long = 200L, - onStart: (() -> Unit)? = null, - onFinish: (() -> Unit)? = null + offset: Long = 0L, + duration: Long = 200L, + onStart: (() -> Unit)? = null, + onFinish: (() -> Unit)? = null ) { if (!isAttachedToWindow) { onStart?.invoke() @@ -276,8 +293,12 @@ fun TextView.setTextWithFade(text: String, duration: Long = 200, onFinish: (() - }) } -fun TextView.setTextWithFade(@StringRes textId: Int, duration: Long = 200, onFinish: (() -> Unit)? = null) = - setTextWithFade(context.getString(textId), duration, onFinish) +fun TextView.setTextWithFade( + @StringRes textId: Int, + duration: Long = 200, + onFinish: (() -> Unit)? = null +) = + setTextWithFade(context.getString(textId), duration, onFinish) fun ViewPropertyAnimator.scaleXY(value: Float) = scaleX(value).scaleY(value) @@ -294,10 +315,10 @@ fun Int.animateTo(end: Int, duration: Long = 400, func: (value: Int) -> Unit) { } fun Animator.addListener( - onEnd: (Animator) -> Unit = {}, - onStart: (Animator) -> Unit = {}, - onCancel: (Animator) -> Unit = {}, - onRepeat: (Animator) -> Unit = {} + onEnd: (Animator) -> Unit = {}, + onStart: (Animator) -> Unit = {}, + onCancel: (Animator) -> Unit = {}, + onRepeat: (Animator) -> Unit = {} ) { addListener(object : Animator.AnimatorListener { override fun onAnimationRepeat(animator: Animator) { @@ -336,8 +357,8 @@ fun Animator.onRepeat(onRepeat: (Animator) -> Unit) { fun Animator.addPauseListener( - onResume: (Animator) -> Unit = {}, - onPause: (Animator) -> Unit = {} + onResume: (Animator) -> Unit = {}, + onPause: (Animator) -> Unit = {} ): Animator.AnimatorPauseListener { val listener = object : Animator.AnimatorPauseListener { override fun onAnimationPause(animator: Animator) { @@ -362,7 +383,12 @@ fun Animator.onPause(onPause: (Animator) -> Unit) { addPauseListener(onPause = onPause) } -fun View.animateTranslationX(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0) { +fun View.animateTranslationX( + values: FloatArray, + duration: Long = 300, + repeatCount: Int = 0, + repeatMode: Int = 0 +) { val animator = ObjectAnimator.ofFloat(this, View.TRANSLATION_X, *values) animator.repeatCount = repeatCount animator.duration = duration @@ -372,7 +398,12 @@ fun View.animateTranslationX(values: FloatArray, duration: Long = 300, repeatCou animator.start() } -fun View.animateTranslationY(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0) { +fun View.animateTranslationY( + values: FloatArray, + duration: Long = 300, + repeatCount: Int = 0, + repeatMode: Int = 0 +) { val animator = ObjectAnimator.ofFloat(this, View.TRANSLATION_Y, *values) animator.repeatCount = repeatCount animator.duration = duration @@ -383,7 +414,12 @@ fun View.animateTranslationY(values: FloatArray, duration: Long = 300, repeatCou } -fun View.animateTranslationZ(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0) { +fun View.animateTranslationZ( + values: FloatArray, + duration: Long = 300, + repeatCount: Int = 0, + repeatMode: Int = 0 +) { val animator = ObjectAnimator.ofFloat(this, View.TRANSLATION_Z, *values) animator.repeatCount = repeatCount animator.duration = duration @@ -393,7 +429,12 @@ fun View.animateTranslationZ(values: FloatArray, duration: Long = 300, repeatCou animator.start() } -fun View.animateScaleX(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0) { +fun View.animateScaleX( + values: FloatArray, + duration: Long = 300, + repeatCount: Int = 0, + repeatMode: Int = 0 +) { val animator = ObjectAnimator.ofFloat(this, View.SCALE_X, *values) animator.repeatCount = repeatCount animator.duration = duration @@ -403,7 +444,12 @@ fun View.animateScaleX(values: FloatArray, duration: Long = 300, repeatCount: In animator.start() } -fun View.animateScaleY(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0) { +fun View.animateScaleY( + values: FloatArray, + duration: Long = 300, + repeatCount: Int = 0, + repeatMode: Int = 0 +) { val animator = ObjectAnimator.ofFloat(this, View.SCALE_Y, *values) animator.repeatCount = repeatCount animator.duration = duration @@ -413,7 +459,12 @@ fun View.animateScaleY(values: FloatArray, duration: Long = 300, repeatCount: In animator.start() } -fun View.animateAlpha(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0) { +fun View.animateAlpha( + values: FloatArray, + duration: Long = 300, + repeatCount: Int = 0, + repeatMode: Int = 0 +) { val animator = ObjectAnimator.ofFloat(this, View.ALPHA, *values) animator.repeatCount = repeatCount animator.duration = duration @@ -423,7 +474,12 @@ fun View.animateAlpha(values: FloatArray, duration: Long = 300, repeatCount: Int animator.start() } -fun View.animateRotation(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0) { +fun View.animateRotation( + values: FloatArray, + duration: Long = 300, + repeatCount: Int = 0, + repeatMode: Int = 0 +) { val animator = ObjectAnimator.ofFloat(this, View.ROTATION, *values) animator.repeatCount = repeatCount animator.duration = duration @@ -433,7 +489,12 @@ fun View.animateRotation(values: FloatArray, duration: Long = 300, repeatCount: animator.start() } -fun View.animateRotationX(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0) { +fun View.animateRotationX( + values: FloatArray, + duration: Long = 300, + repeatCount: Int = 0, + repeatMode: Int = 0 +) { val animator = ObjectAnimator.ofFloat(this, View.ROTATION_X, *values) animator.repeatCount = repeatCount animator.duration = duration @@ -443,7 +504,12 @@ fun View.animateRotationX(values: FloatArray, duration: Long = 300, repeatCount: animator.start() } -fun View.animateRotationY(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0) { +fun View.animateRotationY( + values: FloatArray, + duration: Long = 300, + repeatCount: Int = 0, + repeatMode: Int = 0 +) { val animator = ObjectAnimator.ofFloat(this, View.ROTATION_Y, *values) animator.repeatCount = repeatCount animator.duration = duration @@ -453,7 +519,12 @@ fun View.animateRotationY(values: FloatArray, duration: Long = 300, repeatCount: animator.start() } -fun View.animateX(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0) { +fun View.animateX( + values: FloatArray, + duration: Long = 300, + repeatCount: Int = 0, + repeatMode: Int = 0 +) { val animator = ObjectAnimator.ofFloat(this, View.X, *values) animator.repeatCount = repeatCount animator.duration = duration @@ -463,7 +534,12 @@ fun View.animateX(values: FloatArray, duration: Long = 300, repeatCount: Int = 0 animator.start() } -fun View.animateY(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0) { +fun View.animateY( + values: FloatArray, + duration: Long = 300, + repeatCount: Int = 0, + repeatMode: Int = 0 +) { val animator = ObjectAnimator.ofFloat(this, View.Y, *values) animator.repeatCount = repeatCount animator.duration = duration @@ -474,7 +550,12 @@ fun View.animateY(values: FloatArray, duration: Long = 300, repeatCount: Int = 0 } -fun View.animateZ(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0) { +fun View.animateZ( + values: FloatArray, + duration: Long = 300, + repeatCount: Int = 0, + repeatMode: Int = 0 +) { val animator = ObjectAnimator.ofFloat(this, View.Z, *values) animator.repeatCount = repeatCount animator.duration = duration diff --git a/animations/src/main/java/com/crazylegend/animations/Animations2.kt b/animations/src/main/java/com/funkymuse/animations/Animations2.kt similarity index 98% rename from animations/src/main/java/com/crazylegend/animations/Animations2.kt rename to animations/src/main/java/com/funkymuse/animations/Animations2.kt index 64f80b7e1..8145550aa 100644 --- a/animations/src/main/java/com/crazylegend/animations/Animations2.kt +++ b/animations/src/main/java/com/funkymuse/animations/Animations2.kt @@ -1,11 +1,14 @@ -package com.crazylegend.animations - -import android.animation.* -import android.annotation.SuppressLint +package com.funkymuse.animations + +import android.animation.Animator +import android.animation.AnimatorListenerAdapter +import android.animation.AnimatorSet +import android.animation.ArgbEvaluator +import android.animation.ObjectAnimator +import android.animation.ValueAnimator import android.content.res.Resources import android.graphics.Point import android.graphics.drawable.ColorDrawable -import android.os.Build import android.transition.Scene import android.transition.TransitionManager import android.transition.TransitionSet @@ -17,22 +20,17 @@ import android.view.animation.AccelerateDecelerateInterpolator import android.view.animation.DecelerateInterpolator import android.view.animation.Interpolator import android.view.animation.LinearInterpolator -import android.widget.AbsListView import android.widget.EdgeEffect -import android.widget.ScrollView import androidx.annotation.ColorInt import androidx.core.content.ContextCompat import androidx.core.view.isVisible import androidx.core.widget.NestedScrollView -import com.crazylegend.view.afterLatestMeasured -import com.crazylegend.view.gone -import com.crazylegend.view.invisible -import com.crazylegend.view.visible +import com.funkymuse.view.afterLatestMeasured +import com.funkymuse.view.gone +import com.funkymuse.view.invisible +import com.funkymuse.view.visible import kotlin.math.hypot -/** - * Created by funkymuse on 5/26/21 to long live and prosper ! - */ fun View.translationXAnimator(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0): Animator { val animator = ObjectAnimator.ofFloat(this, View.TRANSLATION_X, *values) diff --git a/animations/src/main/java/com/crazylegend/animations/AttentionAnim.kt b/animations/src/main/java/com/funkymuse/animations/AttentionAnim.kt similarity index 96% rename from animations/src/main/java/com/crazylegend/animations/AttentionAnim.kt rename to animations/src/main/java/com/funkymuse/animations/AttentionAnim.kt index 9562b3b47..0891da3e7 100644 --- a/animations/src/main/java/com/crazylegend/animations/AttentionAnim.kt +++ b/animations/src/main/java/com/funkymuse/animations/AttentionAnim.kt @@ -1,13 +1,9 @@ -package com.crazylegend.animations +package com.funkymuse.animations import android.animation.AnimatorSet import android.animation.ObjectAnimator import android.view.View -import com.crazylegend.animations.* -/** - * Created by crazy on 10/6/19 to long live and prosper ! - */ fun View.attentionBounce(): AnimatorSet { val animatorSet = AnimatorSet() diff --git a/animations/src/main/java/com/crazylegend/animations/BounceAnim.kt b/animations/src/main/java/com/funkymuse/animations/BounceAnim.kt similarity index 94% rename from animations/src/main/java/com/crazylegend/animations/BounceAnim.kt rename to animations/src/main/java/com/funkymuse/animations/BounceAnim.kt index d00d41053..f0e2ee2db 100644 --- a/animations/src/main/java/com/crazylegend/animations/BounceAnim.kt +++ b/animations/src/main/java/com/funkymuse/animations/BounceAnim.kt @@ -1,13 +1,9 @@ -package com.crazylegend.animations +package com.funkymuse.animations import android.animation.AnimatorSet import android.animation.ObjectAnimator import android.view.View -import com.crazylegend.animations.* -/** - * Created by crazy on 10/6/19 to long live and prosper ! - */ fun View.bounceIn(): AnimatorSet { val animatorSet = AnimatorSet() diff --git a/animations/src/main/java/com/crazylegend/animations/FadeAnim.kt b/animations/src/main/java/com/funkymuse/animations/FadeAnim.kt similarity index 92% rename from animations/src/main/java/com/crazylegend/animations/FadeAnim.kt rename to animations/src/main/java/com/funkymuse/animations/FadeAnim.kt index 8f9ab7aed..de3f52eef 100644 --- a/animations/src/main/java/com/crazylegend/animations/FadeAnim.kt +++ b/animations/src/main/java/com/funkymuse/animations/FadeAnim.kt @@ -1,17 +1,10 @@ -package com.crazylegend.animations +package com.funkymuse.animations import android.animation.AnimatorSet import android.animation.ObjectAnimator import android.view.View -import com.crazylegend.animations.ANIM_alpha_CONST -import com.crazylegend.animations.ANIM_translationX_CONST -import com.crazylegend.animations.ANIM_translationY_CONST -/** - * Created by crazy on 10/6/19 to long live and prosper ! - */ - fun View.fadeIn(): AnimatorSet { val animatorSet = AnimatorSet() diff --git a/animations/src/main/java/com/crazylegend/animations/FlipAnim.kt b/animations/src/main/java/com/funkymuse/animations/FlipAnim.kt similarity index 84% rename from animations/src/main/java/com/crazylegend/animations/FlipAnim.kt rename to animations/src/main/java/com/funkymuse/animations/FlipAnim.kt index 72269b434..c9b093a49 100644 --- a/animations/src/main/java/com/crazylegend/animations/FlipAnim.kt +++ b/animations/src/main/java/com/funkymuse/animations/FlipAnim.kt @@ -1,15 +1,9 @@ -package com.crazylegend.animations +package com.funkymuse.animations import android.animation.AnimatorSet import android.animation.ObjectAnimator import android.view.View -import com.crazylegend.animations.ANIM_alpha_CONST -import com.crazylegend.animations.ANIM_rotationX_CONST -import com.crazylegend.animations.ANIM_rotationY_CONST -/** - * Created by crazy on 10/6/19 to long live and prosper ! - */ fun View.flipInX(): AnimatorSet { val animatorSet = AnimatorSet() diff --git a/animations/src/main/java/com/crazylegend/animations/RotateAnim.kt b/animations/src/main/java/com/funkymuse/animations/RotateAnim.kt similarity index 94% rename from animations/src/main/java/com/crazylegend/animations/RotateAnim.kt rename to animations/src/main/java/com/funkymuse/animations/RotateAnim.kt index 8d9403930..19cf8222a 100644 --- a/animations/src/main/java/com/crazylegend/animations/RotateAnim.kt +++ b/animations/src/main/java/com/funkymuse/animations/RotateAnim.kt @@ -1,16 +1,8 @@ -package com.crazylegend.animations +package com.funkymuse.animations import android.animation.AnimatorSet import android.animation.ObjectAnimator import android.view.View -import com.crazylegend.animations.ANIM_alpha_CONST -import com.crazylegend.animations.ANIM_pivotX_CONST -import com.crazylegend.animations.ANIM_pivotY_CONST -import com.crazylegend.animations.ANIM_rotation_CONST - -/** - * Created by crazy on 10/6/19 to long live and prosper ! - */ fun View.rotateIn(): AnimatorSet { diff --git a/animations/src/main/java/com/crazylegend/animations/SlideAnim.kt b/animations/src/main/java/com/funkymuse/animations/SlideAnim.kt similarity index 92% rename from animations/src/main/java/com/crazylegend/animations/SlideAnim.kt rename to animations/src/main/java/com/funkymuse/animations/SlideAnim.kt index 1096a303a..49c175e43 100644 --- a/animations/src/main/java/com/crazylegend/animations/SlideAnim.kt +++ b/animations/src/main/java/com/funkymuse/animations/SlideAnim.kt @@ -1,18 +1,11 @@ -package com.crazylegend.animations +package com.funkymuse.animations import android.animation.AnimatorSet import android.animation.ObjectAnimator import android.view.View import android.view.ViewGroup -import com.crazylegend.animations.ANIM_alpha_CONST -import com.crazylegend.animations.ANIM_translationX_CONST -import com.crazylegend.animations.ANIM_translationY_CONST -/** - * Created by crazy on 10/6/19 to long live and prosper ! - */ - fun View.slideInDown(): AnimatorSet { val animatorSet = AnimatorSet() val distance = (top + height).toFloat() diff --git a/animations/src/main/java/com/crazylegend/animations/ZoomAnim.kt b/animations/src/main/java/com/funkymuse/animations/ZoomAnim.kt similarity index 98% rename from animations/src/main/java/com/crazylegend/animations/ZoomAnim.kt rename to animations/src/main/java/com/funkymuse/animations/ZoomAnim.kt index 6fdb405c6..90e296038 100644 --- a/animations/src/main/java/com/crazylegend/animations/ZoomAnim.kt +++ b/animations/src/main/java/com/funkymuse/animations/ZoomAnim.kt @@ -1,13 +1,11 @@ -package com.crazylegend.animations +package com.funkymuse.animations import android.animation.AnimatorSet import android.animation.ObjectAnimator import android.view.View import android.view.ViewGroup -/** - * Created by crazy on 10/6/19 to long live and prosper ! - */ + fun View.zoomIn(): AnimatorSet { val animatorSet = AnimatorSet() diff --git a/animations/src/main/java/com/crazylegend/animations/animators/ProgressAnimator.kt b/animations/src/main/java/com/funkymuse/animations/animators/ProgressAnimator.kt similarity index 95% rename from animations/src/main/java/com/crazylegend/animations/animators/ProgressAnimator.kt rename to animations/src/main/java/com/funkymuse/animations/animators/ProgressAnimator.kt index 195a17e98..396d31df2 100644 --- a/animations/src/main/java/com/crazylegend/animations/animators/ProgressAnimator.kt +++ b/animations/src/main/java/com/funkymuse/animations/animators/ProgressAnimator.kt @@ -1,4 +1,4 @@ -package com.crazylegend.animations.animators +package com.funkymuse.animations.animators import android.animation.Animator import android.animation.AnimatorListenerAdapter @@ -6,9 +6,7 @@ import android.animation.ValueAnimator import android.view.animation.Interpolator -/** - * Created by hristijan on 3/5/19 to long live and prosper ! - */ + class ProgressAnimator private constructor(private vararg val values: Float) { companion object { diff --git a/animations/src/main/java/com/crazylegend/animations/transition/DissolveTransition.kt b/animations/src/main/java/com/funkymuse/animations/transition/DissolveTransition.kt similarity index 98% rename from animations/src/main/java/com/crazylegend/animations/transition/DissolveTransition.kt rename to animations/src/main/java/com/funkymuse/animations/transition/DissolveTransition.kt index 169e896d6..f8a690090 100644 --- a/animations/src/main/java/com/crazylegend/animations/transition/DissolveTransition.kt +++ b/animations/src/main/java/com/funkymuse/animations/transition/DissolveTransition.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.crazylegend.animations.transition +package com.funkymuse.animations.transition import android.animation.Animator import android.animation.ObjectAnimator diff --git a/animations/src/main/java/com/crazylegend/animations/transition/StaggerTransition.kt b/animations/src/main/java/com/funkymuse/animations/transition/StaggerTransition.kt similarity index 93% rename from animations/src/main/java/com/crazylegend/animations/transition/StaggerTransition.kt rename to animations/src/main/java/com/funkymuse/animations/transition/StaggerTransition.kt index 18def3932..c2e0f2516 100644 --- a/animations/src/main/java/com/crazylegend/animations/transition/StaggerTransition.kt +++ b/animations/src/main/java/com/funkymuse/animations/transition/StaggerTransition.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.crazylegend.animations.transition +package com.funkymuse.animations.transition import android.animation.Animator import android.animation.AnimatorSet @@ -27,8 +27,8 @@ import androidx.transition.Fade import androidx.transition.SidePropagation import androidx.transition.TransitionManager import androidx.transition.TransitionValues -import com.crazylegend.animations.transition.interpolators.LINEAR_OUT_SLOW_IN -import com.crazylegend.animations.transition.utils.LARGE_EXPAND_DURATION +import com.funkymuse.animations.transition.interpolators.LINEAR_OUT_SLOW_IN +import com.funkymuse.animations.transition.utils.LARGE_EXPAND_DURATION /** * Transition for stagger effect. diff --git a/animations/src/main/java/com/crazylegend/animations/transition/TransitionExtensions.kt b/animations/src/main/java/com/funkymuse/animations/transition/TransitionExtensions.kt similarity index 96% rename from animations/src/main/java/com/crazylegend/animations/transition/TransitionExtensions.kt rename to animations/src/main/java/com/funkymuse/animations/transition/TransitionExtensions.kt index 42a53d769..b88eb8267 100644 --- a/animations/src/main/java/com/crazylegend/animations/transition/TransitionExtensions.kt +++ b/animations/src/main/java/com/funkymuse/animations/transition/TransitionExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.animations.transition +package com.funkymuse.animations.transition import android.animation.ValueAnimator import android.app.Activity @@ -15,12 +15,10 @@ import androidx.transition.AutoTransition import androidx.transition.Transition import androidx.transition.TransitionInflater import androidx.transition.TransitionManager -import com.crazylegend.view.scaleXY +import com.funkymuse.view.scaleXY + -/** - * Created by hristijan on 3/5/19 to long live and prosper ! - */ fun Context.transition(enterTransition: Int, exitTransition: Int) { (this as Activity).overridePendingTransition(enterTransition, exitTransition) diff --git a/animations/src/main/java/com/crazylegend/animations/transition/interpolators/Interpolators.kt b/animations/src/main/java/com/funkymuse/animations/transition/interpolators/Interpolators.kt similarity index 89% rename from animations/src/main/java/com/crazylegend/animations/transition/interpolators/Interpolators.kt rename to animations/src/main/java/com/funkymuse/animations/transition/interpolators/Interpolators.kt index 076f6f176..b54f7c578 100644 --- a/animations/src/main/java/com/crazylegend/animations/transition/interpolators/Interpolators.kt +++ b/animations/src/main/java/com/funkymuse/animations/transition/interpolators/Interpolators.kt @@ -1,14 +1,9 @@ -package com.crazylegend.animations.transition.interpolators +package com.funkymuse.animations.transition.interpolators import android.animation.TimeInterpolator import androidx.core.view.animation.PathInterpolatorCompat -/** - * Created by crazy on 3/27/20 to long live and prosper ! - */ - - /** * Standard easing. * diff --git a/animations/src/main/java/com/crazylegend/animations/transition/interpolators/SegmentInterpolator.kt b/animations/src/main/java/com/funkymuse/animations/transition/interpolators/SegmentInterpolator.kt similarity index 95% rename from animations/src/main/java/com/crazylegend/animations/transition/interpolators/SegmentInterpolator.kt rename to animations/src/main/java/com/funkymuse/animations/transition/interpolators/SegmentInterpolator.kt index c03066ab9..692594963 100644 --- a/animations/src/main/java/com/crazylegend/animations/transition/interpolators/SegmentInterpolator.kt +++ b/animations/src/main/java/com/funkymuse/animations/transition/interpolators/SegmentInterpolator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.crazylegend.animations.transition.interpolators +package com.funkymuse.animations.transition.interpolators import android.animation.TimeInterpolator diff --git a/animations/src/main/java/com/crazylegend/animations/transition/utils/Durations.kt b/animations/src/main/java/com/funkymuse/animations/transition/utils/Durations.kt similarity index 94% rename from animations/src/main/java/com/crazylegend/animations/transition/utils/Durations.kt rename to animations/src/main/java/com/funkymuse/animations/transition/utils/Durations.kt index 3c0c1a7f0..6b6fa4fb4 100644 --- a/animations/src/main/java/com/crazylegend/animations/transition/utils/Durations.kt +++ b/animations/src/main/java/com/funkymuse/animations/transition/utils/Durations.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.crazylegend.animations.transition.utils +package com.funkymuse.animations.transition.utils // Animation durations. // See https://material.io/design/motion/speed.html#duration for the detail. diff --git a/animations/src/main/java/com/crazylegend/animations/transition/utils/SequentialTransitionSet.kt b/animations/src/main/java/com/funkymuse/animations/transition/utils/SequentialTransitionSet.kt similarity index 96% rename from animations/src/main/java/com/crazylegend/animations/transition/utils/SequentialTransitionSet.kt rename to animations/src/main/java/com/funkymuse/animations/transition/utils/SequentialTransitionSet.kt index 3b67dc93e..5424ef9b2 100644 --- a/animations/src/main/java/com/crazylegend/animations/transition/utils/SequentialTransitionSet.kt +++ b/animations/src/main/java/com/funkymuse/animations/transition/utils/SequentialTransitionSet.kt @@ -14,12 +14,12 @@ * limitations under the License. */ -package com.crazylegend.animations.transition.utils +package com.funkymuse.animations.transition.utils import android.animation.TimeInterpolator import androidx.transition.Transition import androidx.transition.TransitionSet -import com.crazylegend.animations.transition.interpolators.SegmentInterpolator +import com.funkymuse.animations.transition.interpolators.SegmentInterpolator /** * Runs multiple [Transition]s sequentially. diff --git a/animations/src/main/java/com/crazylegend/animations/transition/utils/TransitionUtils.kt b/animations/src/main/java/com/funkymuse/animations/transition/utils/TransitionUtils.kt similarity index 90% rename from animations/src/main/java/com/crazylegend/animations/transition/utils/TransitionUtils.kt rename to animations/src/main/java/com/funkymuse/animations/transition/utils/TransitionUtils.kt index 57653d1d4..c27f65f10 100644 --- a/animations/src/main/java/com/crazylegend/animations/transition/utils/TransitionUtils.kt +++ b/animations/src/main/java/com/funkymuse/animations/transition/utils/TransitionUtils.kt @@ -1,17 +1,12 @@ -package com.crazylegend.animations.transition.utils +package com.funkymuse.animations.transition.utils import androidx.recyclerview.widget.RecyclerView import androidx.transition.ChangeBounds import androidx.transition.Fade import androidx.transition.Transition import androidx.transition.TransitionSet -import com.crazylegend.animations.transition.interpolators.FAST_OUT_SLOW_IN -import com.crazylegend.animations.transition.onTransitionEnd - - -/** - * Created by crazy on 3/27/20 to long live and prosper ! - */ +import com.funkymuse.animations.transition.interpolators.FAST_OUT_SLOW_IN +import com.funkymuse.animations.transition.onTransitionEnd /** * Usage diff --git a/animations/src/test/java/com/crazylegend/animations/ExampleUnitTest.kt b/animations/src/test/java/com/crazylegend/animations/ExampleUnitTest.kt deleted file mode 100644 index 2d42d5cee..000000000 --- a/animations/src/test/java/com/crazylegend/animations/ExampleUnitTest.kt +++ /dev/null @@ -1,17 +0,0 @@ -package com.crazylegend.animations - -import org.junit.Test - -import org.junit.Assert.* - -/** - * Example local unit test, which will execute on the development machine (host). - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -class ExampleUnitTest { - @Test - fun addition_isCorrect() { - assertEquals(4, 2 + 2) - } -} \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100644 index f4d23d37d..000000000 --- a/app/build.gradle +++ /dev/null @@ -1,134 +0,0 @@ -android { - defaultConfig { - applicationId "com.crazylegend.setofusefulkotlinextensions" - vectorDrawables.useSupportLibrary = true - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - - debug { - minifyEnabled false - shrinkResources false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - packagingOptions { - resources { - excludes += ['META-INF/LICENSE.txt', 'META-INF/NOTICE.txt', 'META-INF/LICENSE'] - } - } - - - kapt { - correctErrorTypes = true - useBuildCache = true - } - - buildFeatures { - viewBinding = true - } - namespace 'com.crazylegend.setofusefulkotlinextensions' -} - -dependencies { - implementation project(path: ':kotlinextensions') - implementation project(path: ':security') - implementation project(path: ':retrofit') - implementation project(path: ':coroutines') - implementation project(path: ':rx') - implementation project(path: ':viewbinding') - implementation project(path: ':customviews') - implementation project(path: ':recyclerview') - implementation project(path: ':biometrics') - implementation project(path: ':internetDetector') - implementation project(path: ':activity') - implementation project(path: ':context') - implementation project(path: ':common') - implementation project(path: ':animations') - implementation project(path: ':view') - implementation project(path: ':collections') - implementation project(path: ':lifecycle') - implementation project(path: ':fragment') - - - testImplementation "junit:junit:$junitVersion" - - //language features - implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" - - //live data - implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:$lifecycle" - implementation "androidx.lifecycle:lifecycle-reactivestreams:$lifecycle" - implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle" - implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle" - implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle" - implementation "androidx.lifecycle:lifecycle-service:$lifecycle" - implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle" - implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:$lifecycle" - implementation "androidx.lifecycle:lifecycle-service:$lifecycle" - implementation "androidx.lifecycle:lifecycle-process:$lifecycle" - - implementation "com.squareup.retrofit2:converter-moshi:$retrofit" - implementation "com.squareup.retrofit2:retrofit:$retrofit" - implementation "com.squareup.retrofit2:adapter-rxjava3:$retrofit" - implementation "com.squareup.retrofit2:converter-gson:$retrofit" - implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0' - - //joda time - implementation "net.danlew:android.joda:$joda" - - - //moshi - implementation "com.squareup.moshi:moshi-kotlin:$moshi" - kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshi" - - - // glide - implementation "com.github.bumptech.glide:glide:$glide" - kapt "com.github.bumptech.glide:compiler:$glide" - - //ui - implementation 'androidx.vectordrawable:vectordrawable:1.1.0' - - implementation "androidx.constraintlayout:constraintlayout:$constraint_layout" - - //nav - implementation "androidx.navigation:navigation-fragment-ktx:$nav_version" - implementation "androidx.navigation:navigation-ui-ktx:$nav_version" - - //coroutines - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines" - - //auth - implementation "androidx.biometric:biometric:$biometrics" - - //util - implementation "androidx.exifinterface:exifinterface:$exifinterface" - - //core - implementation "androidx.preference:preference:$preference" - implementation "androidx.palette:palette-ktx:$palette" - - implementation "androidx.core:core-ktx:$coreKTX" - - - //android apis - implementation "androidx.viewpager2:viewpager2:$viewPager" - implementation "com.google.android.material:material:$material" - implementation "androidx.swiperefreshlayout:swiperefreshlayout:$swipeRefresh" - implementation "androidx.appcompat:appcompat:$appCompat" - implementation "androidx.documentfile:documentfile:$documentFile" - - implementation "androidx.fragment:fragment-ktx:$fragment" - implementation "androidx.activity:activity-ktx:$activity" - - //room - implementation "androidx.room:room-ktx:$room_version" - kapt "androidx.room:room-compiler:$room_version" - - -} \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 000000000..cc11b0590 --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,108 @@ +plugins { + id(libs.plugins.convention.app.get().pluginId) +} + +android { + packaging { + resources { + excludes.addAll(setOf("META-INF/LICENSE.txt", "META-INF/NOTICE.txt", "META-INF/LICENSE")) + } + } + buildFeatures { + viewBinding = true + } +} + +dependencies { + implementation(projects.kotlinextensions) + implementation(projects.security) + implementation(projects.retrofit) + implementation(projects.coroutines) + implementation(projects.rx) + implementation(projects.viewbinding) + implementation(projects.customviews) + implementation(projects.recyclerview) + implementation(projects.biometrics) + implementation(projects.internetDetector) + implementation(projects.activity) + implementation(projects.context) + implementation(projects.common) + implementation(projects.animations) + implementation(projects.view) + implementation(projects.collections) + implementation(projects.lifecycle) + implementation(projects.fragment) + + testImplementation(libs.junit) + + implementation(libs.converter.moshi) + implementation(libs.retrofit) + implementation(libs.adapter.rxjava3) + implementation(libs.converter.gson) + implementation(libs.logging.interceptor) + + //joda time + implementation(libs.android.joda) + + //moshi + implementation(libs.moshi.kotlin) + ksp(libs.moshi.kotlin.codegen) + + + // glide + implementation(libs.glide) + ksp(libs.glide.compiler) + + //ui + implementation(libs.androidx.vectordrawable) + + implementation(libs.androidx.constraintlayout) + + //nav + implementation(libs.androidx.navigation.fragment.ktx) + implementation(libs.androidx.navigation.ui.ktx) + + //coroutines + implementation(libs.kotlinx.coroutines.android) + implementation(libs.kotlinx.coroutines.core) + + //auth + implementation(libs.androidx.biometric) + + //util + implementation(libs.androidx.exifinterface) + + //core + implementation(libs.androidx.preference) + implementation(libs.androidx.palette.ktx) + + implementation(libs.androidx.core.ktx) + + + //android apis + implementation(libs.androidx.viewpager2) + implementation(libs.material) + implementation(libs.androidx.swiperefreshlayout) + implementation(libs.androidx.appcompat) + implementation(libs.androidx.documentfile) + + implementation(libs.androidx.fragment.ktx) + implementation(libs.androidx.activity.ktx) + + //room + implementation(libs.androidx.room.ktx) + ksp(libs.androidx.room.compiler) + + testImplementation(libs.junit) + testImplementation(libs.hamcrest.all) + testImplementation(libs.androidx.junit.ktx) + testImplementation(libs.androidx.test.core.ktx) + testImplementation(libs.robolectric) + testImplementation(libs.androidx.core.testing) + testImplementation(libs.kotlinx.coroutines.test) + + // AndroidX Test - Instrumented testing + androidTestImplementation(libs.androidx.junit) + androidTestImplementation(libs.androidx.espresso.core) + +} \ No newline at end of file diff --git a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/TestApi.kt b/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/TestApi.kt deleted file mode 100644 index 39dd99788..000000000 --- a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/TestApi.kt +++ /dev/null @@ -1,20 +0,0 @@ -package com.crazylegend.setofusefulkotlinextensions - -import com.crazylegend.retrofit.apiresult.ApiResult -import com.crazylegend.setofusefulkotlinextensions.adapter.TestModel -import retrofit2.http.GET - - -/** - * Created by hristijan on 8/26/19 to long live and prosper ! - */ -interface TestApi { - - - @GET("posts") - suspend fun getPosts(): ApiResult> - - companion object { - const val API = "https://jsonplaceholder.typicode.com/" - } -} \ No newline at end of file diff --git a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/db/TestRepo.kt b/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/db/TestRepo.kt deleted file mode 100644 index 7b805a6a1..000000000 --- a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/db/TestRepo.kt +++ /dev/null @@ -1,26 +0,0 @@ -package com.crazylegend.setofusefulkotlinextensions.db - -import android.content.Context -import com.crazylegend.kotlinextensions.log.debug -import com.crazylegend.setofusefulkotlinextensions.adapter.TestModel - -/** - * Created by crazy on 1/14/21 to long live and prosper ! - * This is for demonstration purposes, do not do this in real app scenario - */ -class TestRepo(context: Context) : TestDao { - - private val dao = TestDatabase.getInstance(context).dao() - - override fun getAllFlow() = dao.getAllFlow() - - override suspend fun insertList(list: List) { - debug { "DATABASE insertList OPERATION" } - dao.insertList(list) - } - - override suspend fun getAll(): List { - debug { "DATABASE getAll OPERATION" } - return dao.getAll() - } -} \ No newline at end of file diff --git a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/nav/DetailFragment.kt b/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/nav/DetailFragment.kt deleted file mode 100644 index 86fa1305e..000000000 --- a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/nav/DetailFragment.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.crazylegend.setofusefulkotlinextensions.nav - -import androidx.fragment.app.Fragment -import com.crazylegend.setofusefulkotlinextensions.R - -/** - * Created by Hristijan, date 6/16/21 - */ -class DetailFragment : Fragment(R.layout.fragment_test) { - -} \ No newline at end of file diff --git a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/AppLevel.kt b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/AppLevel.kt similarity index 52% rename from app/src/main/java/com/crazylegend/setofusefulkotlinextensions/AppLevel.kt rename to app/src/main/java/com/funkymuse/setofusefulkotlinextensions/AppLevel.kt index 00fbb1512..172788585 100644 --- a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/AppLevel.kt +++ b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/AppLevel.kt @@ -1,11 +1,8 @@ -package com.crazylegend.setofusefulkotlinextensions +package com.funkymuse.setofusefulkotlinextensions import android.app.Application -/** - * Created by crazy on 3/27/20 to long live and prosper ! - */ class AppLevel : Application() { override fun onCreate() { super.onCreate() diff --git a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/DragAndDropActivity.kt b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/DragAndDropActivity.kt similarity index 70% rename from app/src/main/java/com/crazylegend/setofusefulkotlinextensions/DragAndDropActivity.kt rename to app/src/main/java/com/funkymuse/setofusefulkotlinextensions/DragAndDropActivity.kt index 19a8d512b..ec56cef6a 100644 --- a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/DragAndDropActivity.kt +++ b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/DragAndDropActivity.kt @@ -1,15 +1,13 @@ -package com.crazylegend.setofusefulkotlinextensions +package com.funkymuse.setofusefulkotlinextensions import android.os.Bundle import androidx.appcompat.app.AppCompatActivity -import com.crazylegend.customviews.dragAndDrop.DragAndDropListener -import com.crazylegend.setofusefulkotlinextensions.databinding.ActivityDragAndDropBinding -import com.crazylegend.viewbinding.viewBinding +import com.funkymuse.customviews.dragAndDrop.DragAndDropListener +import com.funkymuse.setofusefulkotlinextensions.databinding.ActivityDragAndDropBinding +import com.funkymuse.viewbinding.viewBinding + -/** - * Created by crazy on 8/7/20 to long live and prosper ! - */ class DragAndDropActivity : AppCompatActivity() { private val activityMainBinding by viewBinding(ActivityDragAndDropBinding::inflate) diff --git a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/DrawingActivity.kt b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/DrawingActivity.kt similarity index 86% rename from app/src/main/java/com/crazylegend/setofusefulkotlinextensions/DrawingActivity.kt rename to app/src/main/java/com/funkymuse/setofusefulkotlinextensions/DrawingActivity.kt index c76336b7a..53be12b50 100644 --- a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/DrawingActivity.kt +++ b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/DrawingActivity.kt @@ -1,4 +1,4 @@ -package com.crazylegend.setofusefulkotlinextensions +package com.funkymuse.setofusefulkotlinextensions import android.annotation.SuppressLint import android.os.Bundle @@ -6,15 +6,12 @@ import android.view.GestureDetector import android.view.MotionEvent import android.view.ScaleGestureDetector import androidx.appcompat.app.AppCompatActivity -import com.crazylegend.kotlinextensions.motionEvent.isNewGesture -import com.crazylegend.kotlinextensions.views.clear -import com.crazylegend.setofusefulkotlinextensions.databinding.ActivityDrawingBinding -import com.crazylegend.viewbinding.viewBinding +import com.funkymuse.kotlinextensions.motionEvent.isNewGesture +import com.funkymuse.kotlinextensions.views.clear +import com.funkymuse.setofusefulkotlinextensions.databinding.ActivityDrawingBinding +import com.funkymuse.viewbinding.viewBinding -/** - * Created by crazy on 8/7/20 to long live and prosper ! - */ class DrawingActivity : AppCompatActivity() { private val binding by viewBinding(ActivityDrawingBinding::inflate) @@ -23,7 +20,8 @@ class DrawingActivity : AppCompatActivity() { super.onCreate(savedInstanceState) setContentView(binding.root) - binding.touchListenerChoices.setOnCheckedChangeListener { _, checkedId -> + binding.touchListenerChoices.setOnCheckedStateChangeListener { chipGroup, _ -> + val checkedId = chipGroup.checkedChipId binding.drawingCanvas.isTouchEventListenerEnabled = false binding.drawingCanvas.clear() binding.gestureDescription.clear() @@ -35,8 +33,6 @@ class DrawingActivity : AppCompatActivity() { R.id.scaleGestureDetector -> setUpScaleGestureDetector() } } - - } private fun setUpDefaultTouchListener() { @@ -52,10 +48,12 @@ class DrawingActivity : AppCompatActivity() { eventDescription.isEmpty() -> { return@setOnTouchListener super.onTouchEvent(event) } + event.isNewGesture() -> { binding.gestureDescription.text = eventDescription return@setOnTouchListener true } + else -> { binding.gestureDescription.text = (eventDescription) return@setOnTouchListener true @@ -72,10 +70,12 @@ class DrawingActivity : AppCompatActivity() { eventDescription.isEmpty() -> { return@setOnTouchListener super.onTouchEvent(event) } + event.isNewGesture() -> { binding.gestureDescription.text = (eventDescription) return@setOnTouchListener true } + else -> { binding.gestureDescription.text = (eventDescription) return@setOnTouchListener true @@ -107,18 +107,24 @@ class DrawingActivity : AppCompatActivity() { return true } - override fun onFling(event1: MotionEvent, event2: MotionEvent, velocityX: Float, - velocityY: Float): Boolean { + override fun onFling( + event1: MotionEvent?, event2: MotionEvent, velocityX: Float, + velocityY: Float + ): Boolean { binding.gestureDescription.text = (event1.description("Fling start")) binding.gestureDescription.text = (event2.description("Fling end")) - binding.gestureDescription.text = ("Fling velocity (${velocityX.toInt()}px/s, ${velocityY.toInt()}px/s)") + binding.gestureDescription.text = + ("Fling velocity (${velocityX.toInt()}px/s, ${velocityY.toInt()}px/s)") return true } - override fun onScroll(event1: MotionEvent, event2: MotionEvent, distanceX: Float, - distanceY: Float): Boolean { + override fun onScroll( + event1: MotionEvent?, event2: MotionEvent, distanceX: Float, + distanceY: Float + ): Boolean { binding.gestureDescription.text = (event2.description("Scroll")) - binding.gestureDescription.text = ("Scroll distance (${distanceX.toInt()}, ${distanceY.toInt()})") + binding.gestureDescription.text = + ("Scroll distance (${distanceX.toInt()}, ${distanceY.toInt()})") return true } @@ -202,7 +208,13 @@ class DrawingActivity : AppCompatActivity() { } stringBuilder.append(" {") for (i in 0 until pointerCount) { - stringBuilder.append("\n\t\tPointer with id ${getPointerId(i)} at (${getX(i).toInt()}, ${getY(i).toInt()})") + stringBuilder.append( + "\n\t\tPointer with id ${getPointerId(i)} at (${getX(i).toInt()}, ${ + getY( + i + ).toInt() + })" + ) } stringBuilder.append("\n}") stringBuilder.toString() diff --git a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/MainAbstractActivity.kt b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/MainAbstractActivity.kt similarity index 56% rename from app/src/main/java/com/crazylegend/setofusefulkotlinextensions/MainAbstractActivity.kt rename to app/src/main/java/com/funkymuse/setofusefulkotlinextensions/MainAbstractActivity.kt index 6268c38e2..46deaa974 100644 --- a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/MainAbstractActivity.kt +++ b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/MainAbstractActivity.kt @@ -1,44 +1,43 @@ -package com.crazylegend.setofusefulkotlinextensions +package com.funkymuse.setofusefulkotlinextensions import android.annotation.SuppressLint import android.os.Bundle import android.view.Menu +import androidx.activity.enableEdgeToEdge import androidx.activity.viewModels import androidx.appcompat.app.AppCompatActivity import androidx.core.os.bundleOf import androidx.lifecycle.lifecycleScope import androidx.recyclerview.widget.RecyclerView -import com.crazylegend.animations.transition.utils.fadeRecyclerTransition -import com.crazylegend.context.getColorCompat -import com.crazylegend.context.isGestureNavigationEnabled -import com.crazylegend.coroutines.textChanges -import com.crazylegend.customviews.AppRater -import com.crazylegend.customviews.autoStart.AutoStartHelper -import com.crazylegend.customviews.autoStart.ConfirmationDialogAutoStart -import com.crazylegend.customviews.databinding.CustomizableCardViewBinding -import com.crazylegend.internetdetector.InternetDetector -import com.crazylegend.kotlinextensions.gestureNavigation.EdgeToEdge -import com.crazylegend.kotlinextensions.log.debug -import com.crazylegend.kotlinextensions.misc.RunCodeEveryXLaunch -import com.crazylegend.kotlinextensions.views.asSearchView -import com.crazylegend.kotlinextensions.views.setQueryAndExpand -import com.crazylegend.lifecycle.repeatingJobOnStarted -import com.crazylegend.recyclerview.RecyclerSwipeItemHandler -import com.crazylegend.recyclerview.addSwipe -import com.crazylegend.recyclerview.generateRecycler -import com.crazylegend.recyclerview.hideOnScroll -import com.crazylegend.retrofit.apiresult.ApiResult -import com.crazylegend.retrofit.throwables.NoConnectionException -import com.crazylegend.setofusefulkotlinextensions.adapter.TestModel -import com.crazylegend.setofusefulkotlinextensions.adapter.TestPlaceHolderAdapter -import com.crazylegend.setofusefulkotlinextensions.adapter.TestViewBindingAdapter -import com.crazylegend.setofusefulkotlinextensions.adapter.TestViewHolderShimmer -import com.crazylegend.setofusefulkotlinextensions.databinding.ActivityMainBinding -import com.crazylegend.view.getEditTextSearchView -import com.crazylegend.view.setOnClickListenerCooldown -import com.crazylegend.viewbinding.viewBinding -import kotlinx.coroutines.flow.collect +import com.funkymuse.animations.transition.utils.fadeRecyclerTransition +import com.funkymuse.context.getColorCompat +import com.funkymuse.context.isGestureNavigationEnabled +import com.funkymuse.coroutines.textChanges +import com.funkymuse.customviews.AppRater +import com.funkymuse.customviews.autoStart.AutoStartHelper +import com.funkymuse.customviews.autoStart.ConfirmationDialogAutoStart +import com.funkymuse.internetdetector.InternetDetector +import com.funkymuse.kotlinextensions.log.debug +import com.funkymuse.kotlinextensions.misc.RunCodeEveryXLaunch +import com.funkymuse.kotlinextensions.views.asSearchView +import com.funkymuse.kotlinextensions.views.setQueryAndExpand +import com.funkymuse.lifecycle.repeatingJobOnStarted +import com.funkymuse.recyclerview.RecyclerSwipeItemHandler +import com.funkymuse.recyclerview.addSwipe +import com.funkymuse.recyclerview.generateRecycler +import com.funkymuse.recyclerview.hideOnScroll +import com.funkymuse.retrofit.apiresult.ApiResult +import com.funkymuse.retrofit.throwables.NoConnectionException +import com.funkymuse.setofusefulkotlinextensions.adapter.TestModel +import com.funkymuse.setofusefulkotlinextensions.adapter.TestPlaceHolderAdapter +import com.funkymuse.setofusefulkotlinextensions.adapter.TestViewBindingAdapter +import com.funkymuse.setofusefulkotlinextensions.adapter.TestViewHolderShimmer +import com.funkymuse.setofusefulkotlinextensions.customviews.databinding.CustomizableCardViewBinding +import com.funkymuse.setofusefulkotlinextensions.databinding.ActivityMainBinding +import com.funkymuse.view.getEditTextSearchView +import com.funkymuse.view.setOnClickListenerCooldown +import com.funkymuse.viewbinding.viewBinding import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.onEach @@ -57,8 +56,8 @@ class MainAbstractActivity : AppCompatActivity() { private val exampleGeneratedAdapter by lazy { generateRecycler( - ::TestViewHolderShimmer, - CustomizableCardViewBinding::inflate + ::TestViewHolderShimmer, + CustomizableCardViewBinding::inflate ) { item, holder, _, _ -> holder.bind(item) } @@ -69,7 +68,6 @@ class MainAbstractActivity : AppCompatActivity() { } - private val activityMainBinding by viewBinding(ActivityMainBinding::inflate) private var savedItemAnimator: RecyclerView.ItemAnimator? = null @@ -88,16 +86,16 @@ class MainAbstractActivity : AppCompatActivity() { activityMainBinding.recycler.adapter = generatedAdapter repeatingJobOnStarted { - /* testAVM.posts.collect { - updateUI(it) - }*/ + /* testAVM.posts.collect { + updateUI(it) + }*/ } RunCodeEveryXLaunch.runCode(this, 2) { debug("TEST RUN AT 2 LAUNCHES") } - exampleGeneratedAdapter.forItemClickListener = { _, _, _ -> + exampleGeneratedAdapter.forItemClickListener = { _, _, _ -> } @@ -121,36 +119,27 @@ class MainAbstractActivity : AppCompatActivity() { } AutoStartHelper.checkAutoStart( - this, dialogBundle = bundleOf( + this, dialogBundle = bundleOf( Pair(ConfirmationDialogAutoStart.CANCEL_TEXT, "Dismiss"), Pair(ConfirmationDialogAutoStart.CONFIRM_TEXT, "Allow"), Pair(ConfirmationDialogAutoStart.DO_NOT_SHOW_AGAIN_VISIBILITY, true) - ) + ) ) if (isGestureNavigationEnabled()) { - if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.R) { - EdgeToEdge.setUpRoot(this, activityMainBinding.root, android.R.color.transparent) - } else { - EdgeToEdge.setUpRoot(activityMainBinding.root) - } - EdgeToEdge.setUpAppBar(activityMainBinding.appBar, activityMainBinding.toolbar) - EdgeToEdge.setUpScrollingContent(activityMainBinding.recycler) + enableEdgeToEdge() } - } private fun updateUI(apiResult: ApiResult>) { - /* retrofitResult.asMVIResult(testAVM.resultMVI) { getAsSuccess.isNotNullOrEmpty } - testAVM.resultMVI - .result - .onError { retryOnInternetAvailable(it) } - .onSuccess { - activityMainBinding.progressBar.gone() - generatedAdapter.submitList(it) - }*/ - - + /* retrofitResult.asMVIResult(testAVM.resultMVI) { getAsSuccess.isNotNullOrEmpty } + testAVM.resultMVI + .result + .onError { retryOnInternetAvailable(it) } + .onSuccess { + activityMainBinding.progressBar.gone() + generatedAdapter.submitList(it) + }*/ } private fun retryOnInternetAvailable(throwable: Throwable) { @@ -181,11 +170,11 @@ class MainAbstractActivity : AppCompatActivity() { searchItem.asSearchView()?.apply { queryHint = "Search by title" getEditTextSearchView?.textChanges(skipInitialValue = true, debounce = 350L) - ?.map { it?.toString() } - ?.onEach { - debug("TEXT $it") - savedQuery = it - }?.launchIn(lifecycleScope) + ?.map { it?.toString() } + ?.onEach { + debug("TEXT $it") + savedQuery = it + }?.launchIn(lifecycleScope) } return super.onCreateOptionsMenu(menu) diff --git a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/PinchToZoomActivity.kt b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/PinchToZoomActivity.kt similarity index 70% rename from app/src/main/java/com/crazylegend/setofusefulkotlinextensions/PinchToZoomActivity.kt rename to app/src/main/java/com/funkymuse/setofusefulkotlinextensions/PinchToZoomActivity.kt index f7c20a9bb..63b522c09 100644 --- a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/PinchToZoomActivity.kt +++ b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/PinchToZoomActivity.kt @@ -1,17 +1,15 @@ -package com.crazylegend.setofusefulkotlinextensions +package com.funkymuse.setofusefulkotlinextensions import android.os.Bundle import android.view.MotionEvent import android.view.ScaleGestureDetector import androidx.appcompat.app.AppCompatActivity -import com.crazylegend.setofusefulkotlinextensions.databinding.ActivityPinchToZoomBinding -import com.crazylegend.view.pinchToZoom -import com.crazylegend.viewbinding.viewBinding +import com.funkymuse.setofusefulkotlinextensions.databinding.ActivityPinchToZoomBinding +import com.funkymuse.view.pinchToZoom +import com.funkymuse.viewbinding.viewBinding + -/** - * Created by crazy on 8/7/20 to long live and prosper ! - */ class PinchToZoomActivity : AppCompatActivity() { private val activityMainBinding by viewBinding(ActivityPinchToZoomBinding::inflate) diff --git a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/TestAVM.kt b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/TestAVM.kt similarity index 81% rename from app/src/main/java/com/crazylegend/setofusefulkotlinextensions/TestAVM.kt rename to app/src/main/java/com/funkymuse/setofusefulkotlinextensions/TestAVM.kt index 2c3aed93a..4521b6d5d 100644 --- a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/TestAVM.kt +++ b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/TestAVM.kt @@ -1,19 +1,19 @@ -package com.crazylegend.setofusefulkotlinextensions +package com.funkymuse.setofusefulkotlinextensions import android.app.Application import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.SavedStateHandle import androidx.lifecycle.viewModelScope -import com.crazylegend.common.randomUUIDstring -import com.crazylegend.kotlinextensions.viewmodel.context -import com.crazylegend.retrofit.adapter.ApiResultAdapterFactory -import com.crazylegend.retrofit.apiresult.ApiResult -import com.crazylegend.retrofit.interceptors.ConnectivityInterceptor -import com.crazylegend.retrofit.randomPhotoIndex -import com.crazylegend.retrofit.viewstate.event.ViewStatefulEvent -import com.crazylegend.retrofit.viewstate.state.ViewState -import com.crazylegend.retrofit.viewstate.state.asViewStatePayloadWithEvents -import com.crazylegend.setofusefulkotlinextensions.adapter.TestModel +import com.funkymuse.common.randomUUIDstring +import com.funkymuse.kotlinextensions.viewmodel.context +import com.funkymuse.retrofit.adapter.ApiResultAdapterFactory +import com.funkymuse.retrofit.apiresult.ApiResult +import com.funkymuse.retrofit.interceptors.ConnectivityInterceptor +import com.funkymuse.retrofit.randomPhotoIndex +import com.funkymuse.retrofit.viewstate.event.ViewStatefulEvent +import com.funkymuse.retrofit.viewstate.state.ViewState +import com.funkymuse.retrofit.viewstate.state.asViewStatePayloadWithEvents +import com.funkymuse.setofusefulkotlinextensions.adapter.TestModel import kotlinx.coroutines.delay import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.StateFlow @@ -24,9 +24,6 @@ import retrofit2.converter.moshi.MoshiConverterFactory import retrofit2.create -/** - * Created by hristijan on 8/26/19 to long live and prosper ! - */ class TestAVM( application: Application, val savedStateHandle: SavedStateHandle diff --git a/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/TestApi.kt b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/TestApi.kt new file mode 100644 index 000000000..cc000eb34 --- /dev/null +++ b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/TestApi.kt @@ -0,0 +1,17 @@ +package com.funkymuse.setofusefulkotlinextensions + +import com.funkymuse.retrofit.apiresult.ApiResult +import com.funkymuse.setofusefulkotlinextensions.adapter.TestModel +import retrofit2.http.GET + + +interface TestApi { + + + @GET("posts") + suspend fun getPosts(): ApiResult> + + companion object { + const val API = "https://jsonplaceholder.typicode.com/" + } +} \ No newline at end of file diff --git a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/ViewEventProvider.kt b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/ViewEventProvider.kt similarity index 76% rename from app/src/main/java/com/crazylegend/setofusefulkotlinextensions/ViewEventProvider.kt rename to app/src/main/java/com/funkymuse/setofusefulkotlinextensions/ViewEventProvider.kt index 94e697bca..c7fd4d811 100644 --- a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/ViewEventProvider.kt +++ b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/ViewEventProvider.kt @@ -1,7 +1,7 @@ -package com.crazylegend.setofusefulkotlinextensions +package com.funkymuse.setofusefulkotlinextensions -import com.crazylegend.retrofit.viewstate.event.ViewStatefulEvent -import com.crazylegend.retrofit.viewstate.event.ViewEventContract +import com.funkymuse.retrofit.viewstate.event.ViewEventContract +import com.funkymuse.retrofit.viewstate.event.ViewStatefulEvent import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.Flow diff --git a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/adapter/TestModel.kt b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/adapter/TestModel.kt similarity index 88% rename from app/src/main/java/com/crazylegend/setofusefulkotlinextensions/adapter/TestModel.kt rename to app/src/main/java/com/funkymuse/setofusefulkotlinextensions/adapter/TestModel.kt index eac228e41..a19074bcf 100644 --- a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/adapter/TestModel.kt +++ b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/adapter/TestModel.kt @@ -1,4 +1,4 @@ -package com.crazylegend.setofusefulkotlinextensions.adapter +package com.funkymuse.setofusefulkotlinextensions.adapter import androidx.room.ColumnInfo diff --git a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/adapter/TestPlaceHolderAdapter.kt b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/adapter/TestPlaceHolderAdapter.kt similarity index 64% rename from app/src/main/java/com/crazylegend/setofusefulkotlinextensions/adapter/TestPlaceHolderAdapter.kt rename to app/src/main/java/com/funkymuse/setofusefulkotlinextensions/adapter/TestPlaceHolderAdapter.kt index dfbd69894..7086a4216 100644 --- a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/adapter/TestPlaceHolderAdapter.kt +++ b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/adapter/TestPlaceHolderAdapter.kt @@ -1,14 +1,11 @@ -package com.crazylegend.setofusefulkotlinextensions.adapter +package com.funkymuse.setofusefulkotlinextensions.adapter import android.view.ViewGroup -import com.crazylegend.customviews.databinding.CustomizableCardViewBinding -import com.crazylegend.recyclerview.PlaceholderAdapter -import com.crazylegend.view.inflater +import com.funkymuse.recyclerview.PlaceholderAdapter +import com.funkymuse.setofusefulkotlinextensions.customviews.databinding.CustomizableCardViewBinding +import com.funkymuse.view.inflater -/** - * Created by crazy on 4/2/20 to long live and prosper ! - */ class TestPlaceHolderAdapter : PlaceholderAdapter() { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = TestViewHolder(CustomizableCardViewBinding.inflate(parent.inflater, parent, false)) diff --git a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/adapter/TestViewBindingAdapter.kt b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/adapter/TestViewBindingAdapter.kt similarity index 56% rename from app/src/main/java/com/crazylegend/setofusefulkotlinextensions/adapter/TestViewBindingAdapter.kt rename to app/src/main/java/com/funkymuse/setofusefulkotlinextensions/adapter/TestViewBindingAdapter.kt index 44d0f8bdb..b25dbc38a 100644 --- a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/adapter/TestViewBindingAdapter.kt +++ b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/adapter/TestViewBindingAdapter.kt @@ -1,12 +1,9 @@ -package com.crazylegend.setofusefulkotlinextensions.adapter +package com.funkymuse.setofusefulkotlinextensions.adapter -import com.crazylegend.customviews.databinding.CustomizableCardViewBinding -import com.crazylegend.recyclerview.AbstractViewBindingAdapter +import com.funkymuse.recyclerview.AbstractViewBindingAdapter +import com.funkymuse.setofusefulkotlinextensions.customviews.databinding.CustomizableCardViewBinding -/** - * Created by crazy on 4/5/20 to long live and prosper ! - */ class TestViewBindingAdapter : AbstractViewBindingAdapter( ::TestViewHolderShimmer, CustomizableCardViewBinding::inflate ) { diff --git a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/adapter/TestViewHolder.kt b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/adapter/TestViewHolder.kt similarity index 82% rename from app/src/main/java/com/crazylegend/setofusefulkotlinextensions/adapter/TestViewHolder.kt rename to app/src/main/java/com/funkymuse/setofusefulkotlinextensions/adapter/TestViewHolder.kt index 174821ffa..9d0c934dd 100644 --- a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/adapter/TestViewHolder.kt +++ b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/adapter/TestViewHolder.kt @@ -1,12 +1,12 @@ -package com.crazylegend.setofusefulkotlinextensions.adapter +package com.funkymuse.setofusefulkotlinextensions.adapter import android.animation.ObjectAnimator import android.os.SystemClock import android.view.View import androidx.core.animation.doOnEnd import androidx.recyclerview.widget.RecyclerView -import com.crazylegend.customviews.databinding.CustomizableCardViewBinding -import com.crazylegend.setofusefulkotlinextensions.R +import com.funkymuse.setofusefulkotlinextensions.R +import com.funkymuse.setofusefulkotlinextensions.customviews.databinding.CustomizableCardViewBinding class TestViewHolder(private val binding: CustomizableCardViewBinding) : RecyclerView.ViewHolder(binding.root) { @@ -31,7 +31,7 @@ class TestViewHolder(private val binding: CustomizableCardViewBinding) : Recycle animation.end() binding.content.setBackgroundResource(0) binding.title.setBackgroundResource(0) - binding.image.setImageResource(com.crazylegend.customviews.R.drawable.pin_code_highlight_state) + binding.image.setImageResource(com.funkymuse.setofusefulkotlinextensions.customviews.R.drawable.pin_code_highlight_state) } fun showPlaceHolder() { diff --git a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/adapter/TestViewHolderShimmer.kt b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/adapter/TestViewHolderShimmer.kt similarity index 70% rename from app/src/main/java/com/crazylegend/setofusefulkotlinextensions/adapter/TestViewHolderShimmer.kt rename to app/src/main/java/com/funkymuse/setofusefulkotlinextensions/adapter/TestViewHolderShimmer.kt index dd84ce4f0..2e3494fbf 100644 --- a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/adapter/TestViewHolderShimmer.kt +++ b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/adapter/TestViewHolderShimmer.kt @@ -1,17 +1,20 @@ -package com.crazylegend.setofusefulkotlinextensions.adapter +package com.funkymuse.setofusefulkotlinextensions.adapter import android.animation.ObjectAnimator import android.os.SystemClock import android.view.View import androidx.core.animation.doOnEnd import androidx.recyclerview.widget.RecyclerView -import com.crazylegend.customviews.databinding.CustomizableCardViewBinding -import com.crazylegend.kotlinextensions.views.setPrecomputedText -import com.crazylegend.setofusefulkotlinextensions.R +import com.funkymuse.kotlinextensions.views.setPrecomputedText +import com.funkymuse.setofusefulkotlinextensions.R +import com.funkymuse.setofusefulkotlinextensions.customviews.databinding.CustomizableCardViewBinding -class TestViewHolderShimmer(private val binding: CustomizableCardViewBinding) : RecyclerView.ViewHolder(binding.root) { +class TestViewHolderShimmer(private val binding: CustomizableCardViewBinding) : + RecyclerView.ViewHolder(binding.root) { - private val FADE_DURATION = 1000L + companion object { + private const val FADE_DURATION = 1000L + } private val animation = ObjectAnimator.ofFloat(itemView, View.ALPHA, 1f, 0f, 1f).apply { repeatCount = ObjectAnimator.INFINITE @@ -30,7 +33,7 @@ class TestViewHolderShimmer(private val binding: CustomizableCardViewBinding) : animation.end() binding.content.setBackgroundResource(0) binding.title.setBackgroundResource(0) - binding.image.setImageResource(com.crazylegend.customviews.R.drawable.pin_code_highlight_state) + binding.image.setImageResource(com.funkymuse.setofusefulkotlinextensions.customviews.R.drawable.pin_code_highlight_state) binding.content.setPrecomputedText(item.body) binding.title.setPrecomputedText(item.title) } @@ -39,7 +42,7 @@ class TestViewHolderShimmer(private val binding: CustomizableCardViewBinding) : // Shift the timing of fade-in/out for each item by its adapter position. We use the // elapsed real time to make this independent from the timing of method call. animation.currentPlayTime = - (SystemClock.elapsedRealtime() - bindingAdapterPosition * 30L) % FADE_DURATION + (SystemClock.elapsedRealtime() - bindingAdapterPosition * 30L) % FADE_DURATION animation.start() // Show the placeholder UI. binding.image.setImageResource(R.drawable.image_placeholder) diff --git a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/db/TestDao.kt b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/db/TestDao.kt similarity index 70% rename from app/src/main/java/com/crazylegend/setofusefulkotlinextensions/db/TestDao.kt rename to app/src/main/java/com/funkymuse/setofusefulkotlinextensions/db/TestDao.kt index 8bd445cef..89b773401 100644 --- a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/db/TestDao.kt +++ b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/db/TestDao.kt @@ -1,15 +1,12 @@ -package com.crazylegend.setofusefulkotlinextensions.db +package com.funkymuse.setofusefulkotlinextensions.db import androidx.room.Dao import androidx.room.Insert import androidx.room.OnConflictStrategy import androidx.room.Query -import com.crazylegend.setofusefulkotlinextensions.adapter.TestModel +import com.funkymuse.setofusefulkotlinextensions.adapter.TestModel import kotlinx.coroutines.flow.Flow -/** - * Created by crazy on 1/14/21 to long live and prosper ! - */ @Dao interface TestDao { diff --git a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/db/TestDatabase.kt b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/db/TestDatabase.kt similarity index 65% rename from app/src/main/java/com/crazylegend/setofusefulkotlinextensions/db/TestDatabase.kt rename to app/src/main/java/com/funkymuse/setofusefulkotlinextensions/db/TestDatabase.kt index 090f63f28..a24e08546 100644 --- a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/db/TestDatabase.kt +++ b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/db/TestDatabase.kt @@ -1,15 +1,12 @@ -package com.crazylegend.setofusefulkotlinextensions.db +package com.funkymuse.setofusefulkotlinextensions.db import android.content.Context import androidx.room.Database import androidx.room.Room import androidx.room.RoomDatabase -import com.crazylegend.kotlinextensions.singleton.ParameterizedSingleton -import com.crazylegend.setofusefulkotlinextensions.adapter.TestModel +import com.funkymuse.kotlinextensions.singleton.ParameterizedSingleton +import com.funkymuse.setofusefulkotlinextensions.adapter.TestModel -/** - * Created by crazy on 1/14/21 to long live and prosper ! - */ @Database(entities = [TestModel::class], version = 1, exportSchema = false) abstract class TestDatabase : RoomDatabase() { diff --git a/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/nav/DetailFragment.kt b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/nav/DetailFragment.kt new file mode 100644 index 000000000..12d3a8e99 --- /dev/null +++ b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/nav/DetailFragment.kt @@ -0,0 +1,8 @@ +package com.funkymuse.setofusefulkotlinextensions.nav + +import androidx.fragment.app.Fragment +import com.funkymuse.setofusefulkotlinextensions.R + +class DetailFragment : Fragment(R.layout.fragment_test) { + +} \ No newline at end of file diff --git a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/nav/MVIFragment.kt b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/nav/MVIFragment.kt similarity index 68% rename from app/src/main/java/com/crazylegend/setofusefulkotlinextensions/nav/MVIFragment.kt rename to app/src/main/java/com/funkymuse/setofusefulkotlinextensions/nav/MVIFragment.kt index ea1ee5aff..a27780c38 100644 --- a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/nav/MVIFragment.kt +++ b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/nav/MVIFragment.kt @@ -1,4 +1,4 @@ -package com.crazylegend.setofusefulkotlinextensions.nav +package com.funkymuse.setofusefulkotlinextensions.nav import android.os.Bundle import android.view.View @@ -7,34 +7,32 @@ import android.widget.Toast.LENGTH_LONG import androidx.core.view.isVisible import androidx.fragment.app.Fragment import androidx.fragment.app.viewModels -import com.crazylegend.common.ifTrue -import com.crazylegend.internetdetector.InternetDetector -import com.crazylegend.lifecycle.repeatingJobOnStarted -import com.crazylegend.lifecycle.viewCoroutineScope -import com.crazylegend.retrofit.throwables.isNoConnectionException -import com.crazylegend.retrofit.viewstate.event.ViewStatefulEvent -import com.crazylegend.retrofit.viewstate.event.asApiErrorBody -import com.crazylegend.retrofit.viewstate.event.getAsThrowable -import com.crazylegend.retrofit.viewstate.event.isApiError -import com.crazylegend.retrofit.viewstate.event.isError -import com.crazylegend.retrofit.viewstate.state.handleApiError -import com.crazylegend.retrofit.viewstate.state.showEmptyDataOnErrors -import com.crazylegend.retrofit.viewstate.state.showLoadingWhenDataIsLoaded -import com.crazylegend.retrofit.viewstate.state.showLoadingWhenDataNotLoaded -import com.crazylegend.setofusefulkotlinextensions.R -import com.crazylegend.setofusefulkotlinextensions.TestAVM -import com.crazylegend.setofusefulkotlinextensions.adapter.TestViewBindingAdapter -import com.crazylegend.setofusefulkotlinextensions.databinding.FragmentTestBinding -import com.crazylegend.view.setIsNotRefreshing -import com.crazylegend.view.setIsRefreshing -import com.crazylegend.view.setOnClickListenerCooldown -import com.crazylegend.viewbinding.viewBinding +import com.funkymuse.common.ifTrue +import com.funkymuse.internetdetector.InternetDetector +import com.funkymuse.lifecycle.repeatingJobOnStarted +import com.funkymuse.lifecycle.viewCoroutineScope +import com.funkymuse.retrofit.throwables.isNoConnectionException +import com.funkymuse.retrofit.viewstate.event.ViewStatefulEvent +import com.funkymuse.retrofit.viewstate.event.asApiErrorBody +import com.funkymuse.retrofit.viewstate.event.getAsThrowable +import com.funkymuse.retrofit.viewstate.event.isApiError +import com.funkymuse.retrofit.viewstate.event.isError +import com.funkymuse.retrofit.viewstate.state.handleApiError +import com.funkymuse.retrofit.viewstate.state.showEmptyDataOnErrors +import com.funkymuse.retrofit.viewstate.state.showLoadingWhenDataIsLoaded +import com.funkymuse.retrofit.viewstate.state.showLoadingWhenDataNotLoaded +import com.funkymuse.setofusefulkotlinextensions.R +import com.funkymuse.setofusefulkotlinextensions.TestAVM +import com.funkymuse.setofusefulkotlinextensions.adapter.TestViewBindingAdapter +import com.funkymuse.setofusefulkotlinextensions.databinding.FragmentTestBinding +import com.funkymuse.view.setIsNotRefreshing +import com.funkymuse.view.setIsRefreshing +import com.funkymuse.view.setOnClickListenerCooldown +import com.funkymuse.viewbinding.viewBinding import com.google.android.material.snackbar.Snackbar import kotlinx.coroutines.launch -/** - * Created by Hristijan, date 2/15/21 - */ + class MVIFragment : Fragment(R.layout.fragment_test) { private val binding by viewBinding(FragmentTestBinding::bind) diff --git a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/nav/NavActivity.kt b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/nav/NavActivity.kt similarity index 69% rename from app/src/main/java/com/crazylegend/setofusefulkotlinextensions/nav/NavActivity.kt rename to app/src/main/java/com/funkymuse/setofusefulkotlinextensions/nav/NavActivity.kt index dbdb62f41..edb426625 100644 --- a/app/src/main/java/com/crazylegend/setofusefulkotlinextensions/nav/NavActivity.kt +++ b/app/src/main/java/com/funkymuse/setofusefulkotlinextensions/nav/NavActivity.kt @@ -1,15 +1,12 @@ -package com.crazylegend.setofusefulkotlinextensions.nav +package com.funkymuse.setofusefulkotlinextensions.nav import android.os.Bundle -import android.util.Log import androidx.appcompat.app.AppCompatActivity import androidx.navigation.fragment.NavHostFragment -import com.crazylegend.setofusefulkotlinextensions.databinding.ActivityNavBinding -import com.crazylegend.viewbinding.viewBinding +import com.funkymuse.setofusefulkotlinextensions.databinding.ActivityNavBinding +import com.funkymuse.viewbinding.viewBinding + -/** - * Created by Hristijan, date 2/15/21 - */ class NavActivity : AppCompatActivity() { private val binding by viewBinding(ActivityNavBinding::inflate) diff --git a/app/src/main/res/layout/activity_drag_and_drop.xml b/app/src/main/res/layout/activity_drag_and_drop.xml index 1d447f83e..725211b0f 100644 --- a/app/src/main/res/layout/activity_drag_and_drop.xml +++ b/app/src/main/res/layout/activity_drag_and_drop.xml @@ -4,7 +4,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - - + - - - - diff --git a/app/src/main/res/navigation/test01.xml b/app/src/main/res/navigation/test01.xml index 1ce9259c6..239762275 100644 --- a/app/src/main/res/navigation/test01.xml +++ b/app/src/main/res/navigation/test01.xml @@ -6,7 +6,7 @@ + android:name="com.funkymuse.setofusefulkotlinextensions.nav.DetailFragment"/> \ No newline at end of file diff --git a/app/src/main/res/navigation/test02.xml b/app/src/main/res/navigation/test02.xml index a382b0589..693cb0f66 100644 --- a/app/src/main/res/navigation/test02.xml +++ b/app/src/main/res/navigation/test02.xml @@ -1,6 +1,5 @@ \ No newline at end of file diff --git a/app/src/main/res/navigation/test03.xml b/app/src/main/res/navigation/test03.xml index 4896fdd2d..40eb9fba7 100644 --- a/app/src/main/res/navigation/test03.xml +++ b/app/src/main/res/navigation/test03.xml @@ -1,6 +1,5 @@ diff --git a/app/src/main/res/navigation/test04.xml b/app/src/main/res/navigation/test04.xml index 54118ef87..f6411e8f3 100644 --- a/app/src/main/res/navigation/test04.xml +++ b/app/src/main/res/navigation/test04.xml @@ -1,6 +1,5 @@ diff --git a/app/src/main/res/navigation/test05.xml b/app/src/main/res/navigation/test05.xml index fb298ec1d..241c8a33a 100644 --- a/app/src/main/res/navigation/test05.xml +++ b/app/src/main/res/navigation/test05.xml @@ -1,6 +1,5 @@ diff --git a/app/src/main/res/xml/file_paths.xml b/app/src/main/res/xml/file_paths.xml index d08229a38..c739f244d 100644 --- a/app/src/main/res/xml/file_paths.xml +++ b/app/src/main/res/xml/file_paths.xml @@ -31,10 +31,10 @@ path="." /> + path="Android/data/com.funkymuse.setofusefulkotlinextensions/files/Pictures" /> + path="Android/data/com.funkymuse.setofusefulkotlinextensions/files/Pictures/" /> - + \ No newline at end of file diff --git a/audio/src/main/java/com/crazylegend/audio/AudioManagerExtensions.kt b/audio/src/main/java/com/funkymuse/audio/AudioManagerExtensions.kt similarity index 80% rename from audio/src/main/java/com/crazylegend/audio/AudioManagerExtensions.kt rename to audio/src/main/java/com/funkymuse/audio/AudioManagerExtensions.kt index c5b5c1b16..7c898a682 100644 --- a/audio/src/main/java/com/crazylegend/audio/AudioManagerExtensions.kt +++ b/audio/src/main/java/com/funkymuse/audio/AudioManagerExtensions.kt @@ -1,7 +1,13 @@ -package com.crazylegend.audio +package com.funkymuse.audio import android.media.AudioManager -import android.media.AudioManager.* +import android.media.AudioManager.ADJUST_MUTE +import android.media.AudioManager.ADJUST_UNMUTE +import android.media.AudioManager.STREAM_ALARM +import android.media.AudioManager.STREAM_MUSIC +import android.media.AudioManager.STREAM_NOTIFICATION +import android.media.AudioManager.STREAM_RING +import android.media.AudioManager.STREAM_SYSTEM import android.os.Build.VERSION.SDK_INT import android.os.Build.VERSION_CODES.M import android.view.KeyEvent @@ -9,10 +15,6 @@ import kotlin.math.max import kotlin.math.min -/** - * Created by hristijan on 3/20/19 to long live and prosper ! - */ - fun AudioManager.dispatchEvent(keycode: Int) { dispatchMediaKeyEvent(KeyEvent(KeyEvent.ACTION_DOWN, keycode)) dispatchMediaKeyEvent(KeyEvent(KeyEvent.ACTION_UP, keycode)) @@ -21,9 +23,9 @@ fun AudioManager.dispatchEvent(keycode: Int) { private var isMuted: Boolean = false var AudioManager.isMuted: Boolean - get() = com.crazylegend.audio.isMuted + get() = com.funkymuse.audio.isMuted private set(value) { - com.crazylegend.audio.isMuted = value + com.funkymuse.audio.isMuted = value } @Suppress("DEPRECATION") diff --git a/biometrics/build.gradle b/biometrics/build.gradle deleted file mode 100644 index 197f2d7f5..000000000 --- a/biometrics/build.gradle +++ /dev/null @@ -1,7 +0,0 @@ -dependencies { - api "androidx.biometric:biometric:$biometrics" -} - -android { - namespace 'com.crazylegend.biometrics' -} \ No newline at end of file diff --git a/biometrics/build.gradle.kts b/biometrics/build.gradle.kts new file mode 100644 index 000000000..4fadaaca8 --- /dev/null +++ b/biometrics/build.gradle.kts @@ -0,0 +1,7 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + api(libs.androidx.biometric) +} diff --git a/biometrics/src/main/java/com/crazylegend/biometrics/BiometricUtils.kt b/biometrics/src/main/java/com/funkymuse/biometrics/BiometricUtils.kt similarity index 93% rename from biometrics/src/main/java/com/crazylegend/biometrics/BiometricUtils.kt rename to biometrics/src/main/java/com/funkymuse/biometrics/BiometricUtils.kt index bdcf7d15f..4f5b62c5a 100644 --- a/biometrics/src/main/java/com/crazylegend/biometrics/BiometricUtils.kt +++ b/biometrics/src/main/java/com/funkymuse/biometrics/BiometricUtils.kt @@ -1,18 +1,20 @@ -package com.crazylegend.biometrics +package com.funkymuse.biometrics -import androidx.biometric.BiometricManager.* import androidx.biometric.BiometricManager.Authenticators.BIOMETRIC_STRONG import androidx.biometric.BiometricManager.Authenticators.DEVICE_CREDENTIAL +import androidx.biometric.BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE +import androidx.biometric.BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED +import androidx.biometric.BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE +import androidx.biometric.BiometricManager.BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED +import androidx.biometric.BiometricManager.BIOMETRIC_ERROR_UNSUPPORTED +import androidx.biometric.BiometricManager.BIOMETRIC_STATUS_UNKNOWN +import androidx.biometric.BiometricManager.BIOMETRIC_SUCCESS +import androidx.biometric.BiometricManager.from import androidx.biometric.BiometricPrompt import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentActivity import java.util.concurrent.Executors - -/** - * Created by hristijan on 4/2/19 to long live and prosper ! - */ - /** * Use [canAuthenticate] before calling this function, just to see if the user can be authenticated, don't blame the API or the function * if you get a weird result code that you forgot to handle, peace. diff --git a/biometrics/src/main/java/com/crazylegend/biometrics/FingerPrintController.kt b/biometrics/src/main/java/com/funkymuse/biometrics/FingerPrintController.kt similarity index 95% rename from biometrics/src/main/java/com/crazylegend/biometrics/FingerPrintController.kt rename to biometrics/src/main/java/com/funkymuse/biometrics/FingerPrintController.kt index 96b8e5a73..024703b38 100644 --- a/biometrics/src/main/java/com/crazylegend/biometrics/FingerPrintController.kt +++ b/biometrics/src/main/java/com/funkymuse/biometrics/FingerPrintController.kt @@ -1,4 +1,4 @@ -package com.crazylegend.biometrics +package com.funkymuse.biometrics import android.content.Context import android.os.Build @@ -8,11 +8,16 @@ import android.security.keystore.KeyGenParameterSpec import android.security.keystore.KeyPermanentlyInvalidatedException import android.security.keystore.KeyProperties import android.widget.Toast -import androidx.annotation.RequiresApi import androidx.core.hardware.fingerprint.FingerprintManagerCompat import androidx.core.os.CancellationSignal import java.io.IOException -import java.security.* +import java.security.InvalidAlgorithmParameterException +import java.security.InvalidKeyException +import java.security.KeyStore +import java.security.KeyStoreException +import java.security.NoSuchAlgorithmException +import java.security.NoSuchProviderException +import java.security.UnrecoverableKeyException import javax.crypto.Cipher import javax.crypto.KeyGenerator import javax.crypto.NoSuchPaddingException @@ -20,9 +25,6 @@ import javax.crypto.SecretKey import javax.security.cert.CertificateException -/** - * Created by crazy on 10/16/18 to long live and prosper ! - */ class FingerPrintController( private val fingerprintManagerCompat: FingerprintManagerCompat, private val callback: FingerprintCallback, diff --git a/build-logic/convention/build.gradle.kts b/build-logic/convention/build.gradle.kts new file mode 100644 index 000000000..84041f0c1 --- /dev/null +++ b/build-logic/convention/build.gradle.kts @@ -0,0 +1,49 @@ +plugins { + `kotlin-dsl` +} + +group = libs.versions.app.version.appId + +java { + toolchain { + languageVersion.set(JavaLanguageVersion.of(libs.versions.app.build.kotlinJVMTarget.get())) + } +} + +dependencies { + compileOnly(libs.android.gradlePlugin) + compileOnly(libs.kotlin.gradlePlugin) +} + +gradlePlugin { + plugins { + register("androidConventionComposeLibrary") { + id = "convention.android.compose.library" + implementationClass = "LibraryComposeConventionPlugin" + } + register("androidConventionComposeApp") { + id = "convention.android.compose.app" + implementationClass = "AppComposeConventionPlugin" + } + register("moshiConventionPlugin") { + id = "convention.android.moshi" + implementationClass = "MoshiConventionPlugin" + } + register("roomConventionPlugin") { + id = "convention.android.room" + implementationClass = "RoomConventionPlugin" + } + register("appConventionPlugin") { + id = "convention.android.app" + implementationClass = "AppConventionPlugin" + } + register("libraryConventionPlugin") { + id = "convention.android.library" + implementationClass = "LibraryConventionPlugin" + } + register("kotlinConventionLibraryPlugin") { + id = "convention.android.kotlin.library" + implementationClass = "KotlinLibraryConventionPlugin" + } + } +} diff --git a/build-logic/convention/src/main/kotlin/AppComposeConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AppComposeConventionPlugin.kt new file mode 100644 index 000000000..20cc9475e --- /dev/null +++ b/build-logic/convention/src/main/kotlin/AppComposeConventionPlugin.kt @@ -0,0 +1,14 @@ +import com.android.build.api.dsl.ApplicationExtension +import com.funkymuse.kahelpers.configureAndroidCompose +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.getByType + +class AppComposeConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + val extension = extensions.getByType() + configureAndroidCompose(extension) + } + } +} \ No newline at end of file diff --git a/build-logic/convention/src/main/kotlin/AppConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AppConventionPlugin.kt new file mode 100644 index 000000000..0cb8c5f7f --- /dev/null +++ b/build-logic/convention/src/main/kotlin/AppConventionPlugin.kt @@ -0,0 +1,32 @@ +import com.android.build.api.dsl.ApplicationExtension +import com.funkymuse.kahelpers.commonVersioning +import com.funkymuse.kahelpers.configureAppPluginPackageAndNameSpace +import com.funkymuse.kahelpers.configureBuildFeatures +import com.funkymuse.kahelpers.configureJavaCompatibilityCompileOptions +import com.funkymuse.kahelpers.configureKotlinOptions +import com.funkymuse.kahelpers.getPluginId +import com.funkymuse.kahelpers.versionCatalog +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.configure + +class AppConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + with(pluginManager) { + apply(versionCatalog.getPluginId("android")) + apply(versionCatalog.getPluginId("kotlinAndroid")) + apply(versionCatalog.getPluginId("ksp")) + apply(versionCatalog.getPluginId("convention-compose-app")) + apply(versionCatalog.getPluginId("spotless")) + } + configureKotlinOptions() + extensions.configure{ + commonVersioning(this) + configureAppPluginPackageAndNameSpace(this) + configureBuildFeatures() + configureJavaCompatibilityCompileOptions(this) + } + } + } +} \ No newline at end of file diff --git a/build-logic/convention/src/main/kotlin/KotlinLibraryConventionPlugin.kt b/build-logic/convention/src/main/kotlin/KotlinLibraryConventionPlugin.kt new file mode 100644 index 000000000..fd13085f0 --- /dev/null +++ b/build-logic/convention/src/main/kotlin/KotlinLibraryConventionPlugin.kt @@ -0,0 +1,25 @@ +import com.funkymuse.kahelpers.configureJava +import com.funkymuse.kahelpers.getPluginId +import com.funkymuse.kahelpers.getVersion +import com.funkymuse.kahelpers.versionCatalog +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.jvm.toolchain.JavaLanguageVersion + +class KotlinLibraryConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + with(pluginManager) { + apply(versionCatalog.getPluginId("java-library")) + apply(versionCatalog.getPluginId("kotlinJvm")) + apply(versionCatalog.getPluginId("dokka")) + apply(versionCatalog.getVersion("gradlePlugins-maven-publish")) + } + configureJava { + toolchain { + languageVersion.set(JavaLanguageVersion.of(versionCatalog.getVersion("app-build-kotlinJVMTarget"))) + } + } + } + } +} \ No newline at end of file diff --git a/build-logic/convention/src/main/kotlin/LibraryComposeConventionPlugin.kt b/build-logic/convention/src/main/kotlin/LibraryComposeConventionPlugin.kt new file mode 100644 index 000000000..d860db10b --- /dev/null +++ b/build-logic/convention/src/main/kotlin/LibraryComposeConventionPlugin.kt @@ -0,0 +1,14 @@ +import com.android.build.gradle.LibraryExtension +import com.funkymuse.kahelpers.configureAndroidCompose +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.getByType + +class LibraryComposeConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + val extension = extensions.getByType() + configureAndroidCompose(extension) + } + } +} \ No newline at end of file diff --git a/build-logic/convention/src/main/kotlin/LibraryConventionPlugin.kt b/build-logic/convention/src/main/kotlin/LibraryConventionPlugin.kt new file mode 100644 index 000000000..fc2b95eca --- /dev/null +++ b/build-logic/convention/src/main/kotlin/LibraryConventionPlugin.kt @@ -0,0 +1,35 @@ +import com.android.build.gradle.LibraryExtension +import com.funkymuse.kahelpers.addLibrariesConfig +import com.funkymuse.kahelpers.commonVersioning +import com.funkymuse.kahelpers.configureBuildFeatures +import com.funkymuse.kahelpers.configureJavaCompatibilityCompileOptions +import com.funkymuse.kahelpers.configureKotlinOptions +import com.funkymuse.kahelpers.configureLibraryAndTestNameSpace +import com.funkymuse.kahelpers.getPluginId +import com.funkymuse.kahelpers.getVersion +import com.funkymuse.kahelpers.versionCatalog +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.configure + +class LibraryConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + with(pluginManager) { + apply(versionCatalog.getPluginId("library")) + apply(versionCatalog.getPluginId("kotlinAndroid")) + apply(versionCatalog.getPluginId("spotless")) + apply(versionCatalog.getPluginId("dokka")) + apply(versionCatalog.getVersion("gradlePlugins-maven-publish")) + } + configureKotlinOptions() + configureLibraryAndTestNameSpace() + extensions.configure { + commonVersioning(this) + configureBuildFeatures() + addLibrariesConfig() + configureJavaCompatibilityCompileOptions(this) + } + } + } +} \ No newline at end of file diff --git a/build-logic/convention/src/main/kotlin/MoshiConventionPlugin.kt b/build-logic/convention/src/main/kotlin/MoshiConventionPlugin.kt new file mode 100644 index 000000000..4204029bd --- /dev/null +++ b/build-logic/convention/src/main/kotlin/MoshiConventionPlugin.kt @@ -0,0 +1,21 @@ +import com.funkymuse.kahelpers.getLibrary +import com.funkymuse.kahelpers.implementation +import com.funkymuse.kahelpers.ksp +import com.funkymuse.kahelpers.kspPluginId +import com.funkymuse.kahelpers.versionCatalog +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.dependencies + +class MoshiConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + val libs = versionCatalog + pluginManager.apply(versionCatalog.kspPluginId) + dependencies { + add(implementation, libs.getLibrary("moshi-kotlin")) + add(ksp, libs.getLibrary("moshi-kotlin-codegen")) + } + } + } +} \ No newline at end of file diff --git a/build-logic/convention/src/main/kotlin/RoomConventionPlugin.kt b/build-logic/convention/src/main/kotlin/RoomConventionPlugin.kt new file mode 100644 index 000000000..2c70ad6a3 --- /dev/null +++ b/build-logic/convention/src/main/kotlin/RoomConventionPlugin.kt @@ -0,0 +1,22 @@ +import com.funkymuse.kahelpers.getBundle +import com.funkymuse.kahelpers.getLibrary +import com.funkymuse.kahelpers.implementation +import com.funkymuse.kahelpers.ksp +import com.funkymuse.kahelpers.kspPluginId +import com.funkymuse.kahelpers.versionCatalog +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.dependencies + +class RoomConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + val libs = versionCatalog + pluginManager.apply(versionCatalog.kspPluginId) + dependencies { + add(implementation, libs.getBundle("room")) + add(ksp, libs.getLibrary("androidx-room-compiler")) + } + } + } +} \ No newline at end of file diff --git a/build-logic/convention/src/main/kotlin/com/funkymuse/kahelpers/AndroidCompose.kt b/build-logic/convention/src/main/kotlin/com/funkymuse/kahelpers/AndroidCompose.kt new file mode 100644 index 000000000..2809e340e --- /dev/null +++ b/build-logic/convention/src/main/kotlin/com/funkymuse/kahelpers/AndroidCompose.kt @@ -0,0 +1,63 @@ +package com.funkymuse.kahelpers + +import com.android.build.api.dsl.CommonExtension +import org.gradle.api.Project +import org.gradle.kotlin.dsl.dependencies +import org.gradle.kotlin.dsl.withType +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import java.io.File + +/** + * Configure Compose-specific options + */ +internal fun Project.configureAndroidCompose( + commonExtension: CommonExtension<*, *, *, *, *>, +) { + val libs = versionCatalog + commonExtension.apply { + buildFeatures.compose = true + + composeOptions { + kotlinCompilerExtensionVersion = libs.getVersion("composeCompiler") + } + + tasks.withType { + kotlinOptions { + freeCompilerArgs = freeCompilerArgs + buildComposeMetricsParameters() + } + } + dependencies { + add(implementation, libs.getBundle("compose")) + add(implementation, libs.getLibrary("kotlin-immutable-collections")) + add(debugImplementation, libs.getBundle("compose-preview")) + } + } +} + +val Project.composeMetricsDir get() = layout.buildDirectory.asFile.get().absolutePath + "/compose_metrics" +val Project.composeReportsDir get() = layout.buildDirectory.asFile.get().absolutePath + "/compose_reports" + + +private fun Project.buildComposeMetricsParameters(): List { + val metricParameters = mutableListOf() + val enableMetricsProvider = project.providers.gradleProperty("enableComposeCompilerMetrics") + val enableMetrics = (enableMetricsProvider.orNull == "true") + if (enableMetrics) { + val metricsFolder = File(composeMetricsDir) + metricParameters.add("-P") + metricParameters.add( + "plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" + metricsFolder.absolutePath + ) + } + + val enableReportsProvider = project.providers.gradleProperty("enableComposeCompilerReports") + val enableReports = (enableReportsProvider.orNull == "true") + if (enableReports) { + val reportsFolder = File(composeReportsDir) + metricParameters.add("-P") + metricParameters.add( + "plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" + reportsFolder.absolutePath + ) + } + return metricParameters.toList() +} diff --git a/build-logic/convention/src/main/kotlin/com/funkymuse/kahelpers/ConventionPluginExtensions.kt b/build-logic/convention/src/main/kotlin/com/funkymuse/kahelpers/ConventionPluginExtensions.kt new file mode 100644 index 000000000..703fc6437 --- /dev/null +++ b/build-logic/convention/src/main/kotlin/com/funkymuse/kahelpers/ConventionPluginExtensions.kt @@ -0,0 +1,28 @@ +package com.funkymuse.kahelpers + +import org.gradle.api.Project +import org.gradle.api.artifacts.ExternalModuleDependencyBundle +import org.gradle.api.artifacts.MinimalExternalModuleDependency +import org.gradle.api.artifacts.VersionCatalog +import org.gradle.api.artifacts.VersionCatalogsExtension +import org.gradle.api.provider.Provider +import org.gradle.kotlin.dsl.getByType + +val Project.versionCatalog: VersionCatalog get() = extensions.getByType().named("libs") + +val VersionCatalog.kspPluginId: String get() = getPluginId("ksp") + +fun VersionCatalog.getPluginId(pluginName :String): String = findPlugin(pluginName).get().get().pluginId + +fun VersionCatalog.getLibrary(alias:String): Provider = + findLibrary(alias).get() + +fun VersionCatalog.getBundle(alias:String): Provider = + findBundle(alias).get() + +fun VersionCatalog.getVersion(alias:String): String = + findVersion(alias).get().toString() + +const val implementation = "implementation" +const val debugImplementation = "debugImplementation" +const val ksp = "ksp" \ No newline at end of file diff --git a/build-logic/convention/src/main/kotlin/com/funkymuse/kahelpers/ProjectConfigExtensions.kt b/build-logic/convention/src/main/kotlin/com/funkymuse/kahelpers/ProjectConfigExtensions.kt new file mode 100644 index 000000000..4110ec126 --- /dev/null +++ b/build-logic/convention/src/main/kotlin/com/funkymuse/kahelpers/ProjectConfigExtensions.kt @@ -0,0 +1,12 @@ +package com.funkymuse.kahelpers + +import org.gradle.api.Action +import org.gradle.api.Project +import org.gradle.api.plugins.ExtensionAware +import org.gradle.api.plugins.JavaPluginExtension +import org.gradle.jvm.toolchain.JavaLanguageVersion + +val Project.javaVersion get() = JavaLanguageVersion.of(versionCatalog.getVersion("app-build-javaVersion")) + +fun Project.configureJava(configure: Action): Unit = + (this as ExtensionAware).extensions.configure("java", configure) diff --git a/build-logic/convention/src/main/kotlin/com/funkymuse/kahelpers/ProjectExtensions.kt b/build-logic/convention/src/main/kotlin/com/funkymuse/kahelpers/ProjectExtensions.kt new file mode 100644 index 000000000..f080ddeca --- /dev/null +++ b/build-logic/convention/src/main/kotlin/com/funkymuse/kahelpers/ProjectExtensions.kt @@ -0,0 +1,113 @@ +package com.funkymuse.kahelpers + +import com.android.build.api.dsl.ApplicationExtension +import com.android.build.api.dsl.CommonExtension +import com.android.build.gradle.BaseExtension +import com.android.build.gradle.LibraryExtension +import com.android.build.gradle.TestExtension +import org.gradle.api.JavaVersion +import org.gradle.api.Project +import org.gradle.kotlin.dsl.configure +import org.gradle.kotlin.dsl.withType +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +fun CommonExtension<*, *, *, *, *>.configureBuildFeatures() { + buildFeatures.apply { + aidl = false + renderScript = false + resValues = false + shaders = false + } +} + +fun LibraryExtension.addLibrariesConfig() { + defaultConfig { + consumerProguardFiles("consumer-rules.pro") + } + buildTypes { + getByName("debug") { + isMinifyEnabled = false + } + } +} + + +fun Project.configureKotlinOptions() { + tasks.withType { + kotlinOptions.jvmTarget = versionCatalog.getVersion("app-build-kotlinJVMTarget") + kotlinOptions.freeCompilerArgs = listOf( + "-opt-in=kotlin.RequiresOptIn", + "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", + "-opt-in=kotlinx.coroutines.FlowPreview", + "-Xcontext-receivers" + ) + } +} + +fun Project.configureJavaCompatibilityCompileOptions(commonExtensions: CommonExtension<*, *, *, *, *>) { + commonExtensions.compileOptions { + val currentJavaVersionFromLibs = JavaVersion.valueOf( + versionCatalog.findVersion("app-build-javaVersion").get().toString() + ) + sourceCompatibility = currentJavaVersionFromLibs + targetCompatibility = currentJavaVersionFromLibs + } +} + +fun Project.configureAppPluginPackageAndNameSpace( + commonExtensions: ApplicationExtension +) { + commonExtensions.apply { + namespace = packageName + defaultConfig { + applicationId = packageName + } + } +} + +val Project.packageName get() = versionCatalog.getVersion("app-version-appId") + +fun Project.commonVersioning(libraryExtension: LibraryExtension) { + libraryExtension.apply { + setCompileSdkVersion(getCompileSDKVersion()) + defaultConfig { + minSdk = getMinSDKVersion() + testInstrumentationRunner = getTestRunner() + } + } +} + +fun Project.commonVersioning(libraryExtension: TestExtension) { + libraryExtension.apply { + setCompileSdkVersion(getCompileSDKVersion()) + defaultConfig { + minSdk = getMinSDKVersion() + testInstrumentationRunner = getTestRunner() + } + } +} + +fun Project.commonVersioning(libraryExtension: ApplicationExtension) { + libraryExtension.apply { + compileSdk = getCompileSDKVersion() + defaultConfig { + minSdk = getMinSDKVersion() + targetSdk = getMinSDKVersion() + testInstrumentationRunner = getTestRunner() + versionName = versionCatalog.getVersion("app-version-versionName") + versionCode = versionCatalog.getVersion("app-version-versionCode").toInt() + } + } +} + +fun Project.getTestRunner() = versionCatalog.getVersion("app-build-testRunner") + +fun Project.getMinSDKVersion() = versionCatalog.getVersion("app-build-minimumSDK").toInt() +fun Project.getCompileSDKVersion() = + versionCatalog.getVersion("app-build-compileSDKVersion").toInt() + +fun Project.configureLibraryAndTestNameSpace() { + configure { + namespace = packageName.plus(path.replace(":", ".").replace("-", ".")) + } +} \ No newline at end of file diff --git a/build-logic/gradle-wrapper.properties b/build-logic/gradle-wrapper.properties new file mode 100644 index 000000000..a836ef3c8 --- /dev/null +++ b/build-logic/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Sat May 06 19:10:43 CEST 2023 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/build-logic/gradle.properties b/build-logic/gradle.properties new file mode 100644 index 000000000..1c9073eb9 --- /dev/null +++ b/build-logic/gradle.properties @@ -0,0 +1,4 @@ +# Gradle properties are not passed to included builds https://github.com/gradle/gradle/issues/2534 +org.gradle.parallel=true +org.gradle.caching=true +org.gradle.configureondemand=true diff --git a/build-logic/settings.gradle.kts b/build-logic/settings.gradle.kts new file mode 100644 index 000000000..2907fbfb8 --- /dev/null +++ b/build-logic/settings.gradle.kts @@ -0,0 +1,14 @@ +dependencyResolutionManagement { + repositories { + google() + mavenCentral() + } + versionCatalogs { + create("libs") { + from(files("../gradle/libs.versions.toml")) + } + } +} + +rootProject.name = "build-logic" +include(":convention") diff --git a/build.gradle b/build.gradle deleted file mode 100644 index d4408b074..000000000 --- a/build.gradle +++ /dev/null @@ -1,193 +0,0 @@ -buildscript { - - ext { - lifecycle = '2.7.0' - retrofit = "2.9.0" - okHttp = "4.12.0" - rxBindings = "4.0.0" - glide = "4.16.0" - constraint_layout = '2.1.4' - coroutines = '1.7.3' - nav_version = '2.7.6' - rx = '3.0.1' - material = "1.11.0" - moshi = "1.15.0" - fragment = "1.6.2" - activity = "1.8.2" - appCompat = "1.6.1" - coreKTX = "1.12.0" - securityVersion = "1.1.0-alpha06" - recyclerview = '1.3.2' - annotationVersion = '1.7.1' - documentFile = '1.0.1' - swipeRefresh = '1.1.0' - viewPager = '1.0.0' - biometrics = '1.2.0-alpha05' - joda = '2.12.6' - exifinterface= '1.3.7' - palette = '1.0.0' - preference = '1.2.1' - collection = '1.3.0' - interpolator = '1.0.0' - transition = '1.4.1' - - - //app only - room_version = "2.6.1" - - - //tests - junitVersion = '4.13.2' - hamcrestVersion = '1.3' - androidXTestCoreVersion = '1.5.0' - androidXTestExtKotlinRunnerVersion = '1.1.5' - androidXTestRulesVersion = '1.2.0-beta01' - robolectricVersion = '4.11.1' - archTestingVersion = '2.2.0' - espressoVersion = '3.5.1' - - //compilation - compileVersion = 33 - minVersion = 23 - verCode = 1 - verName = "1.0.0" - testRunner = "androidx.test.runner.AndroidJUnitRunner" - - kotlin_version = '1.9.22' - } - - repositories { - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -plugins { - id 'org.jetbrains.dokka' version '1.9.10' -} - -allprojects { - group = "io.github.funkymuse" - - repositories { - google() - mavenCentral() - } -} - -tasks.register('clean', Delete) { - delete rootProject.layout.getBuildDirectory() -} - -subprojects { - switch (it.name) { - case "app": - apply plugin: 'com.android.application' - apply plugin: 'kotlin-android' - apply plugin: 'kotlin-kapt' - - dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - } - applyAndroid(it, true) - break - - case ["enums", "regex"]: - apply plugin: 'java-library' - apply plugin: 'kotlin' - apply plugin: 'org.jetbrains.dokka' - applyKotlinModule(it) - - break - - default: - //setup gradle for libraries - apply plugin: 'com.android.library' - apply plugin: 'kotlin-android' - apply plugin: 'maven-publish' - apply plugin: 'org.jetbrains.dokka' - - applyAndroid(it, false) - - dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - // Dependencies for local unit tests - testImplementation "junit:junit:$junitVersion" - testImplementation "org.hamcrest:hamcrest-all:$hamcrestVersion" - testImplementation "androidx.test.ext:junit-ktx:$androidXTestExtKotlinRunnerVersion" - testImplementation "androidx.test:core-ktx:$androidXTestCoreVersion" - testImplementation "org.robolectric:robolectric:$robolectricVersion" - testImplementation "androidx.arch.core:core-testing:$archTestingVersion" - testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines" - - // AndroidX Test - Instrumented testing - androidTestImplementation "androidx.test.ext:junit:$androidXTestExtKotlinRunnerVersion" - androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion" - } - - - it.afterEvaluate { - publishing { - publications { - release(MavenPublication) { - from components.release - } - } - } - } - - - break - } - -} - -def applyKotlinModule(project) { - project.java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - } - project.dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - } -} - -def applyAndroid(project, buildConfigCase) { - project.android { - compileSdkVersion compileVersion - - defaultConfig { - minSdkVersion minVersion - targetSdkVersion compileVersion - versionCode verCode - versionName verName - testInstrumentationRunner testRunner - } - - compileOptions { - sourceCompatibility = 17 - targetCompatibility = 17 - } - - kotlinOptions { - jvmTarget = "17" - } - - testOptions.unitTests { - includeAndroidResources = true - } - - buildFeatures { - aidl = false - renderScript = false - resValues = false - shaders = false - buildConfig = buildConfigCase - } - } - -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 000000000..f80c94a03 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,66 @@ +import com.diffplug.gradle.spotless.SpotlessPlugin + +plugins { + alias(libs.plugins.android).apply(false) + alias(libs.plugins.library).apply(false) + alias(libs.plugins.kotlinAndroid).apply(false) + alias(libs.plugins.kotlinJvm).apply(false) + alias(libs.plugins.ksp).apply(false) + alias(libs.plugins.test).apply(false) + alias(libs.plugins.spotless).apply(false) + alias(libs.plugins.dokka).apply(false) +} + +val Project.composeMetricsDir get() = layout.buildDirectory.asFile.get().absolutePath + "/compose_metrics" +val Project.composeReportsDir get() = layout.buildDirectory.asFile.get().absolutePath + "/compose_reports" + +tasks.register("cleanComposeMetrics") { + group = "Cleaning" + description = "Clean compose metrics folders" + subprojects.forEach { + if ( + it.pluginManager.hasPlugin(libs.plugins.convention.compose.library.get().pluginId) + || + it.pluginManager.hasPlugin(libs.plugins.convention.compose.app.get().pluginId) + ) { + val dir = File(it.composeMetricsDir) + if (dir.exists()) { + dir.also { file -> + println("Deleting compose metrics >>> ${file.path} <<<") + }.deleteRecursively() + } + } + } +} +tasks.register("cleanComposeReports") { + group = "Cleaning" + description = "Clean compose reports folders" + subprojects.forEach { + if ( + it.pluginManager.hasPlugin(libs.plugins.convention.compose.library.get().pluginId) + || + it.pluginManager.hasPlugin(libs.plugins.convention.compose.app.get().pluginId) + ) { + val dir = File(it.composeReportsDir) + if (dir.exists()) { + dir.also { file -> + println("Deleting compose reports >>> ${file.path} <<<") + }.deleteRecursively() + } + } + } +} + +allprojects { + plugins.matching { anyPlugin -> anyPlugin is SpotlessPlugin } + .whenPluginAdded { + extensions.configure { + kotlin { + target("**/*.kt") + targetExclude("${layout.buildDirectory.asFile.get()}/**/*.kt") + ktlint() + .setEditorConfigPath("${project.rootDir}/spotless/.editorconfig") + } + } + } +} \ No newline at end of file diff --git a/bytearray/build.gradle b/bytearray/build.gradle deleted file mode 100644 index 3ec19478f..000000000 --- a/bytearray/build.gradle +++ /dev/null @@ -1,3 +0,0 @@ -android { - namespace 'com.crazylegend.bytearray' -} \ No newline at end of file diff --git a/bytearray/build.gradle.kts b/bytearray/build.gradle.kts new file mode 100644 index 000000000..ebf7ff699 --- /dev/null +++ b/bytearray/build.gradle.kts @@ -0,0 +1,3 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} \ No newline at end of file diff --git a/bytearray/src/main/AndroidManifest.xml b/bytearray/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/bytearray/src/main/AndroidManifest.xml +++ b/bytearray/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/bytearray/src/main/java/com/crazylegend/bytearray/ByteArrayBuilder.kt b/bytearray/src/main/java/com/funkymuse/bytearray/ByteArrayBuilder.kt similarity index 96% rename from bytearray/src/main/java/com/crazylegend/bytearray/ByteArrayBuilder.kt rename to bytearray/src/main/java/com/funkymuse/bytearray/ByteArrayBuilder.kt index 41b4b3e17..04bce63be 100644 --- a/bytearray/src/main/java/com/crazylegend/bytearray/ByteArrayBuilder.kt +++ b/bytearray/src/main/java/com/funkymuse/bytearray/ByteArrayBuilder.kt @@ -1,8 +1,7 @@ -package com.crazylegend.bytearray +package com.funkymuse.bytearray /** - * Created by hristijan on 8/5/19 to long live and prosper ! * Helper class to assist with building byte arrays. Works similarly to * [StringBuilder]. */ diff --git a/bytearray/src/main/java/com/crazylegend/bytearray/ByteArrayExtensions.kt b/bytearray/src/main/java/com/funkymuse/bytearray/ByteArrayExtensions.kt similarity index 97% rename from bytearray/src/main/java/com/crazylegend/bytearray/ByteArrayExtensions.kt rename to bytearray/src/main/java/com/funkymuse/bytearray/ByteArrayExtensions.kt index fee2fc097..31a81bf72 100644 --- a/bytearray/src/main/java/com/crazylegend/bytearray/ByteArrayExtensions.kt +++ b/bytearray/src/main/java/com/funkymuse/bytearray/ByteArrayExtensions.kt @@ -1,13 +1,11 @@ -package com.crazylegend.bytearray +package com.funkymuse.bytearray import java.io.File import java.io.FileOutputStream import kotlin.experimental.xor -/** - * Created by hristijan on 3/7/19 to long live and prosper ! - */ + /** * Xor two bytes array together, byte per byte. */ diff --git a/collections/build.gradle b/collections/build.gradle deleted file mode 100644 index 542666c29..000000000 --- a/collections/build.gradle +++ /dev/null @@ -1,9 +0,0 @@ -dependencies { - implementation project(path: ':common') - implementation "androidx.collection:collection-ktx:$collection" - implementation "androidx.core:core-ktx:$coreKTX" -} - -android { - namespace 'com.crazylegend.collections' -} \ No newline at end of file diff --git a/collections/build.gradle.kts b/collections/build.gradle.kts new file mode 100644 index 000000000..60d10cac8 --- /dev/null +++ b/collections/build.gradle.kts @@ -0,0 +1,10 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(projects.common) + implementation(libs.androidx.collection.ktx) + implementation(libs.androidx.core.ktx) + testImplementation(libs.bundles.unit.test) +} \ No newline at end of file diff --git a/collections/src/main/AndroidManifest.xml b/collections/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/collections/src/main/AndroidManifest.xml +++ b/collections/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/collections/src/main/java/com/crazylegend/collections/CollectionsExtensions.kt b/collections/src/main/java/com/funkymuse/collections/CollectionsExtensions.kt similarity index 98% rename from collections/src/main/java/com/crazylegend/collections/CollectionsExtensions.kt rename to collections/src/main/java/com/funkymuse/collections/CollectionsExtensions.kt index fb20a5f81..9323ccb55 100644 --- a/collections/src/main/java/com/crazylegend/collections/CollectionsExtensions.kt +++ b/collections/src/main/java/com/funkymuse/collections/CollectionsExtensions.kt @@ -1,19 +1,13 @@ @file:Suppress("UNCHECKED_CAST") -package com.crazylegend.collections +package com.funkymuse.collections import android.content.res.TypedArray import androidx.collection.LongSparseArray import androidx.collection.SparseArrayCompat import androidx.collection.forEach -import com.crazylegend.common.randomUUIDstring -import java.util.* -import kotlin.collections.ArrayList - - -/** - * Created by hristijan on 2/22/19 to long live and prosper ! - */ +import com.funkymuse.common.randomUUIDstring +import java.util.Collections /** diff --git a/collections/src/main/java/com/crazylegend/collections/CollectionsExtensions2.kt b/collections/src/main/java/com/funkymuse/collections/CollectionsExtensions2.kt similarity index 97% rename from collections/src/main/java/com/crazylegend/collections/CollectionsExtensions2.kt rename to collections/src/main/java/com/funkymuse/collections/CollectionsExtensions2.kt index 621e75155..92d632416 100644 --- a/collections/src/main/java/com/crazylegend/collections/CollectionsExtensions2.kt +++ b/collections/src/main/java/com/funkymuse/collections/CollectionsExtensions2.kt @@ -1,9 +1,7 @@ -package com.crazylegend.collections +package com.funkymuse.collections + -/** - * Created by crazy on 1/24/20 to long live and prosper ! - */ inline fun MutableMap.putAllIfNotNull( diff --git a/collections/src/main/java/com/crazylegend/collections/CollectionsExtensions3.kt b/collections/src/main/java/com/funkymuse/collections/CollectionsExtensions3.kt similarity index 98% rename from collections/src/main/java/com/crazylegend/collections/CollectionsExtensions3.kt rename to collections/src/main/java/com/funkymuse/collections/CollectionsExtensions3.kt index f97866a15..bffb7a56b 100644 --- a/collections/src/main/java/com/crazylegend/collections/CollectionsExtensions3.kt +++ b/collections/src/main/java/com/funkymuse/collections/CollectionsExtensions3.kt @@ -1,13 +1,9 @@ -package com.crazylegend.collections +package com.funkymuse.collections import android.util.SparseArray -import java.util.* -import kotlin.collections.ArrayList - -/** - * Created by funkymuse on 5/26/21 to long live and prosper ! - */ - +import java.util.ArrayDeque +import java.util.Deque +import java.util.Random /** * USAGE diff --git a/collections/src/main/java/com/crazylegend/collections/CollectionsExtensions4.kt b/collections/src/main/java/com/funkymuse/collections/CollectionsExtensions4.kt similarity index 98% rename from collections/src/main/java/com/crazylegend/collections/CollectionsExtensions4.kt rename to collections/src/main/java/com/funkymuse/collections/CollectionsExtensions4.kt index d6d39ac9a..a87673db3 100644 --- a/collections/src/main/java/com/crazylegend/collections/CollectionsExtensions4.kt +++ b/collections/src/main/java/com/funkymuse/collections/CollectionsExtensions4.kt @@ -1,13 +1,9 @@ -package com.crazylegend.collections +package com.funkymuse.collections import android.os.Build -import java.util.* -import kotlin.Comparator -import kotlin.collections.ArrayList - -/** - * Created by funkymuse on 5/26/21 to long live and prosper ! - */ +import java.util.Collections +import java.util.LinkedList +import java.util.Random fun MutableList.removeInRange(position: Int, count: Int) { diff --git a/collections/src/main/java/com/crazylegend/collections/CollectionsExtensions5.kt b/collections/src/main/java/com/funkymuse/collections/CollectionsExtensions5.kt similarity index 92% rename from collections/src/main/java/com/crazylegend/collections/CollectionsExtensions5.kt rename to collections/src/main/java/com/funkymuse/collections/CollectionsExtensions5.kt index f5ef996a0..4135b0c09 100644 --- a/collections/src/main/java/com/crazylegend/collections/CollectionsExtensions5.kt +++ b/collections/src/main/java/com/funkymuse/collections/CollectionsExtensions5.kt @@ -1,9 +1,7 @@ -package com.crazylegend.collections +package com.funkymuse.collections import kotlin.collections.associateBy -/** - * Created by Hristijan, date 10/5/21 - */ + fun Iterable.zipBy( other: Iterable, diff --git a/collections/src/test/java/com/crazylegend/collections/CollectionsExtensions2Test.kt b/collections/src/test/java/com/funkymuse/collections/CollectionsExtensions2Test.kt similarity index 78% rename from collections/src/test/java/com/crazylegend/collections/CollectionsExtensions2Test.kt rename to collections/src/test/java/com/funkymuse/collections/CollectionsExtensions2Test.kt index 574341972..01d3b7165 100644 --- a/collections/src/test/java/com/crazylegend/collections/CollectionsExtensions2Test.kt +++ b/collections/src/test/java/com/funkymuse/collections/CollectionsExtensions2Test.kt @@ -1,11 +1,9 @@ -package com.crazylegend.collections +package com.funkymuse.collections import org.junit.Assert.assertEquals import org.junit.Test -/** - * Created by crazy on 6/15/20 to long live and prosper ! - */ + class CollectionsExtensions2Test { @Test fun isListAndNullOrEmpty_behaviorCorrect() { diff --git a/color/build.gradle b/color/build.gradle deleted file mode 100644 index 2e3339671..000000000 --- a/color/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ - -dependencies { - implementation project(path: ':common') - implementation project(path: ':numbers') - - implementation "androidx.core:core-ktx:$coreKTX" - implementation "androidx.appcompat:appcompat:$appCompat" -} - -android { - namespace 'com.crazylegend.color' -} \ No newline at end of file diff --git a/color/build.gradle.kts b/color/build.gradle.kts new file mode 100644 index 000000000..8cb9e252d --- /dev/null +++ b/color/build.gradle.kts @@ -0,0 +1,11 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(projects.common) + implementation(projects.numbers) + + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.appcompat) +} \ No newline at end of file diff --git a/color/src/main/AndroidManifest.xml b/color/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/color/src/main/AndroidManifest.xml +++ b/color/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/color/src/main/java/com/crazylegend/color/ColorExtensions.kt b/color/src/main/java/com/funkymuse/color/ColorExtensions.kt similarity index 97% rename from color/src/main/java/com/crazylegend/color/ColorExtensions.kt rename to color/src/main/java/com/funkymuse/color/ColorExtensions.kt index fe506b69a..762791690 100644 --- a/color/src/main/java/com/crazylegend/color/ColorExtensions.kt +++ b/color/src/main/java/com/funkymuse/color/ColorExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.color +package com.funkymuse.color import android.annotation.SuppressLint import android.content.Context @@ -6,27 +6,27 @@ import android.content.res.ColorStateList import android.graphics.Color import android.graphics.PorterDuff import android.graphics.drawable.Drawable -import android.os.Build -import android.widget.* +import android.widget.CheckBox +import android.widget.EditText +import android.widget.ImageButton +import android.widget.ProgressBar +import android.widget.RadioButton +import android.widget.SeekBar +import android.widget.TextView import androidx.annotation.ColorInt import androidx.annotation.FloatRange import androidx.appcompat.widget.AppCompatEditText import androidx.appcompat.widget.Toolbar import androidx.core.content.ContextCompat import androidx.core.graphics.ColorUtils -import androidx.core.graphics.drawable.DrawableCompat -import com.crazylegend.common.resolveColor -import com.crazylegend.numbers.round -import java.util.* +import com.funkymuse.common.resolveColor +import com.funkymuse.numbers.round +import java.util.Locale +import java.util.Random import kotlin.math.abs import kotlin.math.roundToInt -/** - * Created by hristijan on 3/4/19 to long live and prosper ! - */ - - /** * Return the color with 0xFF opacity. * E.g., `0xabcdef` will be translated to `0xFFabcdef`. diff --git a/common/build.gradle b/common/build.gradle deleted file mode 100644 index 407906f35..000000000 --- a/common/build.gradle +++ /dev/null @@ -1,8 +0,0 @@ -dependencies { - implementation "androidx.core:core-ktx:$coreKTX" - implementation "androidx.appcompat:appcompat:$appCompat" -} - -android { - namespace 'com.crazylegend.common' -} \ No newline at end of file diff --git a/common/build.gradle.kts b/common/build.gradle.kts new file mode 100644 index 000000000..41ce251c6 --- /dev/null +++ b/common/build.gradle.kts @@ -0,0 +1,8 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.appcompat) +} \ No newline at end of file diff --git a/common/src/main/java/com/crazylegend/common/BasicExtensions.kt b/common/src/main/java/com/funkymuse/common/BasicExtensions.kt similarity index 91% rename from common/src/main/java/com/crazylegend/common/BasicExtensions.kt rename to common/src/main/java/com/funkymuse/common/BasicExtensions.kt index 7c4c2d4c9..8ebf669c8 100644 --- a/common/src/main/java/com/crazylegend/common/BasicExtensions.kt +++ b/common/src/main/java/com/funkymuse/common/BasicExtensions.kt @@ -1,9 +1,4 @@ -package com.crazylegend.common - - -/** - * Created by Hristijan on 2/4/19 to long live and prosper ! - */ +package com.funkymuse.common val T.isNull: Boolean get() { diff --git a/common/src/main/java/com/crazylegend/common/BatteryStatusModel.kt b/common/src/main/java/com/funkymuse/common/BatteryStatusModel.kt similarity index 85% rename from common/src/main/java/com/crazylegend/common/BatteryStatusModel.kt rename to common/src/main/java/com/funkymuse/common/BatteryStatusModel.kt index 5245581fa..c7208a176 100644 --- a/common/src/main/java/com/crazylegend/common/BatteryStatusModel.kt +++ b/common/src/main/java/com/funkymuse/common/BatteryStatusModel.kt @@ -1,8 +1,5 @@ -package com.crazylegend.common +package com.funkymuse.common -/** - * Created by funkymuse on 5/26/21 to long live and prosper ! - */ data class BatteryStatusModel( val isCharging: Boolean, val isUsbCharging: Boolean, diff --git a/common/src/main/java/com/crazylegend/common/BooleanExtensions.kt b/common/src/main/java/com/funkymuse/common/BooleanExtensions.kt similarity index 92% rename from common/src/main/java/com/crazylegend/common/BooleanExtensions.kt rename to common/src/main/java/com/funkymuse/common/BooleanExtensions.kt index 16011e4e7..f41e7f31e 100644 --- a/common/src/main/java/com/crazylegend/common/BooleanExtensions.kt +++ b/common/src/main/java/com/funkymuse/common/BooleanExtensions.kt @@ -1,9 +1,4 @@ -package com.crazylegend.common - - -/** - * Created by hristijan on 3/1/19 to long live and prosper ! - */ +package com.funkymuse.common /** * Converts Boolean to Int, if true then 1 else 0 diff --git a/common/src/main/java/com/crazylegend/common/CommonExtensions.kt b/common/src/main/java/com/funkymuse/common/CommonExtensions.kt similarity index 95% rename from common/src/main/java/com/crazylegend/common/CommonExtensions.kt rename to common/src/main/java/com/funkymuse/common/CommonExtensions.kt index f6afef0f8..a397c164e 100644 --- a/common/src/main/java/com/crazylegend/common/CommonExtensions.kt +++ b/common/src/main/java/com/funkymuse/common/CommonExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.common +package com.funkymuse.common import android.content.Context import android.net.ConnectivityManager @@ -9,10 +9,6 @@ import android.view.inputmethod.EditorInfo import androidx.annotation.AttrRes import androidx.annotation.ColorInt -/** - * Created by funkymuse on 5/26/21 to long live and prosper ! - */ - @Suppress("DEPRECATION") val Context.isOnline: Boolean get() { diff --git a/common/src/main/java/com/crazylegend/common/InMemoryCache.kt b/common/src/main/java/com/funkymuse/common/InMemoryCache.kt similarity index 93% rename from common/src/main/java/com/crazylegend/common/InMemoryCache.kt rename to common/src/main/java/com/funkymuse/common/InMemoryCache.kt index c35f386dc..4a53137f1 100644 --- a/common/src/main/java/com/crazylegend/common/InMemoryCache.kt +++ b/common/src/main/java/com/funkymuse/common/InMemoryCache.kt @@ -1,10 +1,4 @@ -package com.crazylegend.common - - -/** - * Created by hristijan on 3/1/19 to long live and prosper ! - */ - +package com.funkymuse.common /** * Class for an InMemory Cache to keep your variables globally in heap and get them wherever you want. diff --git a/common/src/main/java/com/crazylegend/common/OtherUtils.kt b/common/src/main/java/com/funkymuse/common/OtherUtils.kt similarity index 96% rename from common/src/main/java/com/crazylegend/common/OtherUtils.kt rename to common/src/main/java/com/funkymuse/common/OtherUtils.kt index 06bd4d34f..d9e8e28ac 100644 --- a/common/src/main/java/com/crazylegend/common/OtherUtils.kt +++ b/common/src/main/java/com/funkymuse/common/OtherUtils.kt @@ -1,4 +1,4 @@ -package com.crazylegend.common +package com.funkymuse.common import android.Manifest.permission.ACCESS_WIFI_STATE import android.Manifest.permission.INTERNET @@ -14,8 +14,29 @@ import android.graphics.Color import android.graphics.drawable.Drawable import android.net.wifi.WifiManager import android.os.BatteryManager -import android.os.Build.* -import android.os.Build.VERSION.* +import android.os.Build.BOARD +import android.os.Build.BOOTLOADER +import android.os.Build.BRAND +import android.os.Build.CPU_ABI +import android.os.Build.CPU_ABI2 +import android.os.Build.DEVICE +import android.os.Build.DISPLAY +import android.os.Build.FINGERPRINT +import android.os.Build.HARDWARE +import android.os.Build.HOST +import android.os.Build.ID +import android.os.Build.MANUFACTURER +import android.os.Build.MODEL +import android.os.Build.PRODUCT +import android.os.Build.SUPPORTED_ABIS +import android.os.Build.TAGS +import android.os.Build.TIME +import android.os.Build.TYPE +import android.os.Build.USER +import android.os.Build.VERSION.CODENAME +import android.os.Build.VERSION.INCREMENTAL +import android.os.Build.VERSION.RELEASE +import android.os.Build.VERSION.SDK_INT import android.os.Build.VERSION_CODES.LOLLIPOP import android.os.Handler import android.os.Looper @@ -28,7 +49,7 @@ import androidx.annotation.ColorInt import androidx.annotation.IntRange import androidx.annotation.RequiresPermission import androidx.collection.LruCache -import com.crazylegend.common.device.DefaultUserAgent +import com.funkymuse.common.device.DefaultUserAgent import java.io.Closeable import java.math.BigInteger import java.net.InetAddress @@ -36,15 +57,12 @@ import java.net.NetworkInterface import java.net.SocketException import java.nio.ByteBuffer import java.nio.charset.Charset -import java.util.* +import java.util.Arrays +import java.util.Date +import java.util.Locale +import java.util.UUID import java.util.concurrent.TimeUnit - -/** - * Created by hristijan on 2/22/19 to long live and prosper borrowed from http://kotlinextensions.com - */ - - /** * Method to check is aboveApi. */ diff --git a/common/src/main/java/com/crazylegend/common/device/DefaultUserAgent.kt b/common/src/main/java/com/funkymuse/common/device/DefaultUserAgent.kt similarity index 94% rename from common/src/main/java/com/crazylegend/common/device/DefaultUserAgent.kt rename to common/src/main/java/com/funkymuse/common/device/DefaultUserAgent.kt index 8c3862743..db1d5cf92 100644 --- a/common/src/main/java/com/crazylegend/common/device/DefaultUserAgent.kt +++ b/common/src/main/java/com/funkymuse/common/device/DefaultUserAgent.kt @@ -1,15 +1,10 @@ -package com.crazylegend.common.device +package com.funkymuse.common.device import android.annotation.SuppressLint import android.content.Context import android.webkit.WebSettings import android.webkit.WebView - -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ - /** * https://code.google.com/p/codenameone/issues/detail?id=294 */ diff --git a/common/src/main/java/com/crazylegend/common/device/DeviceUtils.kt b/common/src/main/java/com/funkymuse/common/device/DeviceUtils.kt similarity index 98% rename from common/src/main/java/com/crazylegend/common/device/DeviceUtils.kt rename to common/src/main/java/com/funkymuse/common/device/DeviceUtils.kt index 14e72d12b..7ebab9ef8 100644 --- a/common/src/main/java/com/crazylegend/common/device/DeviceUtils.kt +++ b/common/src/main/java/com/funkymuse/common/device/DeviceUtils.kt @@ -1,18 +1,16 @@ -package com.crazylegend.common.device +package com.funkymuse.common.device import android.annotation.SuppressLint import android.os.Build import android.os.Environment import android.text.TextUtils -import java.io.* -import java.util.* - - -/** - * Created by hristijan on 3/1/19 to long live and prosper ! - */ - +import java.io.BufferedReader +import java.io.File +import java.io.FileInputStream +import java.io.IOException +import java.io.InputStreamReader +import java.util.Properties /** * Helper Class to Provide the Device Informations diff --git a/common/src/main/java/com/crazylegend/common/string/CommonStringExtensions.kt b/common/src/main/java/com/funkymuse/common/string/CommonStringExtensions.kt similarity index 59% rename from common/src/main/java/com/crazylegend/common/string/CommonStringExtensions.kt rename to common/src/main/java/com/funkymuse/common/string/CommonStringExtensions.kt index e449c4954..336c2c028 100644 --- a/common/src/main/java/com/crazylegend/common/string/CommonStringExtensions.kt +++ b/common/src/main/java/com/funkymuse/common/string/CommonStringExtensions.kt @@ -1,10 +1,6 @@ -package com.crazylegend.common.string +package com.funkymuse.common.string import android.text.Spanned import androidx.core.text.HtmlCompat -/** - * Created by funkymuse on 5/26/21 to long live and prosper ! - */ - fun String.toHtmlSpan(): Spanned = HtmlCompat.fromHtml(this, HtmlCompat.FROM_HTML_MODE_LEGACY) \ No newline at end of file diff --git a/context/build.gradle b/context/build.gradle deleted file mode 100644 index 7d9615077..000000000 --- a/context/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ - -dependencies { - implementation project(path: ':contextGetters') - implementation project(path: ':common') - - implementation "androidx.core:core-ktx:$coreKTX" - implementation "androidx.appcompat:appcompat:$appCompat" -} - -android { - namespace 'com.crazylegend.context' -} \ No newline at end of file diff --git a/context/build.gradle.kts b/context/build.gradle.kts new file mode 100644 index 000000000..f79419786 --- /dev/null +++ b/context/build.gradle.kts @@ -0,0 +1,11 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(projects.common) + implementation(projects.contextGetters) + + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.appcompat) +} \ No newline at end of file diff --git a/context/src/main/java/com/crazylegend/context/ContextDialogs.kt b/context/src/main/java/com/funkymuse/context/ContextDialogs.kt similarity index 94% rename from context/src/main/java/com/crazylegend/context/ContextDialogs.kt rename to context/src/main/java/com/funkymuse/context/ContextDialogs.kt index 5c901b618..032d12a90 100644 --- a/context/src/main/java/com/crazylegend/context/ContextDialogs.kt +++ b/context/src/main/java/com/funkymuse/context/ContextDialogs.kt @@ -1,14 +1,8 @@ -package com.crazylegend.context +package com.funkymuse.context import android.content.Context import androidx.appcompat.app.AlertDialog - -/** - * Created by hristijan on 3/1/19 to long live and prosper ! - */ - - /** * There is No Such Thing name Hard Toast, Its just an AlertDialog which will the [msg] you passed until user cancels it. */ diff --git a/context/src/main/java/com/crazylegend/context/ContextExtensions.kt b/context/src/main/java/com/funkymuse/context/ContextExtensions.kt similarity index 97% rename from context/src/main/java/com/crazylegend/context/ContextExtensions.kt rename to context/src/main/java/com/funkymuse/context/ContextExtensions.kt index 611bf773d..4ee071883 100644 --- a/context/src/main/java/com/crazylegend/context/ContextExtensions.kt +++ b/context/src/main/java/com/funkymuse/context/ContextExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.context +package com.funkymuse.context import android.Manifest.permission.READ_PHONE_STATE import android.annotation.SuppressLint @@ -18,13 +18,8 @@ import android.view.Gravity import android.widget.Toast import androidx.annotation.IntRange import androidx.annotation.RequiresPermission -import com.crazylegend.contextgetters.connectivityManager -import com.crazylegend.contextgetters.telephonyManager - - -/** - * Created by Hristijan on 2/1/19 to long live and prosper ! - */ +import com.funkymuse.contextgetters.connectivityManager +import com.funkymuse.contextgetters.telephonyManager inline fun Context.launch() { this.startActivity(Intent(this, T::class.java)) diff --git a/context/src/main/java/com/crazylegend/context/ContextExtensions2.kt b/context/src/main/java/com/funkymuse/context/ContextExtensions2.kt similarity index 92% rename from context/src/main/java/com/crazylegend/context/ContextExtensions2.kt rename to context/src/main/java/com/funkymuse/context/ContextExtensions2.kt index 1e79b89f0..91ee01d5a 100644 --- a/context/src/main/java/com/crazylegend/context/ContextExtensions2.kt +++ b/context/src/main/java/com/funkymuse/context/ContextExtensions2.kt @@ -1,41 +1,55 @@ -package com.crazylegend.context +package com.funkymuse.context import android.Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS import android.app.ActivityManager import android.app.PendingIntent -import android.content.* +import android.content.ActivityNotFoundException +import android.content.ClipData +import android.content.ClipboardManager +import android.content.Context +import android.content.Intent import android.content.pm.PackageManager import android.content.pm.SigningInfo import android.content.res.ColorStateList -import android.graphics.* +import android.graphics.Bitmap +import android.graphics.BlendMode +import android.graphics.BlendModeColorFilter +import android.graphics.PorterDuff import android.graphics.drawable.Drawable import android.net.Uri import android.os.Build import android.os.Bundle import android.provider.Settings import android.provider.Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS -import android.text.Spanned import android.util.DisplayMetrics -import android.view.* +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.view.Window +import android.view.WindowManager import android.view.inputmethod.InputMethodManager -import androidx.annotation.* +import androidx.annotation.BoolRes +import androidx.annotation.ColorRes +import androidx.annotation.DrawableRes +import androidx.annotation.IdRes +import androidx.annotation.LayoutRes +import androidx.annotation.PluralsRes +import androidx.annotation.RequiresApi +import androidx.annotation.RequiresPermission +import androidx.annotation.StringRes import androidx.appcompat.app.AlertDialog import androidx.appcompat.widget.Toolbar import androidx.core.app.ActivityManagerCompat import androidx.core.app.ActivityOptionsCompat import androidx.core.content.ContextCompat import androidx.core.content.FileProvider -import androidx.fragment.app.Fragment -import androidx.fragment.app.FragmentActivity -import com.crazylegend.contextgetters.* +import com.funkymuse.contextgetters.activityManager +import com.funkymuse.contextgetters.clipboardManager +import com.funkymuse.contextgetters.inputMethodManager +import com.funkymuse.contextgetters.layoutInflater +import com.funkymuse.contextgetters.powerManager import java.io.File - -/** - * Created by Hristijan on 2/4/19 to long live and prosper ! - */ - - inline fun Context.openEmail( title: String = "Select an email client", onCantHandleAction: () -> Unit = {} diff --git a/context/src/main/java/com/crazylegend/context/ContextExtensions3.kt b/context/src/main/java/com/funkymuse/context/ContextExtensions3.kt similarity index 97% rename from context/src/main/java/com/crazylegend/context/ContextExtensions3.kt rename to context/src/main/java/com/funkymuse/context/ContextExtensions3.kt index eeb2d99fb..e731e1d74 100644 --- a/context/src/main/java/com/crazylegend/context/ContextExtensions3.kt +++ b/context/src/main/java/com/funkymuse/context/ContextExtensions3.kt @@ -1,4 +1,4 @@ -package com.crazylegend.context +package com.funkymuse.context import android.Manifest import android.Manifest.permission.REBOOT @@ -23,29 +23,22 @@ import android.text.TextUtils.isEmpty import android.util.TypedValue import android.view.View import androidx.annotation.* -import androidx.core.app.ActivityCompat import androidx.core.app.NotificationManagerCompat import androidx.core.content.ContextCompat import androidx.core.content.res.ResourcesCompat import androidx.core.graphics.drawable.DrawableCompat import androidx.fragment.app.DialogFragment -import com.crazylegend.common.ifTrue -import com.crazylegend.common.withOpacity -import com.crazylegend.contextgetters.activityManager -import com.crazylegend.contextgetters.audioManager -import com.crazylegend.contextgetters.powerManager -import com.crazylegend.contextgetters.telephonyManager +import com.funkymuse.common.ifTrue +import com.funkymuse.common.withOpacity +import com.funkymuse.contextgetters.activityManager +import com.funkymuse.contextgetters.audioManager +import com.funkymuse.contextgetters.powerManager +import com.funkymuse.contextgetters.telephonyManager import java.io.BufferedReader import java.io.InputStream import java.io.InputStreamReader import java.util.* - -/** - * Created by hristijan on 2/27/19 to long live and prosper ! - */ - - /** * check if you can resolve the intent */ diff --git a/context/src/main/java/com/crazylegend/context/ContextExtensions4.kt b/context/src/main/java/com/funkymuse/context/ContextExtensions4.kt similarity index 90% rename from context/src/main/java/com/crazylegend/context/ContextExtensions4.kt rename to context/src/main/java/com/funkymuse/context/ContextExtensions4.kt index da3d58502..a2a1ff0a3 100644 --- a/context/src/main/java/com/crazylegend/context/ContextExtensions4.kt +++ b/context/src/main/java/com/funkymuse/context/ContextExtensions4.kt @@ -1,4 +1,4 @@ -package com.crazylegend.context +package com.funkymuse.context import android.content.Context import android.content.res.Configuration @@ -8,23 +8,16 @@ import android.net.Network import android.net.NetworkCapabilities import android.net.NetworkCapabilities.NET_CAPABILITY_INTERNET import android.os.BatteryManager -import android.os.Build import android.telephony.TelephonyManager import android.view.View -import androidx.annotation.RequiresApi import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment -import com.crazylegend.contextgetters.batteryManager -import com.crazylegend.contextgetters.connectivityManager -import com.crazylegend.contextgetters.telephonyManager -import com.crazylegend.contextgetters.uiModeManager +import com.funkymuse.contextgetters.batteryManager +import com.funkymuse.contextgetters.connectivityManager +import com.funkymuse.contextgetters.telephonyManager +import com.funkymuse.contextgetters.uiModeManager import java.io.InputStream -/** - * Created by crazy on 9/7/20 to long live and prosper ! - */ - - fun Fragment.dp2px(dpValue: Float): Int { return requireActivity().dp2px(dpValue) } diff --git a/context/src/main/java/com/crazylegend/context/ContextListeners.kt b/context/src/main/java/com/funkymuse/context/ContextListeners.kt similarity index 82% rename from context/src/main/java/com/crazylegend/context/ContextListeners.kt rename to context/src/main/java/com/funkymuse/context/ContextListeners.kt index 3064b114d..887692638 100644 --- a/context/src/main/java/com/crazylegend/context/ContextListeners.kt +++ b/context/src/main/java/com/funkymuse/context/ContextListeners.kt @@ -1,15 +1,9 @@ -package com.crazylegend.context +package com.funkymuse.context import android.content.Context import android.os.Build import androidx.annotation.RequiresApi -import com.crazylegend.contextgetters.powerManager - - -/** - * Created by hristijan on 7/26/19 to long live and prosper ! - */ - +import com.funkymuse.contextgetters.powerManager /** * Thermal listener diff --git a/contextGetters/build.gradle b/contextGetters/build.gradle deleted file mode 100644 index bc21e4f23..000000000 --- a/contextGetters/build.gradle +++ /dev/null @@ -1,11 +0,0 @@ - -dependencies { - implementation project(path: ':common') - - implementation "androidx.core:core-ktx:$coreKTX" - implementation "androidx.appcompat:appcompat:$appCompat" -} - -android { - namespace 'com.crazylegend.contextgetters' -} \ No newline at end of file diff --git a/contextGetters/build.gradle.kts b/contextGetters/build.gradle.kts new file mode 100644 index 000000000..025b6de41 --- /dev/null +++ b/contextGetters/build.gradle.kts @@ -0,0 +1,10 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(projects.common) + + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.appcompat) +} \ No newline at end of file diff --git a/contextGetters/src/main/AndroidManifest.xml b/contextGetters/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/contextGetters/src/main/AndroidManifest.xml +++ b/contextGetters/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/contextGetters/src/main/java/com/crazylegend/contextgetters/ContextExensionsGetters.kt b/contextGetters/src/main/java/com/funkymuse/contextgetters/ContextExensionsGetters.kt similarity index 79% rename from contextGetters/src/main/java/com/crazylegend/contextgetters/ContextExensionsGetters.kt rename to contextGetters/src/main/java/com/funkymuse/contextgetters/ContextExensionsGetters.kt index 1c7c0a4d6..6b828276f 100644 --- a/contextGetters/src/main/java/com/crazylegend/contextgetters/ContextExensionsGetters.kt +++ b/contextGetters/src/main/java/com/funkymuse/contextgetters/ContextExensionsGetters.kt @@ -1,9 +1,19 @@ -package com.crazylegend.contextgetters +package com.funkymuse.contextgetters import android.accounts.AccountManager import android.annotation.SuppressLint import android.annotation.TargetApi -import android.app.* +import android.app.Activity +import android.app.ActivityManager +import android.app.AlarmManager +import android.app.AppOpsManager +import android.app.DownloadManager +import android.app.KeyguardManager +import android.app.Notification +import android.app.NotificationManager +import android.app.SearchManager +import android.app.UiModeManager +import android.app.WallpaperManager import android.app.admin.DevicePolicyManager import android.app.job.JobScheduler import android.app.usage.UsageStatsManager @@ -11,13 +21,60 @@ import android.appwidget.AppWidgetManager import android.bluetooth.BluetoothManager import android.content.ClipboardManager import android.content.Context -import android.content.Context.* +import android.content.Context.ACCESSIBILITY_SERVICE +import android.content.Context.ACCOUNT_SERVICE +import android.content.Context.ACTIVITY_SERVICE +import android.content.Context.ALARM_SERVICE +import android.content.Context.APPWIDGET_SERVICE +import android.content.Context.APP_OPS_SERVICE +import android.content.Context.AUDIO_SERVICE +import android.content.Context.BATTERY_SERVICE +import android.content.Context.BLUETOOTH_SERVICE +import android.content.Context.CAMERA_SERVICE +import android.content.Context.CAPTIONING_SERVICE +import android.content.Context.CLIPBOARD_SERVICE +import android.content.Context.CONNECTIVITY_SERVICE +import android.content.Context.CONSUMER_IR_SERVICE +import android.content.Context.DEVICE_POLICY_SERVICE +import android.content.Context.DISPLAY_SERVICE +import android.content.Context.DOWNLOAD_SERVICE +import android.content.Context.DROPBOX_SERVICE +import android.content.Context.INPUT_METHOD_SERVICE +import android.content.Context.JOB_SCHEDULER_SERVICE +import android.content.Context.KEYGUARD_SERVICE +import android.content.Context.LAUNCHER_APPS_SERVICE +import android.content.Context.LAYOUT_INFLATER_SERVICE +import android.content.Context.LOCATION_SERVICE +import android.content.Context.MEDIA_PROJECTION_SERVICE +import android.content.Context.MEDIA_ROUTER_SERVICE +import android.content.Context.MEDIA_SESSION_SERVICE +import android.content.Context.NFC_SERVICE +import android.content.Context.NOTIFICATION_SERVICE +import android.content.Context.NSD_SERVICE +import android.content.Context.POWER_SERVICE +import android.content.Context.PRINT_SERVICE +import android.content.Context.RESTRICTIONS_SERVICE +import android.content.Context.SEARCH_SERVICE +import android.content.Context.SENSOR_SERVICE +import android.content.Context.STORAGE_SERVICE +import android.content.Context.TELECOM_SERVICE +import android.content.Context.TELEPHONY_SERVICE +import android.content.Context.TEXT_SERVICES_MANAGER_SERVICE +import android.content.Context.TV_INPUT_SERVICE +import android.content.Context.UI_MODE_SERVICE +import android.content.Context.USAGE_STATS_SERVICE +import android.content.Context.USB_SERVICE +import android.content.Context.USER_SERVICE +import android.content.Context.VIBRATOR_SERVICE +import android.content.Context.WALLPAPER_SERVICE +import android.content.Context.WIFI_P2P_SERVICE +import android.content.Context.WIFI_SERVICE +import android.content.Context.WINDOW_SERVICE import android.content.Intent import android.content.RestrictionsManager import android.content.pm.LauncherApps import android.content.pm.PackageManager import android.content.res.Configuration -import android.graphics.drawable.Drawable import android.hardware.ConsumerIrManager import android.hardware.SensorManager import android.hardware.camera2.CameraManager @@ -35,7 +92,12 @@ import android.net.nsd.NsdManager import android.net.wifi.WifiManager import android.net.wifi.p2p.WifiP2pManager import android.nfc.NfcManager -import android.os.* +import android.os.BatteryManager +import android.os.Build +import android.os.DropBoxManager +import android.os.PowerManager +import android.os.UserManager +import android.os.Vibrator import android.os.storage.StorageManager import android.print.PrintManager import android.telecom.TelecomManager @@ -47,19 +109,11 @@ import android.view.accessibility.AccessibilityManager import android.view.accessibility.CaptioningManager import android.view.inputmethod.InputMethodManager import android.view.textservice.TextServicesManager -import androidx.annotation.ColorRes import androidx.annotation.DrawableRes import androidx.annotation.RequiresApi -import androidx.appcompat.content.res.AppCompatResources import androidx.core.app.NotificationCompat import androidx.core.content.ContextCompat import androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat -import java.lang.Exception - - -/** - * Created by hristijan on 2/22/19 to long live and prosper ! - */ /** * Get inputManager for Context. diff --git a/coroutines/build.gradle b/coroutines/build.gradle deleted file mode 100644 index e9af299fe..000000000 --- a/coroutines/build.gradle +++ /dev/null @@ -1,16 +0,0 @@ -dependencies { - //coroutines - api "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines" - api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines" - - //live data - implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle" - - implementation "androidx.fragment:fragment-ktx:$fragment" - implementation "androidx.appcompat:appcompat:$appCompat" - -} - -android { - namespace 'com.crazylegend.coroutines' -} \ No newline at end of file diff --git a/coroutines/build.gradle.kts b/coroutines/build.gradle.kts new file mode 100644 index 000000000..227e94214 --- /dev/null +++ b/coroutines/build.gradle.kts @@ -0,0 +1,15 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + //coroutines + api(libs.kotlinx.coroutines.android) + api(libs.kotlinx.coroutines.core) + + //live data + implementation(libs.androidx.lifecycle.viewmodel.ktx) + + implementation(libs.androidx.fragment.ktx) + implementation(libs.androidx.appcompat) +} \ No newline at end of file diff --git a/coroutines/src/main/java/com/crazylegend/coroutines/AsyncCoroutines.kt b/coroutines/src/main/java/com/funkymuse/coroutines/AsyncCoroutines.kt similarity index 94% rename from coroutines/src/main/java/com/crazylegend/coroutines/AsyncCoroutines.kt rename to coroutines/src/main/java/com/funkymuse/coroutines/AsyncCoroutines.kt index d15192a86..6d0cd2265 100644 --- a/coroutines/src/main/java/com/crazylegend/coroutines/AsyncCoroutines.kt +++ b/coroutines/src/main/java/com/funkymuse/coroutines/AsyncCoroutines.kt @@ -1,14 +1,14 @@ -package com.crazylegend.coroutines +package com.funkymuse.coroutines import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.viewModelScope -import kotlinx.coroutines.* +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Job +import kotlinx.coroutines.async +import kotlinx.coroutines.launch +import kotlinx.coroutines.supervisorScope -/** - * Created by hristijan on 8/26/19 to long live and prosper ! - */ - inline fun AndroidViewModel.makeIOCall( crossinline onCallExecuted: () -> Unit = {}, crossinline onErrorAction: (throwable: Throwable) -> Unit = { _ -> }, diff --git a/coroutines/src/main/java/com/crazylegend/coroutines/AutoDisposableJob.kt b/coroutines/src/main/java/com/funkymuse/coroutines/AutoDisposableJob.kt similarity index 89% rename from coroutines/src/main/java/com/crazylegend/coroutines/AutoDisposableJob.kt rename to coroutines/src/main/java/com/funkymuse/coroutines/AutoDisposableJob.kt index 44ba2e62f..f1be6a420 100644 --- a/coroutines/src/main/java/com/crazylegend/coroutines/AutoDisposableJob.kt +++ b/coroutines/src/main/java/com/funkymuse/coroutines/AutoDisposableJob.kt @@ -1,13 +1,11 @@ -package com.crazylegend.coroutines +package com.funkymuse.coroutines import android.view.View import android.view.View.OnAttachStateChangeListener import kotlinx.coroutines.Job -/** - * Created by hristijan on 8/5/19 to long live and prosper ! - */ + class AutoDisposableJob(private val view: View, private val wrapped: Job) diff --git a/coroutines/src/main/java/com/crazylegend/coroutines/CoroutineExtensions.kt b/coroutines/src/main/java/com/funkymuse/coroutines/CoroutineExtensions.kt similarity index 95% rename from coroutines/src/main/java/com/crazylegend/coroutines/CoroutineExtensions.kt rename to coroutines/src/main/java/com/funkymuse/coroutines/CoroutineExtensions.kt index 2ffa09981..913946bf7 100644 --- a/coroutines/src/main/java/com/crazylegend/coroutines/CoroutineExtensions.kt +++ b/coroutines/src/main/java/com/funkymuse/coroutines/CoroutineExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.coroutines +package com.funkymuse.coroutines import android.graphics.Bitmap import android.graphics.BitmapFactory @@ -7,15 +7,19 @@ import androidx.fragment.app.Fragment import androidx.lifecycle.ViewModel import androidx.lifecycle.lifecycleScope import androidx.lifecycle.viewModelScope -import kotlinx.coroutines.* +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.CoroutineStart +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.Job +import kotlinx.coroutines.NonCancellable +import kotlinx.coroutines.asCoroutineDispatcher +import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext import java.util.concurrent.Executors import kotlin.concurrent.thread -/** - * Created by hristijan on 5/27/19 to long live and prosper ! - */ - suspend inline fun T.onMain(crossinline block: (T) -> R): R = withContext(mainDispatcher) { this@onMain.let(block) } suspend inline fun onMain(crossinline block: CoroutineScope.() -> T): T = withContext(mainDispatcher) { block.invoke(this@withContext) } diff --git a/coroutines/src/main/java/com/crazylegend/coroutines/CoroutineExtensions2.kt b/coroutines/src/main/java/com/funkymuse/coroutines/CoroutineExtensions2.kt similarity index 90% rename from coroutines/src/main/java/com/crazylegend/coroutines/CoroutineExtensions2.kt rename to coroutines/src/main/java/com/funkymuse/coroutines/CoroutineExtensions2.kt index 4dac186e0..20f23d83f 100644 --- a/coroutines/src/main/java/com/crazylegend/coroutines/CoroutineExtensions2.kt +++ b/coroutines/src/main/java/com/funkymuse/coroutines/CoroutineExtensions2.kt @@ -1,4 +1,4 @@ -package com.crazylegend.coroutines +package com.funkymuse.coroutines import android.view.View import androidx.lifecycle.LifecycleOwner @@ -7,9 +7,7 @@ import kotlinx.coroutines.async import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.launch -/** - * Created by Hristijan, date 5/26/21 - */ + suspend fun doParallel(vararg blocks: suspend () -> Any) = coroutineScope { blocks diff --git a/coroutines/src/main/java/com/crazylegend/coroutines/ExactlyOnceEventBus.kt b/coroutines/src/main/java/com/funkymuse/coroutines/ExactlyOnceEventBus.kt similarity index 93% rename from coroutines/src/main/java/com/crazylegend/coroutines/ExactlyOnceEventBus.kt rename to coroutines/src/main/java/com/funkymuse/coroutines/ExactlyOnceEventBus.kt index 466c70f84..e6d9c8901 100644 --- a/coroutines/src/main/java/com/crazylegend/coroutines/ExactlyOnceEventBus.kt +++ b/coroutines/src/main/java/com/funkymuse/coroutines/ExactlyOnceEventBus.kt @@ -1,4 +1,4 @@ -package com.crazylegend.coroutines +package com.funkymuse.coroutines import kotlinx.coroutines.sync.Semaphore diff --git a/coroutines/src/main/java/com/crazylegend/coroutines/FlowExtensions.kt b/coroutines/src/main/java/com/funkymuse/coroutines/FlowExtensions.kt similarity index 90% rename from coroutines/src/main/java/com/crazylegend/coroutines/FlowExtensions.kt rename to coroutines/src/main/java/com/funkymuse/coroutines/FlowExtensions.kt index 75a186437..b3f05d60e 100644 --- a/coroutines/src/main/java/com/crazylegend/coroutines/FlowExtensions.kt +++ b/coroutines/src/main/java/com/funkymuse/coroutines/FlowExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.coroutines +package com.funkymuse.coroutines import android.text.Editable import android.text.TextWatcher @@ -8,13 +8,14 @@ import kotlinx.coroutines.CancellationException import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.channels.ProducerScope import kotlinx.coroutines.channels.awaitClose -import kotlinx.coroutines.flow.* +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.buffer +import kotlinx.coroutines.flow.callbackFlow +import kotlinx.coroutines.flow.debounce +import kotlinx.coroutines.flow.drop +import kotlinx.coroutines.flow.flow -/** - * Created by hristijan on 9/6/19 to long live and prosper ! - */ - class AbortCollectException : CancellationException() diff --git a/customviews/build.gradle b/customviews/build.gradle deleted file mode 100644 index fb6496c9d..000000000 --- a/customviews/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ -android { - buildFeatures { - viewBinding = true - } - namespace 'com.crazylegend.customviews' -} -dependencies { - implementation project(path: ':viewbinding') - implementation "com.google.android.material:material:$material" - implementation "androidx.core:core-ktx:$coreKTX" - implementation "androidx.fragment:fragment-ktx:$fragment" -} \ No newline at end of file diff --git a/customviews/build.gradle.kts b/customviews/build.gradle.kts new file mode 100644 index 000000000..eb6e8a67d --- /dev/null +++ b/customviews/build.gradle.kts @@ -0,0 +1,15 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +android { + buildFeatures { + viewBinding = true + } +} +dependencies { + implementation(projects.viewbinding) + implementation(libs.material) + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.fragment.ktx) +} \ No newline at end of file diff --git a/customviews/src/main/java/com/crazylegend/customviews/AppRater.kt b/customviews/src/main/java/com/funkymuse/customviews/AppRater.kt similarity index 94% rename from customviews/src/main/java/com/crazylegend/customviews/AppRater.kt rename to customviews/src/main/java/com/funkymuse/customviews/AppRater.kt index c57971e71..418fc8326 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/AppRater.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/AppRater.kt @@ -1,4 +1,4 @@ -package com.crazylegend.customviews +package com.funkymuse.customviews import android.app.Dialog import android.content.Context @@ -9,18 +9,13 @@ import android.view.View import androidx.core.os.bundleOf import androidx.fragment.app.DialogFragment import androidx.fragment.app.FragmentManager -import com.crazylegend.customviews.AppRater.AppRaterModelSetup.Companion.DEFAULT_APP_TITLE -import com.crazylegend.customviews.AppRater.AppRaterModelSetup.Companion.DEFAULT_CONTENT -import com.crazylegend.customviews.databinding.DialogAppRaterBinding -import com.crazylegend.viewbinding.viewBinding +import com.funkymuse.customviews.AppRater.AppRaterModelSetup.Companion.DEFAULT_APP_TITLE +import com.funkymuse.customviews.AppRater.AppRaterModelSetup.Companion.DEFAULT_CONTENT +import com.funkymuse.setofusefulkotlinextensions.customviews.R +import com.funkymuse.setofusefulkotlinextensions.customviews.databinding.DialogAppRaterBinding +import com.funkymuse.viewbinding.viewBinding -/** - * Created by CrazyLegenD on 2/7/19 to long live and prosper ! - * - * Modified on 21/01/2020 - */ - /** * USAGE diff --git a/customviews/src/main/java/com/crazylegend/customviews/CurvedView.kt b/customviews/src/main/java/com/funkymuse/customviews/CurvedView.kt similarity index 90% rename from customviews/src/main/java/com/crazylegend/customviews/CurvedView.kt rename to customviews/src/main/java/com/funkymuse/customviews/CurvedView.kt index a8fc89ecc..eaf03d991 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/CurvedView.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/CurvedView.kt @@ -1,15 +1,15 @@ -package com.crazylegend.customviews - -import android.graphics.* +package com.funkymuse.customviews + +import android.graphics.Bitmap +import android.graphics.Canvas +import android.graphics.LinearGradient +import android.graphics.Paint +import android.graphics.RectF +import android.graphics.Shader import android.graphics.drawable.BitmapDrawable import android.view.ViewGroup import androidx.core.content.ContextCompat - -/** - * Created by hristijan on 4/22/19 to long live and prosper ! - */ - class CurvedView( val startColor: Int, val endColor: Int, diff --git a/customviews/src/main/java/com/crazylegend/customviews/CustomKeyboardView.kt b/customviews/src/main/java/com/funkymuse/customviews/CustomKeyboardView.kt similarity index 95% rename from customviews/src/main/java/com/crazylegend/customviews/CustomKeyboardView.kt rename to customviews/src/main/java/com/funkymuse/customviews/CustomKeyboardView.kt index 69a655702..afb5767ee 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/CustomKeyboardView.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/CustomKeyboardView.kt @@ -1,4 +1,4 @@ -package com.crazylegend.customviews +package com.funkymuse.customviews import android.content.Context import android.util.AttributeSet @@ -6,11 +6,8 @@ import android.view.View import android.widget.FrameLayout import android.widget.TextView import androidx.annotation.IdRes +import com.funkymuse.setofusefulkotlinextensions.customviews.R - -/** - * Created by crazy on 10/24/18 to long live and prosper ! - */ class CustomKeyboardView : FrameLayout, View.OnClickListener { interface OnKeyListener { diff --git a/customviews/src/main/java/com/crazylegend/customviews/CustomizableCardView.kt b/customviews/src/main/java/com/funkymuse/customviews/CustomizableCardView.kt similarity index 86% rename from customviews/src/main/java/com/crazylegend/customviews/CustomizableCardView.kt rename to customviews/src/main/java/com/funkymuse/customviews/CustomizableCardView.kt index 940d5c81f..716fa4b15 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/CustomizableCardView.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/CustomizableCardView.kt @@ -1,15 +1,12 @@ -package com.crazylegend.customviews +package com.funkymuse.customviews import android.content.Context import android.util.AttributeSet import androidx.annotation.Keep -import com.crazylegend.customviews.databinding.CustomizableCardViewBinding +import com.funkymuse.setofusefulkotlinextensions.customviews.R +import com.funkymuse.setofusefulkotlinextensions.customviews.databinding.CustomizableCardViewBinding import com.google.android.material.card.MaterialCardView - -/** - * Created by crazy on 11/29/19 to long live and prosper ! - */ @Keep class CustomizableCardView : MaterialCardView { diff --git a/customviews/src/main/java/com/crazylegend/customviews/DividerView.kt b/customviews/src/main/java/com/funkymuse/customviews/DividerView.kt similarity index 95% rename from customviews/src/main/java/com/crazylegend/customviews/DividerView.kt rename to customviews/src/main/java/com/funkymuse/customviews/DividerView.kt index 3e87456b9..812ffa0bf 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/DividerView.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/DividerView.kt @@ -1,4 +1,4 @@ -package com.crazylegend.customviews +package com.funkymuse.customviews import android.content.Context import android.graphics.Canvas @@ -6,6 +6,7 @@ import android.graphics.DashPathEffect import android.graphics.Paint import android.util.AttributeSet import android.view.View +import com.funkymuse.setofusefulkotlinextensions.customviews.R /** */ - -/** - * Created by crazy on 3/14/19 to long live and prosper ! - */ open class DividerView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : View(context, attrs) { private val mPaint: Paint private var orientation: Int = 0 diff --git a/customviews/src/main/java/com/crazylegend/customviews/DrawableBadge.kt b/customviews/src/main/java/com/funkymuse/customviews/DrawableBadge.kt similarity index 96% rename from customviews/src/main/java/com/crazylegend/customviews/DrawableBadge.kt rename to customviews/src/main/java/com/funkymuse/customviews/DrawableBadge.kt index 690d86156..8bc0e8141 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/DrawableBadge.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/DrawableBadge.kt @@ -1,7 +1,12 @@ -package com.crazylegend.customviews +package com.funkymuse.customviews import android.content.Context -import android.graphics.* +import android.graphics.Bitmap +import android.graphics.BitmapFactory +import android.graphics.Canvas +import android.graphics.Paint +import android.graphics.Rect +import android.graphics.RectF import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.Drawable import android.text.TextPaint @@ -11,11 +16,7 @@ import androidx.annotation.DimenRes import androidx.annotation.DrawableRes import androidx.core.content.ContextCompat import androidx.core.content.res.ResourcesCompat - - -/** - * Created by hristijan on 3/5/19 to long live and prosper ! - */ +import com.funkymuse.setofusefulkotlinextensions.customviews.R class DrawableBadge private constructor(val context: Context, @ColorInt val textColor: Int, diff --git a/customviews/src/main/java/com/crazylegend/customviews/DrawingCanvas.kt b/customviews/src/main/java/com/funkymuse/customviews/DrawingCanvas.kt similarity index 94% rename from customviews/src/main/java/com/crazylegend/customviews/DrawingCanvas.kt rename to customviews/src/main/java/com/funkymuse/customviews/DrawingCanvas.kt index d17b51beb..c23804c8a 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/DrawingCanvas.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/DrawingCanvas.kt @@ -1,4 +1,4 @@ -package com.crazylegend.customviews +package com.funkymuse.customviews import android.annotation.SuppressLint @@ -12,10 +12,6 @@ import android.view.MotionEvent import android.view.ScaleGestureDetector import android.view.View -/** - * Created by crazy on 8/7/20 to long live and prosper ! - */ - class DrawingCanvas @JvmOverloads constructor(context: Context, attributeSet: AttributeSet? = null, defStyleAttr: Int = -1) : View(context, attributeSet, defStyleAttr) { @@ -54,12 +50,12 @@ class DrawingCanvas @JvmOverloads constructor(context: Context, } }) - override fun onDraw(canvas: Canvas?) { + override fun onDraw(canvas: Canvas) { pointerIdToPathMap.forEach { (_, path) -> - canvas?.drawPath(path, paint) + canvas.drawPath(path, paint) } finishedPointerPaths.forEach { path -> - canvas?.drawPath(path, paint) + canvas.drawPath(path, paint) } } diff --git a/customviews/src/main/java/com/crazylegend/customviews/InternalUtils.kt b/customviews/src/main/java/com/funkymuse/customviews/InternalUtils.kt similarity index 91% rename from customviews/src/main/java/com/crazylegend/customviews/InternalUtils.kt rename to customviews/src/main/java/com/funkymuse/customviews/InternalUtils.kt index 0b98bb2ab..140a54a08 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/InternalUtils.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/InternalUtils.kt @@ -1,4 +1,4 @@ -package com.crazylegend.customviews +package com.funkymuse.customviews import android.content.Context import android.content.SharedPreferences @@ -6,10 +6,6 @@ import androidx.core.content.edit import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentManager -/** - * Created by crazy on 9/5/20 to long live and prosper ! - */ - internal fun Context.getSharedPreferencesByTag(tag: String) = getSharedPreferences(tag, Context.MODE_PRIVATE) diff --git a/customviews/src/main/java/com/crazylegend/customviews/NestedScrollableHost.kt b/customviews/src/main/java/com/funkymuse/customviews/NestedScrollableHost.kt similarity index 99% rename from customviews/src/main/java/com/crazylegend/customviews/NestedScrollableHost.kt rename to customviews/src/main/java/com/funkymuse/customviews/NestedScrollableHost.kt index 1e618ad99..1ef8e7f5c 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/NestedScrollableHost.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/NestedScrollableHost.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.crazylegend.customviews +package com.funkymuse.customviews import android.content.Context import android.util.AttributeSet diff --git a/customviews/src/main/java/com/crazylegend/customviews/NonScrollableListView.kt b/customviews/src/main/java/com/funkymuse/customviews/NonScrollableListView.kt similarity index 87% rename from customviews/src/main/java/com/crazylegend/customviews/NonScrollableListView.kt rename to customviews/src/main/java/com/funkymuse/customviews/NonScrollableListView.kt index a42acfb9c..c559fa0ea 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/NonScrollableListView.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/NonScrollableListView.kt @@ -1,14 +1,10 @@ -package com.crazylegend.customviews +package com.funkymuse.customviews import android.content.Context import android.util.AttributeSet import android.widget.ListView -/** - * Created by Hristijan on 2/4/19 to long live and prosper ! - */ - class NonScrollableListView : ListView { constructor(context: Context) : super(context) diff --git a/customviews/src/main/java/com/crazylegend/customviews/RippleCanvas.kt b/customviews/src/main/java/com/funkymuse/customviews/RippleCanvas.kt similarity index 94% rename from customviews/src/main/java/com/crazylegend/customviews/RippleCanvas.kt rename to customviews/src/main/java/com/funkymuse/customviews/RippleCanvas.kt index d0cca63ff..b5868f05e 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/RippleCanvas.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/RippleCanvas.kt @@ -1,19 +1,19 @@ -package com.crazylegend.customviews +package com.funkymuse.customviews import android.animation.Animator import android.animation.AnimatorListenerAdapter import android.animation.ArgbEvaluator import android.animation.ValueAnimator import android.content.Context -import android.graphics.* +import android.graphics.Canvas +import android.graphics.Color +import android.graphics.Paint +import android.graphics.PorterDuff +import android.graphics.PorterDuffXfermode import android.util.AttributeSet import android.view.View -/** - * Created by hristijan on 3/5/19 to long live and prosper ! - */ - class RippleCanvas @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, diff --git a/customviews/src/main/java/com/crazylegend/customviews/ScalingView.kt b/customviews/src/main/java/com/funkymuse/customviews/ScalingView.kt similarity index 94% rename from customviews/src/main/java/com/crazylegend/customviews/ScalingView.kt rename to customviews/src/main/java/com/funkymuse/customviews/ScalingView.kt index 57dad23b2..b997703d6 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/ScalingView.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/ScalingView.kt @@ -1,4 +1,4 @@ -package com.crazylegend.customviews +package com.funkymuse.customviews import android.animation.AnimatorSet import android.animation.ObjectAnimator @@ -12,9 +12,6 @@ import android.widget.FrameLayout import androidx.core.view.GestureDetectorCompat -/** - * Created by crazy on 4/18/20 to long live and prosper ! - */ class ScalingView : FrameLayout, GestureDetector.OnGestureListener, GestureDetector.OnDoubleTapListener { @@ -119,11 +116,11 @@ class ScalingView : FrameLayout, GestureDetector.OnGestureListener, return true } - override fun onFling(p0: MotionEvent, p1: MotionEvent, p2: Float, p3: Float): Boolean { + override fun onFling(p0: MotionEvent?, p1: MotionEvent, p2: Float, p3: Float): Boolean { return true } - override fun onScroll(p0: MotionEvent, p1: MotionEvent, p2: Float, p3: Float): Boolean { + override fun onScroll(p0: MotionEvent?, p1: MotionEvent, p2: Float, p3: Float): Boolean { return true } diff --git a/customviews/src/main/java/com/crazylegend/customviews/StatefulMotionLayout.kt b/customviews/src/main/java/com/funkymuse/customviews/StatefulMotionLayout.kt similarity index 90% rename from customviews/src/main/java/com/crazylegend/customviews/StatefulMotionLayout.kt rename to customviews/src/main/java/com/funkymuse/customviews/StatefulMotionLayout.kt index c2ea202f6..e777db4c3 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/StatefulMotionLayout.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/StatefulMotionLayout.kt @@ -1,4 +1,4 @@ -package com.crazylegend.customviews +package com.funkymuse.customviews import android.content.Context import android.os.Bundle @@ -8,9 +8,6 @@ import androidx.constraintlayout.motion.widget.MotionLayout import androidx.core.os.bundleOf -/** - * Created by crazy on 5/31/20 to long live and prosper ! - */ class StatefulMotionLayout @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 ) : MotionLayout(context, attrs, defStyleAttr) { diff --git a/customviews/src/main/java/com/crazylegend/customviews/WatermarkBitmap.kt b/customviews/src/main/java/com/funkymuse/customviews/WatermarkBitmap.kt similarity index 93% rename from customviews/src/main/java/com/crazylegend/customviews/WatermarkBitmap.kt rename to customviews/src/main/java/com/funkymuse/customviews/WatermarkBitmap.kt index 035ea9538..4d0bcfa7d 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/WatermarkBitmap.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/WatermarkBitmap.kt @@ -1,13 +1,14 @@ -package com.crazylegend.customviews +package com.funkymuse.customviews - -/** - * Created by crazy on 1/14/20 to long live and prosper ! - */ - -import android.graphics.* +import android.graphics.Bitmap +import android.graphics.Canvas +import android.graphics.Color +import android.graphics.Paint import android.graphics.Paint.ANTI_ALIAS_FLAG import android.graphics.Paint.DITHER_FLAG +import android.graphics.PointF +import android.graphics.Rect +import android.graphics.Typeface import androidx.annotation.ColorInt diff --git a/customviews/src/main/java/com/crazylegend/customviews/WrapContentHeightViewPager.kt b/customviews/src/main/java/com/funkymuse/customviews/WrapContentHeightViewPager.kt similarity index 88% rename from customviews/src/main/java/com/crazylegend/customviews/WrapContentHeightViewPager.kt rename to customviews/src/main/java/com/funkymuse/customviews/WrapContentHeightViewPager.kt index 10e05cf0f..80950ea6a 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/WrapContentHeightViewPager.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/WrapContentHeightViewPager.kt @@ -1,13 +1,10 @@ -package com.crazylegend.customviews +package com.funkymuse.customviews import android.content.Context import android.util.AttributeSet import androidx.viewpager.widget.ViewPager -/** - * Created by hristijan on 6/7/19 to long live and prosper ! - */ class WrapContentHeightViewPager : ViewPager { constructor(context: Context) : super(context) diff --git a/customviews/src/main/java/com/crazylegend/customviews/autoStart/AutoStartHelper.kt b/customviews/src/main/java/com/funkymuse/customviews/autoStart/AutoStartHelper.kt similarity index 96% rename from customviews/src/main/java/com/crazylegend/customviews/autoStart/AutoStartHelper.kt rename to customviews/src/main/java/com/funkymuse/customviews/autoStart/AutoStartHelper.kt index 19353568d..9167b8880 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/autoStart/AutoStartHelper.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/autoStart/AutoStartHelper.kt @@ -1,4 +1,4 @@ -package com.crazylegend.customviews.autoStart +package com.funkymuse.customviews.autoStart import android.content.ComponentName import android.content.Context @@ -10,15 +10,12 @@ import androidx.core.os.bundleOf import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentManager import androidx.lifecycle.LifecycleOwner -import com.crazylegend.customviews.* +import com.funkymuse.customviews.getSharedPreferencesByTag +import com.funkymuse.customviews.ifFalse +import com.funkymuse.customviews.ifTrue +import com.funkymuse.customviews.putBoolean +import com.funkymuse.customviews.remove - -/** - * Created by crazy on 8/6/20 to long live and prosper ! - * - * adb shell "dumpsys activity activities | grep mResumedActivity" - * to contribute - */ object AutoStartHelper { private val Context.doNotShowAgainPrefs get() = getSharedPreferencesByTag(DIALOG_TAG) diff --git a/customviews/src/main/java/com/crazylegend/customviews/autoStart/ConfirmationDialogAutoStart.kt b/customviews/src/main/java/com/funkymuse/customviews/autoStart/ConfirmationDialogAutoStart.kt similarity index 89% rename from customviews/src/main/java/com/crazylegend/customviews/autoStart/ConfirmationDialogAutoStart.kt rename to customviews/src/main/java/com/funkymuse/customviews/autoStart/ConfirmationDialogAutoStart.kt index 6959b98fd..6aa2e229b 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/autoStart/ConfirmationDialogAutoStart.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/autoStart/ConfirmationDialogAutoStart.kt @@ -1,18 +1,15 @@ -package com.crazylegend.customviews.autoStart +package com.funkymuse.customviews.autoStart import android.os.Bundle import android.view.View import androidx.core.os.bundleOf import androidx.fragment.app.DialogFragment import androidx.fragment.app.setFragmentResult -import com.crazylegend.customviews.R -import com.crazylegend.customviews.databinding.DialogConfirmationAutoStartHelperBinding -import com.crazylegend.viewbinding.viewBinding +import com.funkymuse.setofusefulkotlinextensions.customviews.R +import com.funkymuse.setofusefulkotlinextensions.customviews.databinding.DialogConfirmationAutoStartHelperBinding +import com.funkymuse.viewbinding.viewBinding -/** - * Created by hristijan on 6/28/19 to long live and prosper ! - */ class ConfirmationDialogAutoStart : DialogFragment(R.layout.dialog_confirmation_auto_start_helper) { override fun onCreateDialog(savedInstanceState: Bundle?) = with(super.onCreateDialog(savedInstanceState)) { diff --git a/customviews/src/main/java/com/crazylegend/customviews/dragAndDrop/DragAndDropContainer.kt b/customviews/src/main/java/com/funkymuse/customviews/dragAndDrop/DragAndDropContainer.kt similarity index 94% rename from customviews/src/main/java/com/crazylegend/customviews/dragAndDrop/DragAndDropContainer.kt rename to customviews/src/main/java/com/funkymuse/customviews/dragAndDrop/DragAndDropContainer.kt index 49cb47449..fca96ce65 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/dragAndDrop/DragAndDropContainer.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/dragAndDrop/DragAndDropContainer.kt @@ -1,4 +1,4 @@ -package com.crazylegend.customviews.dragAndDrop +package com.funkymuse.customviews.dragAndDrop import android.content.ClipData import android.content.ClipDescription @@ -8,9 +8,6 @@ import android.util.AttributeSet import android.view.View import android.widget.FrameLayout -/** - * Created by crazy on 8/7/20 to long live and prosper ! - */ class DragAndDropContainer( context: Context, attrs: AttributeSet? diff --git a/customviews/src/main/java/com/crazylegend/customviews/dragAndDrop/DragAndDropListener.kt b/customviews/src/main/java/com/funkymuse/customviews/dragAndDrop/DragAndDropListener.kt similarity index 92% rename from customviews/src/main/java/com/crazylegend/customviews/dragAndDrop/DragAndDropListener.kt rename to customviews/src/main/java/com/funkymuse/customviews/dragAndDrop/DragAndDropListener.kt index 695a5dad3..182b116bb 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/dragAndDrop/DragAndDropListener.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/dragAndDrop/DragAndDropListener.kt @@ -1,4 +1,4 @@ -package com.crazylegend.customviews.dragAndDrop +package com.funkymuse.customviews.dragAndDrop import android.content.ClipDescription import android.view.DragEvent @@ -6,12 +6,6 @@ import android.view.View import androidx.annotation.DrawableRes import androidx.core.content.ContextCompat - -/** - * Created by crazy on 8/7/20 to long live and prosper ! - */ - - class DragAndDropListener(@DrawableRes private val solidOutline: Int, @DrawableRes private val dashOutline: Int) : View.OnDragListener { override fun onDrag(view: View, event: DragEvent): Boolean { return when (event.action) { diff --git a/customviews/src/main/java/com/crazylegend/customviews/mirrorView/MirrorView.kt b/customviews/src/main/java/com/funkymuse/customviews/mirrorView/MirrorView.kt similarity index 91% rename from customviews/src/main/java/com/crazylegend/customviews/mirrorView/MirrorView.kt rename to customviews/src/main/java/com/funkymuse/customviews/mirrorView/MirrorView.kt index d4067fffd..e0502b488 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/mirrorView/MirrorView.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/mirrorView/MirrorView.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.crazylegend.customviews.mirrorView +package com.funkymuse.customviews.mirrorView import android.content.Context import android.graphics.Canvas @@ -30,7 +30,7 @@ import android.view.View * @see SharedFadeTransition * * - * @@ -54,7 +54,7 @@ class MirrorView @JvmOverloads constructor( setWillNotDraw(value == null) } - override fun onDraw(canvas: Canvas?) { + override fun onDraw(canvas: Canvas) { _substance?.draw(canvas) } } diff --git a/customviews/src/main/java/com/crazylegend/customviews/mirrorView/SharedFadeTransition.kt b/customviews/src/main/java/com/funkymuse/customviews/mirrorView/SharedFadeTransition.kt similarity index 98% rename from customviews/src/main/java/com/crazylegend/customviews/mirrorView/SharedFadeTransition.kt rename to customviews/src/main/java/com/funkymuse/customviews/mirrorView/SharedFadeTransition.kt index f4a901948..fdacbfb14 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/mirrorView/SharedFadeTransition.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/mirrorView/SharedFadeTransition.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.crazylegend.customviews.mirrorView +package com.funkymuse.customviews.mirrorView import android.animation.Animator import android.animation.ObjectAnimator diff --git a/customviews/src/main/java/com/crazylegend/customviews/pin/PinEditText.kt b/customviews/src/main/java/com/funkymuse/customviews/pin/PinEditText.kt similarity index 97% rename from customviews/src/main/java/com/crazylegend/customviews/pin/PinEditText.kt rename to customviews/src/main/java/com/funkymuse/customviews/pin/PinEditText.kt index bf3eb32ad..65428e604 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/pin/PinEditText.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/pin/PinEditText.kt @@ -1,4 +1,4 @@ -package com.crazylegend.customviews.pin +package com.funkymuse.customviews.pin import android.annotation.SuppressLint import android.content.Context @@ -14,12 +14,7 @@ import android.view.View import android.widget.TextView import androidx.appcompat.widget.AppCompatEditText import androidx.core.content.ContextCompat -import com.crazylegend.customviews.R - - -/** - * Created by hristijan on 3/5/19 to long live and prosper ! - */ +import com.funkymuse.setofusefulkotlinextensions.customviews.R class PinEditText : AppCompatEditText { @@ -193,7 +188,7 @@ class PinEditText : AppCompatEditText { /* - Int, val height: () -> Int) : GestureDetector.SimpleOnGestureListener() { private val density: Float @@ -49,7 +44,7 @@ open class ScrollListener(val width: () -> Int, val height: () -> Int) : Gesture return true } - override fun onScroll(e1: MotionEvent, e2: MotionEvent, distanceX: Float, distanceY: Float): Boolean { + override fun onScroll(e1: MotionEvent?, e2: MotionEvent, distanceX: Float, distanceY: Float): Boolean { val dX = startX - e2.x val dY = startY - e2.y diff --git a/customviews/src/main/java/com/crazylegend/customviews/ui/ShadowView.kt b/customviews/src/main/java/com/funkymuse/customviews/ui/ShadowView.kt similarity index 92% rename from customviews/src/main/java/com/crazylegend/customviews/ui/ShadowView.kt rename to customviews/src/main/java/com/funkymuse/customviews/ui/ShadowView.kt index 93c854d4b..5d35c090f 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/ui/ShadowView.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/ui/ShadowView.kt @@ -1,16 +1,11 @@ -package com.crazylegend.customviews.ui +package com.funkymuse.customviews.ui import android.content.Context import android.graphics.Color import android.graphics.drawable.GradientDrawable import android.util.AttributeSet import android.view.View -import com.crazylegend.customviews.R - - -/** - * Created by hristijan on 4/15/19 to long live and prosper ! - */ +import com.funkymuse.setofusefulkotlinextensions.customviews.R /** * A simple Class to set the Drop Shadow Above or Below any View diff --git a/customviews/src/main/java/com/crazylegend/customviews/ui/StringMakeup.kt b/customviews/src/main/java/com/funkymuse/customviews/ui/StringMakeup.kt similarity index 92% rename from customviews/src/main/java/com/crazylegend/customviews/ui/StringMakeup.kt rename to customviews/src/main/java/com/funkymuse/customviews/ui/StringMakeup.kt index 2fd130f40..00a53e739 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/ui/StringMakeup.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/ui/StringMakeup.kt @@ -1,9 +1,14 @@ -package com.crazylegend.customviews.ui +package com.funkymuse.customviews.ui import android.graphics.Typeface import android.text.Spannable import android.text.SpannableString -import android.text.style.* +import android.text.style.BackgroundColorSpan +import android.text.style.ForegroundColorSpan +import android.text.style.RelativeSizeSpan +import android.text.style.StrikethroughSpan +import android.text.style.StyleSpan +import android.text.style.UnderlineSpan import androidx.annotation.ColorInt diff --git a/customviews/src/main/java/com/crazylegend/customviews/ui/SwipeDistanceView.kt b/customviews/src/main/java/com/funkymuse/customviews/ui/SwipeDistanceView.kt similarity index 94% rename from customviews/src/main/java/com/crazylegend/customviews/ui/SwipeDistanceView.kt rename to customviews/src/main/java/com/funkymuse/customviews/ui/SwipeDistanceView.kt index a2f4520ce..4222d42eb 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/ui/SwipeDistanceView.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/ui/SwipeDistanceView.kt @@ -1,4 +1,4 @@ -package com.crazylegend.customviews.ui +package com.funkymuse.customviews.ui import android.content.Context @@ -7,11 +7,6 @@ import android.view.MotionEvent import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.view.GestureDetectorCompat -/** - * Created by hristijan on 8/5/19 to long live and prosper ! - */ - - open class SwipeDistanceView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 ) : ConstraintLayout(context, attrs, defStyleAttr) { diff --git a/customviews/src/main/java/com/crazylegend/customviews/ui/UiCreators.kt b/customviews/src/main/java/com/funkymuse/customviews/ui/UiCreators.kt similarity index 96% rename from customviews/src/main/java/com/crazylegend/customviews/ui/UiCreators.kt rename to customviews/src/main/java/com/funkymuse/customviews/ui/UiCreators.kt index 5d1b4509a..6e8ab8068 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/ui/UiCreators.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/ui/UiCreators.kt @@ -1,4 +1,4 @@ -package com.crazylegend.customviews.ui +package com.funkymuse.customviews.ui import android.content.Context import android.content.res.ColorStateList @@ -7,7 +7,6 @@ import android.graphics.drawable.Drawable import android.graphics.drawable.GradientDrawable import android.graphics.drawable.RippleDrawable import android.graphics.drawable.StateListDrawable -import android.os.Build import android.view.Gravity import android.view.View import android.view.ViewGroup @@ -15,13 +14,6 @@ import android.widget.LinearLayout import androidx.annotation.ColorInt import com.google.android.material.textview.MaterialTextView -/** - * Created by hristijan on 8/5/19 to long live and prosper ! - */ - - -// Extensions for creating drawables and other drawable-related helpers - fun backgroundDrawable( @ColorInt color: Int, isButton: Boolean = false, diff --git a/customviews/src/main/java/com/crazylegend/customviews/ui/WrapContentHeightViewPager.kt b/customviews/src/main/java/com/funkymuse/customviews/ui/WrapContentHeightViewPager.kt similarity index 88% rename from customviews/src/main/java/com/crazylegend/customviews/ui/WrapContentHeightViewPager.kt rename to customviews/src/main/java/com/funkymuse/customviews/ui/WrapContentHeightViewPager.kt index b9cc74886..01d30e9e5 100644 --- a/customviews/src/main/java/com/crazylegend/customviews/ui/WrapContentHeightViewPager.kt +++ b/customviews/src/main/java/com/funkymuse/customviews/ui/WrapContentHeightViewPager.kt @@ -1,14 +1,9 @@ -package com.crazylegend.customviews.ui +package com.funkymuse.customviews.ui import android.content.Context import android.util.AttributeSet import androidx.viewpager.widget.ViewPager - -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ - class WrapContentHeightViewPager : ViewPager { constructor(context: Context) : super(context) diff --git a/customviews/src/main/res/values/strings.xml b/customviews/src/main/res/values/strings.xml new file mode 100644 index 000000000..bc882fb4d --- /dev/null +++ b/customviews/src/main/res/values/strings.xml @@ -0,0 +1,15 @@ + + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + Clear + Back + \ No newline at end of file diff --git a/dataStructuresAndAlgorithms/build.gradle b/dataStructuresAndAlgorithms/build.gradle deleted file mode 100644 index dcb356653..000000000 --- a/dataStructuresAndAlgorithms/build.gradle +++ /dev/null @@ -1,3 +0,0 @@ -android { - namespace 'com.crazylegend.datastructuresandalgorithms' -} \ No newline at end of file diff --git a/dataStructuresAndAlgorithms/build.gradle.kts b/dataStructuresAndAlgorithms/build.gradle.kts new file mode 100644 index 000000000..ff390193e --- /dev/null +++ b/dataStructuresAndAlgorithms/build.gradle.kts @@ -0,0 +1,4 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/Edge.kt b/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/Edge.kt deleted file mode 100644 index 13b61eb71..000000000 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/Edge.kt +++ /dev/null @@ -1,10 +0,0 @@ -package com.crazylegend.datastructuresandalgorithms.graphs - -/** - * Created by crazy on 8/31/20 to long live and prosper ! - */ -data class Edge( - val source: Vertex, - val destination: Vertex, - val weight: Double? = null -) \ No newline at end of file diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/EdgeType.kt b/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/EdgeType.kt deleted file mode 100644 index a6e537a67..000000000 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/EdgeType.kt +++ /dev/null @@ -1,9 +0,0 @@ -package com.crazylegend.datastructuresandalgorithms.graphs - -/** - * Created by crazy on 8/31/20 to long live and prosper ! - */ -enum class EdgeType { - DIRECTED, - UNDIRECTED -} \ No newline at end of file diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/NumberOfPaths.kt b/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/NumberOfPaths.kt deleted file mode 100644 index 81f410497..000000000 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/NumberOfPaths.kt +++ /dev/null @@ -1,7 +0,0 @@ -package com.crazylegend.datastructuresandalgorithms.graphs - -/** - * Created by crazy on 8/31/20 to long live and prosper ! - */ - -data class NumberOfPaths(var value: T) \ No newline at end of file diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/Vertex.kt b/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/Vertex.kt deleted file mode 100644 index 037a93464..000000000 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/Vertex.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.crazylegend.datastructuresandalgorithms.graphs - -/** - * Created by crazy on 8/31/20 to long live and prosper ! - */ -data class Vertex(val index: Int, val data: T) \ No newline at end of file diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/djikstra/Visit.kt b/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/djikstra/Visit.kt deleted file mode 100644 index 6eb6e9cb1..000000000 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/djikstra/Visit.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.crazylegend.datastructuresandalgorithms.graphs.djikstra - -import com.crazylegend.datastructuresandalgorithms.graphs.Edge - -/** - * Created by crazy on 9/7/20 to long live and prosper ! - */ -class Visit(val type: VisitType, val edge: Edge? = null) \ No newline at end of file diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/djikstra/VisitType.kt b/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/djikstra/VisitType.kt deleted file mode 100644 index f37eb12e4..000000000 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/djikstra/VisitType.kt +++ /dev/null @@ -1,9 +0,0 @@ -package com.crazylegend.datastructuresandalgorithms.graphs.djikstra - -/** - * Created by crazy on 9/7/20 to long live and prosper ! - */ -enum class VisitType { - START, - EDGE -} \ No newline at end of file diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/memoization/Extensions.kt b/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/memoization/Extensions.kt deleted file mode 100644 index da8f86795..000000000 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/memoization/Extensions.kt +++ /dev/null @@ -1,7 +0,0 @@ -package com.crazylegend.datastructuresandalgorithms.memoization - -/** - * Created by crazy on 1/4/21 to long live and prosper ! - */ - -fun ((T) -> R).memoize(): (T) -> R = Memoize(this) diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/priority/comparable/ComparablePriorityQueue.kt b/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/priority/comparable/ComparablePriorityQueue.kt deleted file mode 100644 index ac9102e03..000000000 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/priority/comparable/ComparablePriorityQueue.kt +++ /dev/null @@ -1,12 +0,0 @@ -package com.crazylegend.datastructuresandalgorithms.queue.priority.comparable - -import com.crazylegend.datastructuresandalgorithms.heap.ComparableHeap -import com.crazylegend.datastructuresandalgorithms.heap.Heap -import com.crazylegend.datastructuresandalgorithms.queue.priority.AbstractPriorityQueue - -class ComparablePriorityQueue> : AbstractPriorityQueue() { - override val heap: Heap = ComparableHeap() - - override val isEmpty: Boolean - get() = heap.isEmpty -} \ No newline at end of file diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/priority/comparator/ComparatorPriorityQueue.kt b/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/priority/comparator/ComparatorPriorityQueue.kt deleted file mode 100644 index 95b6415f8..000000000 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/priority/comparator/ComparatorPriorityQueue.kt +++ /dev/null @@ -1,12 +0,0 @@ -package com.crazylegend.datastructuresandalgorithms.queue.priority.comparator - -import com.crazylegend.datastructuresandalgorithms.heap.ComparatorHeap -import com.crazylegend.datastructuresandalgorithms.heap.Heap -import com.crazylegend.datastructuresandalgorithms.queue.priority.AbstractPriorityQueue - -class ComparatorPriorityQueue(comparator: Comparator) : AbstractPriorityQueue() { - override val heap: Heap = ComparatorHeap(comparator) - - override val isEmpty: Boolean - get() = heap.isEmpty -} \ No newline at end of file diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/Utils.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/Utils.kt similarity index 90% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/Utils.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/Utils.kt index d806b6536..af1d211a9 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/Utils.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/Utils.kt @@ -1,11 +1,7 @@ -package com.crazylegend.datastructuresandalgorithms +package com.funkymuse.datastructuresandalgorithms -import com.crazylegend.datastructuresandalgorithms.sort.selectionSort -import java.util.* - -/** - * Created by crazy on 9/7/20 to long live and prosper ! - */ +import com.funkymuse.datastructuresandalgorithms.sort.selectionSort +import java.util.Collections internal fun List.swap(i: Int, j: Int): List { diff --git a/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/Edge.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/Edge.kt new file mode 100644 index 000000000..f5c14793b --- /dev/null +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/Edge.kt @@ -0,0 +1,7 @@ +package com.funkymuse.datastructuresandalgorithms.graphs + +data class Edge( + val source: Vertex, + val destination: Vertex, + val weight: Double? = null +) \ No newline at end of file diff --git a/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/EdgeType.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/EdgeType.kt new file mode 100644 index 000000000..de0eeb791 --- /dev/null +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/EdgeType.kt @@ -0,0 +1,6 @@ +package com.funkymuse.datastructuresandalgorithms.graphs + +enum class EdgeType { + DIRECTED, + UNDIRECTED +} \ No newline at end of file diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/Graph.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/Graph.kt similarity index 95% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/Graph.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/Graph.kt index cfe3d8a47..12e7cb110 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/Graph.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/Graph.kt @@ -1,11 +1,8 @@ -package com.crazylegend.datastructuresandalgorithms.graphs +package com.funkymuse.datastructuresandalgorithms.graphs -import com.crazylegend.datastructuresandalgorithms.queue.StackQueue -import com.crazylegend.datastructuresandalgorithms.stack.Stack +import com.funkymuse.datastructuresandalgorithms.queue.StackQueue +import com.funkymuse.datastructuresandalgorithms.stack.Stack -/** - * Created by crazy on 8/31/20 to long live and prosper ! - */ interface Graph { val allVertices: ArrayList> diff --git a/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/NumberOfPaths.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/NumberOfPaths.kt new file mode 100644 index 000000000..b74d336e7 --- /dev/null +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/NumberOfPaths.kt @@ -0,0 +1,3 @@ +package com.funkymuse.datastructuresandalgorithms.graphs + +data class NumberOfPaths(var value: T) \ No newline at end of file diff --git a/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/Vertex.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/Vertex.kt new file mode 100644 index 000000000..6c25ea1c3 --- /dev/null +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/Vertex.kt @@ -0,0 +1,3 @@ +package com.funkymuse.datastructuresandalgorithms.graphs + +data class Vertex(val index: Int, val data: T) \ No newline at end of file diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/adjacency/AdjacencyList.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/adjacency/AdjacencyList.kt similarity index 81% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/adjacency/AdjacencyList.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/adjacency/AdjacencyList.kt index 361fa8952..adbe86e1d 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/adjacency/AdjacencyList.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/adjacency/AdjacencyList.kt @@ -1,13 +1,10 @@ -package com.crazylegend.datastructuresandalgorithms.graphs.adjacency +package com.funkymuse.datastructuresandalgorithms.graphs.adjacency -import com.crazylegend.datastructuresandalgorithms.graphs.Edge -import com.crazylegend.datastructuresandalgorithms.graphs.EdgeType -import com.crazylegend.datastructuresandalgorithms.graphs.Graph -import com.crazylegend.datastructuresandalgorithms.graphs.Vertex +import com.funkymuse.datastructuresandalgorithms.graphs.Edge +import com.funkymuse.datastructuresandalgorithms.graphs.EdgeType +import com.funkymuse.datastructuresandalgorithms.graphs.Graph +import com.funkymuse.datastructuresandalgorithms.graphs.Vertex -/** - * Created by crazy on 8/31/20 to long live and prosper ! - */ class AdjacencyList : Graph { private val adjacencies: HashMap, ArrayList>> = HashMap() diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/adjacency/AdjacencyMatrix.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/adjacency/AdjacencyMatrix.kt similarity index 86% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/adjacency/AdjacencyMatrix.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/adjacency/AdjacencyMatrix.kt index 17748efc3..b7e33ba87 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/adjacency/AdjacencyMatrix.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/adjacency/AdjacencyMatrix.kt @@ -1,13 +1,10 @@ -package com.crazylegend.datastructuresandalgorithms.graphs.adjacency +package com.funkymuse.datastructuresandalgorithms.graphs.adjacency -import com.crazylegend.datastructuresandalgorithms.graphs.Edge -import com.crazylegend.datastructuresandalgorithms.graphs.EdgeType -import com.crazylegend.datastructuresandalgorithms.graphs.Graph -import com.crazylegend.datastructuresandalgorithms.graphs.Vertex +import com.funkymuse.datastructuresandalgorithms.graphs.Edge +import com.funkymuse.datastructuresandalgorithms.graphs.EdgeType +import com.funkymuse.datastructuresandalgorithms.graphs.Graph +import com.funkymuse.datastructuresandalgorithms.graphs.Vertex -/** - * Created by crazy on 8/31/20 to long live and prosper ! - */ class AdjacencyMatrix : Graph { override val allVertices: ArrayList> get() = vertices diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/djikstra/Dijkstra.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/djikstra/Dijkstra.kt similarity index 83% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/djikstra/Dijkstra.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/djikstra/Dijkstra.kt index 7418303c6..fb614dbbc 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/djikstra/Dijkstra.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/djikstra/Dijkstra.kt @@ -1,13 +1,10 @@ -package com.crazylegend.datastructuresandalgorithms.graphs.djikstra +package com.funkymuse.datastructuresandalgorithms.graphs.djikstra -import com.crazylegend.datastructuresandalgorithms.graphs.Edge -import com.crazylegend.datastructuresandalgorithms.graphs.Vertex -import com.crazylegend.datastructuresandalgorithms.graphs.adjacency.AdjacencyList -import com.crazylegend.datastructuresandalgorithms.queue.priority.comparator.ComparatorPriorityQueue +import com.funkymuse.datastructuresandalgorithms.graphs.Edge +import com.funkymuse.datastructuresandalgorithms.graphs.Vertex +import com.funkymuse.datastructuresandalgorithms.graphs.adjacency.AdjacencyList +import com.funkymuse.datastructuresandalgorithms.queue.priority.comparator.ComparatorPriorityQueue -/** - * Created by crazy on 9/7/20 to long live and prosper ! - */ class Dijkstra(private val graph: AdjacencyList) { private fun route(destination: Vertex, paths: HashMap, Visit>): ArrayList> { diff --git a/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/djikstra/Visit.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/djikstra/Visit.kt new file mode 100644 index 000000000..1520a08e6 --- /dev/null +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/djikstra/Visit.kt @@ -0,0 +1,5 @@ +package com.funkymuse.datastructuresandalgorithms.graphs.djikstra + +import com.funkymuse.datastructuresandalgorithms.graphs.Edge + +class Visit(val type: VisitType, val edge: Edge? = null) \ No newline at end of file diff --git a/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/djikstra/VisitType.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/djikstra/VisitType.kt new file mode 100644 index 000000000..4229553dd --- /dev/null +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/djikstra/VisitType.kt @@ -0,0 +1,6 @@ +package com.funkymuse.datastructuresandalgorithms.graphs.djikstra + +enum class VisitType { + START, + EDGE +} \ No newline at end of file diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/prim/Prim.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/prim/Prim.kt similarity index 70% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/prim/Prim.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/prim/Prim.kt index 30041bdce..173e89a5f 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/graphs/prim/Prim.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/graphs/prim/Prim.kt @@ -1,18 +1,14 @@ -package com.crazylegend.datastructuresandalgorithms.graphs.prim - -import com.crazylegend.datastructuresandalgorithms.graphs.Edge -import com.crazylegend.datastructuresandalgorithms.graphs.EdgeType -import com.crazylegend.datastructuresandalgorithms.graphs.Graph -import com.crazylegend.datastructuresandalgorithms.graphs.Vertex -import com.crazylegend.datastructuresandalgorithms.graphs.adjacency.AdjacencyList -import com.crazylegend.datastructuresandalgorithms.queue.priority.AbstractPriorityQueue -import com.crazylegend.datastructuresandalgorithms.queue.priority.comparator.ComparatorPriorityQueue +package com.funkymuse.datastructuresandalgorithms.graphs.prim + +import com.funkymuse.datastructuresandalgorithms.graphs.Edge +import com.funkymuse.datastructuresandalgorithms.graphs.EdgeType +import com.funkymuse.datastructuresandalgorithms.graphs.Graph +import com.funkymuse.datastructuresandalgorithms.graphs.Vertex +import com.funkymuse.datastructuresandalgorithms.graphs.adjacency.AdjacencyList +import com.funkymuse.datastructuresandalgorithms.queue.priority.AbstractPriorityQueue +import com.funkymuse.datastructuresandalgorithms.queue.priority.comparator.ComparatorPriorityQueue import kotlin.math.roundToInt -/** - * Created by crazy on 9/7/20 to long live and prosper ! - */ - object Prim { private fun addAvailableEdges(vertex: Vertex, graph: Graph, visited: Set>, priorityQueue: AbstractPriorityQueue>) { diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/heap/AbstractHeap.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/heap/AbstractHeap.kt similarity index 97% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/heap/AbstractHeap.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/heap/AbstractHeap.kt index 5887c5051..73857d4ac 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/heap/AbstractHeap.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/heap/AbstractHeap.kt @@ -1,7 +1,6 @@ -package com.crazylegend.datastructuresandalgorithms.heap +package com.funkymuse.datastructuresandalgorithms.heap -import java.util.* -import kotlin.collections.ArrayList +import java.util.Collections abstract class AbstractHeap : Heap { abstract fun compare(first: T, second: T): Int diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/heap/Collection.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/heap/Collection.kt similarity index 78% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/heap/Collection.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/heap/Collection.kt index 57e41e971..a432e255f 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/heap/Collection.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/heap/Collection.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.heap +package com.funkymuse.datastructuresandalgorithms.heap interface Collection { val count: Int diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/heap/ComparableHeap.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/heap/ComparableHeap.kt similarity index 87% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/heap/ComparableHeap.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/heap/ComparableHeap.kt index f67cdfe50..8a49ff073 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/heap/ComparableHeap.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/heap/ComparableHeap.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.heap +package com.funkymuse.datastructuresandalgorithms.heap class ComparableHeap> : AbstractHeap() { diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/heap/ComparatorHeap.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/heap/ComparatorHeap.kt similarity index 87% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/heap/ComparatorHeap.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/heap/ComparatorHeap.kt index 20147e4e7..e94f9d814 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/heap/ComparatorHeap.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/heap/ComparatorHeap.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.heap +package com.funkymuse.datastructuresandalgorithms.heap class ComparatorHeap(private val comparator: Comparator) : AbstractHeap() { diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/heap/Heap.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/heap/Heap.kt similarity index 73% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/heap/Heap.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/heap/Heap.kt index adfbd3966..a5df89226 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/heap/Heap.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/heap/Heap.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.heap +package com.funkymuse.datastructuresandalgorithms.heap interface Heap : Collection { fun peek(): T? diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/linkedList/Extensions.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/linkedList/Extensions.kt similarity index 93% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/linkedList/Extensions.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/linkedList/Extensions.kt index fae12101d..f26d45e34 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/linkedList/Extensions.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/linkedList/Extensions.kt @@ -1,6 +1,6 @@ -package com.crazylegend.datastructuresandalgorithms.linkedList +package com.funkymuse.datastructuresandalgorithms.linkedList -import com.crazylegend.datastructuresandalgorithms.stack.Stack +import com.funkymuse.datastructuresandalgorithms.stack.Stack fun LinkedList.printInReverse() { val stack = Stack() diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/linkedList/LinkedList.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/linkedList/LinkedList.kt similarity index 98% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/linkedList/LinkedList.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/linkedList/LinkedList.kt index ed8f68503..3527fa2a6 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/linkedList/LinkedList.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/linkedList/LinkedList.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.linkedList +package com.funkymuse.datastructuresandalgorithms.linkedList import java.io.Serializable diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/linkedList/LinkedListIterator.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/linkedList/LinkedListIterator.kt similarity index 92% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/linkedList/LinkedListIterator.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/linkedList/LinkedListIterator.kt index 97f143c03..32efb12dc 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/linkedList/LinkedListIterator.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/linkedList/LinkedListIterator.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.linkedList +package com.funkymuse.datastructuresandalgorithms.linkedList class LinkedListIterator(private val list: LinkedList) : Iterator, MutableIterator { diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/linkedList/Node.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/linkedList/Node.kt similarity index 78% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/linkedList/Node.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/linkedList/Node.kt index cbe95168e..f5e165773 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/linkedList/Node.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/linkedList/Node.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.linkedList +package com.funkymuse.datastructuresandalgorithms.linkedList data class Node(var value: T, var next: Node? = null) { diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/mathematics/Fibonacci.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/mathematics/Fibonacci.kt similarity index 82% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/mathematics/Fibonacci.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/mathematics/Fibonacci.kt index 1aaec3494..2de873e70 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/mathematics/Fibonacci.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/mathematics/Fibonacci.kt @@ -1,9 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.mathematics - - -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ +package com.funkymuse.datastructuresandalgorithms.mathematics fun findFibonacciRecursive(n: Int, prev: Long = 1, current: Long = 1): Long { return if (n <= 2) current diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/mathematics/GCD.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/mathematics/GCD.kt similarity index 77% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/mathematics/GCD.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/mathematics/GCD.kt index d338feae2..24a147702 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/mathematics/GCD.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/mathematics/GCD.kt @@ -1,9 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.mathematics - - -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ +package com.funkymuse.datastructuresandalgorithms.mathematics /** * The method computes the greatest common divisor of two numbers by recursively applying the Euclidean algorithm: diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/mathematics/LCM.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/mathematics/LCM.kt similarity index 83% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/mathematics/LCM.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/mathematics/LCM.kt index 3c9c117a6..bcb8125b7 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/mathematics/LCM.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/mathematics/LCM.kt @@ -1,9 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.mathematics - - -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ +package com.funkymuse.datastructuresandalgorithms.mathematics /** * The least common multiple is found out by using the principle that diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/mathematics/PowerBigNumbers.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/mathematics/PowerBigNumbers.kt similarity index 84% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/mathematics/PowerBigNumbers.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/mathematics/PowerBigNumbers.kt index 6dcb93b71..c657754ae 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/mathematics/PowerBigNumbers.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/mathematics/PowerBigNumbers.kt @@ -1,12 +1,7 @@ -package com.crazylegend.datastructuresandalgorithms.mathematics +package com.funkymuse.datastructuresandalgorithms.mathematics import java.math.BigInteger - -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ - /** * Recursively raises a number to a certain power. * This method returns the original number is power is 1, otherwise multiplies the number on the result of calling itself diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/mathematics/Prime.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/mathematics/Prime.kt similarity index 97% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/mathematics/Prime.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/mathematics/Prime.kt index 23b7f67ce..984e6db46 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/mathematics/Prime.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/mathematics/Prime.kt @@ -1,13 +1,8 @@ -package com.crazylegend.datastructuresandalgorithms.mathematics +package com.funkymuse.datastructuresandalgorithms.mathematics import kotlin.math.sqrt import kotlin.random.Random - -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ - /** * Two numbers are co-prime when the GCD of the numbers is 1. * This method uses an algorithm called the Euclidean algorithm to compute GCD. diff --git a/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/memoization/Extensions.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/memoization/Extensions.kt new file mode 100644 index 000000000..5e26b49f0 --- /dev/null +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/memoization/Extensions.kt @@ -0,0 +1,3 @@ +package com.funkymuse.datastructuresandalgorithms.memoization + +fun ((T) -> R).memoize(): (T) -> R = Memoize(this) diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/memoization/Memoize.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/memoization/Memoize.kt similarity index 65% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/memoization/Memoize.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/memoization/Memoize.kt index 2860491b3..19589eef8 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/memoization/Memoize.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/memoization/Memoize.kt @@ -1,8 +1,5 @@ -package com.crazylegend.datastructuresandalgorithms.memoization +package com.funkymuse.datastructuresandalgorithms.memoization -/** - * Created by crazy on 1/4/21 to long live and prosper ! - */ class Memoize(val function: (type: T) -> R) : (T) -> R { private val valuesCache = mutableMapOf() diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/problems/FindIfAnyPairProducesSum.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/problems/FindIfAnyPairProducesSum.kt similarity index 86% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/problems/FindIfAnyPairProducesSum.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/problems/FindIfAnyPairProducesSum.kt index 235a3dd6b..24aa1073a 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/problems/FindIfAnyPairProducesSum.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/problems/FindIfAnyPairProducesSum.kt @@ -1,12 +1,6 @@ -package com.crazylegend.datastructuresandalgorithms.problems - -import com.crazylegend.datastructuresandalgorithms.search.binarySearch - - -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ +package com.funkymuse.datastructuresandalgorithms.problems +import com.funkymuse.datastructuresandalgorithms.search.binarySearch /** * Methods are assuming the sorted list. diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/problems/GenerateWordsFromTheAlphabet.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/problems/GenerateWordsFromTheAlphabet.kt similarity index 88% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/problems/GenerateWordsFromTheAlphabet.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/problems/GenerateWordsFromTheAlphabet.kt index 6dc7af1c8..f7ed84c90 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/problems/GenerateWordsFromTheAlphabet.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/problems/GenerateWordsFromTheAlphabet.kt @@ -1,10 +1,6 @@ -package com.crazylegend.datastructuresandalgorithms.problems +package com.funkymuse.datastructuresandalgorithms.problems -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ - fun generateWordsFixedLength(length: Int, alphabet: List): List { var result = ArrayList() for (i in 1..length) { diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/problems/StringBalance.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/problems/StringBalance.kt similarity index 78% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/problems/StringBalance.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/problems/StringBalance.kt index 04a1fb31e..a23b05fef 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/problems/StringBalance.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/problems/StringBalance.kt @@ -1,12 +1,6 @@ -package com.crazylegend.datastructuresandalgorithms.problems - -import java.util.* - - -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ +package com.funkymuse.datastructuresandalgorithms.problems +import java.util.Stack fun isStringBalanced(s: String): Boolean { val bracketStack = Stack() diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/ArrayListQueue.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/ArrayListQueue.kt similarity index 93% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/ArrayListQueue.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/ArrayListQueue.kt index 9117c6896..53a01b81e 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/ArrayListQueue.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/ArrayListQueue.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.queue +package com.funkymuse.datastructuresandalgorithms.queue class ArrayListQueue : Queue { diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/Extensions.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/Extensions.kt similarity index 78% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/Extensions.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/Extensions.kt index a1f3a42fe..c0050c82b 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/Extensions.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/Extensions.kt @@ -1,7 +1,7 @@ -package com.crazylegend.datastructuresandalgorithms.queue +package com.funkymuse.datastructuresandalgorithms.queue -import java.util.* +import java.util.Stack fun Queue.reverse() { val stack = Stack() diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/LinkedListQueue.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/LinkedListQueue.kt similarity index 88% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/LinkedListQueue.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/LinkedListQueue.kt index 4689462e7..29ef4e9f1 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/LinkedListQueue.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/LinkedListQueue.kt @@ -1,6 +1,6 @@ -package com.crazylegend.datastructuresandalgorithms.queue +package com.funkymuse.datastructuresandalgorithms.queue -import com.crazylegend.datastructuresandalgorithms.linkedList.LinkedList +import com.funkymuse.datastructuresandalgorithms.linkedList.LinkedList class LinkedListQueue : Queue { diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/Queue.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/Queue.kt similarity index 76% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/Queue.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/Queue.kt index 985d1481d..3f3851919 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/Queue.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/Queue.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.queue +package com.funkymuse.datastructuresandalgorithms.queue interface Queue { diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/RingBufferQueue.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/RingBufferQueue.kt similarity index 86% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/RingBufferQueue.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/RingBufferQueue.kt index fdbca252e..e3de9d25a 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/RingBufferQueue.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/RingBufferQueue.kt @@ -1,7 +1,7 @@ -package com.crazylegend.datastructuresandalgorithms.queue +package com.funkymuse.datastructuresandalgorithms.queue -import com.crazylegend.datastructuresandalgorithms.ringBuffer.RingBuffer +import com.funkymuse.datastructuresandalgorithms.ringBuffer.RingBuffer class RingBufferQueue(size: Int) : Queue { diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/StackQueue.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/StackQueue.kt similarity index 90% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/StackQueue.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/StackQueue.kt index 741248d5c..5ecb299fc 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/StackQueue.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/StackQueue.kt @@ -1,7 +1,7 @@ -package com.crazylegend.datastructuresandalgorithms.queue +package com.funkymuse.datastructuresandalgorithms.queue -import com.crazylegend.datastructuresandalgorithms.stack.Stack +import com.funkymuse.datastructuresandalgorithms.stack.Stack /** * Same complexity as Ring buffer queue diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/priority/AbstractPriorityQueue.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/priority/AbstractPriorityQueue.kt similarity index 64% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/priority/AbstractPriorityQueue.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/priority/AbstractPriorityQueue.kt index 9193897b3..8a86d574b 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/priority/AbstractPriorityQueue.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/priority/AbstractPriorityQueue.kt @@ -1,7 +1,7 @@ -package com.crazylegend.datastructuresandalgorithms.queue.priority +package com.funkymuse.datastructuresandalgorithms.queue.priority -import com.crazylegend.datastructuresandalgorithms.heap.Heap -import com.crazylegend.datastructuresandalgorithms.queue.Queue +import com.funkymuse.datastructuresandalgorithms.heap.Heap +import com.funkymuse.datastructuresandalgorithms.queue.Queue abstract class AbstractPriorityQueue : Queue { diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/priority/AbstractPriorityQueueArrayList.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/priority/AbstractPriorityQueueArrayList.kt similarity index 78% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/priority/AbstractPriorityQueueArrayList.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/priority/AbstractPriorityQueueArrayList.kt index ab707f3a1..1ac1723a5 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/priority/AbstractPriorityQueueArrayList.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/priority/AbstractPriorityQueueArrayList.kt @@ -1,6 +1,6 @@ -package com.crazylegend.datastructuresandalgorithms.queue.priority +package com.funkymuse.datastructuresandalgorithms.queue.priority -import com.crazylegend.datastructuresandalgorithms.queue.Queue +import com.funkymuse.datastructuresandalgorithms.queue.Queue abstract class AbstractPriorityQueueArrayList : Queue { protected val elements = ArrayList() diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/priority/CustomPriorityQueueArrayList.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/priority/CustomPriorityQueueArrayList.kt similarity index 88% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/priority/CustomPriorityQueueArrayList.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/priority/CustomPriorityQueueArrayList.kt index a52449f7f..73e96a400 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/priority/CustomPriorityQueueArrayList.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/priority/CustomPriorityQueueArrayList.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.queue.priority +package com.funkymuse.datastructuresandalgorithms.queue.priority class CustomPriorityQueueArrayList> : AbstractPriorityQueueArrayList() { diff --git a/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/priority/comparable/ComparablePriorityQueue.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/priority/comparable/ComparablePriorityQueue.kt new file mode 100644 index 000000000..cba444aa3 --- /dev/null +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/priority/comparable/ComparablePriorityQueue.kt @@ -0,0 +1,12 @@ +package com.funkymuse.datastructuresandalgorithms.queue.priority.comparable + +import com.funkymuse.datastructuresandalgorithms.heap.ComparableHeap +import com.funkymuse.datastructuresandalgorithms.heap.Heap +import com.funkymuse.datastructuresandalgorithms.queue.priority.AbstractPriorityQueue + +class ComparablePriorityQueue> : AbstractPriorityQueue() { + override val heap: Heap = ComparableHeap() + + override val isEmpty: Boolean + get() = heap.isEmpty +} \ No newline at end of file diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/priority/comparable/ComparablePriorityQueueArrayList.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/priority/comparable/ComparablePriorityQueueArrayList.kt similarity index 57% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/priority/comparable/ComparablePriorityQueueArrayList.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/priority/comparable/ComparablePriorityQueueArrayList.kt index baca67988..0b621144c 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/priority/comparable/ComparablePriorityQueueArrayList.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/priority/comparable/ComparablePriorityQueueArrayList.kt @@ -1,6 +1,6 @@ -package com.crazylegend.datastructuresandalgorithms.queue.priority.comparable +package com.funkymuse.datastructuresandalgorithms.queue.priority.comparable -import com.crazylegend.datastructuresandalgorithms.queue.priority.AbstractPriorityQueueArrayList +import com.funkymuse.datastructuresandalgorithms.queue.priority.AbstractPriorityQueueArrayList class ComparablePriorityQueueArrayList> : AbstractPriorityQueueArrayList() { diff --git a/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/priority/comparator/ComparatorPriorityQueue.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/priority/comparator/ComparatorPriorityQueue.kt new file mode 100644 index 000000000..12e684e5b --- /dev/null +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/priority/comparator/ComparatorPriorityQueue.kt @@ -0,0 +1,12 @@ +package com.funkymuse.datastructuresandalgorithms.queue.priority.comparator + +import com.funkymuse.datastructuresandalgorithms.heap.ComparatorHeap +import com.funkymuse.datastructuresandalgorithms.heap.Heap +import com.funkymuse.datastructuresandalgorithms.queue.priority.AbstractPriorityQueue + +class ComparatorPriorityQueue(comparator: Comparator) : AbstractPriorityQueue() { + override val heap: Heap = ComparatorHeap(comparator) + + override val isEmpty: Boolean + get() = heap.isEmpty +} \ No newline at end of file diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/priority/comparator/ComparatorPriorityQueueArrayList.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/priority/comparator/ComparatorPriorityQueueArrayList.kt similarity index 58% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/priority/comparator/ComparatorPriorityQueueArrayList.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/priority/comparator/ComparatorPriorityQueueArrayList.kt index 07353bf4b..9b697bde5 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/queue/priority/comparator/ComparatorPriorityQueueArrayList.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/queue/priority/comparator/ComparatorPriorityQueueArrayList.kt @@ -1,7 +1,7 @@ -package com.crazylegend.datastructuresandalgorithms.queue.priority.comparator +package com.funkymuse.datastructuresandalgorithms.queue.priority.comparator -import com.crazylegend.datastructuresandalgorithms.queue.priority.AbstractPriorityQueueArrayList -import java.util.* +import com.funkymuse.datastructuresandalgorithms.queue.priority.AbstractPriorityQueueArrayList +import java.util.Collections class ComparatorPriorityQueueArrayList(private val comparator: Comparator) : AbstractPriorityQueueArrayList() { diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/ringBuffer/RingBuffer.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/ringBuffer/RingBuffer.kt similarity index 95% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/ringBuffer/RingBuffer.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/ringBuffer/RingBuffer.kt index 4830b8321..bfc8ceca7 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/ringBuffer/RingBuffer.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/ringBuffer/RingBuffer.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.ringBuffer +package com.funkymuse.datastructuresandalgorithms.ringBuffer class RingBuffer(private val size: Int) { diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/search/BinarySearch.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/search/BinarySearch.kt similarity index 90% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/search/BinarySearch.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/search/BinarySearch.kt index 334634591..dea57c5de 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/search/BinarySearch.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/search/BinarySearch.kt @@ -1,9 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.search - - -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ +package com.funkymuse.datastructuresandalgorithms.search /** * Binary stringSearch, assumes that the list is sorted. diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/search/Extensions.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/search/Extensions.kt similarity index 97% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/search/Extensions.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/search/Extensions.kt index 25d783ffa..9540a1415 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/search/Extensions.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/search/Extensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.search +package com.funkymuse.datastructuresandalgorithms.search fun > ArrayList.findIndices( value: T diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/search/PlainSearch.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/search/PlainSearch.kt similarity index 78% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/search/PlainSearch.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/search/PlainSearch.kt index 56dcbc1d9..b6f1fa7f9 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/search/PlainSearch.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/search/PlainSearch.kt @@ -1,9 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.search - - -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ +package com.funkymuse.datastructuresandalgorithms.search /** * Plain list stringSearch. diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/BogoSort.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/BogoSort.kt similarity index 86% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/BogoSort.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/BogoSort.kt index 7c41735c1..871a1db2c 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/BogoSort.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/BogoSort.kt @@ -1,9 +1,7 @@ -package com.crazylegend.datastructuresandalgorithms.sort +package com.funkymuse.datastructuresandalgorithms.sort + -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ /** diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/BubbleSort.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/BubbleSort.kt similarity index 81% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/BubbleSort.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/BubbleSort.kt index a6000ab45..2e3d56f1d 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/BubbleSort.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/BubbleSort.kt @@ -1,13 +1,7 @@ -package com.crazylegend.datastructuresandalgorithms.sort - -import com.crazylegend.datastructuresandalgorithms.swap -import com.crazylegend.datastructuresandalgorithms.swapAt - - -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ +package com.funkymuse.datastructuresandalgorithms.sort +import com.funkymuse.datastructuresandalgorithms.swap +import com.funkymuse.datastructuresandalgorithms.swapAt /** Worst complexity: n^2 diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/HeapSort.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/HeapSort.kt similarity index 89% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/HeapSort.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/HeapSort.kt index 2952a5f49..083e3e4a1 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/HeapSort.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/HeapSort.kt @@ -1,12 +1,10 @@ -package com.crazylegend.datastructuresandalgorithms.sort +package com.funkymuse.datastructuresandalgorithms.sort + +import com.funkymuse.datastructuresandalgorithms.swap +import com.funkymuse.datastructuresandalgorithms.swapAt -import com.crazylegend.datastructuresandalgorithms.swap -import com.crazylegend.datastructuresandalgorithms.swapAt -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ /** Inventor: J. W. J. Williams diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/InsertionSort.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/InsertionSort.kt similarity index 81% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/InsertionSort.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/InsertionSort.kt index afb3ebbbd..746ed063d 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/InsertionSort.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/InsertionSort.kt @@ -1,11 +1,9 @@ -package com.crazylegend.datastructuresandalgorithms.sort +package com.funkymuse.datastructuresandalgorithms.sort + +import com.funkymuse.datastructuresandalgorithms.swapAt -import com.crazylegend.datastructuresandalgorithms.swapAt -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ /** diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/MergeInsertionSort.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/MergeInsertionSort.kt similarity index 94% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/MergeInsertionSort.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/MergeInsertionSort.kt index 67da0c98d..eaff687f7 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/MergeInsertionSort.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/MergeInsertionSort.kt @@ -1,9 +1,7 @@ -package com.crazylegend.datastructuresandalgorithms.sort +package com.funkymuse.datastructuresandalgorithms.sort + -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ /** * Merge-Insertion sort is a sorting algorithm using the principle that for diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/MergeSortPlain.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/MergeSortPlain.kt similarity index 93% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/MergeSortPlain.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/MergeSortPlain.kt index 183d88592..3d01a5ffc 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/MergeSortPlain.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/MergeSortPlain.kt @@ -1,9 +1,7 @@ -package com.crazylegend.datastructuresandalgorithms.sort +package com.funkymuse.datastructuresandalgorithms.sort + -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ /** * Merge sort is an efficient algorithm for sorting lists of data. diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/MergeSortSentinel.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/MergeSortSentinel.kt similarity index 94% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/MergeSortSentinel.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/MergeSortSentinel.kt index b0c83367e..f0ceb242b 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/MergeSortSentinel.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/MergeSortSentinel.kt @@ -1,9 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.sort - - -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ +package com.funkymuse.datastructuresandalgorithms.sort /** * Merge Sort using Sentinels - Int.MAX_VALUE entries when merging lists. diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/Mergesort.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/Mergesort.kt similarity index 95% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/Mergesort.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/Mergesort.kt index e820fc1ba..3be062202 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/Mergesort.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/Mergesort.kt @@ -1,8 +1,6 @@ -package com.crazylegend.datastructuresandalgorithms.sort +package com.funkymuse.datastructuresandalgorithms.sort + -/** - * Created by crazy on 9/7/20 to long live and prosper ! - */ fun > List.mergeSort(): List { if (this.size < 2) return this diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/RadixSort.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/RadixSort.kt similarity index 97% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/RadixSort.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/RadixSort.kt index d9491c768..3aa8342ff 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/RadixSort.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/RadixSort.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.sort +package com.funkymuse.datastructuresandalgorithms.sort import kotlin.math.pow diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/SelectionSort.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/SelectionSort.kt similarity index 86% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/SelectionSort.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/SelectionSort.kt index 48f1e42d2..210b642ce 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/SelectionSort.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/SelectionSort.kt @@ -1,12 +1,6 @@ -package com.crazylegend.datastructuresandalgorithms.sort - -import com.crazylegend.datastructuresandalgorithms.swapAt - - -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ +package com.funkymuse.datastructuresandalgorithms.sort +import com.funkymuse.datastructuresandalgorithms.swapAt /** * Selection sort is an inefficient* primitive sorting algorithm. diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/quickSort/Extensions.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/quickSort/Extensions.kt similarity index 85% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/quickSort/Extensions.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/quickSort/Extensions.kt index 5b4c20955..6271844b6 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/quickSort/Extensions.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/quickSort/Extensions.kt @@ -1,6 +1,6 @@ -package com.crazylegend.datastructuresandalgorithms.sort.quickSort +package com.funkymuse.datastructuresandalgorithms.sort.quickSort -import java.util.* +import java.util.Stack fun > MutableList.quicksortIterativeLomuto(low: Int, high: Int) { val stack = Stack() diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/quickSort/QuickSort.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/quickSort/QuickSort.kt similarity index 79% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/quickSort/QuickSort.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/quickSort/QuickSort.kt index 55dba7b4c..c38bacd67 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/quickSort/QuickSort.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/quickSort/QuickSort.kt @@ -1,11 +1,9 @@ -package com.crazylegend.datastructuresandalgorithms.sort.quickSort +package com.funkymuse.datastructuresandalgorithms.sort.quickSort + +import com.funkymuse.datastructuresandalgorithms.swap -import com.crazylegend.datastructuresandalgorithms.swap -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ /** Inventor: Tony Hoare diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/quickSort/QuicksortDutchFlag.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/quickSort/QuicksortDutchFlag.kt similarity index 89% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/quickSort/QuicksortDutchFlag.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/quickSort/QuicksortDutchFlag.kt index cb00192eb..c4ef40314 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/quickSort/QuicksortDutchFlag.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/quickSort/QuicksortDutchFlag.kt @@ -1,6 +1,6 @@ -package com.crazylegend.datastructuresandalgorithms.sort.quickSort +package com.funkymuse.datastructuresandalgorithms.sort.quickSort -import com.crazylegend.datastructuresandalgorithms.swapAt +import com.funkymuse.datastructuresandalgorithms.swapAt /** diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/quickSort/QuicksortHoare.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/quickSort/QuicksortHoare.kt similarity index 86% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/quickSort/QuicksortHoare.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/quickSort/QuicksortHoare.kt index 97680f2ca..1b5c9b78f 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/quickSort/QuicksortHoare.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/quickSort/QuicksortHoare.kt @@ -1,6 +1,6 @@ -package com.crazylegend.datastructuresandalgorithms.sort.quickSort +package com.funkymuse.datastructuresandalgorithms.sort.quickSort -import com.crazylegend.datastructuresandalgorithms.swapAt +import com.funkymuse.datastructuresandalgorithms.swapAt /** diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/quickSort/QuicksortLomuto.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/quickSort/QuicksortLomuto.kt similarity index 85% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/quickSort/QuicksortLomuto.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/quickSort/QuicksortLomuto.kt index 9e911e56e..088c1d8f4 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/quickSort/QuicksortLomuto.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/quickSort/QuicksortLomuto.kt @@ -1,6 +1,6 @@ -package com.crazylegend.datastructuresandalgorithms.sort.quickSort +package com.funkymuse.datastructuresandalgorithms.sort.quickSort -import com.crazylegend.datastructuresandalgorithms.swapAt +import com.funkymuse.datastructuresandalgorithms.swapAt /** diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/quickSort/QuicksortMedian.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/quickSort/QuicksortMedian.kt similarity index 87% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/quickSort/QuicksortMedian.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/quickSort/QuicksortMedian.kt index 2c9cc8170..d3dffbcd2 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/quickSort/QuicksortMedian.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/quickSort/QuicksortMedian.kt @@ -1,6 +1,6 @@ -package com.crazylegend.datastructuresandalgorithms.sort.quickSort +package com.funkymuse.datastructuresandalgorithms.sort.quickSort -import com.crazylegend.datastructuresandalgorithms.swapAt +import com.funkymuse.datastructuresandalgorithms.swapAt fun > MutableList.quickSortMedian(low: Int, high: Int) { diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/quickSort/QuicksortNaive.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/quickSort/QuicksortNaive.kt similarity index 87% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/quickSort/QuicksortNaive.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/quickSort/QuicksortNaive.kt index 273b5a638..501b1a9f0 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/sort/quickSort/QuicksortNaive.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/sort/quickSort/QuicksortNaive.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.sort.quickSort +package com.funkymuse.datastructuresandalgorithms.sort.quickSort /** * The naive partitioning creates a new list on every filter function; this is inefficient. diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/stack/Extensions.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/stack/Extensions.kt similarity index 86% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/stack/Extensions.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/stack/Extensions.kt index 644dcb159..a8be0da01 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/stack/Extensions.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/stack/Extensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.stack +package com.funkymuse.datastructuresandalgorithms.stack fun stackOf(vararg elements: T) = Stack.create(elements.asList()) diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/stack/Stack.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/stack/Stack.kt similarity index 93% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/stack/Stack.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/stack/Stack.kt index 096374735..cdddca99e 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/stack/Stack.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/stack/Stack.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.stack +package com.funkymuse.datastructuresandalgorithms.stack class Stack { private val storage = arrayListOf() diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trees/TreeNode.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trees/TreeNode.kt similarity index 88% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trees/TreeNode.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trees/TreeNode.kt index e4890a8f4..d35afc486 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trees/TreeNode.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trees/TreeNode.kt @@ -1,7 +1,7 @@ -package com.crazylegend.datastructuresandalgorithms.trees +package com.funkymuse.datastructuresandalgorithms.trees -import com.crazylegend.datastructuresandalgorithms.queue.ArrayListQueue -import com.crazylegend.datastructuresandalgorithms.queue.LinkedListQueue +import com.funkymuse.datastructuresandalgorithms.queue.ArrayListQueue +import com.funkymuse.datastructuresandalgorithms.queue.LinkedListQueue typealias Visitor = (TreeNode) -> Unit diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trees/Utils.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trees/Utils.kt similarity index 74% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trees/Utils.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trees/Utils.kt index f99e71094..1bc14d064 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trees/Utils.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trees/Utils.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.trees +package com.funkymuse.datastructuresandalgorithms.trees import kotlin.math.pow diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trees/avl/AVLNode.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trees/avl/AVLNode.kt similarity index 96% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trees/avl/AVLNode.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trees/avl/AVLNode.kt index b89d65919..5f1879a33 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trees/avl/AVLNode.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trees/avl/AVLNode.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.trees.avl +package com.funkymuse.datastructuresandalgorithms.trees.avl typealias Visitor = (T) -> Unit diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trees/avl/AVLTree.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trees/avl/AVLTree.kt similarity index 98% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trees/avl/AVLTree.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trees/avl/AVLTree.kt index 4f2a40af2..02dff90c6 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trees/avl/AVLTree.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trees/avl/AVLTree.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.trees.avl +package com.funkymuse.datastructuresandalgorithms.trees.avl import kotlin.math.max diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trees/binary/BinaryNode.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trees/binary/BinaryNode.kt similarity index 97% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trees/binary/BinaryNode.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trees/binary/BinaryNode.kt index d23b9c286..0582dc961 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trees/binary/BinaryNode.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trees/binary/BinaryNode.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.trees.binary +package com.funkymuse.datastructuresandalgorithms.trees.binary import kotlin.math.max diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trees/binarySearchTree/BinarySearchNode.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trees/binarySearchTree/BinarySearchNode.kt similarity index 96% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trees/binarySearchTree/BinarySearchNode.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trees/binarySearchTree/BinarySearchNode.kt index e6d9a59c3..bffe980fc 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trees/binarySearchTree/BinarySearchNode.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trees/binarySearchTree/BinarySearchNode.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.trees.binarySearchTree +package com.funkymuse.datastructuresandalgorithms.trees.binarySearchTree typealias Visitor = (T) -> Unit diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trees/binarySearchTree/BinarySearchTree.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trees/binarySearchTree/BinarySearchTree.kt similarity index 96% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trees/binarySearchTree/BinarySearchTree.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trees/binarySearchTree/BinarySearchTree.kt index 40b877b32..e914e8491 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trees/binarySearchTree/BinarySearchTree.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trees/binarySearchTree/BinarySearchTree.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.trees.binarySearchTree +package com.funkymuse.datastructuresandalgorithms.trees.binarySearchTree class BinarySearchTree> { diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trees/binarySearchTree/TraversableBinaryNode.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trees/binarySearchTree/TraversableBinaryNode.kt similarity index 89% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trees/binarySearchTree/TraversableBinaryNode.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trees/binarySearchTree/TraversableBinaryNode.kt index 7de622037..af1af0cc4 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trees/binarySearchTree/TraversableBinaryNode.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trees/binarySearchTree/TraversableBinaryNode.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.trees.binarySearchTree +package com.funkymuse.datastructuresandalgorithms.trees.binarySearchTree abstract class TraversableBinaryNode, T>(var value: T) { diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trie/Extensions.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trie/Extensions.kt similarity index 86% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trie/Extensions.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trie/Extensions.kt index dad164609..172c00e99 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trie/Extensions.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trie/Extensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.trie +package com.funkymuse.datastructuresandalgorithms.trie fun Trie.insert(string: String) { insert(string.toList()) diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trie/Trie.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trie/Trie.kt similarity index 97% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trie/Trie.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trie/Trie.kt index 87ecf3b61..1a7d2c489 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trie/Trie.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trie/Trie.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.trie +package com.funkymuse.datastructuresandalgorithms.trie class Trie { diff --git a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trie/TrieNode.kt b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trie/TrieNode.kt similarity index 73% rename from dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trie/TrieNode.kt rename to dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trie/TrieNode.kt index 6b3f3c941..6c9bbe12d 100644 --- a/dataStructuresAndAlgorithms/src/main/java/com/crazylegend/datastructuresandalgorithms/trie/TrieNode.kt +++ b/dataStructuresAndAlgorithms/src/main/java/com/funkymuse/datastructuresandalgorithms/trie/TrieNode.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datastructuresandalgorithms.trie +package com.funkymuse.datastructuresandalgorithms.trie class TrieNode(var key: Key?, var parent: TrieNode?) { diff --git a/dateTime/build.gradle b/dateTime/build.gradle deleted file mode 100644 index ba8a004a6..000000000 --- a/dateTime/build.gradle +++ /dev/null @@ -1,7 +0,0 @@ -dependencies { - implementation "androidx.core:core-ktx:$coreKTX" -} - -android { - namespace 'com.crazylegend.datetime' -} \ No newline at end of file diff --git a/dateTime/build.gradle.kts b/dateTime/build.gradle.kts new file mode 100644 index 000000000..8d03e563c --- /dev/null +++ b/dateTime/build.gradle.kts @@ -0,0 +1,7 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(libs.androidx.core.ktx) +} diff --git a/dateTime/src/main/AndroidManifest.xml b/dateTime/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/dateTime/src/main/AndroidManifest.xml +++ b/dateTime/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/dateTime/src/main/java/com/crazylegend/datetime/DateExtensions.kt b/dateTime/src/main/java/com/funkymuse/datetime/DateExtensions.kt similarity index 99% rename from dateTime/src/main/java/com/crazylegend/datetime/DateExtensions.kt rename to dateTime/src/main/java/com/funkymuse/datetime/DateExtensions.kt index a230f1bcd..89636dbfa 100644 --- a/dateTime/src/main/java/com/crazylegend/datetime/DateExtensions.kt +++ b/dateTime/src/main/java/com/funkymuse/datetime/DateExtensions.kt @@ -1,17 +1,15 @@ -package com.crazylegend.datetime +package com.funkymuse.datetime import android.content.Context import android.text.format.DateFormat import android.text.format.DateUtils import java.text.SimpleDateFormat -import java.util.* +import java.util.Calendar +import java.util.Date +import java.util.Locale import java.util.concurrent.TimeUnit -/** - * Created by Hristijan on 2/1/19 to long live and prosper ! - */ - fun Date.millisecondsSince(date: Date) = (time - date.time) fun Date.secondsSince(date: Date): Double = millisecondsSince(date) / 1000.0 fun Date.minutesSince(date: Date): Double = secondsSince(date) / 60 diff --git a/dateTime/src/main/java/com/crazylegend/datetime/DateExtensions2.kt b/dateTime/src/main/java/com/funkymuse/datetime/DateExtensions2.kt similarity index 97% rename from dateTime/src/main/java/com/crazylegend/datetime/DateExtensions2.kt rename to dateTime/src/main/java/com/funkymuse/datetime/DateExtensions2.kt index 805f6b8b0..c4ae0a1c7 100644 --- a/dateTime/src/main/java/com/crazylegend/datetime/DateExtensions2.kt +++ b/dateTime/src/main/java/com/funkymuse/datetime/DateExtensions2.kt @@ -1,12 +1,8 @@ -package com.crazylegend.datetime +package com.funkymuse.datetime import java.text.SimpleDateFormat -import java.util.* - - -/** - * Created by crazy on 8/9/20 to long live and prosper ! - */ +import java.util.Calendar +import java.util.Date fun Date.with( diff --git a/dateTime/src/main/java/com/crazylegend/datetime/OffsetExtensions.kt b/dateTime/src/main/java/com/funkymuse/datetime/OffsetExtensions.kt similarity index 82% rename from dateTime/src/main/java/com/crazylegend/datetime/OffsetExtensions.kt rename to dateTime/src/main/java/com/funkymuse/datetime/OffsetExtensions.kt index a0f505a0d..6bc1c19ba 100644 --- a/dateTime/src/main/java/com/crazylegend/datetime/OffsetExtensions.kt +++ b/dateTime/src/main/java/com/funkymuse/datetime/OffsetExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.datetime +package com.funkymuse.datetime import android.os.Build import androidx.annotation.RequiresApi @@ -7,9 +7,7 @@ import java.time.OffsetDateTime import java.time.ZoneId -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ + /** * Obtains an [OffsetDateTime] instance from Instant diff --git a/dateTime/src/main/java/com/crazylegend/datetime/TimeExtensions.kt b/dateTime/src/main/java/com/funkymuse/datetime/TimeExtensions.kt similarity index 98% rename from dateTime/src/main/java/com/crazylegend/datetime/TimeExtensions.kt rename to dateTime/src/main/java/com/funkymuse/datetime/TimeExtensions.kt index 2086c22d1..b4dfb1112 100644 --- a/dateTime/src/main/java/com/crazylegend/datetime/TimeExtensions.kt +++ b/dateTime/src/main/java/com/funkymuse/datetime/TimeExtensions.kt @@ -1,16 +1,13 @@ -package com.crazylegend.datetime +package com.funkymuse.datetime import java.text.ParseException import java.text.SimpleDateFormat -import java.util.* +import java.util.Calendar +import java.util.Date +import java.util.Locale import java.util.concurrent.TimeUnit -/** - * Created by hristijan on 3/20/19 to long live and prosper ! - */ - - const val DAY = "DD" const val HOUR = "hh" const val MINUTE = "mm" diff --git a/dateTime/src/main/java/com/crazylegend/datetime/TimestampConvert.kt b/dateTime/src/main/java/com/funkymuse/datetime/TimestampConvert.kt similarity index 97% rename from dateTime/src/main/java/com/crazylegend/datetime/TimestampConvert.kt rename to dateTime/src/main/java/com/funkymuse/datetime/TimestampConvert.kt index 91144a369..474a7a296 100644 --- a/dateTime/src/main/java/com/crazylegend/datetime/TimestampConvert.kt +++ b/dateTime/src/main/java/com/funkymuse/datetime/TimestampConvert.kt @@ -1,9 +1,7 @@ -package com.crazylegend.datetime +package com.funkymuse.datetime + -/** - * Created by hristijan on 4/15/19 to long live and prosper ! - */ import java.text.ParseException import java.text.SimpleDateFormat diff --git a/enums/build.gradle b/enums/build.gradle deleted file mode 100644 index e69de29bb..000000000 diff --git a/enums/build.gradle.kts b/enums/build.gradle.kts new file mode 100644 index 000000000..58e507a44 --- /dev/null +++ b/enums/build.gradle.kts @@ -0,0 +1,4 @@ +plugins { + id(libs.plugins.convention.kotlin.library.get().pluginId) +} + diff --git a/enums/src/main/java/com/crazylegend/enums/EnumExtensions.kt b/enums/src/main/java/com/funkymuse/enums/EnumExtensions.kt similarity index 84% rename from enums/src/main/java/com/crazylegend/enums/EnumExtensions.kt rename to enums/src/main/java/com/funkymuse/enums/EnumExtensions.kt index 821fcff49..76bbaba6b 100644 --- a/enums/src/main/java/com/crazylegend/enums/EnumExtensions.kt +++ b/enums/src/main/java/com/funkymuse/enums/EnumExtensions.kt @@ -1,9 +1,7 @@ -package com.crazylegend.enums +package com.funkymuse.enums + -/** - * Created by hristijan on 3/20/19 to long live and prosper ! - */ inline fun > find(predicate: (item: T) -> Boolean): T? = enumValues().find { predicate(it) } diff --git a/file/build.gradle b/file/build.gradle deleted file mode 100644 index 8d1a3f00e..000000000 --- a/file/build.gradle +++ /dev/null @@ -1,13 +0,0 @@ - -dependencies { - - implementation project(path: ':common') - implementation project(path: ':string') - implementation "androidx.core:core-ktx:$coreKTX" - implementation "androidx.documentfile:documentfile:$documentFile" - -} - -android { - namespace 'com.crazylegend.file' -} \ No newline at end of file diff --git a/file/build.gradle.kts b/file/build.gradle.kts new file mode 100644 index 000000000..7e5d2f3ec --- /dev/null +++ b/file/build.gradle.kts @@ -0,0 +1,10 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(projects.string) + implementation(projects.common) + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.documentfile) +} diff --git a/file/src/main/AndroidManifest.xml b/file/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/file/src/main/AndroidManifest.xml +++ b/file/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/file/src/main/java/com/crazylegend/file/FileExtensions.kt b/file/src/main/java/com/funkymuse/file/FileExtensions.kt similarity index 98% rename from file/src/main/java/com/crazylegend/file/FileExtensions.kt rename to file/src/main/java/com/funkymuse/file/FileExtensions.kt index 8bb283db6..3b9905df1 100644 --- a/file/src/main/java/com/crazylegend/file/FileExtensions.kt +++ b/file/src/main/java/com/funkymuse/file/FileExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.file +package com.funkymuse.file import android.content.ContentResolver import android.content.ContentUris @@ -11,21 +11,18 @@ import android.os.Build import android.os.Environment import android.provider.DocumentsContract import android.provider.MediaStore -import androidx.annotation.Nullable import androidx.core.content.FileProvider import androidx.core.net.toFile -import com.crazylegend.common.tryOrIgnore -import java.io.* +import com.funkymuse.common.tryOrIgnore +import java.io.ByteArrayOutputStream +import java.io.File +import java.io.FileInputStream +import java.io.FileOutputStream +import java.io.InputStream import java.net.HttpURLConnection import java.net.URL import java.nio.channels.FileChannel import java.nio.charset.Charset -import java.util.* - - -/** - * Created by crazy on 2/24/19 to long live and prosper ! - */ /** diff --git a/file/src/main/java/com/crazylegend/file/FileExtensions2.kt b/file/src/main/java/com/funkymuse/file/FileExtensions2.kt similarity index 99% rename from file/src/main/java/com/crazylegend/file/FileExtensions2.kt rename to file/src/main/java/com/funkymuse/file/FileExtensions2.kt index 8ca20b46b..33c33eef1 100644 --- a/file/src/main/java/com/crazylegend/file/FileExtensions2.kt +++ b/file/src/main/java/com/funkymuse/file/FileExtensions2.kt @@ -1,4 +1,4 @@ -package com.crazylegend.file +package com.funkymuse.file import android.content.Context import android.os.Build @@ -13,9 +13,7 @@ import java.util.zip.ZipEntry import java.util.zip.ZipFile import java.util.zip.ZipOutputStream -/** - * Created by funkymuse on 5/26/21 to long live and prosper ! - */ + fun File.lastModifiedDateTimeAsString(): String = SimpleDateFormat("dd.MM.yyyy HH:mm:ss", Locale.getDefault()).format(lastModified()) diff --git a/file/src/main/java/com/crazylegend/file/FileExtensions3.kt b/file/src/main/java/com/funkymuse/file/FileExtensions3.kt similarity index 85% rename from file/src/main/java/com/crazylegend/file/FileExtensions3.kt rename to file/src/main/java/com/funkymuse/file/FileExtensions3.kt index b365c77a0..a5ad4beaa 100644 --- a/file/src/main/java/com/crazylegend/file/FileExtensions3.kt +++ b/file/src/main/java/com/funkymuse/file/FileExtensions3.kt @@ -1,11 +1,9 @@ -package com.crazylegend.file +package com.funkymuse.file import java.io.File import java.net.URLConnection -/** - * Created by Hristijan, date 5/26/21 - */ + fun File.mediaType(): String { return URLConnection.getFileNameMap().getContentTypeFor(name) ?: when (extension.lowercase()) { diff --git a/file/src/main/java/com/crazylegend/file/FileTypeExtensions.kt b/file/src/main/java/com/funkymuse/file/FileTypeExtensions.kt similarity index 94% rename from file/src/main/java/com/crazylegend/file/FileTypeExtensions.kt rename to file/src/main/java/com/funkymuse/file/FileTypeExtensions.kt index 917463ec5..8e28dd448 100644 --- a/file/src/main/java/com/crazylegend/file/FileTypeExtensions.kt +++ b/file/src/main/java/com/funkymuse/file/FileTypeExtensions.kt @@ -1,15 +1,13 @@ -package com.crazylegend.file +package com.funkymuse.file import android.webkit.MimeTypeMap import androidx.documentfile.provider.DocumentFile -import com.crazylegend.string.containsInArray -import com.crazylegend.string.isEmptyString +import com.funkymuse.string.containsInArray +import com.funkymuse.string.isEmptyString import java.io.File -/** - * Created by hristijan on 3/7/19 to long live and prosper ! - */ + /** diff --git a/file/src/main/java/com/crazylegend/file/UriExtensions.kt b/file/src/main/java/com/funkymuse/file/UriExtensions.kt similarity index 97% rename from file/src/main/java/com/crazylegend/file/UriExtensions.kt rename to file/src/main/java/com/funkymuse/file/UriExtensions.kt index d1f9f152a..c356efcfc 100644 --- a/file/src/main/java/com/crazylegend/file/UriExtensions.kt +++ b/file/src/main/java/com/funkymuse/file/UriExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.file +package com.funkymuse.file import android.content.ClipData import android.content.ContentResolver @@ -10,9 +10,7 @@ import android.webkit.MimeTypeMap import java.io.File -/** - * Created by hristijan on 3/5/19 to long live and prosper ! - */ + /** diff --git a/fragment/build.gradle b/fragment/build.gradle deleted file mode 100644 index 74a0b5d0c..000000000 --- a/fragment/build.gradle +++ /dev/null @@ -1,13 +0,0 @@ - -dependencies { - - implementation "androidx.fragment:fragment-ktx:$fragment" - implementation "androidx.appcompat:appcompat:$appCompat" - implementation project(path: ':common') - implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle" - -} - -android { - namespace 'com.crazylegend.fragment' -} \ No newline at end of file diff --git a/fragment/build.gradle.kts b/fragment/build.gradle.kts new file mode 100644 index 000000000..1927899a1 --- /dev/null +++ b/fragment/build.gradle.kts @@ -0,0 +1,10 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(libs.androidx.fragment.ktx) + implementation(libs.androidx.appcompat) + implementation(projects.common) + implementation(libs.androidx.lifecycle.common.java8) +} diff --git a/fragment/src/main/AndroidManifest.xml b/fragment/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/fragment/src/main/AndroidManifest.xml +++ b/fragment/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/fragment/src/main/java/com/crazylegend/fragment/AutoClearedValueInFragment.kt b/fragment/src/main/java/com/funkymuse/fragment/AutoClearedValueInFragment.kt similarity index 86% rename from fragment/src/main/java/com/crazylegend/fragment/AutoClearedValueInFragment.kt rename to fragment/src/main/java/com/funkymuse/fragment/AutoClearedValueInFragment.kt index dbaefd233..31868ed61 100644 --- a/fragment/src/main/java/com/crazylegend/fragment/AutoClearedValueInFragment.kt +++ b/fragment/src/main/java/com/funkymuse/fragment/AutoClearedValueInFragment.kt @@ -1,13 +1,11 @@ -package com.crazylegend.fragment +package com.funkymuse.fragment import androidx.fragment.app.Fragment import kotlin.properties.ReadWriteProperty import kotlin.reflect.KProperty -/** - * Created by crazy on 2/25/20 to long live and prosper ! - */ + class AutoClearedValueInFragment(fragment: Fragment) : ReadWriteProperty { private var _value: T? = null diff --git a/fragment/src/main/java/com/crazylegend/fragment/FragmentExtensions.kt b/fragment/src/main/java/com/funkymuse/fragment/FragmentExtensions.kt similarity index 97% rename from fragment/src/main/java/com/crazylegend/fragment/FragmentExtensions.kt rename to fragment/src/main/java/com/funkymuse/fragment/FragmentExtensions.kt index c6fde48aa..a4b209b74 100644 --- a/fragment/src/main/java/com/crazylegend/fragment/FragmentExtensions.kt +++ b/fragment/src/main/java/com/funkymuse/fragment/FragmentExtensions.kt @@ -1,6 +1,5 @@ -package com.crazylegend.fragment +package com.funkymuse.fragment -import android.annotation.SuppressLint import android.app.AppOpsManager import android.content.Context import android.content.Intent @@ -15,24 +14,25 @@ import android.util.Log import android.util.TypedValue import android.view.View import android.widget.Toast -import androidx.annotation.* +import androidx.annotation.ColorRes +import androidx.annotation.DrawableRes +import androidx.annotation.IdRes +import androidx.annotation.StringRes import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.view.ContextThemeWrapper import androidx.appcompat.widget.Toolbar import androidx.core.content.ContextCompat import androidx.core.content.getSystemService -import androidx.fragment.app.* +import androidx.fragment.app.Fragment +import androidx.fragment.app.FragmentActivity +import androidx.fragment.app.FragmentManager +import androidx.fragment.app.FragmentTransaction +import androidx.fragment.app.commit import androidx.lifecycle.DefaultLifecycleObserver import androidx.lifecycle.LifecycleOwner -import androidx.lifecycle.coroutineScope -import com.crazylegend.common.orFalse -import com.crazylegend.common.tryOrElse - - -/** - * Created by hristijan on 2/22/19 to long live and prosper ! - */ +import com.funkymuse.common.orFalse +import com.funkymuse.common.tryOrElse fun Fragment.shortToast(text: String) { diff --git a/fragment/src/main/java/com/crazylegend/fragment/FragmentExtensions2.kt b/fragment/src/main/java/com/funkymuse/fragment/FragmentExtensions2.kt similarity index 97% rename from fragment/src/main/java/com/crazylegend/fragment/FragmentExtensions2.kt rename to fragment/src/main/java/com/funkymuse/fragment/FragmentExtensions2.kt index 386fb413e..623bd486a 100644 --- a/fragment/src/main/java/com/crazylegend/fragment/FragmentExtensions2.kt +++ b/fragment/src/main/java/com/funkymuse/fragment/FragmentExtensions2.kt @@ -1,4 +1,4 @@ -package com.crazylegend.fragment +package com.funkymuse.fragment import android.app.PictureInPictureParams import android.content.Intent @@ -10,11 +10,9 @@ import androidx.annotation.RequiresApi import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentTransaction -import com.crazylegend.common.tryOrElse +import com.funkymuse.common.tryOrElse + -/** - * Created by crazy on 9/7/20 to long live and prosper ! - */ fun Fragment.hide() { diff --git a/fragment/src/main/java/com/crazylegend/fragment/FragmentResultExtensions.kt b/fragment/src/main/java/com/funkymuse/fragment/FragmentResultExtensions.kt similarity index 97% rename from fragment/src/main/java/com/crazylegend/fragment/FragmentResultExtensions.kt rename to fragment/src/main/java/com/funkymuse/fragment/FragmentResultExtensions.kt index c00a0dc09..c4ec1724a 100644 --- a/fragment/src/main/java/com/crazylegend/fragment/FragmentResultExtensions.kt +++ b/fragment/src/main/java/com/funkymuse/fragment/FragmentResultExtensions.kt @@ -1,14 +1,9 @@ -package com.crazylegend.fragment +package com.funkymuse.fragment import android.os.Parcelable import androidx.fragment.app.Fragment import androidx.fragment.app.setFragmentResultListener - -/** - * Created by crazy on 9/15/20 to long live and prosper ! - */ - inline fun Fragment.fragmentBooleanResult( requestKey: String, bundleKey: String, diff --git a/generators/build.gradle b/generators/build.gradle deleted file mode 100644 index fc2de6181..000000000 --- a/generators/build.gradle +++ /dev/null @@ -1,9 +0,0 @@ -dependencies { - implementation project(path: ':math') - - -} - -android { - namespace 'com.crazylegend.generators' -} \ No newline at end of file diff --git a/generators/build.gradle.kts b/generators/build.gradle.kts new file mode 100644 index 000000000..40da7ddd3 --- /dev/null +++ b/generators/build.gradle.kts @@ -0,0 +1,7 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(projects.math) +} diff --git a/generators/src/main/AndroidManifest.xml b/generators/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/generators/src/main/AndroidManifest.xml +++ b/generators/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/generators/src/main/java/com/crazylegend/generators/GeneratorUtils.kt b/generators/src/main/java/com/funkymuse/generators/GeneratorUtils.kt similarity index 90% rename from generators/src/main/java/com/crazylegend/generators/GeneratorUtils.kt rename to generators/src/main/java/com/funkymuse/generators/GeneratorUtils.kt index 634819842..9ba45667e 100644 --- a/generators/src/main/java/com/crazylegend/generators/GeneratorUtils.kt +++ b/generators/src/main/java/com/funkymuse/generators/GeneratorUtils.kt @@ -1,16 +1,14 @@ -package com.crazylegend.generators +package com.funkymuse.generators import android.graphics.Color import android.graphics.drawable.ColorDrawable -import com.crazylegend.math.MathUtils.Companion.random -import com.crazylegend.math.MathUtils.Companion.randomBoolean +import com.funkymuse.math.MathUtils.Companion.random +import com.funkymuse.math.MathUtils.Companion.randomBoolean import java.text.MessageFormat.format import kotlin.math.roundToInt -/** - * Created by hristijan on 4/15/19 to long live and prosper ! - */ + fun createRandomImageUrl(): String { diff --git a/generators/src/main/java/com/crazylegend/generators/RandomXS128.kt b/generators/src/main/java/com/funkymuse/generators/RandomXS128.kt similarity index 98% rename from generators/src/main/java/com/crazylegend/generators/RandomXS128.kt rename to generators/src/main/java/com/funkymuse/generators/RandomXS128.kt index f3f03eb30..f81efb00a 100644 --- a/generators/src/main/java/com/crazylegend/generators/RandomXS128.kt +++ b/generators/src/main/java/com/funkymuse/generators/RandomXS128.kt @@ -1,10 +1,7 @@ -package com.crazylegend.generators +package com.funkymuse.generators -import java.util.* +import java.util.Random -/** - * Created by hristijan on 4/15/19 to long live and prosper ! - */ class RandomXS128 : Random { diff --git a/generators/src/main/java/com/crazylegend/generators/UIDGenerator.kt b/generators/src/main/java/com/funkymuse/generators/UIDGenerator.kt similarity index 82% rename from generators/src/main/java/com/crazylegend/generators/UIDGenerator.kt rename to generators/src/main/java/com/funkymuse/generators/UIDGenerator.kt index 3e9ec8337..ad6632643 100644 --- a/generators/src/main/java/com/crazylegend/generators/UIDGenerator.kt +++ b/generators/src/main/java/com/funkymuse/generators/UIDGenerator.kt @@ -1,11 +1,9 @@ -package com.crazylegend.generators +package com.funkymuse.generators import java.util.concurrent.atomic.AtomicInteger -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ + object UIDGenerator { diff --git a/glide/build.gradle b/glide/build.gradle deleted file mode 100644 index fefda576c..000000000 --- a/glide/build.gradle +++ /dev/null @@ -1,8 +0,0 @@ -dependencies { - implementation "com.github.bumptech.glide:glide:$glide" - implementation "androidx.appcompat:appcompat:$appCompat" -} - -android { - namespace 'com.crazylegend.glide' -} \ No newline at end of file diff --git a/glide/build.gradle.kts b/glide/build.gradle.kts new file mode 100644 index 000000000..4be61854b --- /dev/null +++ b/glide/build.gradle.kts @@ -0,0 +1,8 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(libs.glide) + implementation(libs.androidx.appcompat) +} \ No newline at end of file diff --git a/glide/src/main/java/com/crazylegend/glide/GlideExtensions.kt b/glide/src/main/java/com/funkymuse/glide/GlideExtensions.kt similarity index 98% rename from glide/src/main/java/com/crazylegend/glide/GlideExtensions.kt rename to glide/src/main/java/com/funkymuse/glide/GlideExtensions.kt index adffa334f..40f15e185 100644 --- a/glide/src/main/java/com/crazylegend/glide/GlideExtensions.kt +++ b/glide/src/main/java/com/funkymuse/glide/GlideExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.glide +package com.funkymuse.glide import android.content.Context import android.graphics.Bitmap @@ -14,10 +14,6 @@ import com.bumptech.glide.request.BaseRequestOptions import com.bumptech.glide.request.RequestOptions -/** - * Created by Crazy on 2/5/19 to long live and prosper ! - */ - fun Context.loadImg(imgUrl: Any?, view: AppCompatImageView) { Glide.with(this) .load(imgUrl) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 000000000..7136ae289 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,190 @@ +[versions] +androidx-activity = "1.8.2" +androidx-coreKTX = "1.12.0" +androidx-appCompat = "1.6.1" +androidx-interpolator = "1.0.0" +androidx-recyclerview = "1.3.2" +androidx-transition = "1.4.1" +androidx-biometrics = "1.2.0-alpha05" +androidx-collection = "1.3.0" +androidx-fragment = "1.6.2" +androidx-lifecycle = "2.7.0" +androidx-documentFile = "1.0.1" +androidx-constraintlayout = "2.1.4" +androidx-exifinterface = "1.3.7" +androidx-paletteKtx = "1.0.0" +androidx-preferenceKtx = "1.2.1" +androidx-swiperefreshlayout = "1.1.0" +androidx-vectordrawable = "1.1.0" +androidx-viewpager2 = "1.1.0-beta02" +androidx-securityVersion = "1.1.0-alpha06" +androidx-annotation = "1.7.1" +androidx-test-core = '1.5.0' +archTestingVersion = "2.2.0" +coroutines = "1.7.3" +espressoCore = "3.5.1" +hamcrestVersion = "1.3" +moshi = "1.15.0" +navigationFragmentKtx = "2.7.6" +okHttp = "4.12.0" +retrofit = "2.9.0" +robolectricVersion = "4.11.1" +roomKtx = "2.6.1" +rx = "3.0.1" +glide = "4.16.0" +gson = "2.10.1" +joda = "2.12.6" +junit = "4.13.2" +junitVersion = "1.1.5" +kotlinReflect = "1.9.22" +material = "1.11.0" +kotlin = "1.9.22" +ksp = "1.9.22-1.0.16" +kotlin-immutable-collections = "0.3.7" +#Compose +composeActivity = "1.8.2" +compose = "1.6.0-rc01" +composeCompiler = "1.5.8" +composeMaterial3 = "1.2.0-beta02" +#Gradle +gradlePlugins-agp = "8.2.1" +gradlePlugins-spotless = "6.24.0" +gradlePlugins-dokka = "1.9.10" +gradlePlugins-maven-publish = "maven-publish" +#Build +app-build-compileSDKVersion = "34" +app-build-targetSDK = "34" +app-build-minimumSDK = "21" +app-build-testRunner = "androidx.test.runner.AndroidJUnitRunner" +app-build-kotlinJVMTarget = "17" +app-build-javaVersion = "VERSION_17" +#versioning +app-version-appId = "com.funkymuse.setofusefulkotlinextensions" +app-version-versionCode = "1" +app-version-versionName = "1.0.0" + +[libraries] +adapter-rxjava3 = { module = "com.squareup.retrofit2:adapter-rxjava3", version.ref = "retrofit" } +android-joda = { module = "net.danlew:android.joda", version.ref = "joda" } +androidx-activity-ktx = { module = "androidx.activity:activity-ktx", version.ref = "androidx-activity" } +androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appCompat" } +androidx-appcompat-resources = { module = "androidx.appcompat:appcompat-resources", version.ref = "androidx-appCompat" } +androidx-biometric = { module = "androidx.biometric:biometric", version.ref = "androidx-biometrics" } +androidx-collection-ktx = { module = "androidx.collection:collection-ktx", version.ref = "androidx-collection" } +androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "androidx-constraintlayout" } +androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidx-coreKTX" } +androidx-core-testing = { module = "androidx.arch.core:core-testing", version.ref = "archTestingVersion" } +androidx-documentfile = { module = "androidx.documentfile:documentfile", version.ref = "androidx-documentFile" } +androidx-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espressoCore" } +androidx-exifinterface = { module = "androidx.exifinterface:exifinterface", version.ref = "androidx-exifinterface" } +androidx-fragment-ktx = { module = "androidx.fragment:fragment-ktx", version.ref = "androidx-fragment" } +androidx-interpolator = { module = "androidx.interpolator:interpolator", version.ref = "androidx-interpolator" } +androidx-junit = { module = "androidx.test.ext:junit", version.ref = "junitVersion" } +androidx-junit-ktx = { module = "androidx.test.ext:junit-ktx", version.ref = "junitVersion" } +androidx-lifecycle-common-java8 = { module = "androidx.lifecycle:lifecycle-common-java8", version.ref = "androidx-lifecycle" } +androidx-lifecycle-lifecycle-viewmodel-savedstate = { module = "androidx.lifecycle:lifecycle-viewmodel-savedstate", version.ref = "androidx-lifecycle" } +androidx-lifecycle-livedata-ktx = { module = "androidx.lifecycle:lifecycle-livedata-ktx", version.ref = "androidx-lifecycle" } +androidx-lifecycle-process = { module = "androidx.lifecycle:lifecycle-process", version.ref = "androidx-lifecycle" } +androidx-lifecycle-reactivestreams = { module = "androidx.lifecycle:lifecycle-reactivestreams", version.ref = "androidx-lifecycle" } +androidx-lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "androidx-lifecycle" } +androidx-lifecycle-service = { module = "androidx.lifecycle:lifecycle-service", version.ref = "androidx-lifecycle" } +androidx-lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle" } +androidx-navigation-fragment-ktx = { module = "androidx.navigation:navigation-fragment-ktx", version.ref = "navigationFragmentKtx" } +androidx-navigation-ui-ktx = { module = "androidx.navigation:navigation-ui-ktx", version.ref = "navigationFragmentKtx" } +androidx-palette-ktx = { module = "androidx.palette:palette-ktx", version.ref = "androidx-paletteKtx" } +androidx-preference = { module = "androidx.preference:preference", version.ref = "androidx-preferenceKtx" } +androidx-preference-ktx = { module = "androidx.preference:preference-ktx", version.ref = "androidx-preferenceKtx" } +androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "androidx-recyclerview" } +androidx-room-ktx = { module = "androidx.room:room-ktx", version.ref = "roomKtx" } +androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "roomKtx" } +androidx-security-crypto-ktx = { module = "androidx.security:security-crypto-ktx", version.ref = "androidx-securityVersion" } +androidx-swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version.ref = "androidx-swiperefreshlayout" } +androidx-transition = { module = "androidx.transition:transition", version.ref = "androidx-transition" } +androidx-vectordrawable = { module = "androidx.vectordrawable:vectordrawable", version.ref = "androidx-vectordrawable" } +androidx-viewpager2 = { module = "androidx.viewpager2:viewpager2", version.ref = "androidx-viewpager2" } +androidx-annotation = { module = "androidx.annotation:annotation", version.ref = "androidx-annotation" } +androidx-test-core-ktx = { module = "androidx.test:core-ktx", version.ref = "androidx-test-core" } +converter-gson = { module = "com.squareup.retrofit2:converter-gson", version.ref = "retrofit" } +converter-moshi = { module = "com.squareup.retrofit2:converter-moshi", version.ref = "retrofit" } +glide = { module = "com.github.bumptech.glide:glide", version.ref = "glide" } +glide-compiler = { module = "com.github.bumptech.glide:compiler", version.ref = "glide" } +gson = { module = "com.google.code.gson:gson", version.ref = "gson" } +hamcrest-all = { module = "org.hamcrest:hamcrest-all", version.ref = "hamcrestVersion" } +junit = { module = "junit:junit", version.ref = "junit" } +kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlinReflect" } +kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" } +kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" } +kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" } +logging-interceptor = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okHttp" } +material = { module = "com.google.android.material:material", version.ref = "material" } +moshi = { module = "com.squareup.moshi:moshi", version.ref = "moshi" } +moshi-kotlin = { module = "com.squareup.moshi:moshi-kotlin", version.ref = "moshi" } +moshi-kotlin-codegen = { module = "com.squareup.moshi:moshi-kotlin-codegen", version.ref = "moshi" } +retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" } +robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectricVersion" } +rxandroid = { module = "io.reactivex.rxjava3:rxandroid", version.ref = "rx" } +rxkotlin = { module = "io.reactivex.rxjava3:rxkotlin", version.ref = "rx" } +kotlin-immutable-collections = { module = "org.jetbrains.kotlinx:kotlinx-collections-immutable", version.ref = "kotlin-immutable-collections" } +#Compose +compose-compiler = { module = "androidx.compose.compiler:compiler", version.ref = "composeCompiler" } +compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "compose" } +compose-material3 = { module = "androidx.compose.material3:material3", version.ref = "composeMaterial3" } +compose-material-icons = { module = "androidx.compose.material:material-icons-extended", version.ref = "compose" } +compose-animation = { module = "androidx.compose.animation:animation", version.ref = "compose" } +compose-activity = { module = "androidx.activity:activity-compose", version.ref = "composeActivity" } +compose-ui = { module = "androidx.compose.ui:ui", version.ref = "compose" } +compose-runtime = { module = "androidx.compose.runtime:runtime", version.ref = "compose" } +compose-uiTooling-debug = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" } +compose-uiTooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose" } +# Dependencies of the included build-logic +android-gradlePlugin = { module = "com.android.tools.build:gradle", version.ref = "gradlePlugins-agp" } +kotlin-gradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } +[bundles] +compose = [ + "compose-activity", + "compose-animation", + "compose-compiler", + "compose-foundation", + "compose-material-icons", + "compose-material3", + "compose-runtime", + "compose-ui", + "compose-uiTooling-preview", +] +compose-preview = [ + "compose-uiTooling-debug", +] +coroutines = [ + "kotlinx-coroutines-android", + "kotlinx-coroutines-core" +] +unit-test = [ + "junit", + "hamcrest-all", + "androidx-junit-ktx", + "androidx-test-core-ktx", + "robolectric", + "androidx-core-testing", + "kotlinx-coroutines-test" +] +android-test = [ + "androidx-junit", + "androidx-espresso-core" +] +[plugins] +java-library = { id = "java-library" } +test = { id = "com.android.test", version.ref = "gradlePlugins-agp" } +spotless = { id = "com.diffplug.spotless", version.ref = "gradlePlugins-spotless" } +android = { id = "com.android.application", version.ref = "gradlePlugins-agp" } +library = { id = "com.android.library", version.ref = "gradlePlugins-agp" } +kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +kotlinJvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } +dokka = { id = "org.jetbrains.dokka", version.ref = "gradlePlugins-dokka" } +ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } +convention-compose-app = { id = "convention.android.compose.app" } +convention-compose-library = { id = "convention.android.compose.library" } +convention-moshi = { id = "convention.android.moshi" } +convention-room = { id = "convention.android.room" } +convention-app = { id = "convention.android.app" } +convention-library = { id = "convention.android.library" } +convention-kotlin-library = { id = "convention.android.kotlin.library" } \ No newline at end of file diff --git a/gson/build.gradle b/gson/build.gradle deleted file mode 100644 index 142c5460f..000000000 --- a/gson/build.gradle +++ /dev/null @@ -1,7 +0,0 @@ -dependencies { - api 'com.google.code.gson:gson:2.10.1' -} - -android { - namespace 'com.crazylegend.gson' -} \ No newline at end of file diff --git a/gson/build.gradle.kts b/gson/build.gradle.kts new file mode 100644 index 000000000..11b8fcfd1 --- /dev/null +++ b/gson/build.gradle.kts @@ -0,0 +1,7 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + api(libs.gson) +} diff --git a/gson/src/main/java/com/crazylegend/gson/GsonExtensions.kt b/gson/src/main/java/com/funkymuse/gson/GsonExtensions.kt similarity index 96% rename from gson/src/main/java/com/crazylegend/gson/GsonExtensions.kt rename to gson/src/main/java/com/funkymuse/gson/GsonExtensions.kt index 3d8960765..c4f941116 100644 --- a/gson/src/main/java/com/crazylegend/gson/GsonExtensions.kt +++ b/gson/src/main/java/com/funkymuse/gson/GsonExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.gson +package com.funkymuse.gson import android.content.SharedPreferences import com.google.gson.Gson @@ -12,9 +12,7 @@ import kotlin.properties.ReadWriteProperty import kotlin.reflect.KProperty -/** - * Created by hristijan on 2/22/19 to long live and prosper ! - */ + val gson: Gson by lazy { Gson() } diff --git a/http/build.gradle b/http/build.gradle deleted file mode 100644 index 955e9f877..000000000 --- a/http/build.gradle +++ /dev/null @@ -1,7 +0,0 @@ - -dependencies { -} - -android { - namespace 'com.crazylegend.http' -} \ No newline at end of file diff --git a/http/build.gradle.kts b/http/build.gradle.kts new file mode 100644 index 000000000..0f8b71618 --- /dev/null +++ b/http/build.gradle.kts @@ -0,0 +1,3 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} diff --git a/http/src/main/AndroidManifest.xml b/http/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/http/src/main/AndroidManifest.xml +++ b/http/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/http/src/main/java/com/crazylegend/http/HttpExt.kt b/http/src/main/java/com/crazylegend/http/HttpExt.kt deleted file mode 100644 index 11e4b7bcc..000000000 --- a/http/src/main/java/com/crazylegend/http/HttpExt.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.crazylegend.http - -import java.io.File -import java.net.URLConnection.getFileNameMap - - -/** - * Created by hristijan on 7/30/19 to long live and prosper ! - */ - - diff --git a/http/src/main/java/com/funkymuse/http/HttpExt.kt b/http/src/main/java/com/funkymuse/http/HttpExt.kt new file mode 100644 index 000000000..bdf4cb66b --- /dev/null +++ b/http/src/main/java/com/funkymuse/http/HttpExt.kt @@ -0,0 +1,3 @@ +package com.funkymuse.http + + diff --git a/http/src/main/java/com/crazylegend/http/HttpsUtils.kt b/http/src/main/java/com/funkymuse/http/HttpsUtils.kt similarity index 97% rename from http/src/main/java/com/crazylegend/http/HttpsUtils.kt rename to http/src/main/java/com/funkymuse/http/HttpsUtils.kt index f3a336d63..97db31b7e 100644 --- a/http/src/main/java/com/crazylegend/http/HttpsUtils.kt +++ b/http/src/main/java/com/funkymuse/http/HttpsUtils.kt @@ -1,4 +1,4 @@ -package com.crazylegend.http +package com.funkymuse.http import java.io.IOException import java.io.InputStream @@ -10,10 +10,6 @@ import java.security.cert.CertificateFactory import java.security.cert.X509Certificate import javax.net.ssl.* -/** - * Created by hristijan on 7/30/19 to long live and prosper ! - */ - object HttpsUtils { val sslSocketFactory: SSLParams diff --git a/intent/build.gradle b/intent/build.gradle deleted file mode 100644 index ce92f284e..000000000 --- a/intent/build.gradle +++ /dev/null @@ -1,9 +0,0 @@ -dependencies { - implementation project(path: ':common') - implementation "androidx.core:core-ktx:$coreKTX" - implementation "androidx.appcompat:appcompat:$appCompat" -} - -android { - namespace 'com.crazylegend.intent' -} \ No newline at end of file diff --git a/intent/build.gradle.kts b/intent/build.gradle.kts new file mode 100644 index 000000000..56b734abe --- /dev/null +++ b/intent/build.gradle.kts @@ -0,0 +1,9 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(projects.common) + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.appcompat) +} diff --git a/intent/src/main/AndroidManifest.xml b/intent/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/intent/src/main/AndroidManifest.xml +++ b/intent/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/intent/src/main/java/com/crazylegend/intent/IntentConstants.kt b/intent/src/main/java/com/funkymuse/intent/IntentConstants.kt similarity index 81% rename from intent/src/main/java/com/crazylegend/intent/IntentConstants.kt rename to intent/src/main/java/com/funkymuse/intent/IntentConstants.kt index 250be2d3e..e325162af 100644 --- a/intent/src/main/java/com/crazylegend/intent/IntentConstants.kt +++ b/intent/src/main/java/com/funkymuse/intent/IntentConstants.kt @@ -1,9 +1,4 @@ -package com.crazylegend.intent - - -/** - * Created by hristijan on 3/15/19 to long live and prosper ! - */ +package com.funkymuse.intent const val INTENT_TYPE_EMAIL = "message/rfc822" const val INTENT_TYPE_TEXT = "text/plain" diff --git a/intent/src/main/java/com/crazylegend/intent/IntentExtensions.kt b/intent/src/main/java/com/funkymuse/intent/IntentExtensions.kt similarity index 97% rename from intent/src/main/java/com/crazylegend/intent/IntentExtensions.kt rename to intent/src/main/java/com/funkymuse/intent/IntentExtensions.kt index 4dbe828fe..05a7efb5c 100644 --- a/intent/src/main/java/com/crazylegend/intent/IntentExtensions.kt +++ b/intent/src/main/java/com/funkymuse/intent/IntentExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.intent +package com.funkymuse.intent import android.app.Activity import android.app.PendingIntent @@ -7,9 +7,7 @@ import android.content.Intent import android.net.Uri -/** - * Created by crazy on 2/24/19 to long live and prosper ! - */ + fun Intent.clearTask() = apply { addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK) diff --git a/intent/src/main/java/com/crazylegend/intent/IntentGetters.kt b/intent/src/main/java/com/funkymuse/intent/IntentGetters.kt similarity index 92% rename from intent/src/main/java/com/crazylegend/intent/IntentGetters.kt rename to intent/src/main/java/com/funkymuse/intent/IntentGetters.kt index 3f7df6fdb..a52579d2a 100644 --- a/intent/src/main/java/com/crazylegend/intent/IntentGetters.kt +++ b/intent/src/main/java/com/funkymuse/intent/IntentGetters.kt @@ -1,11 +1,9 @@ -package com.crazylegend.intent +package com.funkymuse.intent import android.content.Intent -/** - * Created by hristijan on 8/5/19 to long live and prosper ! - */ + /** diff --git a/intent/src/main/java/com/crazylegend/intent/IntentPickersAndActionsExtensions.kt b/intent/src/main/java/com/funkymuse/intent/IntentPickersAndActionsExtensions.kt similarity index 97% rename from intent/src/main/java/com/crazylegend/intent/IntentPickersAndActionsExtensions.kt rename to intent/src/main/java/com/funkymuse/intent/IntentPickersAndActionsExtensions.kt index d7c7db630..2cae3b868 100644 --- a/intent/src/main/java/com/crazylegend/intent/IntentPickersAndActionsExtensions.kt +++ b/intent/src/main/java/com/funkymuse/intent/IntentPickersAndActionsExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.intent +package com.funkymuse.intent import android.Manifest.permission.SET_ALARM import android.app.SearchManager @@ -7,7 +7,11 @@ import android.content.Context import android.content.Intent import android.net.Uri import android.os.Build -import android.provider.* +import android.provider.AlarmClock +import android.provider.CalendarContract +import android.provider.ContactsContract +import android.provider.MediaStore +import android.provider.Settings import android.provider.Settings.Panel.ACTION_INTERNET_CONNECTIVITY import android.widget.TimePicker import androidx.activity.result.ActivityResultLauncher @@ -15,12 +19,7 @@ import androidx.activity.result.contract.ActivityResultContracts import androidx.annotation.RequiresPermission import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentActivity -import com.crazylegend.common.tryOrElse - - -/** - * Created by hristijan on 3/28/19 to long live and prosper ! - */ +import com.funkymuse.common.tryOrElse @RequiresPermission(allOf = [SET_ALARM]) diff --git a/internetDetector/build.gradle b/internetDetector/build.gradle deleted file mode 100644 index 20d1d0aca..000000000 --- a/internetDetector/build.gradle +++ /dev/null @@ -1,14 +0,0 @@ -dependencies { - implementation project(path: ':common') - - //coroutines - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines" - - implementation "androidx.annotation:annotation:$annotationVersion" - -} - -android { - namespace 'com.crazylegend.internetdetector' -} \ No newline at end of file diff --git a/internetDetector/build.gradle.kts b/internetDetector/build.gradle.kts new file mode 100644 index 000000000..0e1558dec --- /dev/null +++ b/internetDetector/build.gradle.kts @@ -0,0 +1,11 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(projects.common) + //coroutines + implementation(libs.kotlinx.coroutines.android) + implementation(libs.kotlinx.coroutines.core) + implementation(libs.androidx.annotation) +} diff --git a/internetDetector/src/main/java/com/crazylegend/internetdetector/InternetDetector.kt b/internetDetector/src/main/java/com/funkymuse/internetdetector/InternetDetector.kt similarity index 95% rename from internetDetector/src/main/java/com/crazylegend/internetdetector/InternetDetector.kt rename to internetDetector/src/main/java/com/funkymuse/internetdetector/InternetDetector.kt index 859ffcd26..29fae75d8 100644 --- a/internetDetector/src/main/java/com/crazylegend/internetdetector/InternetDetector.kt +++ b/internetDetector/src/main/java/com/funkymuse/internetdetector/InternetDetector.kt @@ -1,4 +1,4 @@ -package com.crazylegend.internetdetector +package com.funkymuse.internetdetector import android.Manifest.permission.ACCESS_NETWORK_STATE import android.content.Context @@ -13,9 +13,7 @@ import kotlinx.coroutines.channels.awaitClose import kotlinx.coroutines.flow.callbackFlow -/** - * Created by Hristijan on 2/1/19 to long live and prosper ! - */ + class InternetDetector(private val context: Context, private val serverUrl: String = "https://www.google.com/", private val timeOut: Int = 10 * 1000) { diff --git a/internetDetector/src/main/java/com/crazylegend/internetdetector/InternetDetectorExtensions.kt b/internetDetector/src/main/java/com/funkymuse/internetdetector/InternetDetectorExtensions.kt similarity index 93% rename from internetDetector/src/main/java/com/crazylegend/internetdetector/InternetDetectorExtensions.kt rename to internetDetector/src/main/java/com/funkymuse/internetdetector/InternetDetectorExtensions.kt index 04bf65f0f..02227acca 100644 --- a/internetDetector/src/main/java/com/crazylegend/internetdetector/InternetDetectorExtensions.kt +++ b/internetDetector/src/main/java/com/funkymuse/internetdetector/InternetDetectorExtensions.kt @@ -1,19 +1,15 @@ -package com.crazylegend.internetdetector +package com.funkymuse.internetdetector import android.content.Context import android.net.ConnectivityManager import android.net.Network import android.net.NetworkCapabilities import android.net.NetworkRequest -import com.crazylegend.common.isOnline -import java.net.HttpURLConnection -import java.net.URL +import com.funkymuse.common.isOnline import kotlinx.coroutines.channels.awaitClose import kotlinx.coroutines.flow.callbackFlow - -/** - * Created by funkymuse on 5/26/21 to long live and prosper ! - */ +import java.net.HttpURLConnection +import java.net.URL /** diff --git a/jodaDateTime/build.gradle b/jodaDateTime/build.gradle deleted file mode 100644 index 17f24a4d2..000000000 --- a/jodaDateTime/build.gradle +++ /dev/null @@ -1,13 +0,0 @@ -android { - packagingOptions { - resources { - excludes += ['META-INF/LICENSE.txt', 'META-INF/NOTICE.txt', 'META-INF/LICENSE'] - } - } - namespace 'com.crazylegend.jodadatetime' -} - -dependencies { - //joda time - implementation "net.danlew:android.joda:$joda" -} \ No newline at end of file diff --git a/jodaDateTime/build.gradle.kts b/jodaDateTime/build.gradle.kts new file mode 100644 index 000000000..ded06b857 --- /dev/null +++ b/jodaDateTime/build.gradle.kts @@ -0,0 +1,16 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +android { + packaging { + resources { + excludes.addAll(setOf("META-INF/LICENSE.txt", "META-INF/NOTICE.txt", "META-INF/LICENSE")) + } + } +} + +dependencies { + //joda time + implementation(libs.android.joda) +} \ No newline at end of file diff --git a/jodaDateTime/src/main/java/com/crazylegend/jodadatetime/DateExtensions.kt b/jodaDateTime/src/main/java/com/funkymuse/jodadatetime/DateExtensions.kt similarity index 96% rename from jodaDateTime/src/main/java/com/crazylegend/jodadatetime/DateExtensions.kt rename to jodaDateTime/src/main/java/com/funkymuse/jodadatetime/DateExtensions.kt index 80263f0bb..09aa55f02 100644 --- a/jodaDateTime/src/main/java/com/crazylegend/jodadatetime/DateExtensions.kt +++ b/jodaDateTime/src/main/java/com/funkymuse/jodadatetime/DateExtensions.kt @@ -1,17 +1,32 @@ -package com.crazylegend.jodadatetime - -import org.joda.time.* +package com.funkymuse.jodadatetime + +import org.joda.time.DateTime +import org.joda.time.DateTimeConstants +import org.joda.time.DateTimeZone +import org.joda.time.Days +import org.joda.time.Duration +import org.joda.time.Hours +import org.joda.time.Instant +import org.joda.time.Interval +import org.joda.time.LocalDate +import org.joda.time.LocalDateTime +import org.joda.time.LocalTime +import org.joda.time.Minutes +import org.joda.time.Months +import org.joda.time.MutableDateTime +import org.joda.time.Period +import org.joda.time.ReadableDuration +import org.joda.time.ReadableInstant +import org.joda.time.ReadablePeriod +import org.joda.time.Seconds +import org.joda.time.Years import org.joda.time.base.AbstractInstant import org.joda.time.format.DateTimeFormat import org.joda.time.format.DateTimeFormatter import org.joda.time.format.ISODateTimeFormat import java.sql.Timestamp -import java.util.* - +import java.util.Date -/** - * Created by Hristijan on 2/1/19 to long live and prosper ! - */ @JvmField val EPOCH = DateTime(0) diff --git a/kotlinextensions/build.gradle b/kotlinextensions/build.gradle deleted file mode 100644 index d2f0fce8d..000000000 --- a/kotlinextensions/build.gradle +++ /dev/null @@ -1,49 +0,0 @@ -dependencies { - - implementation project(path: ':common') - implementation project(path: ':context') - implementation project(path: ':activity') - implementation project(path: ':bytearray') - implementation project(path: ':intent') - implementation project(path: ':sharedpreferences') - implementation project(path: ':color') - - //live data - implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:$lifecycle" - implementation "androidx.lifecycle:lifecycle-reactivestreams:$lifecycle" - implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle" - implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle" - implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle" - implementation "androidx.lifecycle:lifecycle-service:$lifecycle" - implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle" - implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:$lifecycle" - implementation "androidx.lifecycle:lifecycle-process:$lifecycle" - - //ui - implementation 'androidx.vectordrawable:vectordrawable:1.1.0' - implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' - implementation "com.google.android.material:material:$material" - implementation "androidx.constraintlayout:constraintlayout:$constraint_layout" - - //util - implementation 'androidx.exifinterface:exifinterface:1.3.7' - - //core - implementation "androidx.fragment:fragment-ktx:$fragment" - implementation "androidx.activity:activity-ktx:$activity" - implementation 'androidx.preference:preference-ktx:1.2.1' - implementation 'androidx.palette:palette-ktx:1.0.0' - implementation "androidx.core:core-ktx:$coreKTX" - - //android apis - implementation 'androidx.viewpager2:viewpager2:1.0.0' - implementation 'androidx.documentfile:documentfile:1.0.1' - - implementation "androidx.appcompat:appcompat:$appCompat" - implementation "androidx.appcompat:appcompat-resources:$appCompat" - -} - -android { - namespace 'com.crazylegend.kotlinextensions' -} diff --git a/kotlinextensions/build.gradle.kts b/kotlinextensions/build.gradle.kts new file mode 100644 index 000000000..dda733429 --- /dev/null +++ b/kotlinextensions/build.gradle.kts @@ -0,0 +1,49 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(projects.common) + implementation(projects.context) + implementation(projects.activity) + implementation(projects.bytearray) + implementation(projects.intent) + implementation(projects.sharedpreferences) + implementation(projects.color) + + //live data + implementation(libs.androidx.lifecycle.lifecycle.viewmodel.savedstate) + implementation(libs.androidx.lifecycle.reactivestreams) + implementation(libs.androidx.lifecycle.livedata.ktx) + implementation(libs.androidx.lifecycle.viewmodel.ktx) + implementation(libs.androidx.lifecycle.common.java8) + implementation(libs.androidx.lifecycle.service) + implementation(libs.androidx.lifecycle.runtime.ktx) + implementation(libs.androidx.lifecycle.lifecycle.viewmodel.savedstate) + implementation(libs.androidx.lifecycle.process) + + //ui + implementation(libs.androidx.vectordrawable) + implementation(libs.androidx.swiperefreshlayout) + implementation(libs.material) + implementation(libs.androidx.constraintlayout) + + //util + implementation(libs.androidx.exifinterface) + + //core + implementation(libs.androidx.fragment.ktx) + implementation(libs.androidx.activity.ktx) + implementation(libs.androidx.preference.ktx) + implementation(libs.androidx.palette.ktx) + implementation(libs.androidx.core.ktx) + + //android apis + implementation(libs.androidx.viewpager2) + implementation(libs.androidx.documentfile) + + implementation(libs.androidx.appcompat) + implementation(libs.androidx.appcompat.resources) + + testImplementation(libs.bundles.unit.test) +} diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/gestureNavigation/EdgeToEdge.kt b/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/gestureNavigation/EdgeToEdge.kt deleted file mode 100644 index 00b72a74f..000000000 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/gestureNavigation/EdgeToEdge.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.crazylegend.kotlinextensions.gestureNavigation - -/** - * Created by crazy on 1/7/21 to long live and prosper ! - */ -object EdgeToEdge : EdgeToEdgeImpl by EdgeToEdgeApi21() diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/gestureNavigation/EdgeToEdgeApi21.kt b/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/gestureNavigation/EdgeToEdgeApi21.kt deleted file mode 100644 index 5ba145e3c..000000000 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/gestureNavigation/EdgeToEdgeApi21.kt +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright 2019 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.crazylegend.kotlinextensions.gestureNavigation - -import android.app.Activity -import android.os.Build -import android.view.View -import android.view.ViewGroup -import android.view.Window -import android.view.WindowInsets -import androidx.annotation.ColorRes -import androidx.annotation.RequiresApi -import androidx.appcompat.widget.Toolbar -import androidx.core.content.ContextCompat -import androidx.core.view.WindowCompat -import androidx.core.view.WindowInsetsCompat -import androidx.core.view.updatePadding -import com.crazylegend.kotlinextensions.R -import com.google.android.material.appbar.AppBarLayout - -/** - * A utility for edge-to-edge display. It provides several features needed to make the app - * displayed edge-to-edge on Android Q with gestural navigation. - */ - -/** - * Usage - * - * EdgeToEdge.setUpRoot(findViewById(R.id.root)) - * EdgeToEdge.setUpAppBar(findViewById(R.id.app_bar), toolbar) - * EdgeToEdge.setUpScrollingContent(findViewById(R.id.content)) - -And add insets ex. - -ViewCompat.setOnApplyWindowInsetsListener(view) { _, insets -> -toolbar.updateLayoutParams { -topMargin = insets.systemWindowInsetTop -} -// The collapsed app bar gets taller by the toolbar's top margin. The CoordinatorLayout -// has to have a bottom margin of the same amount so that the scrolling content is -// completely visible. -scroll.updateLayoutParams { -bottomMargin = insets.systemWindowInsetTop -} -content.updatePadding( -left = insets.systemWindowInsetLeft, -right = insets.systemWindowInsetRight, -bottom = insets.systemWindowInsetBottom -) -insets -} - - -Ex2 - -ViewCompat.setOnApplyWindowInsetsListener(root) { _, insets -> -fab.updateLayoutParams { -leftMargin = fabMargin + insets.systemWindowInsetLeft -rightMargin = fabMargin + insets.systemWindowInsetRight -bottomMargin = fabMargin + insets.systemWindowInsetBottom -} -sheet.updateLayoutParams { -leftMargin = fabMargin + insets.systemWindowInsetLeft -rightMargin = fabMargin + insets.systemWindowInsetRight -bottomMargin = fabMargin + insets.systemWindowInsetBottom -} -insets -} - - */ - -@Suppress("DEPRECATION") -internal class EdgeToEdgeApi21 : EdgeToEdgeImpl { - - override fun setUpRoot(root: ViewGroup) { - root.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN - } - - @RequiresApi(Build.VERSION_CODES.R) - override fun setUpRoot(activity: Activity, root: ViewGroup, @ColorRes navBarColor: Int) { - setDecorFitsSystemWindows(activity) - activity.window.navigationBarColor = ContextCompat.getColor(activity, navBarColor) - root.windowInsetsController?.hide(WindowInsetsCompat.Type.systemGestures()) - } - - override fun setUpAppBar(appBar: AppBarLayout, toolbar: Toolbar) { - val toolbarPadding = toolbar.resources.getDimensionPixelSize(R.dimen.spacing_medium) - appBar.setOnApplyWindowInsetsListener { _, windowInsets -> - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { - val insets = windowInsets.getInsets(WindowInsets.Type.systemBars()) - appBar.updatePadding(top = insets.top) - toolbar.updatePadding( - left = toolbarPadding + insets.left, - right = insets.right - ) - } else { - appBar.updatePadding(top = windowInsets.systemWindowInsetTop) - toolbar.updatePadding( - left = toolbarPadding + windowInsets.systemWindowInsetLeft, - right = windowInsets.systemWindowInsetRight - ) - } - - windowInsets - } - } - - override fun setDecorFitsSystemWindows(activity: Activity, setDecor: Boolean) { - WindowCompat.setDecorFitsSystemWindows(activity.window, setDecor) - } - - override fun setDecorFitsSystemWindows(window: Window, setDecor: Boolean) { - WindowCompat.setDecorFitsSystemWindows(window, setDecor) - } - - override fun setUpScrollingContent(scrollingContent: ViewGroup, includePaddingBottom: Boolean) { - val originalPaddingLeft = scrollingContent.paddingLeft - val originalPaddingRight = scrollingContent.paddingRight - val originalPaddingBottom = scrollingContent.paddingBottom - val originalPaddingTop = scrollingContent.paddingTop - - - scrollingContent.setOnApplyWindowInsetsListener { _, windowInsets -> - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { - val insets = windowInsets.getInsets(WindowInsets.Type.systemBars()) - val bottomPadding = if (includePaddingBottom) originalPaddingBottom + insets.bottom else originalPaddingBottom - scrollingContent.updatePadding( - left = originalPaddingLeft + insets.left, - right = originalPaddingRight + insets.right, - bottom = bottomPadding, - top = originalPaddingTop + insets.top - ) - } else { - val paddingBottomCompat = if (includePaddingBottom) originalPaddingBottom + windowInsets.systemWindowInsetBottom else originalPaddingBottom - scrollingContent.updatePadding( - left = originalPaddingLeft + windowInsets.systemWindowInsetLeft, - right = originalPaddingRight + windowInsets.systemWindowInsetRight, - bottom = paddingBottomCompat, - top = originalPaddingTop + windowInsets.systemWindowInsetTop - ) - } - windowInsets - } - } -} diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/gestureNavigation/EdgeToEdgeImpl.kt b/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/gestureNavigation/EdgeToEdgeImpl.kt deleted file mode 100644 index 1b5894b47..000000000 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/gestureNavigation/EdgeToEdgeImpl.kt +++ /dev/null @@ -1,45 +0,0 @@ -package com.crazylegend.kotlinextensions.gestureNavigation - -import android.app.Activity -import android.os.Build -import android.view.ViewGroup -import android.view.Window -import androidx.annotation.ColorRes -import androidx.annotation.RequiresApi -import androidx.appcompat.widget.Toolbar -import com.google.android.material.appbar.AppBarLayout - -/** - * Created by crazy on 1/7/21 to long live and prosper ! - */ -internal interface EdgeToEdgeImpl { - /** - * Configures a root view of an Activity in edge-to-edge display. - * @param root A root view of an Activity. - */ - fun setUpRoot(root: ViewGroup) - - @RequiresApi(Build.VERSION_CODES.R) - fun setUpRoot(activity: Activity, root: ViewGroup, @ColorRes navBarColor: Int = android.R.color.transparent) - - /** - * Configures an app bar and a toolbar for edge-to-edge display. - * @param appBar An [AppBarLayout]. - * @param toolbar A [Toolbar] in the [appBar]. - */ - fun setUpAppBar(appBar: AppBarLayout, toolbar: Toolbar) - - /** - * Configures a scrolling content for edge-to-edge display. - * @param scrollingContent A scrolling ViewGroup. This is typically a RecyclerView or a - * ScrollView. It should be as wide as the screen, and should touch the bottom edge of - * the screen. - */ - fun setUpScrollingContent(scrollingContent: ViewGroup, includePaddingBottom: Boolean = false) - - /** - * Tell the window that we want to handle/fit any system windows - */ - fun setDecorFitsSystemWindows(window: Window, setDecor: Boolean = true) - fun setDecorFitsSystemWindows(activity: Activity, setDecor: Boolean = true) -} \ No newline at end of file diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/AdaptersExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/AdaptersExtensions.kt similarity index 51% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/AdaptersExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/AdaptersExtensions.kt index e5b678796..ea2b8ca10 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/AdaptersExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/AdaptersExtensions.kt @@ -1,10 +1,8 @@ -package com.crazylegend.kotlinextensions +package com.funkymuse.kotlinextensions import android.widget.ArrayAdapter -/** - * Created by hristijan on 8/5/19 to long live and prosper ! - */ + operator fun ArrayAdapter.get(position: Int): T? = getItem(position) diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/AttrExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/AttrExtensions.kt similarity index 93% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/AttrExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/AttrExtensions.kt index 22c123a2d..ae1e317b5 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/AttrExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/AttrExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions +package com.funkymuse.kotlinextensions import android.content.Context import android.graphics.Color @@ -8,9 +8,7 @@ import androidx.annotation.AttrRes import androidx.annotation.ColorInt -/** - * Created by hristijan on 8/5/19 to long live and prosper ! - */ + /** * Get a color from the attribute theme diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/CharSequenceExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/CharSequenceExtensions.kt similarity index 98% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/CharSequenceExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/CharSequenceExtensions.kt index 1745678f8..9f35ee3af 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/CharSequenceExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/CharSequenceExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions +package com.funkymuse.kotlinextensions import android.graphics.Typeface import android.text.Spannable @@ -12,9 +12,7 @@ import java.util.* import java.util.regex.Pattern -/** - * Created by crazy on 11/11/19 to long live and prosper ! - */ + private val FORMAT_SEQUENCE = Pattern.compile("%([0-9]+\\$| Activity.argument(key: String) = intent?.extras?.get(key) as T? diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/bitmap/BitmapExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/bitmap/BitmapExtensions.kt similarity index 99% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/bitmap/BitmapExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/bitmap/BitmapExtensions.kt index 00fd93b28..337770001 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/bitmap/BitmapExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/bitmap/BitmapExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.bitmap +package com.funkymuse.kotlinextensions.bitmap import android.annotation.SuppressLint import android.app.Activity @@ -28,9 +28,7 @@ import kotlin.math.ceil import kotlin.math.min -/** - * Created by Hristijan on 2/1/19 to long live and prosper ! - */ + fun Bitmap.overlay(overlay: Bitmap): Bitmap { diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/bitmap/BitmapUtils.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/bitmap/BitmapUtils.kt similarity index 76% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/bitmap/BitmapUtils.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/bitmap/BitmapUtils.kt index 31c26af9a..857f3e27d 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/bitmap/BitmapUtils.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/bitmap/BitmapUtils.kt @@ -1,15 +1,8 @@ -package com.crazylegend.kotlinextensions.bitmap +package com.funkymuse.kotlinextensions.bitmap -import android.content.Context import android.graphics.Bitmap -import android.graphics.Canvas import android.graphics.Matrix -import com.crazylegend.common.tryOrIgnore - - -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ +import com.funkymuse.common.tryOrIgnore fun Bitmap.flipHorizontally(): Bitmap { diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/bundle/BundleExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/bundle/BundleExtensions.kt similarity index 97% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/bundle/BundleExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/bundle/BundleExtensions.kt index fd3d78425..b42388f12 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/bundle/BundleExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/bundle/BundleExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.bundle +package com.funkymuse.kotlinextensions.bundle import android.annotation.SuppressLint import android.app.Activity @@ -10,17 +10,14 @@ import android.util.SparseArray import androidx.annotation.AnimRes import androidx.core.os.bundleOf import androidx.fragment.app.Fragment -import com.crazylegend.common.TAG -import com.crazylegend.kotlinextensions.R -import com.crazylegend.kotlinextensions.log.log +import com.funkymuse.common.TAG +import com.funkymuse.kotlinextensions.log.log import java.io.Serializable import kotlin.properties.ReadWriteProperty import kotlin.reflect.KProperty -/** - * Created by Hristijan on 3/6/19 to long live and prosper ! - */ + fun Bundle.withCustomAnimation( diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/calendar/CalendarExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/calendar/CalendarExtensions.kt similarity index 96% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/calendar/CalendarExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/calendar/CalendarExtensions.kt index 4adcf6d48..5121ea588 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/calendar/CalendarExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/calendar/CalendarExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.calendar +package com.funkymuse.kotlinextensions.calendar import android.Manifest.permission.READ_CALENDAR import android.content.ContentUris @@ -7,13 +7,9 @@ import android.content.Intent import android.net.Uri import android.provider.CalendarContract import androidx.annotation.RequiresPermission -import java.util.* +import java.util.Calendar -/** - * Created by crazy on 11/11/19 to long live and prosper ! - */ - val insertCalendarIntent: Intent get() { return Intent(Intent.ACTION_INSERT) diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/compress/CompressExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/compress/CompressExtensions.kt similarity index 89% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/compress/CompressExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/compress/CompressExtensions.kt index e73c143ce..fbe885c8c 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/compress/CompressExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/compress/CompressExtensions.kt @@ -1,13 +1,11 @@ -package com.crazylegend.kotlinextensions.compress +package com.funkymuse.kotlinextensions.compress import java.io.ByteArrayOutputStream import java.util.zip.Deflater import java.util.zip.Inflater -/** - * Created by hristijan on 3/20/19 to long live and prosper ! - */ + fun ByteArray.compress(): ByteArray { val deflater = Deflater() diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/compress/GzipExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/compress/GzipExtensions.kt similarity index 86% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/compress/GzipExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/compress/GzipExtensions.kt index 9ae6f457f..77e60f23e 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/compress/GzipExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/compress/GzipExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.compress +package com.funkymuse.kotlinextensions.compress import java.io.ByteArrayInputStream import java.io.ByteArrayOutputStream @@ -7,9 +7,7 @@ import java.util.zip.GZIPInputStream import java.util.zip.GZIPOutputStream -/** - * Created by hristijan on 3/20/19 to long live and prosper ! - */ + fun gZipcompress(data: ByteArray): ByteArray { val stream = ByteArrayOutputStream(data.size) val gzip = GZIPOutputStream(stream) diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/constraints/ConstraintSetAnimator.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/constraints/ConstraintSetAnimator.kt similarity index 93% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/constraints/ConstraintSetAnimator.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/constraints/ConstraintSetAnimator.kt index 8bfb4cb77..4aea2b168 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/constraints/ConstraintSetAnimator.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/constraints/ConstraintSetAnimator.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.constraints +package com.funkymuse.kotlinextensions.constraints import android.view.animation.DecelerateInterpolator import androidx.constraintlayout.widget.ConstraintLayout @@ -7,9 +7,7 @@ import androidx.transition.AutoTransition import androidx.transition.TransitionManager -/** - * Created by crazy on 1/24/20 to long live and prosper ! - */ + /** * Constraint Set Animator class diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/contentObserver/ContentObserverExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/contentObserver/ContentObserverExtensions.kt similarity index 81% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/contentObserver/ContentObserverExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/contentObserver/ContentObserverExtensions.kt index 6e6ffc38b..de9b94c71 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/contentObserver/ContentObserverExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/contentObserver/ContentObserverExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.contentObserver +package com.funkymuse.kotlinextensions.contentObserver import android.content.ContentResolver import android.database.ContentObserver @@ -6,12 +6,6 @@ import android.net.Uri import android.os.Handler import android.os.Looper - -/** - * Created by crazy on 7/31/20 to long live and prosper ! - */ - - inline fun ContentResolver.registerObserver( uri: Uri, crossinline observer: (change: Boolean) -> Unit diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/core/AnyExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/core/AnyExtensions.kt similarity index 90% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/core/AnyExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/core/AnyExtensions.kt index 2623cbd5c..b070eba90 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/core/AnyExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/core/AnyExtensions.kt @@ -1,11 +1,9 @@ -package com.crazylegend.kotlinextensions.core +package com.funkymuse.kotlinextensions.core + +import com.funkymuse.common.tryOrNull -import com.crazylegend.common.tryOrNull -/** - * Created by hristijan on 6/7/19 to long live and prosper ! - */ fun Any.toUnsafeInt(): Int { return when (val value = this) { diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/core/URLExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/core/URLExtensions.kt similarity index 77% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/core/URLExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/core/URLExtensions.kt index 48fe308f8..85bf109be 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/core/URLExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/core/URLExtensions.kt @@ -1,13 +1,11 @@ -package com.crazylegend.kotlinextensions.core +package com.funkymuse.kotlinextensions.core import java.net.HttpURLConnection import java.net.URL import java.net.URLConnection -/** - * Created by hristijan on 6/7/19 to long live and prosper ! - */ + inline fun URL.use(block: (URLConnection) -> R): R { var connection: URLConnection? = null diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/countUpTimer/CountUpTimer.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/countUpTimer/CountUpTimer.kt similarity index 97% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/countUpTimer/CountUpTimer.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/countUpTimer/CountUpTimer.kt index cdc5c5261..10edef071 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/countUpTimer/CountUpTimer.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/countUpTimer/CountUpTimer.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.countUpTimer +package com.funkymuse.kotlinextensions.countUpTimer import android.annotation.SuppressLint import android.os.Handler @@ -6,9 +6,7 @@ import android.os.Looper import android.os.Message -/** - * Created by crazy on 2/25/20 to long live and prosper ! - */ + /** * val countUpTimer = object : CountUpTimer(ALLOWED_MS_OF_INACTIVITY) { diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/countUpTimer/CountUpTimerCallback.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/countUpTimer/CountUpTimerCallback.kt similarity index 74% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/countUpTimer/CountUpTimerCallback.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/countUpTimer/CountUpTimerCallback.kt index b7a0e9166..c9b1d44d1 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/countUpTimer/CountUpTimerCallback.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/countUpTimer/CountUpTimerCallback.kt @@ -1,9 +1,7 @@ -package com.crazylegend.kotlinextensions.countUpTimer +package com.funkymuse.kotlinextensions.countUpTimer + -/** - * Created by crazy on 2/25/20 to long live and prosper ! - */ interface CountUpTimerCallback { /** diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/cursor/CursorExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/cursor/CursorExtensions.kt similarity index 98% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/cursor/CursorExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/cursor/CursorExtensions.kt index 5dd98af1f..9923b2392 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/cursor/CursorExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/cursor/CursorExtensions.kt @@ -1,13 +1,11 @@ -package com.crazylegend.kotlinextensions.cursor +package com.funkymuse.kotlinextensions.cursor import android.database.Cursor import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flow -/** - * Created by hristijan on 3/20/19 to long live and prosper ! - */ + fun Cursor.mapToList(cursorPredicate: (Cursor) -> T): List = generateSequence { if (moveToNext()) cursorPredicate(this) else null diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/cursor/SQLiteDBExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/cursor/SQLiteDBExtensions.kt similarity index 96% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/cursor/SQLiteDBExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/cursor/SQLiteDBExtensions.kt index 38f8b0cbf..87969c281 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/cursor/SQLiteDBExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/cursor/SQLiteDBExtensions.kt @@ -1,12 +1,10 @@ -package com.crazylegend.kotlinextensions.cursor +package com.funkymuse.kotlinextensions.cursor import android.database.Cursor import android.database.sqlite.SQLiteDatabase -/** - * Created by hristijan on 8/5/19 to long live and prosper ! - */ + /** diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/delegates/SharedPrefsDelegates.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/delegates/SharedPrefsDelegates.kt similarity index 93% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/delegates/SharedPrefsDelegates.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/delegates/SharedPrefsDelegates.kt index 1f4b78f8f..cdbf7044d 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/delegates/SharedPrefsDelegates.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/delegates/SharedPrefsDelegates.kt @@ -1,17 +1,15 @@ -package com.crazylegend.kotlinextensions.delegates +package com.funkymuse.kotlinextensions.delegates import android.content.SharedPreferences -import com.crazylegend.sharedpreferences.putBoolean -import com.crazylegend.sharedpreferences.putFloat -import com.crazylegend.sharedpreferences.putInt -import com.crazylegend.sharedpreferences.putString +import com.funkymuse.sharedpreferences.putBoolean +import com.funkymuse.sharedpreferences.putFloat +import com.funkymuse.sharedpreferences.putInt +import com.funkymuse.sharedpreferences.putString import kotlin.properties.ReadWriteProperty import kotlin.reflect.KProperty -/** - * Created by crazy on 11/14/19 to long live and prosper ! - */ + /** diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/dialog/DialogExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/dialog/DialogExtensions.kt similarity index 94% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/dialog/DialogExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/dialog/DialogExtensions.kt index e4684f769..2f7d545cc 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/dialog/DialogExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/dialog/DialogExtensions.kt @@ -1,25 +1,16 @@ -package com.crazylegend.kotlinextensions.dialog +package com.funkymuse.kotlinextensions.dialog import android.app.Dialog import android.content.Context import android.graphics.Color -import android.graphics.Typeface import android.graphics.drawable.ColorDrawable -import android.graphics.drawable.Drawable import android.view.View import android.view.Window import android.widget.TextView -import androidx.annotation.* import androidx.appcompat.app.AlertDialog import androidx.core.content.ContextCompat import androidx.fragment.app.DialogFragment -import com.crazylegend.kotlinextensions.R - - -/** - * Created by hristijan on 3/5/19 to long live and prosper ! - */ - +import com.funkymuse.setofusefulkotlinextensions.kotlinextensions.R fun Dialog.setCustomTitle(resId: Int, title: String) { diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/displayMetrics/DisplayMetricsExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/displayMetrics/DisplayMetricsExtensions.kt similarity index 79% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/displayMetrics/DisplayMetricsExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/displayMetrics/DisplayMetricsExtensions.kt index a0949e98b..4c6e7d2c6 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/displayMetrics/DisplayMetricsExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/displayMetrics/DisplayMetricsExtensions.kt @@ -1,13 +1,11 @@ -package com.crazylegend.kotlinextensions.displayMetrics +package com.funkymuse.kotlinextensions.displayMetrics import android.content.Context import android.view.View import androidx.fragment.app.Fragment -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ + fun Context.dp(value: Int): Int = (value * resources.displayMetrics.density).toInt() diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/dsls/DSLs.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/dsls/DSLs.kt similarity index 73% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/dsls/DSLs.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/dsls/DSLs.kt index 09c8ae205..7affae100 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/dsls/DSLs.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/dsls/DSLs.kt @@ -1,13 +1,11 @@ -package com.crazylegend.kotlinextensions.dsls +package com.funkymuse.kotlinextensions.dsls import android.content.BroadcastReceiver import android.content.Context import android.content.Intent -/** - * Created by hristijan on 8/5/19 to long live and prosper ! - */ + inline fun broadcastReceiver(crossinline block: (Context, Intent) -> Unit) = object : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/effects/Vibration.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/effects/Vibration.kt similarity index 94% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/effects/Vibration.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/effects/Vibration.kt index de3a5b8dc..a92e30a6d 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/effects/Vibration.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/effects/Vibration.kt @@ -1,6 +1,6 @@ @file:Suppress("DEPRECATION") -package com.crazylegend.kotlinextensions.effects +package com.funkymuse.kotlinextensions.effects import android.Manifest.permission.VIBRATE import android.content.Context @@ -10,11 +10,6 @@ import android.os.VibrationEffect import android.os.Vibrator import androidx.annotation.RequiresPermission - -/** - * Created by hristijan on 2/22/19 to long live and prosper ! - */ - /** * Vibrate from context with milliseconds */ diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/environment/EnvironmentExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/environment/EnvironmentExtensions.kt similarity index 82% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/environment/EnvironmentExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/environment/EnvironmentExtensions.kt index 8913cd7eb..c74aabf16 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/environment/EnvironmentExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/environment/EnvironmentExtensions.kt @@ -1,13 +1,11 @@ -package com.crazylegend.kotlinextensions.environment +package com.funkymuse.kotlinextensions.environment import android.os.Environment import android.os.Environment.MEDIA_MOUNTED import android.os.Environment.MEDIA_MOUNTED_READ_ONLY -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ + inline val Environment.isExternalStorageWritable diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/font/FontUtils.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/font/FontUtils.kt similarity index 88% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/font/FontUtils.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/font/FontUtils.kt index 203f272db..77bfec975 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/font/FontUtils.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/font/FontUtils.kt @@ -1,12 +1,10 @@ -package com.crazylegend.kotlinextensions.font +package com.funkymuse.kotlinextensions.font import android.content.Context import android.graphics.Typeface -/** - * Created by hristijan on 3/5/19 to long live and prosper ! - */ + object FontUtils { diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/googleMaps/GoogleMapsExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/googleMaps/GoogleMapsExtensions.kt similarity index 98% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/googleMaps/GoogleMapsExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/googleMaps/GoogleMapsExtensions.kt index 6e3bbfac3..0603c3aa2 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/googleMaps/GoogleMapsExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/googleMaps/GoogleMapsExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.googleMaps +package com.funkymuse.kotlinextensions.googleMaps import android.content.ActivityNotFoundException import android.content.Context @@ -6,13 +6,7 @@ import android.content.Intent import android.content.pm.PackageManager import android.location.Location import android.net.Uri -import com.crazylegend.intent.canBeHandled - - -/** - * Created by crazy on 1/24/20 to long live and prosper ! - */ - +import com.funkymuse.intent.canBeHandled const val MAPS_URL = "com.google.android.apps.maps" const val LOC_MARKER_IN_MAPS_BY_LATLONG = "geo:0,0?q=%f,%f(%s)" diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/hideData/HideDataExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/hideData/HideDataExtensions.kt similarity index 94% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/hideData/HideDataExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/hideData/HideDataExtensions.kt index 0cd748203..3d615eb41 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/hideData/HideDataExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/hideData/HideDataExtensions.kt @@ -1,10 +1,4 @@ -package com.crazylegend.kotlinextensions.hideData - - -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ - +package com.funkymuse.kotlinextensions.hideData fun hideBankCard(cardNo: String): String { return hideData(cardNo, 16, 4, 4) diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/imagedecoder/ImageDecoderExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/imagedecoder/ImageDecoderExtensions.kt similarity index 92% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/imagedecoder/ImageDecoderExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/imagedecoder/ImageDecoderExtensions.kt index fcf090b24..a98061508 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/imagedecoder/ImageDecoderExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/imagedecoder/ImageDecoderExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.imagedecoder +package com.funkymuse.kotlinextensions.imagedecoder import android.content.ContentResolver import android.content.res.AssetManager @@ -14,11 +14,6 @@ import java.io.File import java.nio.ByteBuffer -/** - * Created by hristijan on 4/1/19 to long live and prosper ! - */ - - @RequiresApi(Build.VERSION_CODES.P) fun File.decodeImage() = ImageDecoder.createSource(this) diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/inputstream/InputStreamExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/inputstream/InputStreamExtensions.kt similarity index 68% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/inputstream/InputStreamExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/inputstream/InputStreamExtensions.kt index 66253a494..0c32f0cea 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/inputstream/InputStreamExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/inputstream/InputStreamExtensions.kt @@ -1,12 +1,7 @@ -package com.crazylegend.kotlinextensions.inputstream +package com.funkymuse.kotlinextensions.inputstream import java.io.InputStream import java.nio.charset.Charset - -/** - * Created by hristijan on 8/5/19 to long live and prosper ! - */ - fun InputStream.readTextAndClose(charset: Charset = Charsets.UTF_8): String = bufferedReader(charset).use { it.readText() } fun InputStream.readBytesAndClose(): ByteArray = bufferedReader().use { readBytes() } \ No newline at end of file diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/insets/InsetsExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/insets/InsetsExtensions.kt similarity index 90% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/insets/InsetsExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/insets/InsetsExtensions.kt index 9e0525e9c..78b9b8be9 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/insets/InsetsExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/insets/InsetsExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.insets +package com.funkymuse.kotlinextensions.insets import android.os.Build import android.view.View @@ -6,12 +6,8 @@ import androidx.annotation.RequiresApi import androidx.core.view.ViewCompat import androidx.core.view.WindowInsetsCompat - -/** - * Created by crazy on 8/20/20 to long live and prosper ! - */ - val View.isKeyboardVisible: Boolean + @RequiresApi(Build.VERSION_CODES.M) get() = WindowInsetsCompat .toWindowInsetsCompat(rootWindowInsets) .isVisible(WindowInsetsCompat.Type.ime()) diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/json/JsonExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/json/JsonExtensions.kt similarity index 87% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/json/JsonExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/json/JsonExtensions.kt index 189e5fd2c..7d3dda127 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/json/JsonExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/json/JsonExtensions.kt @@ -1,11 +1,9 @@ -package com.crazylegend.kotlinextensions.json +package com.funkymuse.kotlinextensions.json import org.json.JSONArray import org.json.JSONObject -/** - * Created by hristijan on 8/5/19 to long live and prosper ! - */ + fun JSONObject.getStringOrNull(name: String): String? { diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/location/LocationExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/location/LocationExtensions.kt similarity index 95% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/location/LocationExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/location/LocationExtensions.kt index 97909e7b6..29696d940 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/location/LocationExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/location/LocationExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.location +package com.funkymuse.kotlinextensions.location import android.Manifest.permission.ACCESS_COARSE_LOCATION import android.Manifest.permission.ACCESS_FINE_LOCATION @@ -12,11 +12,6 @@ import android.os.Looper import androidx.annotation.RequiresPermission import java.util.concurrent.Executors - -/** - * Created by hristijan on 3/5/19 to long live and prosper ! - */ - /** * Gets a single location update, returning the current location when found through a callback. * diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/location/LocationProvider.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/location/LocationProvider.kt similarity index 98% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/location/LocationProvider.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/location/LocationProvider.kt index 064034caf..6130970c5 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/location/LocationProvider.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/location/LocationProvider.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.location +package com.funkymuse.kotlinextensions.location import android.Manifest.permission.ACCESS_COARSE_LOCATION import android.Manifest.permission.ACCESS_FINE_LOCATION diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/location/ObtainedLocationModel.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/location/ObtainedLocationModel.kt similarity index 66% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/location/ObtainedLocationModel.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/location/ObtainedLocationModel.kt index 1ab41c969..117cb711f 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/location/ObtainedLocationModel.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/location/ObtainedLocationModel.kt @@ -1,9 +1,4 @@ -package com.crazylegend.kotlinextensions.location - - -/** - * Created by crazy on 3/30/19 to long live and prosper ! - */ +package com.funkymuse.kotlinextensions.location data class ObtainedLocationModel( var address: String? = null, diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/log/LogExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/log/LogExtensions.kt similarity index 96% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/log/LogExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/log/LogExtensions.kt index 749b897aa..030412a4d 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/log/LogExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/log/LogExtensions.kt @@ -1,11 +1,9 @@ -package com.crazylegend.kotlinextensions.log +package com.funkymuse.kotlinextensions.log import android.util.Log -/** - * Created by crazy on 2/24/19 to long live and prosper ! - */ + fun Any.debug(message: Any?) = apply { diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/measurements/ImperialMetricUtils.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/measurements/ImperialMetricUtils.kt similarity index 81% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/measurements/ImperialMetricUtils.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/measurements/ImperialMetricUtils.kt index 0519e6823..642cf1429 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/measurements/ImperialMetricUtils.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/measurements/ImperialMetricUtils.kt @@ -1,11 +1,7 @@ -package com.crazylegend.kotlinextensions.measurements +package com.funkymuse.kotlinextensions.measurements import kotlin.math.roundToInt - -/** - * Created by crazy on 1/24/20 to long live and prosper ! - */ object ImperialMetricUtils { private val stToLb = 14 private val lbToKg = 0.45 diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/memory/MemoryConversion.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/memory/MemoryConversion.kt similarity index 91% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/memory/MemoryConversion.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/memory/MemoryConversion.kt index 97332247d..6ecb22f7e 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/memory/MemoryConversion.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/memory/MemoryConversion.kt @@ -1,9 +1,4 @@ -package com.crazylegend.kotlinextensions.memory - - -/** - * Created by crazy on 2/24/19 to long live and prosper ! - */ +package com.funkymuse.kotlinextensions.memory fun getMemoryUsage(transform: (Long, Long, Long, Long, Int) -> String = { _, _, max, usage, percent -> "$usage / $max MB in use ($percent%)" }): Pair { val total = Runtime.getRuntime().totalMemory() diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/misc/Expirable.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/misc/Expirable.kt similarity index 79% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/misc/Expirable.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/misc/Expirable.kt index 95ce0881d..fbc366d0f 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/misc/Expirable.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/misc/Expirable.kt @@ -1,12 +1,9 @@ -package com.crazylegend.kotlinextensions.misc +package com.funkymuse.kotlinextensions.misc -import java.util.* +import java.util.Date import kotlin.reflect.KClass -/** - * Created by crazy on 8/5/20 to long live and prosper ! - */ class Expirable>(private val variable: T, private val expirationDate: Date) { /** * Pass a variable with expiration time in milliseconds in the future diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/misc/KClassExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/misc/KClassExtensions.kt similarity index 93% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/misc/KClassExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/misc/KClassExtensions.kt index 454c80eda..4152e67a4 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/misc/KClassExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/misc/KClassExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.misc +package com.funkymuse.kotlinextensions.misc import android.app.Activity import android.content.Context @@ -7,9 +7,7 @@ import android.os.Bundle import kotlin.reflect.KClass -/** - * Created by crazy on 1/24/20 to long live and prosper ! - */ + /** diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/misc/LruCache.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/misc/LruCache.kt similarity index 92% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/misc/LruCache.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/misc/LruCache.kt index 68028ff03..2dbe296de 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/misc/LruCache.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/misc/LruCache.kt @@ -1,11 +1,9 @@ -package com.crazylegend.kotlinextensions.misc +package com.funkymuse.kotlinextensions.misc import android.util.LruCache -/** - * Created by hristijan on 8/5/19 to long live and prosper ! - */ + /** diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/misc/MiscExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/misc/MiscExtensions.kt similarity index 92% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/misc/MiscExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/misc/MiscExtensions.kt index 00d9a968c..b895ec4d2 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/misc/MiscExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/misc/MiscExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.misc +package com.funkymuse.kotlinextensions.misc import android.Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS import android.content.Context @@ -12,16 +12,8 @@ import androidx.annotation.RawRes import androidx.annotation.RequiresPermission import androidx.appcompat.app.AppCompatDelegate import androidx.appcompat.widget.Toolbar -import androidx.fragment.app.Fragment -import com.crazylegend.kotlinextensions.power.isIgnoringBatteryOptimization -import java.util.* - - -/** - * Created by crazy on 2/25/20 to long live and prosper ! - */ - - +import com.funkymuse.kotlinextensions.power.isIgnoringBatteryOptimization +import java.util.Locale fun getCountryCode(countryName: String) = diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/misc/ParcelExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/misc/ParcelExtensions.kt similarity index 83% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/misc/ParcelExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/misc/ParcelExtensions.kt index 13d503a26..a7af5fc98 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/misc/ParcelExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/misc/ParcelExtensions.kt @@ -1,11 +1,9 @@ -package com.crazylegend.kotlinextensions.misc +package com.funkymuse.kotlinextensions.misc import android.os.Parcel import android.os.Parcelable -/** - * Created by hristijan on 8/5/19 to long live and prosper ! - */ + /** diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/misc/RunCodeEveryXLaunch.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/misc/RunCodeEveryXLaunch.kt similarity index 92% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/misc/RunCodeEveryXLaunch.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/misc/RunCodeEveryXLaunch.kt index 993304c81..a0e8811a2 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/misc/RunCodeEveryXLaunch.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/misc/RunCodeEveryXLaunch.kt @@ -1,11 +1,9 @@ -package com.crazylegend.kotlinextensions.misc +package com.funkymuse.kotlinextensions.misc import android.content.Context -/** - * Created by crazy on 8/13/20 to long live and prosper ! - */ + object RunCodeEveryXLaunch { private const val defaultPrefKey = "RunCodeEveryXLaunch" diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/misc/SynchronizedValue.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/misc/SynchronizedValue.kt similarity index 88% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/misc/SynchronizedValue.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/misc/SynchronizedValue.kt index aa14fa64a..6523a562e 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/misc/SynchronizedValue.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/misc/SynchronizedValue.kt @@ -1,9 +1,7 @@ -package com.crazylegend.kotlinextensions.misc +package com.funkymuse.kotlinextensions.misc + -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ class SynchronizedValue { diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/misc/ThreadExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/misc/ThreadExtensions.kt similarity index 74% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/misc/ThreadExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/misc/ThreadExtensions.kt index 0f7f40e05..05d2137de 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/misc/ThreadExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/misc/ThreadExtensions.kt @@ -1,9 +1,7 @@ -package com.crazylegend.kotlinextensions.misc +package com.funkymuse.kotlinextensions.misc + -/** - * Created by hristijan on 8/5/19 to long live and prosper ! - */ fun setThreadPriority(priority: Int) { diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/motionEvent/MotionEventExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/motionEvent/MotionEventExtensions.kt similarity index 50% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/motionEvent/MotionEventExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/motionEvent/MotionEventExtensions.kt index 8eb62e258..608511c66 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/motionEvent/MotionEventExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/motionEvent/MotionEventExtensions.kt @@ -1,13 +1,7 @@ -package com.crazylegend.kotlinextensions.motionEvent +package com.funkymuse.kotlinextensions.motionEvent import android.view.MotionEvent - -/** - * Created by crazy on 8/7/20 to long live and prosper ! - */ - - fun MotionEvent.isNewGesture(): Boolean { return action == MotionEvent.ACTION_DOWN } \ No newline at end of file diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/notifications/NotificationExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/notifications/NotificationExtensions.kt similarity index 85% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/notifications/NotificationExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/notifications/NotificationExtensions.kt index 7263b456f..cb2de65ab 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/notifications/NotificationExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/notifications/NotificationExtensions.kt @@ -1,15 +1,10 @@ -package com.crazylegend.kotlinextensions.notifications +package com.funkymuse.kotlinextensions.notifications import android.content.Context import androidx.core.app.NotificationCompat import androidx.core.app.NotificationManagerCompat import androidx.core.content.getSystemService - -/** - * Created by hristijan on 3/7/19 to long live and prosper ! - */ - /** * Removes notification * @param[id]: Id of the notification to remove diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/notifications/NotificationsUtil.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/notifications/NotificationsUtil.kt similarity index 98% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/notifications/NotificationsUtil.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/notifications/NotificationsUtil.kt index 23cffc0d4..61994fdd0 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/notifications/NotificationsUtil.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/notifications/NotificationsUtil.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.notifications +package com.funkymuse.kotlinextensions.notifications import android.app.Notification import android.app.NotificationChannel @@ -13,11 +13,6 @@ import androidx.annotation.IdRes import androidx.core.app.NotificationCompat import androidx.core.app.NotificationManagerCompat - -/** - * Created by Hristijan on 2/1/19 to long live and prosper ! - */ - class NotificationsUtil(private val context: Context, private val channelName: String = "gi", private val channelID: String, diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/packageutils/PackageUtils.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/packageutils/PackageUtils.kt similarity index 97% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/packageutils/PackageUtils.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/packageutils/PackageUtils.kt index 716d53ae6..6f4933928 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/packageutils/PackageUtils.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/packageutils/PackageUtils.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.packageutils +package com.funkymuse.kotlinextensions.packageutils import android.content.ActivityNotFoundException import android.content.Context @@ -11,11 +11,6 @@ import android.net.Uri import android.os.Build import android.provider.Settings - -/** - * Created by hristijan on 3/5/19 to long live and prosper ! - */ - /** * Checks if a given package is installed * @param packageName packageId diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/palette/PaletteExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/palette/PaletteExtensions.kt similarity index 83% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/palette/PaletteExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/palette/PaletteExtensions.kt index 8b636c34d..d4da85b55 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/palette/PaletteExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/palette/PaletteExtensions.kt @@ -1,14 +1,8 @@ -package com.crazylegend.kotlinextensions.palette +package com.funkymuse.kotlinextensions.palette import android.graphics.Bitmap import androidx.palette.graphics.Palette - -/** - * Created by hristijan on 10/7/19 to long live and prosper ! - */ - - /** * Synchronous palette generator from a bitmap */ diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/path/PathExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/path/PathExtensions.kt similarity index 88% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/path/PathExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/path/PathExtensions.kt index e9a0e1a52..017d2399a 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/path/PathExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/path/PathExtensions.kt @@ -1,11 +1,9 @@ -package com.crazylegend.kotlinextensions.path +package com.funkymuse.kotlinextensions.path import android.graphics.Path -/** - * Created by hristijan on 4/22/19 to long live and prosper ! - */ + fun Path.moveTo(x: Int, y: Int) { diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/pdf/PdfExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/pdf/PdfExtensions.kt similarity index 98% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/pdf/PdfExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/pdf/PdfExtensions.kt index 4d581c10b..20f65efbb 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/pdf/PdfExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/pdf/PdfExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.pdf +package com.funkymuse.kotlinextensions.pdf import android.graphics.Bitmap import android.graphics.Canvas @@ -13,12 +13,7 @@ import android.widget.LinearLayout import androidx.core.content.FileProvider import java.io.File import java.io.FileOutputStream -import java.util.* - - -/** - * Created by hristijan on 3/28/19 to long live and prosper ! - */ +import java.util.UUID fun View.createPDF(mediaDir: String, uriAuthority: String): Uri? { diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/pip/PipExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/pip/PipExtensions.kt similarity index 84% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/pip/PipExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/pip/PipExtensions.kt index 14ad37160..f7948b120 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/pip/PipExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/pip/PipExtensions.kt @@ -1,19 +1,17 @@ @file:Suppress("DEPRECATION") -package com.crazylegend.kotlinextensions.pip +package com.funkymuse.kotlinextensions.pip import android.app.Activity import android.app.PictureInPictureParams import android.os.Build import androidx.annotation.RequiresApi -import com.crazylegend.activity.hasPipPermission -import com.crazylegend.activity.supportsPictureInPicture -import com.crazylegend.intent.applicationDetailsIntent +import com.funkymuse.activity.hasPipPermission +import com.funkymuse.activity.supportsPictureInPicture +import com.funkymuse.intent.applicationDetailsIntent + -/** - * Created by crazy on 8/4/20 to long live and prosper ! - */ @RequiresApi(Build.VERSION_CODES.N) diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/power/PowerExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/power/PowerExtensions.kt similarity index 96% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/power/PowerExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/power/PowerExtensions.kt index 7be416d2c..ef6d132be 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/power/PowerExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/power/PowerExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.power +package com.funkymuse.kotlinextensions.power import android.content.Context import android.content.pm.PackageManager @@ -8,9 +8,7 @@ import androidx.annotation.RequiresApi import androidx.core.content.getSystemService -/** - * Created by crazy on 8/7/20 to long live and prosper ! - */ + private val Context.powerManager get() = getSystemService() diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/preferences/PreferenceDelegate.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/preferences/PreferenceDelegate.kt similarity index 83% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/preferences/PreferenceDelegate.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/preferences/PreferenceDelegate.kt index 15d5e7dab..9fe91454e 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/preferences/PreferenceDelegate.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/preferences/PreferenceDelegate.kt @@ -1,13 +1,10 @@ -package com.crazylegend.kotlinextensions.preferences +package com.funkymuse.kotlinextensions.preferences import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat import kotlin.properties.ReadOnlyProperty import kotlin.reflect.KProperty -/** - * Created by funkymuse on 10/9/21 to long live and prosper ! - */ class PreferenceDelegate(private val key: String) : ReadOnlyProperty { diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/preferences/PreferencesExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/preferences/PreferencesExtensions.kt similarity index 93% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/preferences/PreferencesExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/preferences/PreferencesExtensions.kt index fdc2d5954..ec75b1b0f 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/preferences/PreferencesExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/preferences/PreferencesExtensions.kt @@ -1,14 +1,9 @@ -package com.crazylegend.kotlinextensions.preferences +package com.funkymuse.kotlinextensions.preferences import androidx.preference.DialogPreference import androidx.preference.Preference import androidx.preference.TwoStatePreference - -/** - * Created by crazy on 4/30/20 to long live and prosper ! - */ - inline fun TwoStatePreference?.booleanChangeListener(crossinline action: (preference: Preference, newValue: Boolean) -> Unit = { _, _ -> }) { this?.setOnPreferenceChangeListener { pref, value -> value as Boolean diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/print/PrintExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/print/PrintExtensions.kt similarity index 84% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/print/PrintExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/print/PrintExtensions.kt index 465a88d88..2d7411836 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/print/PrintExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/print/PrintExtensions.kt @@ -1,15 +1,9 @@ -package com.crazylegend.kotlinextensions.print +package com.funkymuse.kotlinextensions.print import android.content.Context import android.graphics.BitmapFactory import androidx.print.PrintHelper -import com.crazylegend.kotlinextensions.log.debug - - -/** - * Created by crazy on 3/17/20 to long live and prosper ! - */ - +import com.funkymuse.kotlinextensions.log.debug fun List.printList() { this.forEachIndexed { index, t -> diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/registerReceiverChanges/ReceiverChangesUtils.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/registerReceiverChanges/ReceiverChangesUtils.kt similarity index 84% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/registerReceiverChanges/ReceiverChangesUtils.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/registerReceiverChanges/ReceiverChangesUtils.kt index d8c7be93f..ebea3db20 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/registerReceiverChanges/ReceiverChangesUtils.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/registerReceiverChanges/ReceiverChangesUtils.kt @@ -1,14 +1,13 @@ -package com.crazylegend.kotlinextensions.registerReceiverChanges +package com.funkymuse.kotlinextensions.registerReceiverChanges import android.app.Service -import android.content.* +import android.content.BroadcastReceiver +import android.content.Context +import android.content.ContextWrapper +import android.content.Intent +import android.content.IntentFilter import android.media.AudioManager - -/** - * Created by hristijan on 6/7/19 to long live and prosper ! - */ - inline fun Service.registerVolumeChange(crossinline block: (Int) -> Unit): BroadcastReceiver { return object : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/sensors/SensorFusion.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/sensors/SensorFusion.kt similarity index 98% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/sensors/SensorFusion.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/sensors/SensorFusion.kt index bcda43703..f1649378b 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/sensors/SensorFusion.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/sensors/SensorFusion.kt @@ -1,18 +1,16 @@ -package com.crazylegend.kotlinextensions.sensors +package com.funkymuse.kotlinextensions.sensors import android.content.Context import android.hardware.Sensor import android.hardware.SensorEvent import android.hardware.SensorEventListener import android.hardware.SensorManager -import java.util.* +import java.util.Timer +import java.util.TimerTask import kotlin.math.cos import kotlin.math.sin import kotlin.math.sqrt -/** - * Created by crazy on 4/10/20 to long live and prosper ! - */ open class SensorFusion(context: Context) : SensorEventListener { private val sensorManager: SensorManager = context.getSystemService(Context.SENSOR_SERVICE) as SensorManager diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/sensors/SensorRenderer.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/sensors/SensorRenderer.kt similarity index 99% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/sensors/SensorRenderer.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/sensors/SensorRenderer.kt index b67ed5589..ee00e6b82 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/sensors/SensorRenderer.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/sensors/SensorRenderer.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.sensors +package com.funkymuse.kotlinextensions.sensors import android.opengl.GLES20 import android.opengl.GLSurfaceView diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/singleton/ParameterizedSingleton.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/singleton/ParameterizedSingleton.kt similarity index 94% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/singleton/ParameterizedSingleton.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/singleton/ParameterizedSingleton.kt index c2c49688e..6451ea2cc 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/singleton/ParameterizedSingleton.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/singleton/ParameterizedSingleton.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.singleton +package com.funkymuse.kotlinextensions.singleton /* diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/social/SocialMediaExts.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/social/SocialMediaExts.kt similarity index 91% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/social/SocialMediaExts.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/social/SocialMediaExts.kt index a3536b6bd..c51e15b46 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/social/SocialMediaExts.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/social/SocialMediaExts.kt @@ -1,14 +1,9 @@ -package com.crazylegend.kotlinextensions.social +package com.funkymuse.kotlinextensions.social import android.content.Context import android.content.Intent import android.net.Uri -import com.crazylegend.intent.intentCanBeHandled - - -/** - * Created by crazy on 3/17/20 to long live and prosper ! - */ +import com.funkymuse.intent.intentCanBeHandled /** * @param pageId Facebook page id diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/sound/SoundExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/sound/SoundExtensions.kt similarity index 97% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/sound/SoundExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/sound/SoundExtensions.kt index 265543e79..57a2be982 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/sound/SoundExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/sound/SoundExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.sound +package com.funkymuse.kotlinextensions.sound import android.Manifest.permission.ACCESS_NOTIFICATION_POLICY import android.Manifest.permission.MODIFY_AUDIO_SETTINGS @@ -10,11 +10,6 @@ import android.os.Build import androidx.annotation.RequiresApi import androidx.annotation.RequiresPermission - -/** - * Created by hristijan on 2/22/19 to long live and prosper ! - */ - @RequiresPermission(allOf = [MODIFY_AUDIO_SETTINGS]) fun Context.increaseVolume() { val audioManager = this.getSystemService(Context.AUDIO_SERVICE) as AudioManager diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/storage/StorageExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/storage/StorageExtensions.kt similarity index 97% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/storage/StorageExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/storage/StorageExtensions.kt index a689c8653..d80346227 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/storage/StorageExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/storage/StorageExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.storage +package com.funkymuse.kotlinextensions.storage import android.app.Activity import android.content.ContentResolver @@ -14,19 +14,14 @@ import android.provider.DocumentsContract import android.provider.MediaStore import android.provider.OpenableColumns import androidx.annotation.RequiresApi -import com.crazylegend.common.device.DeviceUtils -import com.crazylegend.intent.INTENT_TYPE_DOCUMENT -import com.crazylegend.intent.INTENT_TYPE_IMGs -import com.crazylegend.intent.INTENT_TYPE_PDF -import com.crazylegend.intent.INTENT_TYPE_VIDEO -import com.crazylegend.kotlinextensions.cursor.getStringOrNull +import com.funkymuse.common.device.DeviceUtils +import com.funkymuse.intent.INTENT_TYPE_DOCUMENT +import com.funkymuse.intent.INTENT_TYPE_IMGs +import com.funkymuse.intent.INTENT_TYPE_PDF +import com.funkymuse.intent.INTENT_TYPE_VIDEO +import com.funkymuse.kotlinextensions.cursor.getStringOrNull import java.io.* - -/** - * Created by hristijan on 8/8/19 to long live and prosper ! - */ - /** * * @receiver Context diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/tools/ToolsAndUtils.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/tools/ToolsAndUtils.kt similarity index 92% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/tools/ToolsAndUtils.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/tools/ToolsAndUtils.kt index 9aba586d2..4e9c703ac 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/tools/ToolsAndUtils.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/tools/ToolsAndUtils.kt @@ -1,13 +1,7 @@ -package com.crazylegend.kotlinextensions.tools +package com.funkymuse.kotlinextensions.tools import kotlin.reflect.KClass - -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ - - /** * Wraps the [kotlin.checkNotNull] to avoid IllegalStateExceptions. Just returns false instead of * the Exception like it is implemented in the native kotlin implementation. diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/uri/UriExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/uri/UriExtensions.kt similarity index 86% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/uri/UriExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/uri/UriExtensions.kt index c2433a46f..6e93a8b95 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/uri/UriExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/uri/UriExtensions.kt @@ -1,16 +1,14 @@ -package com.crazylegend.kotlinextensions.uri +package com.funkymuse.kotlinextensions.uri import android.content.ContentResolver import android.content.Context import android.graphics.Bitmap import android.graphics.BitmapFactory import android.net.Uri -import com.crazylegend.common.closeQuietly +import com.funkymuse.common.closeQuietly + -/** - * Created by hristijan on 6/13/19 to long live and prosper ! - */ fun Uri.toBytes(context: Context): ByteArray? { context.contentResolver.openInputStream(this).use { diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/version/VersionExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/version/VersionExtensions.kt similarity index 96% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/version/VersionExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/version/VersionExtensions.kt index 4ec136281..bbb580c48 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/version/VersionExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/version/VersionExtensions.kt @@ -1,14 +1,9 @@ -package com.crazylegend.kotlinextensions.version +package com.funkymuse.kotlinextensions.version import android.content.Context import android.os.Build import androidx.annotation.RequiresApi - -/** - * Created by hristijan on 3/4/19 to long live and prosper ! - */ - inline fun toApi(toVersion: Int, inclusive: Boolean = false, action: () -> Unit) { if (Build.VERSION.SDK_INT < toVersion || (inclusive && Build.VERSION.SDK_INT == toVersion)) action() } diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/viewmodel/ViewModelExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/viewmodel/ViewModelExtensions.kt similarity index 63% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/viewmodel/ViewModelExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/viewmodel/ViewModelExtensions.kt index 093548a77..3513de7df 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/viewmodel/ViewModelExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/viewmodel/ViewModelExtensions.kt @@ -1,13 +1,8 @@ -package com.crazylegend.kotlinextensions.viewmodel +package com.funkymuse.kotlinextensions.viewmodel import android.content.Context import androidx.lifecycle.AndroidViewModel -/** - * Created by funkymuse on 6/19/21 to long live and prosper ! - */ - - /** * Gets the application context from within the android viewmodel */ diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/BottomSheetExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/BottomSheetExtensions.kt similarity index 93% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/BottomSheetExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/BottomSheetExtensions.kt index 7900ae6e6..6c8804de1 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/BottomSheetExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/BottomSheetExtensions.kt @@ -1,13 +1,8 @@ -package com.crazylegend.kotlinextensions.views +package com.funkymuse.kotlinextensions.views import android.view.View import com.google.android.material.bottomsheet.BottomSheetBehavior - -/** - * Created by hristijan on 9/23/19 to long live and prosper ! - */ - inline var BottomSheetBehavior.isExpanded: Boolean get() = state == BottomSheetBehavior.STATE_EXPANDED set(expand) { diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/ButtonExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/ButtonExtensions.kt similarity index 94% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/ButtonExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/ButtonExtensions.kt index 7e3584d84..c2c833cfe 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/ButtonExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/ButtonExtensions.kt @@ -1,16 +1,10 @@ -package com.crazylegend.kotlinextensions.views +package com.funkymuse.kotlinextensions.views import android.graphics.drawable.Drawable import android.view.View import android.widget.Button import android.widget.ProgressBar - -/** - * Created by hristijan on 3/4/19 to long live and prosper ! - */ - - private var viewOriginalHeight: Int = 0 fun Button.enableButtonWithLoading(progressBar: ProgressBar) { diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/CompoundButtonExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/CompoundButtonExtensions.kt similarity index 91% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/CompoundButtonExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/CompoundButtonExtensions.kt index b060b4e64..cbb9fae6c 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/CompoundButtonExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/CompoundButtonExtensions.kt @@ -1,12 +1,7 @@ -package com.crazylegend.kotlinextensions.views +package com.funkymuse.kotlinextensions.views import android.widget.CompoundButton - -/** - * Created by hristijan on 3/4/19 to long live and prosper ! - */ - /** * Sets CompoundButton.OnCheckedChangeListener and calls specified function [block] * if this button state changed to checked diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/DrawableExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/DrawableExtensions.kt similarity index 92% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/DrawableExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/DrawableExtensions.kt index 0d9db27c3..013df2a13 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/DrawableExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/DrawableExtensions.kt @@ -1,22 +1,22 @@ -package com.crazylegend.kotlinextensions.views +package com.funkymuse.kotlinextensions.views import android.content.Context import android.content.res.ColorStateList import android.graphics.Bitmap import android.graphics.PorterDuff import android.graphics.Rect -import android.graphics.drawable.* +import android.graphics.drawable.BitmapDrawable +import android.graphics.drawable.ColorDrawable +import android.graphics.drawable.Drawable +import android.graphics.drawable.LayerDrawable +import android.graphics.drawable.RippleDrawable import android.os.Build import android.os.Handler import android.os.Looper import androidx.annotation.ColorInt import androidx.core.graphics.drawable.DrawableCompat -import com.crazylegend.color.adjustAlpha +import com.funkymuse.color.adjustAlpha - -/** - * Created by hristijan on 3/4/19 to long live and prosper ! - */ /** * Converts a Bitmap to a Drawable */ diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/EditTextExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/EditTextExtensions.kt similarity index 96% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/EditTextExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/EditTextExtensions.kt index 0531548e3..394566e60 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/EditTextExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/EditTextExtensions.kt @@ -1,13 +1,22 @@ -package com.crazylegend.kotlinextensions.views +package com.funkymuse.kotlinextensions.views import android.annotation.SuppressLint import android.content.ClipboardManager import android.graphics.drawable.Drawable -import android.hardware.input.InputManager import android.os.Handler import android.os.Looper -import android.text.* -import android.view.* +import android.text.Editable +import android.text.InputFilter +import android.text.InputType +import android.text.Selection +import android.text.TextUtils +import android.text.TextWatcher +import android.view.ActionMode +import android.view.KeyEvent +import android.view.Menu +import android.view.MenuItem +import android.view.MotionEvent +import android.view.View import android.view.inputmethod.EditorInfo import android.view.inputmethod.InputMethodManager import android.widget.EditText @@ -15,9 +24,9 @@ import android.widget.TextView import androidx.core.content.ContextCompat import androidx.core.content.getSystemService import androidx.core.graphics.drawable.DrawableCompat -import com.crazylegend.common.isKeyboardSubmit -import com.crazylegend.kotlinextensions.insets.hideKeyboard -import com.crazylegend.kotlinextensions.insets.showKeyboard +import com.funkymuse.common.isKeyboardSubmit +import com.funkymuse.kotlinextensions.insets.hideKeyboard +import com.funkymuse.kotlinextensions.insets.showKeyboard import com.google.android.material.textfield.TextInputEditText import java.net.MalformedURLException import java.net.URL @@ -25,10 +34,6 @@ import kotlin.math.max import kotlin.math.min -/** - * Created by hristijan on 3/4/19 to long live and prosper ! - */ - val TextInputEditText.getString: String get() = this.text.toString() val TextInputEditText.getStringTrimmed: String get() = this.text.toString().trim() diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/FlingGestureHandler.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/FlingGestureHandler.kt similarity index 89% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/FlingGestureHandler.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/FlingGestureHandler.kt index ce6738d8f..5dbfed91c 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/FlingGestureHandler.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/FlingGestureHandler.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.views +package com.funkymuse.kotlinextensions.views import android.app.Activity import android.view.GestureDetector @@ -8,9 +8,6 @@ import android.view.View import kotlin.math.abs -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ abstract class FlingGestureHandler @JvmOverloads constructor( activity: Activity, private val minDistance: Int = 100, @@ -39,9 +36,10 @@ abstract class FlingGestureHandler @JvmOverloads constructor( private inner class GestureListener : GestureDetector.SimpleOnGestureListener() { override fun onFling( - e1: MotionEvent, e2: MotionEvent, velocityX: Float, + e1: MotionEvent?, e2: MotionEvent, velocityX: Float, velocityY: Float ): Boolean { + val e1 = e1 ?: return false if (e1.x - e2.x > minDistance && abs(velocityX) > velocityThreshold) { onRightToLeft() return true diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/ImageViewExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/ImageViewExtensions.kt similarity index 93% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/ImageViewExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/ImageViewExtensions.kt index 879bd56d0..a5c14f662 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/ImageViewExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/ImageViewExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.views +package com.funkymuse.kotlinextensions.views import android.app.WallpaperManager import android.content.res.ColorStateList @@ -13,10 +13,6 @@ import androidx.core.widget.ImageViewCompat import java.io.FileOutputStream -/** - * Created by hristijan on 3/4/19 to long live and prosper ! - */ - /** * Change Imageview tint */ diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/MenuExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/MenuExtensions.kt similarity index 97% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/MenuExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/MenuExtensions.kt index 85ab26337..23af70f7b 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/MenuExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/MenuExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.views +package com.funkymuse.kotlinextensions.views import android.annotation.SuppressLint import android.app.Activity @@ -11,13 +11,6 @@ import androidx.annotation.UiThread import androidx.appcompat.widget.SearchView import androidx.core.text.parseAsHtml import androidx.core.view.doOnNextLayout -import com.crazylegend.kotlinextensions.R - - -/** - * Created by hristijan on 3/7/19 to long live and prosper ! - */ - /** * Sets a color filter on all menu icons, including the overflow button (if it exists) diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/OnSwipeTouchListener.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/OnSwipeTouchListener.kt similarity index 90% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/OnSwipeTouchListener.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/OnSwipeTouchListener.kt index 0e82d2bb9..1b83b4fc2 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/OnSwipeTouchListener.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/OnSwipeTouchListener.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.views +package com.funkymuse.kotlinextensions.views import android.content.Context import android.view.GestureDetector @@ -7,11 +7,6 @@ import android.view.View import kotlin.math.abs -/** - * Created by hristijan on 2/21/19 to long live and prosper ! - */ - - /** * * @@ -62,7 +57,8 @@ open class OnSwipeTouchListener(context: Context) : View.OnTouchListener { return true } - override fun onFling(e1: MotionEvent, e2: MotionEvent, velocityX: Float, velocityY: Float): Boolean { + override fun onFling(e1: MotionEvent?, e2: MotionEvent, velocityX: Float, velocityY: Float): Boolean { + val e1 = e1 ?: return false var result = false try { val diffY = e2.y - e1.y diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/SnackbarExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/SnackbarExtensions.kt similarity index 95% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/SnackbarExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/SnackbarExtensions.kt index b1eb9e9e7..d2cdf1086 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/SnackbarExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/SnackbarExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.views +package com.funkymuse.kotlinextensions.views import android.view.View import android.widget.TextView @@ -6,10 +6,6 @@ import androidx.annotation.StringRes import com.google.android.material.snackbar.Snackbar -/** - * Created by hristijan on 3/7/19 to long live and prosper ! - */ - fun View.snackbar(msg: String) { Snackbar.make(this, msg, Snackbar.LENGTH_SHORT).show() } diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/SpanExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/SpanExtensions.kt similarity index 93% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/SpanExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/SpanExtensions.kt index efcc54046..8cd559b26 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/SpanExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/SpanExtensions.kt @@ -1,18 +1,18 @@ -package com.crazylegend.kotlinextensions.views +package com.funkymuse.kotlinextensions.views import android.graphics.Color import android.graphics.Typeface import android.text.Spannable import android.text.SpannableString import android.text.TextPaint -import android.text.style.* +import android.text.style.BackgroundColorSpan +import android.text.style.ClickableSpan +import android.text.style.ForegroundColorSpan +import android.text.style.RelativeSizeSpan +import android.text.style.StrikethroughSpan +import android.text.style.StyleSpan import android.view.View - -/** - * Created by hristijan on 3/4/19 to long live and prosper ! - */ - /** * Change the foreground color of the text specified in a paragraph of text * @param range The range of text to change the foreground color diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/SpinnerExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/SpinnerExtensions.kt similarity index 93% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/SpinnerExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/SpinnerExtensions.kt index 24ef2479c..d176ce8cd 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/SpinnerExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/SpinnerExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.views +package com.funkymuse.kotlinextensions.views import android.view.View import android.widget.AdapterView @@ -6,11 +6,6 @@ import android.widget.ArrayAdapter import android.widget.Spinner import android.widget.SpinnerAdapter - -/** - * Created by hristijan on 3/4/19 to long live and prosper ! - */ - /** * Callback executed when a spinner item is selected * @return Am implemented `OnItemSelectedListener` interface in case the same is needed for any other operation. diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/TextViewExtensions.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/TextViewExtensions.kt similarity index 98% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/TextViewExtensions.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/TextViewExtensions.kt index 052ae5f0a..62f69eb4a 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/views/TextViewExtensions.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/views/TextViewExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.views +package com.funkymuse.kotlinextensions.views import android.animation.ObjectAnimator import android.animation.ValueAnimator @@ -10,7 +10,11 @@ import android.graphics.Rect import android.graphics.Typeface import android.graphics.drawable.Drawable import android.os.Build -import android.text.* +import android.text.Editable +import android.text.Html +import android.text.Spannable +import android.text.TextUtils +import android.text.TextWatcher import android.text.method.LinkMovementMethod import android.text.method.ScrollingMovementMethod import android.text.style.ForegroundColorSpan @@ -21,7 +25,11 @@ import android.view.View import android.view.ViewGroup import android.view.animation.AccelerateDecelerateInterpolator import android.widget.TextView -import androidx.annotation.* +import androidx.annotation.DrawableRes +import androidx.annotation.FontRes +import androidx.annotation.StringRes +import androidx.annotation.StyleRes +import androidx.annotation.WorkerThread import androidx.appcompat.widget.AppCompatTextView import androidx.core.animation.doOnEnd import androidx.core.content.ContextCompat @@ -31,11 +39,6 @@ import androidx.core.widget.TextViewCompat import androidx.vectordrawable.graphics.drawable.ArgbEvaluator import com.google.android.material.textfield.TextInputLayout - -/** - * Created by hristijan on 2/22/19 to long live and prosper ! - */ - /** * UnderLine the TextView. */ diff --git a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/wakelock/WakeLockExts.kt b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/wakelock/WakeLockExts.kt similarity index 81% rename from kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/wakelock/WakeLockExts.kt rename to kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/wakelock/WakeLockExts.kt index d2df84827..d87de8841 100644 --- a/kotlinextensions/src/main/java/com/crazylegend/kotlinextensions/wakelock/WakeLockExts.kt +++ b/kotlinextensions/src/main/java/com/funkymuse/kotlinextensions/wakelock/WakeLockExts.kt @@ -1,17 +1,11 @@ -package com.crazylegend.kotlinextensions.wakelock +package com.funkymuse.kotlinextensions.wakelock import android.Manifest.permission.WAKE_LOCK import android.content.Context import android.os.Build import android.os.PowerManager import androidx.annotation.RequiresPermission -import java.util.* - - -/** - * Created by hristijan on 10/29/19 to long live and prosper ! - */ - +import java.util.Locale @RequiresPermission(WAKE_LOCK) fun PowerManager.WakeLock.safeRelease() { diff --git a/kotlinextensions/src/main/res/values/strings.xml b/kotlinextensions/src/main/res/values/strings.xml index 4774a440f..b52247fc8 100644 --- a/kotlinextensions/src/main/res/values/strings.xml +++ b/kotlinextensions/src/main/res/values/strings.xml @@ -1,15 +1,4 @@ KotlinExtensions - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - Clear - Back + diff --git a/kotlinextensions/src/test/java/com/crazylegend/kotlinextensions/singleton/ParameterizedSingletonTest.kt b/kotlinextensions/src/test/java/com/funkymuse/kotlinextensions/singleton/ParameterizedSingletonTest.kt similarity index 82% rename from kotlinextensions/src/test/java/com/crazylegend/kotlinextensions/singleton/ParameterizedSingletonTest.kt rename to kotlinextensions/src/test/java/com/funkymuse/kotlinextensions/singleton/ParameterizedSingletonTest.kt index d88a81685..4bf2d0918 100644 --- a/kotlinextensions/src/test/java/com/crazylegend/kotlinextensions/singleton/ParameterizedSingletonTest.kt +++ b/kotlinextensions/src/test/java/com/funkymuse/kotlinextensions/singleton/ParameterizedSingletonTest.kt @@ -1,12 +1,9 @@ -package com.crazylegend.kotlinextensions.singleton +package com.funkymuse.kotlinextensions.singleton import org.junit.Assert.assertEquals import org.junit.Before import org.junit.Test -/** - * Created by crazy on 7/17/20 to long live and prosper ! - */ class ParameterizedSingletonTest { diff --git a/lifecycle/build.gradle b/lifecycle/build.gradle deleted file mode 100644 index 9a42a655f..000000000 --- a/lifecycle/build.gradle +++ /dev/null @@ -1,11 +0,0 @@ - -dependencies { - implementation "androidx.core:core-ktx:$coreKTX" - implementation "androidx.appcompat:appcompat:$appCompat" - implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle" - -} - -android { - namespace 'com.crazylegend.lifecycle' -} \ No newline at end of file diff --git a/lifecycle/build.gradle.kts b/lifecycle/build.gradle.kts new file mode 100644 index 000000000..f2fd1971f --- /dev/null +++ b/lifecycle/build.gradle.kts @@ -0,0 +1,9 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.appcompat) + implementation(libs.androidx.lifecycle.runtime.ktx) +} \ No newline at end of file diff --git a/lifecycle/src/main/AndroidManifest.xml b/lifecycle/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/lifecycle/src/main/AndroidManifest.xml +++ b/lifecycle/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/lifecycle/src/main/java/com/crazylegend/lifecycle/LifeCycleCallBacks.kt b/lifecycle/src/main/java/com/crazylegend/lifecycle/LifeCycleCallBacks.kt deleted file mode 100644 index 12cec58ab..000000000 --- a/lifecycle/src/main/java/com/crazylegend/lifecycle/LifeCycleCallBacks.kt +++ /dev/null @@ -1,10 +0,0 @@ -package com.crazylegend.lifecycle - - -/** - * Created by hristijan on 3/18/19 to long live and prosper ! - */ -interface LifeCycleCallBacks { - fun appInBackground() - fun appInForeground() -} \ No newline at end of file diff --git a/lifecycle/src/main/java/com/crazylegend/lifecycle/AppLifeCycleObserver.kt b/lifecycle/src/main/java/com/funkymuse/lifecycle/AppLifeCycleObserver.kt similarity index 89% rename from lifecycle/src/main/java/com/crazylegend/lifecycle/AppLifeCycleObserver.kt rename to lifecycle/src/main/java/com/funkymuse/lifecycle/AppLifeCycleObserver.kt index 46f83dd65..bd1bb619c 100644 --- a/lifecycle/src/main/java/com/crazylegend/lifecycle/AppLifeCycleObserver.kt +++ b/lifecycle/src/main/java/com/funkymuse/lifecycle/AppLifeCycleObserver.kt @@ -1,13 +1,11 @@ -package com.crazylegend.lifecycle +package com.funkymuse.lifecycle import androidx.lifecycle.Lifecycle import androidx.lifecycle.LifecycleObserver import androidx.lifecycle.OnLifecycleEvent -/** - * Created by hristijan on 3/18/19 to long live and prosper ! - */ + /** * USAGE diff --git a/lifecycle/src/main/java/com/funkymuse/lifecycle/LifeCycleCallBacks.kt b/lifecycle/src/main/java/com/funkymuse/lifecycle/LifeCycleCallBacks.kt new file mode 100644 index 000000000..2abab8638 --- /dev/null +++ b/lifecycle/src/main/java/com/funkymuse/lifecycle/LifeCycleCallBacks.kt @@ -0,0 +1,8 @@ +package com.funkymuse.lifecycle + + + +interface LifeCycleCallBacks { + fun appInBackground() + fun appInForeground() +} \ No newline at end of file diff --git a/lifecycle/src/main/java/com/crazylegend/lifecycle/LifecycleExtensions.kt b/lifecycle/src/main/java/com/funkymuse/lifecycle/LifecycleExtensions.kt similarity index 95% rename from lifecycle/src/main/java/com/crazylegend/lifecycle/LifecycleExtensions.kt rename to lifecycle/src/main/java/com/funkymuse/lifecycle/LifecycleExtensions.kt index 8facff06b..c8d44b47c 100644 --- a/lifecycle/src/main/java/com/crazylegend/lifecycle/LifecycleExtensions.kt +++ b/lifecycle/src/main/java/com/funkymuse/lifecycle/LifecycleExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.lifecycle +package com.funkymuse.lifecycle import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.Fragment @@ -13,11 +13,6 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch -/** - * Created by crazy on 1/21/20 to long live and prosper ! - */ - - fun LifecycleRegistry.setInitialized() { currentState = Lifecycle.State.INITIALIZED } diff --git a/livedata/build.gradle b/livedata/build.gradle deleted file mode 100644 index ab9cabc42..000000000 --- a/livedata/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ - -dependencies { - - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation "androidx.core:core-ktx:$coreKTX" - implementation "androidx.appcompat:appcompat:$appCompat" - -} - -android { - namespace 'com.crazylegend.livedata' -} \ No newline at end of file diff --git a/livedata/build.gradle.kts b/livedata/build.gradle.kts new file mode 100644 index 000000000..41ce251c6 --- /dev/null +++ b/livedata/build.gradle.kts @@ -0,0 +1,8 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.appcompat) +} \ No newline at end of file diff --git a/livedata/src/main/AndroidManifest.xml b/livedata/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/livedata/src/main/AndroidManifest.xml +++ b/livedata/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/livedata/src/main/java/com/crazylegend/livedata/EventObserver.kt b/livedata/src/main/java/com/funkymuse/livedata/EventObserver.kt similarity index 94% rename from livedata/src/main/java/com/crazylegend/livedata/EventObserver.kt rename to livedata/src/main/java/com/funkymuse/livedata/EventObserver.kt index f5e31138f..3ba658b91 100644 --- a/livedata/src/main/java/com/crazylegend/livedata/EventObserver.kt +++ b/livedata/src/main/java/com/funkymuse/livedata/EventObserver.kt @@ -1,4 +1,4 @@ -package com.crazylegend.livedata +package com.funkymuse.livedata import androidx.lifecycle.Observer diff --git a/livedata/src/main/java/com/crazylegend/livedata/LiveDataExtensions.kt b/livedata/src/main/java/com/funkymuse/livedata/LiveDataExtensions.kt similarity index 97% rename from livedata/src/main/java/com/crazylegend/livedata/LiveDataExtensions.kt rename to livedata/src/main/java/com/funkymuse/livedata/LiveDataExtensions.kt index a6b734dac..9239d6be1 100644 --- a/livedata/src/main/java/com/crazylegend/livedata/LiveDataExtensions.kt +++ b/livedata/src/main/java/com/funkymuse/livedata/LiveDataExtensions.kt @@ -1,11 +1,11 @@ -package com.crazylegend.livedata - -import androidx.lifecycle.* - - -/** - * Created by Hristijan on 2/1/19 to long live and prosper ! - */ +package com.funkymuse.livedata + +import androidx.lifecycle.LifecycleOwner +import androidx.lifecycle.LiveData +import androidx.lifecycle.MediatorLiveData +import androidx.lifecycle.MutableLiveData +import androidx.lifecycle.Observer +import androidx.lifecycle.Transformations fun LiveData.observeOnce(observer: Observer) { diff --git a/livedata/src/main/java/com/crazylegend/livedata/LiveDataGetAsValues.kt b/livedata/src/main/java/com/funkymuse/livedata/LiveDataGetAsValues.kt similarity index 94% rename from livedata/src/main/java/com/crazylegend/livedata/LiveDataGetAsValues.kt rename to livedata/src/main/java/com/funkymuse/livedata/LiveDataGetAsValues.kt index 757cf99c3..2f2089bb6 100644 --- a/livedata/src/main/java/com/crazylegend/livedata/LiveDataGetAsValues.kt +++ b/livedata/src/main/java/com/funkymuse/livedata/LiveDataGetAsValues.kt @@ -1,13 +1,11 @@ -package com.crazylegend.livedata +package com.funkymuse.livedata import androidx.lifecycle.LiveData import androidx.lifecycle.MediatorLiveData import androidx.lifecycle.MutableLiveData -/** - * Created by hristijan on 3/5/19 to long live and prosper ! - */ + /** * Emits the items that are different from the last item diff --git a/livedata/src/main/java/com/crazylegend/livedata/NonNullLiveData.kt b/livedata/src/main/java/com/funkymuse/livedata/NonNullLiveData.kt similarity index 86% rename from livedata/src/main/java/com/crazylegend/livedata/NonNullLiveData.kt rename to livedata/src/main/java/com/funkymuse/livedata/NonNullLiveData.kt index a62673518..05cb208a8 100644 --- a/livedata/src/main/java/com/crazylegend/livedata/NonNullLiveData.kt +++ b/livedata/src/main/java/com/funkymuse/livedata/NonNullLiveData.kt @@ -1,13 +1,11 @@ -package com.crazylegend.livedata +package com.funkymuse.livedata import androidx.lifecycle.LiveData import androidx.lifecycle.MediatorLiveData import androidx.lifecycle.Observer -/** - * Created by hristijan on 3/5/19 to long live and prosper ! - */ + class NonNullLiveData(liveData: LiveData) : LiveData() { private val mediatorLiveData = MediatorLiveData() diff --git a/livedata/src/main/java/com/crazylegend/livedata/SingleEvent.kt b/livedata/src/main/java/com/funkymuse/livedata/SingleEvent.kt similarity index 97% rename from livedata/src/main/java/com/crazylegend/livedata/SingleEvent.kt rename to livedata/src/main/java/com/funkymuse/livedata/SingleEvent.kt index ba96c7a38..89e1720a7 100644 --- a/livedata/src/main/java/com/crazylegend/livedata/SingleEvent.kt +++ b/livedata/src/main/java/com/funkymuse/livedata/SingleEvent.kt @@ -1,4 +1,4 @@ -package com.crazylegend.livedata +package com.funkymuse.livedata //https://medium.com/androiddevelopers/livedata-with-snackbar-navigation-and-other-events-the-singleliveevent-case-ac2622673150 diff --git a/livedata/src/main/java/com/crazylegend/livedata/SingleLiveData.kt b/livedata/src/main/java/com/funkymuse/livedata/SingleLiveData.kt similarity index 86% rename from livedata/src/main/java/com/crazylegend/livedata/SingleLiveData.kt rename to livedata/src/main/java/com/funkymuse/livedata/SingleLiveData.kt index d180bc2d0..c044de77c 100644 --- a/livedata/src/main/java/com/crazylegend/livedata/SingleLiveData.kt +++ b/livedata/src/main/java/com/funkymuse/livedata/SingleLiveData.kt @@ -1,13 +1,11 @@ -package com.crazylegend.livedata +package com.funkymuse.livedata import androidx.lifecycle.LiveData import androidx.lifecycle.MediatorLiveData import androidx.lifecycle.Observer -/** - * Created by hristijan on 3/5/19 to long live and prosper ! - */ + class SingleLiveData(liveData: LiveData) : MediatorLiveData() { private var didSetValue = false private val mediatorObserver = Observer { diff --git a/livedata/src/main/java/com/crazylegend/livedata/SingleLiveDataConcat.kt b/livedata/src/main/java/com/funkymuse/livedata/SingleLiveDataConcat.kt similarity index 91% rename from livedata/src/main/java/com/crazylegend/livedata/SingleLiveDataConcat.kt rename to livedata/src/main/java/com/funkymuse/livedata/SingleLiveDataConcat.kt index 4719d6071..474d8693e 100644 --- a/livedata/src/main/java/com/crazylegend/livedata/SingleLiveDataConcat.kt +++ b/livedata/src/main/java/com/funkymuse/livedata/SingleLiveDataConcat.kt @@ -1,11 +1,9 @@ -package com.crazylegend.livedata +package com.funkymuse.livedata import androidx.lifecycle.MediatorLiveData -/** - * Created by hristijan on 3/6/19 to long live and prosper ! - */ + class SingleLiveDataConcat(liveDataList: List>) : MediatorLiveData() { constructor(vararg liveData: SingleLiveData) : this(liveData.toList()) diff --git a/livedata/src/main/java/com/crazylegend/livedata/SingleLiveEvent.kt b/livedata/src/main/java/com/funkymuse/livedata/SingleLiveEvent.kt similarity index 96% rename from livedata/src/main/java/com/crazylegend/livedata/SingleLiveEvent.kt rename to livedata/src/main/java/com/funkymuse/livedata/SingleLiveEvent.kt index 9509a79de..b8871237b 100644 --- a/livedata/src/main/java/com/crazylegend/livedata/SingleLiveEvent.kt +++ b/livedata/src/main/java/com/funkymuse/livedata/SingleLiveEvent.kt @@ -1,12 +1,10 @@ -package com.crazylegend.livedata +package com.funkymuse.livedata import android.util.Log import androidx.annotation.MainThread -import androidx.annotation.Nullable import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.MutableLiveData import androidx.lifecycle.Observer - import java.util.concurrent.atomic.AtomicBoolean /** diff --git a/livedata/src/test/java/com/crazylegend/livedata/LiveDataTestUtils.kt b/livedata/src/test/java/com/funkymuse/livedata/LiveDataTestUtils.kt similarity index 95% rename from livedata/src/test/java/com/crazylegend/livedata/LiveDataTestUtils.kt rename to livedata/src/test/java/com/funkymuse/livedata/LiveDataTestUtils.kt index c9aed9a4b..07e349214 100644 --- a/livedata/src/test/java/com/crazylegend/livedata/LiveDataTestUtils.kt +++ b/livedata/src/test/java/com/funkymuse/livedata/LiveDataTestUtils.kt @@ -1,4 +1,4 @@ -package com.crazylegend.kotlinextensions.collections +package com.funkymuse.livedata import androidx.annotation.VisibleForTesting import androidx.lifecycle.LiveData diff --git a/locale/build.gradle b/locale/build.gradle deleted file mode 100644 index 6cfaba900..000000000 --- a/locale/build.gradle +++ /dev/null @@ -1,9 +0,0 @@ - -dependencies { - implementation "androidx.preference:preference:$preference" - -} - -android { - namespace 'com.crazylegend.locale' -} \ No newline at end of file diff --git a/locale/build.gradle.kts b/locale/build.gradle.kts new file mode 100644 index 000000000..e69eda41c --- /dev/null +++ b/locale/build.gradle.kts @@ -0,0 +1,7 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(libs.androidx.preference) +} \ No newline at end of file diff --git a/locale/src/main/AndroidManifest.xml b/locale/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/locale/src/main/AndroidManifest.xml +++ b/locale/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/locale/src/main/java/com/crazylegend/locale/CountryCode.kt b/locale/src/main/java/com/funkymuse/locale/CountryCode.kt similarity index 89% rename from locale/src/main/java/com/crazylegend/locale/CountryCode.kt rename to locale/src/main/java/com/funkymuse/locale/CountryCode.kt index 5a7a4f414..9ba0b7ff7 100644 --- a/locale/src/main/java/com/crazylegend/locale/CountryCode.kt +++ b/locale/src/main/java/com/funkymuse/locale/CountryCode.kt @@ -1,9 +1,7 @@ -package com.crazylegend.locale +package com.funkymuse.locale + -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ /** * @see http://countrycode.org/ diff --git a/locale/src/main/java/com/crazylegend/locale/LocaleExtensions.kt b/locale/src/main/java/com/funkymuse/locale/LocaleExtensions.kt similarity index 88% rename from locale/src/main/java/com/crazylegend/locale/LocaleExtensions.kt rename to locale/src/main/java/com/funkymuse/locale/LocaleExtensions.kt index fd77fd7ba..21d793111 100644 --- a/locale/src/main/java/com/crazylegend/locale/LocaleExtensions.kt +++ b/locale/src/main/java/com/funkymuse/locale/LocaleExtensions.kt @@ -1,17 +1,13 @@ -package com.crazylegend.locale +package com.funkymuse.locale import android.content.Context import android.content.res.Configuration import android.content.res.Resources import android.os.Build import android.os.LocaleList -import java.util.* +import java.util.Locale -/** - * Created by hristijan on 8/5/19 to long live and prosper ! - */ - val defaultLocale: Locale get() = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) LocaleList.getDefault()[0] else Locale.getDefault() diff --git a/locale/src/main/java/com/crazylegend/locale/LocaleHelper.kt b/locale/src/main/java/com/funkymuse/locale/LocaleHelper.kt similarity index 98% rename from locale/src/main/java/com/crazylegend/locale/LocaleHelper.kt rename to locale/src/main/java/com/funkymuse/locale/LocaleHelper.kt index f17df00ab..131cc1806 100644 --- a/locale/src/main/java/com/crazylegend/locale/LocaleHelper.kt +++ b/locale/src/main/java/com/funkymuse/locale/LocaleHelper.kt @@ -1,4 +1,4 @@ -package com.crazylegend.locale +package com.funkymuse.locale import android.annotation.TargetApi import android.content.Context @@ -6,13 +6,9 @@ import android.content.res.Configuration import android.content.res.Resources import android.os.Build import androidx.preference.PreferenceManager -import java.util.* +import java.util.Locale -/** - * Created by Hristijan on 11/6/18 to live long and prosper. - */ - /** * * In your application level implementation diff --git a/math/build.gradle b/math/build.gradle deleted file mode 100644 index 1761d0802..000000000 --- a/math/build.gradle +++ /dev/null @@ -1,3 +0,0 @@ -android { - namespace 'com.crazylegend.math' -} \ No newline at end of file diff --git a/math/build.gradle.kts b/math/build.gradle.kts new file mode 100644 index 000000000..ff390193e --- /dev/null +++ b/math/build.gradle.kts @@ -0,0 +1,4 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + diff --git a/math/src/main/AndroidManifest.xml b/math/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/math/src/main/AndroidManifest.xml +++ b/math/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/math/src/main/java/com/crazylegend/math/MathExtensions.kt b/math/src/main/java/com/funkymuse/math/MathExtensions.kt similarity index 98% rename from math/src/main/java/com/crazylegend/math/MathExtensions.kt rename to math/src/main/java/com/funkymuse/math/MathExtensions.kt index 7257c1086..ba36edafc 100644 --- a/math/src/main/java/com/crazylegend/math/MathExtensions.kt +++ b/math/src/main/java/com/funkymuse/math/MathExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.math +package com.funkymuse.math import android.content.Context import java.math.BigDecimal @@ -8,9 +8,7 @@ import java.text.DecimalFormatSymbols import kotlin.random.Random -/** - * Created by hristijan on 2/22/19 to long live and prosper ! - */ + fun Double.sin(): Double = Math.sin(this) diff --git a/math/src/main/java/com/crazylegend/math/MathUtils.kt b/math/src/main/java/com/funkymuse/math/MathUtils.kt similarity index 99% rename from math/src/main/java/com/crazylegend/math/MathUtils.kt rename to math/src/main/java/com/funkymuse/math/MathUtils.kt index 5c59998da..829bdf8e2 100644 --- a/math/src/main/java/com/crazylegend/math/MathUtils.kt +++ b/math/src/main/java/com/funkymuse/math/MathUtils.kt @@ -1,4 +1,4 @@ -package com.crazylegend.math +package com.funkymuse.math import android.content.res.Resources import java.util.* @@ -6,9 +6,7 @@ import kotlin.math.ln import kotlin.math.roundToLong -/** - * Created by hristijan on 8/5/19 to long live and prosper ! - */ + class MathUtils @Throws(IllegalAccessException::class) private constructor() { diff --git a/moshi/build.gradle b/moshi/build.gradle deleted file mode 100644 index 9b4338b4e..000000000 --- a/moshi/build.gradle +++ /dev/null @@ -1,7 +0,0 @@ -dependencies { - api "com.squareup.moshi:moshi:$moshi" -} - -android { - namespace 'com.crazylegend.moshi' -} \ No newline at end of file diff --git a/moshi/build.gradle.kts b/moshi/build.gradle.kts new file mode 100644 index 000000000..df34c9961 --- /dev/null +++ b/moshi/build.gradle.kts @@ -0,0 +1,7 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + api(libs.moshi) +} \ No newline at end of file diff --git a/moshi/src/main/java/com/crazylegend/moshi/MoshiExtensions.kt b/moshi/src/main/java/com/funkymuse/moshi/MoshiExtensions.kt similarity index 95% rename from moshi/src/main/java/com/crazylegend/moshi/MoshiExtensions.kt rename to moshi/src/main/java/com/funkymuse/moshi/MoshiExtensions.kt index 1fd65f27c..c30e31514 100644 --- a/moshi/src/main/java/com/crazylegend/moshi/MoshiExtensions.kt +++ b/moshi/src/main/java/com/funkymuse/moshi/MoshiExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.moshi +package com.funkymuse.moshi import android.content.SharedPreferences import com.squareup.moshi.JsonAdapter @@ -8,9 +8,7 @@ import kotlin.properties.ReadWriteProperty import kotlin.reflect.KProperty -/** - * Created by crazy on 2/25/20 to long live and prosper ! - */ + inline fun T.toJson( @@ -74,7 +72,7 @@ inline fun SharedPreferences.getObject( key: String ): T? { val string = getString(key, null) - if (string == null || string.isEmpty()) return null + if (string.isNullOrEmpty()) return null return getString(key, null)?.fromJson(factory) } diff --git a/networking/build.gradle b/networking/build.gradle deleted file mode 100644 index 3a0458125..000000000 --- a/networking/build.gradle +++ /dev/null @@ -1,7 +0,0 @@ -dependencies { - implementation project(path: ':common') -} - -android { - namespace 'com.crazylegend.networking' -} \ No newline at end of file diff --git a/networking/build.gradle.kts b/networking/build.gradle.kts new file mode 100644 index 000000000..9eef7c629 --- /dev/null +++ b/networking/build.gradle.kts @@ -0,0 +1,7 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(projects.common) +} \ No newline at end of file diff --git a/networking/src/main/AndroidManifest.xml b/networking/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/networking/src/main/AndroidManifest.xml +++ b/networking/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/networking/src/main/java/com/crazylegend/networking/NetworkUtils.kt b/networking/src/main/java/com/funkymuse/networking/NetworkUtils.kt similarity index 92% rename from networking/src/main/java/com/crazylegend/networking/NetworkUtils.kt rename to networking/src/main/java/com/funkymuse/networking/NetworkUtils.kt index 84663f48b..967591987 100644 --- a/networking/src/main/java/com/crazylegend/networking/NetworkUtils.kt +++ b/networking/src/main/java/com/funkymuse/networking/NetworkUtils.kt @@ -1,19 +1,14 @@ -package com.crazylegend.networking +package com.funkymuse.networking import android.content.Context import android.net.wifi.WifiManager import android.telephony.PhoneStateListener import android.telephony.ServiceState import android.telephony.TelephonyManager -import com.crazylegend.common.tryOrNull +import com.funkymuse.common.tryOrNull import java.net.InetAddress import java.net.UnknownHostException - -/** - * Created by hristijan on 6/21/19 to long live and prosper ! - */ - fun Context.getIPAddress(defaultAddress: String = "127.0.0.1"): String { return tryOrNull { getInetAddress()?.hostAddress diff --git a/networking/src/main/java/com/crazylegend/networking/SSLUtils.kt b/networking/src/main/java/com/funkymuse/networking/SSLUtils.kt similarity index 96% rename from networking/src/main/java/com/crazylegend/networking/SSLUtils.kt rename to networking/src/main/java/com/funkymuse/networking/SSLUtils.kt index 948bc8eda..197095f15 100644 --- a/networking/src/main/java/com/crazylegend/networking/SSLUtils.kt +++ b/networking/src/main/java/com/funkymuse/networking/SSLUtils.kt @@ -1,4 +1,4 @@ -package com.crazylegend.networking +package com.funkymuse.networking import android.annotation.SuppressLint import android.content.Context @@ -12,9 +12,7 @@ import java.security.cert.X509Certificate import javax.net.ssl.* import javax.security.cert.CertificateException -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ + object SSLUtils { diff --git a/numbers/build.gradle b/numbers/build.gradle deleted file mode 100644 index cb4e22a35..000000000 --- a/numbers/build.gradle +++ /dev/null @@ -1,11 +0,0 @@ - -dependencies { - implementation project(path: ':bytearray') - implementation project(path: ':math') - implementation "androidx.annotation:annotation:$annotationVersion" - -} - -android { - namespace 'com.crazylegend.numbers' -} \ No newline at end of file diff --git a/numbers/build.gradle.kts b/numbers/build.gradle.kts new file mode 100644 index 000000000..bb6346e98 --- /dev/null +++ b/numbers/build.gradle.kts @@ -0,0 +1,9 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(projects.bytearray) + implementation(projects.math) + implementation(libs.androidx.annotation) +} \ No newline at end of file diff --git a/numbers/src/main/AndroidManifest.xml b/numbers/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/numbers/src/main/AndroidManifest.xml +++ b/numbers/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/numbers/src/main/java/com/crazylegend/numbers/FiatSymbols.kt b/numbers/src/main/java/com/funkymuse/numbers/FiatSymbols.kt similarity index 94% rename from numbers/src/main/java/com/crazylegend/numbers/FiatSymbols.kt rename to numbers/src/main/java/com/funkymuse/numbers/FiatSymbols.kt index 2e75ca0d0..458adba93 100644 --- a/numbers/src/main/java/com/crazylegend/numbers/FiatSymbols.kt +++ b/numbers/src/main/java/com/funkymuse/numbers/FiatSymbols.kt @@ -1,13 +1,7 @@ -package com.crazylegend.numbers +package com.funkymuse.numbers import android.util.ArrayMap - -/** - * Created by Hristijan on 20/2/19 to long live and prosper ! - */ - - object FiatSymbols { var symbolsMap: ArrayMap = ArrayMap() diff --git a/numbers/src/main/java/com/crazylegend/numbers/NumberFormatter.kt b/numbers/src/main/java/com/funkymuse/numbers/NumberFormatter.kt similarity index 60% rename from numbers/src/main/java/com/crazylegend/numbers/NumberFormatter.kt rename to numbers/src/main/java/com/funkymuse/numbers/NumberFormatter.kt index 593618eeb..d5d2c77ef 100644 --- a/numbers/src/main/java/com/crazylegend/numbers/NumberFormatter.kt +++ b/numbers/src/main/java/com/funkymuse/numbers/NumberFormatter.kt @@ -1,13 +1,8 @@ -package com.crazylegend.numbers +package com.funkymuse.numbers import java.text.DecimalFormat import java.text.NumberFormat -import java.util.* - - -/** - * Created by Hristijan on 2/1/19 to long live and prosper ! - */ +import java.util.Locale fun getNumberFormatter(locale: Locale): DecimalFormat { diff --git a/numbers/src/main/java/com/crazylegend/numbers/Numberextensions.kt b/numbers/src/main/java/com/funkymuse/numbers/Numberextensions.kt similarity index 98% rename from numbers/src/main/java/com/crazylegend/numbers/Numberextensions.kt rename to numbers/src/main/java/com/funkymuse/numbers/Numberextensions.kt index cb3de1711..a4a199365 100644 --- a/numbers/src/main/java/com/crazylegend/numbers/Numberextensions.kt +++ b/numbers/src/main/java/com/funkymuse/numbers/Numberextensions.kt @@ -1,13 +1,13 @@ -package com.crazylegend.numbers +package com.funkymuse.numbers import android.content.Context import android.os.Build import androidx.annotation.DimenRes import androidx.annotation.IntRange import androidx.annotation.RequiresApi -import com.crazylegend.bytearray.byteArray -import com.crazylegend.bytearray.xorAll -import com.crazylegend.math.log +import com.funkymuse.bytearray.byteArray +import com.funkymuse.bytearray.xorAll +import com.funkymuse.math.log import java.lang.Double.doubleToRawLongBits import java.lang.Double.longBitsToDouble import java.lang.Float.floatToRawIntBits @@ -25,10 +25,6 @@ import kotlin.math.ln import kotlin.math.pow -/** - * Created by hristijan on 2/20/19 to long live and prosper ! - */ - fun Int.sleep() = this.toLong().sleep() fun Long.sleep() = Thread.sleep(this) diff --git a/permissions/build.gradle b/permissions/build.gradle deleted file mode 100644 index b39a2f8c5..000000000 --- a/permissions/build.gradle +++ /dev/null @@ -1,9 +0,0 @@ -dependencies { - implementation "androidx.core:core-ktx:$coreKTX" - implementation "androidx.appcompat:appcompat:$appCompat" - -} - -android { - namespace 'com.crazylegend.permissions' -} \ No newline at end of file diff --git a/permissions/build.gradle.kts b/permissions/build.gradle.kts new file mode 100644 index 000000000..41ce251c6 --- /dev/null +++ b/permissions/build.gradle.kts @@ -0,0 +1,8 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.appcompat) +} \ No newline at end of file diff --git a/permissions/src/main/AndroidManifest.xml b/permissions/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/permissions/src/main/AndroidManifest.xml +++ b/permissions/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/permissions/src/main/java/com/crazylegend/permissions/AccessibilityContract.kt b/permissions/src/main/java/com/funkymuse/permissions/AccessibilityContract.kt similarity index 80% rename from permissions/src/main/java/com/crazylegend/permissions/AccessibilityContract.kt rename to permissions/src/main/java/com/funkymuse/permissions/AccessibilityContract.kt index 93ac62658..060e34819 100644 --- a/permissions/src/main/java/com/crazylegend/permissions/AccessibilityContract.kt +++ b/permissions/src/main/java/com/funkymuse/permissions/AccessibilityContract.kt @@ -1,14 +1,10 @@ -package com.crazylegend.permissions +package com.funkymuse.permissions import android.content.Context import android.content.Intent import android.provider.Settings import androidx.activity.result.contract.ActivityResultContract -/** - * Created by crazy on 10/14/20 to long live and prosper ! - */ - class AccessibilityContract : ActivityResultContract() { override fun createIntent(context: Context, input: Nothing): Intent = Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS) override fun parseResult(resultCode: Int, intent: Intent?): Unit = Unit diff --git a/permissions/src/main/java/com/crazylegend/permissions/CreateVideoContract.kt b/permissions/src/main/java/com/funkymuse/permissions/CreateVideoContract.kt similarity index 91% rename from permissions/src/main/java/com/crazylegend/permissions/CreateVideoContract.kt rename to permissions/src/main/java/com/funkymuse/permissions/CreateVideoContract.kt index c9469dc03..39f9dab37 100644 --- a/permissions/src/main/java/com/crazylegend/permissions/CreateVideoContract.kt +++ b/permissions/src/main/java/com/funkymuse/permissions/CreateVideoContract.kt @@ -1,4 +1,4 @@ -package com.crazylegend.permissions +package com.funkymuse.permissions import android.app.Activity import android.content.Context @@ -7,9 +7,6 @@ import android.net.Uri import androidx.activity.result.contract.ActivityResultContract -/** - * Created by crazy on 5/26/20 to long live and prosper ! - */ /** private val registerDocumentContract = registerForActivityResult(CreateVideo()) { if (it == null) { diff --git a/permissions/src/main/java/com/crazylegend/permissions/LocationSettingsContract.kt b/permissions/src/main/java/com/funkymuse/permissions/LocationSettingsContract.kt similarity index 89% rename from permissions/src/main/java/com/crazylegend/permissions/LocationSettingsContract.kt rename to permissions/src/main/java/com/funkymuse/permissions/LocationSettingsContract.kt index 327f134c1..0065a05a5 100644 --- a/permissions/src/main/java/com/crazylegend/permissions/LocationSettingsContract.kt +++ b/permissions/src/main/java/com/funkymuse/permissions/LocationSettingsContract.kt @@ -1,4 +1,4 @@ -package com.crazylegend.permissions +package com.funkymuse.permissions import android.content.Context import android.content.Intent @@ -7,8 +7,6 @@ import androidx.activity.result.contract.ActivityResultContract /** - * Created by crazy on 5/4/20 to long live and prosper ! - * * private var enableLocationRetryCount = 1 private val enableLocation = registerForActivityResult(LocationSettingsContract()) { if (enableLocationRetryCount <= 2) { diff --git a/permissions/src/main/java/com/crazylegend/permissions/PermissionExtensions.kt b/permissions/src/main/java/com/funkymuse/permissions/PermissionExtensions.kt similarity index 95% rename from permissions/src/main/java/com/crazylegend/permissions/PermissionExtensions.kt rename to permissions/src/main/java/com/funkymuse/permissions/PermissionExtensions.kt index 981819fda..d22bc2689 100644 --- a/permissions/src/main/java/com/crazylegend/permissions/PermissionExtensions.kt +++ b/permissions/src/main/java/com/funkymuse/permissions/PermissionExtensions.kt @@ -1,6 +1,9 @@ -package com.crazylegend.permissions +package com.funkymuse.permissions -import android.Manifest.permission.* +import android.Manifest.permission.ACCESS_BACKGROUND_LOCATION +import android.Manifest.permission.ACCESS_COARSE_LOCATION +import android.Manifest.permission.ACCESS_FINE_LOCATION +import android.Manifest.permission.CAMERA import android.os.Build import androidx.activity.result.ActivityResultLauncher import androidx.activity.result.contract.ActivityResultContracts @@ -8,10 +11,6 @@ import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentActivity -/** - * Created by crazy on 6/15/20 to long live and prosper ! - */ - //region Multiple permissions inline fun Fragment.askForMultiplePermissions( crossinline onDenied: () -> Unit = {}, diff --git a/permissions/src/main/java/com/crazylegend/permissions/ProtectedPermissions.kt b/permissions/src/main/java/com/funkymuse/permissions/ProtectedPermissions.kt similarity index 86% rename from permissions/src/main/java/com/crazylegend/permissions/ProtectedPermissions.kt rename to permissions/src/main/java/com/funkymuse/permissions/ProtectedPermissions.kt index 094093120..85d879f68 100644 --- a/permissions/src/main/java/com/crazylegend/permissions/ProtectedPermissions.kt +++ b/permissions/src/main/java/com/funkymuse/permissions/ProtectedPermissions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.permissions +package com.funkymuse.permissions import android.Manifest import android.app.AppOpsManager @@ -6,13 +6,8 @@ import android.content.Context import android.content.pm.PackageManager import android.os.Build import android.os.Process -import androidx.annotation.RequiresApi import androidx.core.content.getSystemService -/** - * Created by crazy on 10/30/20 to long live and prosper ! - */ - fun Context.hasUsageStatsPermission(): Boolean { val appOps = getSystemService() ?: return false val mode = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { diff --git a/photos/build.gradle b/photos/build.gradle deleted file mode 100644 index e5183b42a..000000000 --- a/photos/build.gradle +++ /dev/null @@ -1,9 +0,0 @@ -dependencies { - implementation "androidx.core:core-ktx:$coreKTX" - implementation "androidx.appcompat:appcompat:$appCompat" - implementation "androidx.exifinterface:exifinterface:$exifinterface" -} - -android { - namespace 'com.crazylegend.photos' -} \ No newline at end of file diff --git a/photos/build.gradle.kts b/photos/build.gradle.kts new file mode 100644 index 000000000..addca195c --- /dev/null +++ b/photos/build.gradle.kts @@ -0,0 +1,9 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.appcompat) + implementation(libs.androidx.exifinterface) +} \ No newline at end of file diff --git a/photos/src/main/AndroidManifest.xml b/photos/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/photos/src/main/AndroidManifest.xml +++ b/photos/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/photos/src/main/java/com/crazylegend/photos/DecodeColorOnTouch.kt b/photos/src/main/java/com/funkymuse/photos/DecodeColorOnTouch.kt similarity index 94% rename from photos/src/main/java/com/crazylegend/photos/DecodeColorOnTouch.kt rename to photos/src/main/java/com/funkymuse/photos/DecodeColorOnTouch.kt index 2e6709fee..f6efa06f4 100644 --- a/photos/src/main/java/com/crazylegend/photos/DecodeColorOnTouch.kt +++ b/photos/src/main/java/com/funkymuse/photos/DecodeColorOnTouch.kt @@ -1,4 +1,4 @@ -package com.crazylegend.photos +package com.funkymuse.photos import android.graphics.Bitmap import android.graphics.BitmapFactory @@ -9,9 +9,7 @@ import android.view.View import kotlin.math.roundToInt -/** - * Created by hristijan on 3/28/19 to long live and prosper ! - */ + /** diff --git a/photos/src/main/java/com/crazylegend/photos/ImageUtils.kt b/photos/src/main/java/com/funkymuse/photos/ImageUtils.kt similarity index 98% rename from photos/src/main/java/com/crazylegend/photos/ImageUtils.kt rename to photos/src/main/java/com/funkymuse/photos/ImageUtils.kt index 8cef32864..00ff28ed3 100644 --- a/photos/src/main/java/com/crazylegend/photos/ImageUtils.kt +++ b/photos/src/main/java/com/funkymuse/photos/ImageUtils.kt @@ -1,4 +1,4 @@ -package com.crazylegend.photos +package com.funkymuse.photos import android.Manifest.permission.CAMERA import android.annotation.SuppressLint @@ -21,11 +21,6 @@ import java.text.SimpleDateFormat import java.util.* import kotlin.math.roundToInt -/** - * Created by hristijan on 4/8/19 to long live and prosper ! - */ - - fun ExifInterface.getRotationMatrix() = when (getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_UNDEFINED)) { ExifInterface.ORIENTATION_ROTATE_90 -> Matrix().apply { postRotate(90f) } //6 diff --git a/photos/src/main/java/com/crazylegend/photos/PhotosExtensions.kt b/photos/src/main/java/com/funkymuse/photos/PhotosExtensions.kt similarity index 95% rename from photos/src/main/java/com/crazylegend/photos/PhotosExtensions.kt rename to photos/src/main/java/com/funkymuse/photos/PhotosExtensions.kt index 49a99c645..d4fbb11e5 100644 --- a/photos/src/main/java/com/crazylegend/photos/PhotosExtensions.kt +++ b/photos/src/main/java/com/funkymuse/photos/PhotosExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.photos +package com.funkymuse.photos import android.content.Context import android.graphics.BitmapFactory @@ -7,9 +7,7 @@ import androidx.annotation.DrawableRes import java.io.File import java.io.IOException -/** - * Created by hristijan on 3/5/19 to long live and prosper ! - */ + private val options: BitmapFactory.Options by lazy { val opt = BitmapFactory.Options() diff --git a/receivers/build.gradle b/receivers/build.gradle deleted file mode 100644 index 0b70005e2..000000000 --- a/receivers/build.gradle +++ /dev/null @@ -1,3 +0,0 @@ -android { - namespace 'com.crazylegend.receivers' -} \ No newline at end of file diff --git a/receivers/build.gradle.kts b/receivers/build.gradle.kts new file mode 100644 index 000000000..0f8b71618 --- /dev/null +++ b/receivers/build.gradle.kts @@ -0,0 +1,3 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} diff --git a/receivers/src/main/AndroidManifest.xml b/receivers/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/receivers/src/main/AndroidManifest.xml +++ b/receivers/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/receivers/src/main/java/com/crazylegend/receivers/PhoneCallReceiver.kt b/receivers/src/main/java/com/funkymuse/receivers/PhoneCallReceiver.kt similarity index 97% rename from receivers/src/main/java/com/crazylegend/receivers/PhoneCallReceiver.kt rename to receivers/src/main/java/com/funkymuse/receivers/PhoneCallReceiver.kt index 145e13cb2..56daed00c 100644 --- a/receivers/src/main/java/com/crazylegend/receivers/PhoneCallReceiver.kt +++ b/receivers/src/main/java/com/funkymuse/receivers/PhoneCallReceiver.kt @@ -1,17 +1,13 @@ -package com.crazylegend.receivers +package com.funkymuse.receivers import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import android.telephony.PhoneStateListener import android.telephony.TelephonyManager -import java.util.* +import java.util.Date -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ - /** * * diff --git a/receivers/src/main/java/com/crazylegend/receivers/ServicesReceiverExtensions.kt b/receivers/src/main/java/com/funkymuse/receivers/ServicesReceiverExtensions.kt similarity index 94% rename from receivers/src/main/java/com/crazylegend/receivers/ServicesReceiverExtensions.kt rename to receivers/src/main/java/com/funkymuse/receivers/ServicesReceiverExtensions.kt index b89e66fc7..e094c3cca 100644 --- a/receivers/src/main/java/com/crazylegend/receivers/ServicesReceiverExtensions.kt +++ b/receivers/src/main/java/com/funkymuse/receivers/ServicesReceiverExtensions.kt @@ -1,18 +1,17 @@ -package com.crazylegend.receivers +package com.funkymuse.receivers import android.app.ActivityManager import android.app.Service import android.bluetooth.BluetoothAdapter import android.bluetooth.BluetoothProfile -import android.content.* +import android.content.BroadcastReceiver +import android.content.Context +import android.content.Intent +import android.content.IntentFilter import android.media.AudioManager import android.os.Build -/** - * Created by hristijan on 8/5/19 to long live and prosper ! - */ - inline fun Context.registerVolumeChange(crossinline block: (Int) -> Unit): BroadcastReceiver { return object : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { diff --git a/receivers/src/main/java/com/crazylegend/receivers/SmsReceiver.kt b/receivers/src/main/java/com/funkymuse/receivers/SmsReceiver.kt similarity index 89% rename from receivers/src/main/java/com/crazylegend/receivers/SmsReceiver.kt rename to receivers/src/main/java/com/funkymuse/receivers/SmsReceiver.kt index 5a3404b6a..9a0f8301e 100644 --- a/receivers/src/main/java/com/crazylegend/receivers/SmsReceiver.kt +++ b/receivers/src/main/java/com/funkymuse/receivers/SmsReceiver.kt @@ -1,4 +1,4 @@ -package com.crazylegend.receivers +package com.funkymuse.receivers import android.content.BroadcastReceiver import android.content.Context @@ -7,9 +7,7 @@ import android.provider.Telephony import android.telephony.SmsMessage -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ + /** * - : RecyclerView.Adapter() { override fun getItemCount() = Int.MAX_VALUE diff --git a/recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerHorizontalItemHeaderDecoration.kt b/recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerHorizontalItemHeaderDecoration.kt similarity index 97% rename from recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerHorizontalItemHeaderDecoration.kt rename to recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerHorizontalItemHeaderDecoration.kt index ac09f343a..31ec3e2c1 100644 --- a/recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerHorizontalItemHeaderDecoration.kt +++ b/recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerHorizontalItemHeaderDecoration.kt @@ -1,4 +1,4 @@ -package com.crazylegend.recyclerview +package com.funkymuse.recyclerview import android.graphics.Canvas import android.view.LayoutInflater @@ -8,7 +8,6 @@ import androidx.recyclerview.widget.RecyclerView import com.google.android.material.textview.MaterialTextView /** - * Created by funkymuse, date 10/21/21 * /* USAGE val sectionItemDecoration = RecyclerSectionItemDecoration(R.id.list_item_section_text, R.layout.section_header object : RecyclerSectionItemDecoration.SectionCallback { diff --git a/recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerSectionItemDecoration.kt b/recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerSectionItemDecoration.kt similarity index 97% rename from recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerSectionItemDecoration.kt rename to recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerSectionItemDecoration.kt index 71f898b71..2beb40a9c 100644 --- a/recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerSectionItemDecoration.kt +++ b/recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerSectionItemDecoration.kt @@ -1,4 +1,4 @@ -package com.crazylegend.recyclerview +package com.funkymuse.recyclerview import android.graphics.Canvas import android.view.LayoutInflater @@ -9,9 +9,7 @@ import com.google.android.material.textview.MaterialTextView import kotlin.math.max -/** - * Created by Hristijan on 2/1/19 to long live and prosper ! - */ + /** * diff --git a/recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerSwipe.kt b/recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerSwipe.kt similarity index 97% rename from recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerSwipe.kt rename to recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerSwipe.kt index 3449241c0..1d1328102 100644 --- a/recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerSwipe.kt +++ b/recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerSwipe.kt @@ -1,16 +1,16 @@ -package com.crazylegend.recyclerview +package com.funkymuse.recyclerview import android.content.Context -import android.graphics.* +import android.graphics.Bitmap +import android.graphics.BitmapFactory +import android.graphics.Canvas +import android.graphics.Paint +import android.graphics.RectF import androidx.core.content.ContextCompat import androidx.recyclerview.widget.ItemTouchHelper import androidx.recyclerview.widget.RecyclerView -/** - * Created by crazy on 1/30/20 to long live and prosper ! - */ - data class RecyclerSwipeItemHandler(var drawableLeft: Int? = null, var drawLeftBackground: Boolean = false, var leftBackgroundColor: Int? = null, diff --git a/recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerViewDrag.kt b/recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerViewDrag.kt similarity index 94% rename from recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerViewDrag.kt rename to recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerViewDrag.kt index 980960e32..9c9d660dc 100644 --- a/recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerViewDrag.kt +++ b/recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerViewDrag.kt @@ -1,13 +1,8 @@ -package com.crazylegend.recyclerview +package com.funkymuse.recyclerview import androidx.recyclerview.widget.ItemTouchHelper import androidx.recyclerview.widget.RecyclerView -import java.util.* - - -/** - * Created by crazy on 2/3/20 to long live and prosper ! - */ +import java.util.Collections /** * Don't forget to call [ItemTouchHelper.attachToRecyclerView] on this since it returns [ItemTouchHelper] diff --git a/recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerViewExtensions.kt b/recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerViewExtensions.kt similarity index 98% rename from recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerViewExtensions.kt rename to recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerViewExtensions.kt index 75db80178..e22e0d765 100644 --- a/recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerViewExtensions.kt +++ b/recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerViewExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.recyclerview +package com.funkymuse.recyclerview import android.animation.ObjectAnimator import android.annotation.SuppressLint @@ -16,16 +16,18 @@ import androidx.annotation.DimenRes import androidx.core.animation.doOnEnd import androidx.core.content.ContextCompat import androidx.core.view.ViewCompat -import androidx.recyclerview.widget.* +import androidx.recyclerview.widget.DividerItemDecoration +import androidx.recyclerview.widget.GridLayoutManager +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.LinearSmoothScroller +import androidx.recyclerview.widget.PagerSnapHelper +import androidx.recyclerview.widget.RecyclerView +import androidx.recyclerview.widget.SnapHelper +import androidx.recyclerview.widget.StaggeredGridLayoutManager import com.google.android.material.appbar.AppBarLayout import com.google.android.material.snackbar.Snackbar -/** - * Created by hristijan on 3/4/19 to long live and prosper ! - */ - - val RecyclerView.Adapter.isEmpty: Boolean where VH : RecyclerView.ViewHolder get() = itemCount == 0 diff --git a/recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerViewExtensions2.kt b/recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerViewExtensions2.kt similarity index 97% rename from recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerViewExtensions2.kt rename to recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerViewExtensions2.kt index 89203e775..6e27d4121 100644 --- a/recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerViewExtensions2.kt +++ b/recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerViewExtensions2.kt @@ -1,4 +1,4 @@ -package com.crazylegend.recyclerview +package com.funkymuse.recyclerview import android.graphics.Color import android.os.Build @@ -11,11 +11,6 @@ import androidx.recyclerview.widget.RecyclerView import androidx.transition.Transition import androidx.transition.TransitionManager - -/** - * Created by hristijan on 1/17/21 to long live and prosper ! - */ - inline fun RecyclerView.hideOnScroll(threshold: Int = 20, crossinline hide: () -> Unit = {}, crossinline show: () -> Unit = {}) { diff --git a/recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerViewGenerator.kt b/recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerViewGenerator.kt similarity index 96% rename from recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerViewGenerator.kt rename to recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerViewGenerator.kt index d495f3630..78e19ff3a 100644 --- a/recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerViewGenerator.kt +++ b/recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerViewGenerator.kt @@ -1,16 +1,10 @@ -package com.crazylegend.recyclerview +package com.funkymuse.recyclerview import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import androidx.viewbinding.ViewBinding - -/** - * Created by crazy on 3/9/20 to long live and prosper ! - */ - - inline fun generateRecycler( noinline viewHolder: (binding: VB) -> VH, noinline bindingInflater: (LayoutInflater, ViewGroup, Boolean) -> VB, diff --git a/recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerViewUtils.kt b/recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerViewUtils.kt similarity index 97% rename from recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerViewUtils.kt rename to recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerViewUtils.kt index e03c1c247..ee7942ef4 100644 --- a/recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerViewUtils.kt +++ b/recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerViewUtils.kt @@ -1,4 +1,4 @@ -package com.crazylegend.recyclerview +package com.funkymuse.recyclerview import android.content.Context import android.util.SparseBooleanArray @@ -8,13 +8,8 @@ import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import com.google.android.material.snackbar.Snackbar -import java.util.* -/** - * Created by Hristijan on 2/1/19 to long live and prosper ! - */ - class RecyclerViewUtils { var selectedPosition = -1 diff --git a/recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerViewUtilsActionMode.kt b/recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerViewUtilsActionMode.kt similarity index 98% rename from recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerViewUtilsActionMode.kt rename to recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerViewUtilsActionMode.kt index 79574722d..a9fcc3401 100644 --- a/recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerViewUtilsActionMode.kt +++ b/recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerViewUtilsActionMode.kt @@ -1,4 +1,4 @@ -package com.crazylegend.recyclerview +package com.funkymuse.recyclerview import android.content.Context import android.util.SparseBooleanArray @@ -9,9 +9,7 @@ import androidx.appcompat.view.ActionMode import androidx.recyclerview.widget.RecyclerView -/** - * Created by Hristijan on 2/1/19 to long live and prosper ! - */ + class RecyclerViewUtilsActionMode { diff --git a/recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerViewWithHolderGenerator.kt b/recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerViewWithHolderGenerator.kt similarity index 96% rename from recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerViewWithHolderGenerator.kt rename to recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerViewWithHolderGenerator.kt index 46d931cd9..47e997725 100644 --- a/recyclerview/src/main/java/com/crazylegend/recyclerview/RecyclerViewWithHolderGenerator.kt +++ b/recyclerview/src/main/java/com/funkymuse/recyclerview/RecyclerViewWithHolderGenerator.kt @@ -1,4 +1,4 @@ -package com.crazylegend.recyclerview +package com.funkymuse.recyclerview import android.content.Context import android.view.LayoutInflater @@ -6,12 +6,6 @@ import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import androidx.viewbinding.ViewBinding - -/** - * Created by crazy on 3/9/20 to long live and prosper ! - */ - - inline fun generateRecyclerWithHolder( noinline bindingInflater: (LayoutInflater, ViewGroup, Boolean) -> VB, noinline areItemsTheSameCallback: (old: T, new: T) -> Boolean? = { _, _ -> null }, diff --git a/recyclerview/src/main/java/com/crazylegend/recyclerview/ScrollStateHolder.kt b/recyclerview/src/main/java/com/funkymuse/recyclerview/ScrollStateHolder.kt similarity index 98% rename from recyclerview/src/main/java/com/crazylegend/recyclerview/ScrollStateHolder.kt rename to recyclerview/src/main/java/com/funkymuse/recyclerview/ScrollStateHolder.kt index 02cb52d73..d78aafff8 100644 --- a/recyclerview/src/main/java/com/crazylegend/recyclerview/ScrollStateHolder.kt +++ b/recyclerview/src/main/java/com/funkymuse/recyclerview/ScrollStateHolder.kt @@ -1,4 +1,4 @@ -package com.crazylegend.recyclerview +package com.funkymuse.recyclerview import android.os.Bundle import android.os.Parcelable @@ -136,7 +136,7 @@ class ScrollStateHolder(savedInstanceState: Bundle? = null) { /* -inside the parent adapter and the recycler must use com.crazylegend.recyclerview.OrientationAwareRecyclerView +inside the parent adapter and the recycler must use com.funkymuse.recyclerview.OrientationAwareRecyclerView override fun onViewRecycled(holder: AdventuresParentViewHolder) { diff --git a/recyclerview/src/main/java/com/crazylegend/recyclerview/SpaceDecoration.kt b/recyclerview/src/main/java/com/funkymuse/recyclerview/SpaceDecoration.kt similarity index 87% rename from recyclerview/src/main/java/com/crazylegend/recyclerview/SpaceDecoration.kt rename to recyclerview/src/main/java/com/funkymuse/recyclerview/SpaceDecoration.kt index 65971fd8f..412698af8 100644 --- a/recyclerview/src/main/java/com/crazylegend/recyclerview/SpaceDecoration.kt +++ b/recyclerview/src/main/java/com/funkymuse/recyclerview/SpaceDecoration.kt @@ -1,13 +1,10 @@ -package com.crazylegend.recyclerview +package com.funkymuse.recyclerview import android.graphics.Rect import android.view.View import androidx.recyclerview.widget.RecyclerView -/** - * Created by crazy on 11/12/19 to long live and prosper ! - */ /** ItemDecoration that adds space around items. */ class SpaceDecoration( private val start: Int = 0, diff --git a/recyclerview/src/main/java/com/crazylegend/recyclerview/decorations/GridItemDecoration.kt b/recyclerview/src/main/java/com/funkymuse/recyclerview/decorations/GridItemDecoration.kt similarity index 95% rename from recyclerview/src/main/java/com/crazylegend/recyclerview/decorations/GridItemDecoration.kt rename to recyclerview/src/main/java/com/funkymuse/recyclerview/decorations/GridItemDecoration.kt index 31a0f3fba..b3d558f31 100644 --- a/recyclerview/src/main/java/com/crazylegend/recyclerview/decorations/GridItemDecoration.kt +++ b/recyclerview/src/main/java/com/funkymuse/recyclerview/decorations/GridItemDecoration.kt @@ -1,13 +1,11 @@ -package com.crazylegend.recyclerview.decorations +package com.funkymuse.recyclerview.decorations import android.graphics.Rect import android.view.View import androidx.recyclerview.widget.RecyclerView -/** - * Created by hristijan on 3/4/19 to long live and prosper ! - */ + open class GridItemDecoration : RecyclerView.ItemDecoration() { var gridSpacingPx: Int = 0 var gridSize: Int = 0 diff --git a/recyclerview/src/main/java/com/crazylegend/recyclerview/decorations/LandScapeGridItemDecoration.kt b/recyclerview/src/main/java/com/funkymuse/recyclerview/decorations/LandScapeGridItemDecoration.kt similarity index 74% rename from recyclerview/src/main/java/com/crazylegend/recyclerview/decorations/LandScapeGridItemDecoration.kt rename to recyclerview/src/main/java/com/funkymuse/recyclerview/decorations/LandScapeGridItemDecoration.kt index 0a9836fbd..6e10e26c7 100644 --- a/recyclerview/src/main/java/com/crazylegend/recyclerview/decorations/LandScapeGridItemDecoration.kt +++ b/recyclerview/src/main/java/com/funkymuse/recyclerview/decorations/LandScapeGridItemDecoration.kt @@ -1,13 +1,11 @@ -package com.crazylegend.recyclerview.decorations +package com.funkymuse.recyclerview.decorations import android.graphics.Rect import android.view.View import androidx.recyclerview.widget.RecyclerView -/** - * Created by hristijan on 3/4/19 to long live and prosper ! - */ + class LandScapeGridItemDecoration : GridItemDecoration() { override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State) { diff --git a/recyclerview/src/main/java/com/crazylegend/recyclerview/decorations/PortraitGridItemDecoration.kt b/recyclerview/src/main/java/com/funkymuse/recyclerview/decorations/PortraitGridItemDecoration.kt similarity index 74% rename from recyclerview/src/main/java/com/crazylegend/recyclerview/decorations/PortraitGridItemDecoration.kt rename to recyclerview/src/main/java/com/funkymuse/recyclerview/decorations/PortraitGridItemDecoration.kt index 34e4cde83..38d08e58f 100644 --- a/recyclerview/src/main/java/com/crazylegend/recyclerview/decorations/PortraitGridItemDecoration.kt +++ b/recyclerview/src/main/java/com/funkymuse/recyclerview/decorations/PortraitGridItemDecoration.kt @@ -1,13 +1,11 @@ -package com.crazylegend.recyclerview.decorations +package com.funkymuse.recyclerview.decorations import android.graphics.Rect import android.view.View import androidx.recyclerview.widget.RecyclerView -/** - * Created by hristijan on 3/4/19 to long live and prosper ! - */ + class PortraitGridItemDecoration : GridItemDecoration() { override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State) { diff --git a/recyclerview/src/main/java/com/crazylegend/recyclerview/decorations/SpaceDecoration.kt b/recyclerview/src/main/java/com/funkymuse/recyclerview/decorations/SpaceDecoration.kt similarity index 95% rename from recyclerview/src/main/java/com/crazylegend/recyclerview/decorations/SpaceDecoration.kt rename to recyclerview/src/main/java/com/funkymuse/recyclerview/decorations/SpaceDecoration.kt index 118d6f7ec..fa549e03c 100644 --- a/recyclerview/src/main/java/com/crazylegend/recyclerview/decorations/SpaceDecoration.kt +++ b/recyclerview/src/main/java/com/funkymuse/recyclerview/decorations/SpaceDecoration.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.crazylegend.recyclerview.decorations +package com.funkymuse.recyclerview.decorations import android.graphics.Rect import android.view.View diff --git a/recyclerview/src/main/java/com/crazylegend/recyclerview/layoutManagers/ZoomLayoutManager.kt b/recyclerview/src/main/java/com/funkymuse/recyclerview/layoutManagers/ZoomLayoutManager.kt similarity index 95% rename from recyclerview/src/main/java/com/crazylegend/recyclerview/layoutManagers/ZoomLayoutManager.kt rename to recyclerview/src/main/java/com/funkymuse/recyclerview/layoutManagers/ZoomLayoutManager.kt index 92f7d39d8..5c088c4c2 100644 --- a/recyclerview/src/main/java/com/crazylegend/recyclerview/layoutManagers/ZoomLayoutManager.kt +++ b/recyclerview/src/main/java/com/funkymuse/recyclerview/layoutManagers/ZoomLayoutManager.kt @@ -1,4 +1,4 @@ -package com.crazylegend.recyclerview.layoutManagers +package com.funkymuse.recyclerview.layoutManagers import android.content.Context import androidx.recyclerview.widget.LinearLayoutManager @@ -6,9 +6,6 @@ import androidx.recyclerview.widget.RecyclerView import kotlin.math.abs -/** - * Created by crazy on 1/5/20 to long live and prosper ! - */ class ZoomLayoutManager : LinearLayoutManager { private val shrinkAmount = 0.15f diff --git a/recyclerview/src/main/java/com/crazylegend/recyclerview/utils/GridEntrust.kt b/recyclerview/src/main/java/com/funkymuse/recyclerview/utils/GridEntrust.kt similarity index 97% rename from recyclerview/src/main/java/com/crazylegend/recyclerview/utils/GridEntrust.kt rename to recyclerview/src/main/java/com/funkymuse/recyclerview/utils/GridEntrust.kt index fdde6b0f8..33e0bc856 100644 --- a/recyclerview/src/main/java/com/crazylegend/recyclerview/utils/GridEntrust.kt +++ b/recyclerview/src/main/java/com/funkymuse/recyclerview/utils/GridEntrust.kt @@ -1,4 +1,4 @@ -package com.crazylegend.recyclerview.utils +package com.funkymuse.recyclerview.utils import android.graphics.Canvas import android.graphics.Rect @@ -7,9 +7,7 @@ import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.RecyclerView -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ + class GridEntrust(leftRight: Int, topBottom: Int, mColor: Int) : SpacesItemDecorationEntrust(leftRight, topBottom, mColor) { diff --git a/recyclerview/src/main/java/com/crazylegend/recyclerview/utils/GridSpacingItemDecoration.kt b/recyclerview/src/main/java/com/funkymuse/recyclerview/utils/GridSpacingItemDecoration.kt similarity index 92% rename from recyclerview/src/main/java/com/crazylegend/recyclerview/utils/GridSpacingItemDecoration.kt rename to recyclerview/src/main/java/com/funkymuse/recyclerview/utils/GridSpacingItemDecoration.kt index 372fba1d2..2e3f3900b 100644 --- a/recyclerview/src/main/java/com/crazylegend/recyclerview/utils/GridSpacingItemDecoration.kt +++ b/recyclerview/src/main/java/com/funkymuse/recyclerview/utils/GridSpacingItemDecoration.kt @@ -1,4 +1,4 @@ -package com.crazylegend.recyclerview.utils +package com.funkymuse.recyclerview.utils import android.graphics.Rect import android.view.View @@ -6,9 +6,7 @@ import android.view.View import androidx.recyclerview.widget.RecyclerView -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ + class GridSpacingItemDecoration( private val spanCount: Int, diff --git a/recyclerview/src/main/java/com/crazylegend/recyclerview/utils/LinearEntrust.kt b/recyclerview/src/main/java/com/funkymuse/recyclerview/utils/LinearEntrust.kt similarity index 96% rename from recyclerview/src/main/java/com/crazylegend/recyclerview/utils/LinearEntrust.kt rename to recyclerview/src/main/java/com/funkymuse/recyclerview/utils/LinearEntrust.kt index 1e2cde57c..531a0a6a9 100644 --- a/recyclerview/src/main/java/com/crazylegend/recyclerview/utils/LinearEntrust.kt +++ b/recyclerview/src/main/java/com/funkymuse/recyclerview/utils/LinearEntrust.kt @@ -1,4 +1,4 @@ -package com.crazylegend.recyclerview.utils +package com.funkymuse.recyclerview.utils import android.graphics.Canvas import android.graphics.Rect @@ -8,9 +8,7 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ + class LinearEntrust(leftRight: Int, topBottom: Int, mColor: Int) : SpacesItemDecorationEntrust(leftRight, topBottom, mColor) { diff --git a/recyclerview/src/main/java/com/crazylegend/recyclerview/utils/SpacesItemDecoration.kt b/recyclerview/src/main/java/com/funkymuse/recyclerview/utils/SpacesItemDecoration.kt similarity index 92% rename from recyclerview/src/main/java/com/crazylegend/recyclerview/utils/SpacesItemDecoration.kt rename to recyclerview/src/main/java/com/funkymuse/recyclerview/utils/SpacesItemDecoration.kt index 4b59faf8a..451ee88b4 100644 --- a/recyclerview/src/main/java/com/crazylegend/recyclerview/utils/SpacesItemDecoration.kt +++ b/recyclerview/src/main/java/com/funkymuse/recyclerview/utils/SpacesItemDecoration.kt @@ -1,4 +1,4 @@ -package com.crazylegend.recyclerview.utils +package com.funkymuse.recyclerview.utils import android.graphics.Canvas import android.graphics.Rect @@ -7,9 +7,7 @@ import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.RecyclerView -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ + class SpacesItemDecoration(private val leftRight: Int, private val topBottom: Int) : RecyclerView.ItemDecoration() { diff --git a/recyclerview/src/main/java/com/crazylegend/recyclerview/utils/SpacesItemDecorationEntrust.kt b/recyclerview/src/main/java/com/funkymuse/recyclerview/utils/SpacesItemDecorationEntrust.kt similarity index 86% rename from recyclerview/src/main/java/com/crazylegend/recyclerview/utils/SpacesItemDecorationEntrust.kt rename to recyclerview/src/main/java/com/funkymuse/recyclerview/utils/SpacesItemDecorationEntrust.kt index 9fd17d8ab..d6226a524 100644 --- a/recyclerview/src/main/java/com/crazylegend/recyclerview/utils/SpacesItemDecorationEntrust.kt +++ b/recyclerview/src/main/java/com/funkymuse/recyclerview/utils/SpacesItemDecorationEntrust.kt @@ -1,4 +1,4 @@ -package com.crazylegend.recyclerview.utils +package com.funkymuse.recyclerview.utils import android.graphics.Canvas import android.graphics.Rect @@ -8,9 +8,7 @@ import android.view.View import androidx.recyclerview.widget.RecyclerView -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ + abstract class SpacesItemDecorationEntrust(protected var leftRight: Int, protected var topBottom: Int, mColor: Int) { diff --git a/reflection/build.gradle b/reflection/build.gradle deleted file mode 100644 index 03f1273e4..000000000 --- a/reflection/build.gradle +++ /dev/null @@ -1,7 +0,0 @@ -dependencies { - implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" -} - -android { - namespace 'com.crazylegend.reflection' -} \ No newline at end of file diff --git a/reflection/build.gradle.kts b/reflection/build.gradle.kts new file mode 100644 index 000000000..23739de0d --- /dev/null +++ b/reflection/build.gradle.kts @@ -0,0 +1,7 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(libs.kotlin.reflect) +} \ No newline at end of file diff --git a/reflection/src/main/java/com/crazylegend/reflection/ReflectionUtils.kt b/reflection/src/main/java/com/funkymuse/reflection/ReflectionUtils.kt similarity index 99% rename from reflection/src/main/java/com/crazylegend/reflection/ReflectionUtils.kt rename to reflection/src/main/java/com/funkymuse/reflection/ReflectionUtils.kt index 5c63e17c1..f6ed961de 100644 --- a/reflection/src/main/java/com/crazylegend/reflection/ReflectionUtils.kt +++ b/reflection/src/main/java/com/funkymuse/reflection/ReflectionUtils.kt @@ -1,4 +1,4 @@ -package com.crazylegend.reflection +package com.funkymuse.reflection import android.annotation.SuppressLint import java.lang.reflect.* @@ -11,9 +11,7 @@ import kotlin.reflect.jvm.isAccessible import kotlin.reflect.jvm.kotlinProperty -/** - * Created by hristijan on 6/7/19 to long live and prosper ! - */ + /** diff --git a/regex/build.gradle b/regex/build.gradle deleted file mode 100644 index e69de29bb..000000000 diff --git a/regex/build.gradle.kts b/regex/build.gradle.kts new file mode 100644 index 000000000..58e507a44 --- /dev/null +++ b/regex/build.gradle.kts @@ -0,0 +1,4 @@ +plugins { + id(libs.plugins.convention.kotlin.library.get().pluginId) +} + diff --git a/regex/src/main/java/com/crazylegend/regex/RegexConstants.kt b/regex/src/main/java/com/funkymuse/regex/RegexConstants.kt similarity index 96% rename from regex/src/main/java/com/crazylegend/regex/RegexConstants.kt rename to regex/src/main/java/com/funkymuse/regex/RegexConstants.kt index de5e5cf5d..8c321f524 100644 --- a/regex/src/main/java/com/crazylegend/regex/RegexConstants.kt +++ b/regex/src/main/java/com/funkymuse/regex/RegexConstants.kt @@ -1,10 +1,6 @@ -package com.crazylegend.regex +package com.funkymuse.regex -/** - * Created by hristijan on 3/7/19 to long live and prosper ! - */ - /** * Regex for names */ diff --git a/regex/src/main/java/com/crazylegend/regex/RegexExtensions.kt b/regex/src/main/java/com/funkymuse/regex/RegexExtensions.kt similarity index 89% rename from regex/src/main/java/com/crazylegend/regex/RegexExtensions.kt rename to regex/src/main/java/com/funkymuse/regex/RegexExtensions.kt index 2f52ddb4d..d8a2fbb4c 100644 --- a/regex/src/main/java/com/crazylegend/regex/RegexExtensions.kt +++ b/regex/src/main/java/com/funkymuse/regex/RegexExtensions.kt @@ -1,9 +1,4 @@ -package com.crazylegend.regex - - -/** - * Created by hristijan on 3/7/19 to long live and prosper ! - */ +package com.funkymuse.regex inline val CharSequence?.isMobileSimple: Boolean get() { diff --git a/resources/build.gradle b/resources/build.gradle deleted file mode 100644 index 7bf26c238..000000000 --- a/resources/build.gradle +++ /dev/null @@ -1,10 +0,0 @@ -dependencies { - implementation "androidx.core:core-ktx:$coreKTX" - implementation "androidx.appcompat:appcompat:$appCompat" - implementation project(path: ':common') - -} - -android { - namespace 'com.crazylegend.resources' -} \ No newline at end of file diff --git a/resources/build.gradle.kts b/resources/build.gradle.kts new file mode 100644 index 000000000..abb543958 --- /dev/null +++ b/resources/build.gradle.kts @@ -0,0 +1,9 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.appcompat) + implementation(projects.common) +} \ No newline at end of file diff --git a/resources/src/main/AndroidManifest.xml b/resources/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/resources/src/main/AndroidManifest.xml +++ b/resources/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/resources/src/main/java/com/crazylegend/resources/ContextResourceGetter.kt b/resources/src/main/java/com/funkymuse/resources/ContextResourceGetter.kt similarity index 86% rename from resources/src/main/java/com/crazylegend/resources/ContextResourceGetter.kt rename to resources/src/main/java/com/funkymuse/resources/ContextResourceGetter.kt index 81446cdd7..d28f08fd9 100644 --- a/resources/src/main/java/com/crazylegend/resources/ContextResourceGetter.kt +++ b/resources/src/main/java/com/funkymuse/resources/ContextResourceGetter.kt @@ -1,4 +1,4 @@ -package com.crazylegend.resources +package com.funkymuse.resources import android.content.Context import android.graphics.drawable.Drawable @@ -7,9 +7,7 @@ import androidx.annotation.DrawableRes import androidx.appcompat.content.res.AppCompatResources import androidx.core.content.ContextCompat -/** - * Created by funkymuse on 5/26/21 to long live and prosper ! - */ + /** diff --git a/resources/src/main/java/com/crazylegend/resources/ResourcesExtensions.kt b/resources/src/main/java/com/funkymuse/resources/ResourcesExtensions.kt similarity index 90% rename from resources/src/main/java/com/crazylegend/resources/ResourcesExtensions.kt rename to resources/src/main/java/com/funkymuse/resources/ResourcesExtensions.kt index 2df8cd04b..58eba7018 100644 --- a/resources/src/main/java/com/crazylegend/resources/ResourcesExtensions.kt +++ b/resources/src/main/java/com/funkymuse/resources/ResourcesExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.resources +package com.funkymuse.resources import android.content.Context import android.content.res.Resources @@ -11,13 +11,7 @@ import androidx.annotation.PluralsRes import androidx.annotation.StringRes import androidx.annotation.StyleableRes import androidx.appcompat.content.res.AppCompatResources -import com.crazylegend.common.string.toHtmlSpan - - -/** - * Created by crazy on 11/12/19 to long live and prosper ! - */ - +import com.funkymuse.common.string.toHtmlSpan /** * Alternative to Resources.getDimension() for values that are TYPE_FLOAT. diff --git a/retrofit/build.gradle b/retrofit/build.gradle deleted file mode 100644 index 877b72417..000000000 --- a/retrofit/build.gradle +++ /dev/null @@ -1,14 +0,0 @@ -dependencies { - implementation project(path: ':common') - implementation project(path: ':coroutines') - implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:$lifecycle" - - //retrofit - api "com.squareup.retrofit2:retrofit:$retrofit" - api "com.squareup.okhttp3:logging-interceptor:$okHttp" - -} - -android { - namespace 'com.crazylegend.retrofit' -} \ No newline at end of file diff --git a/retrofit/build.gradle.kts b/retrofit/build.gradle.kts new file mode 100644 index 000000000..181f05db0 --- /dev/null +++ b/retrofit/build.gradle.kts @@ -0,0 +1,15 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(projects.common) + implementation(projects.coroutines) + implementation(libs.androidx.lifecycle.lifecycle.viewmodel.savedstate) + + //retrofit + api(libs.retrofit) + api(libs.logging.interceptor) + + testImplementation(libs.bundles.unit.test) +} \ No newline at end of file diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/RetrofitExtensions.kt b/retrofit/src/main/java/com/funkymuse/retrofit/RetrofitExtensions.kt similarity index 77% rename from retrofit/src/main/java/com/crazylegend/retrofit/RetrofitExtensions.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/RetrofitExtensions.kt index 21350bd5f..def0a714e 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/RetrofitExtensions.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/RetrofitExtensions.kt @@ -1,14 +1,10 @@ -package com.crazylegend.retrofit +package com.funkymuse.retrofit import okhttp3.Interceptor import okhttp3.Request import okhttp3.Response -/** - * Created by hristijan on 10/21/19 to long live and prosper ! - */ - fun Interceptor.Chain.proceedRequest(): Response = proceed(request().newBuilder().build()) diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/RetrofitUtils.kt b/retrofit/src/main/java/com/funkymuse/retrofit/RetrofitUtils.kt similarity index 98% rename from retrofit/src/main/java/com/crazylegend/retrofit/RetrofitUtils.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/RetrofitUtils.kt index 83983774f..a55f7bf69 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/RetrofitUtils.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/RetrofitUtils.kt @@ -1,9 +1,9 @@ -package com.crazylegend.retrofit +package com.funkymuse.retrofit import android.annotation.SuppressLint import android.content.Context import android.util.ArrayMap -import com.crazylegend.retrofit.progressInterceptor.OnAttachmentDownloadListener +import com.funkymuse.retrofit.progressInterceptor.OnAttachmentDownloadListener import okhttp3.Cache import okhttp3.MediaType.Companion.toMediaType import okhttp3.MultipartBody @@ -23,11 +23,6 @@ import javax.net.ssl.X509TrustManager import kotlin.random.Random -/** - * Created by Hristijan on 1/25/19 to long live and prosper ! - */ - - inline val randomPhotoIndex: Int get() = Random.nextInt(0, Int.MAX_VALUE) diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/adapter/ApiResultAdapter.kt b/retrofit/src/main/java/com/funkymuse/retrofit/adapter/ApiResultAdapter.kt similarity index 66% rename from retrofit/src/main/java/com/crazylegend/retrofit/adapter/ApiResultAdapter.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/adapter/ApiResultAdapter.kt index e72dcecab..cd5e883c1 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/adapter/ApiResultAdapter.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/adapter/ApiResultAdapter.kt @@ -1,14 +1,10 @@ -package com.crazylegend.retrofit.adapter +package com.funkymuse.retrofit.adapter -import com.crazylegend.retrofit.apiresult.ApiResult +import com.funkymuse.retrofit.apiresult.ApiResult import retrofit2.Call import retrofit2.CallAdapter import java.lang.reflect.Type -/** - * Created by crazy on 1/6/21 to long live and prosper ! - */ - internal class ApiResultAdapter(private val type: Type) : CallAdapter>> { override fun responseType(): Type = type diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/adapter/ApiResultAdapterFactory.kt b/retrofit/src/main/java/com/funkymuse/retrofit/adapter/ApiResultAdapterFactory.kt similarity index 83% rename from retrofit/src/main/java/com/crazylegend/retrofit/adapter/ApiResultAdapterFactory.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/adapter/ApiResultAdapterFactory.kt index df7bb63f8..78aa568e8 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/adapter/ApiResultAdapterFactory.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/adapter/ApiResultAdapterFactory.kt @@ -1,15 +1,13 @@ -package com.crazylegend.retrofit.adapter +package com.funkymuse.retrofit.adapter -import com.crazylegend.retrofit.apiresult.ApiResult +import com.funkymuse.retrofit.apiresult.ApiResult import retrofit2.Call import retrofit2.CallAdapter import retrofit2.Retrofit import java.lang.reflect.ParameterizedType import java.lang.reflect.Type -/** - * Created by crazy on 1/7/21 to long live and prosper ! - */ + class ApiResultAdapterFactory : CallAdapter.Factory() { override fun get(returnType: Type, annotations: Array, retrofit: Retrofit): CallAdapter<*, *>? = when (getRawType(returnType)) { Call::class.java -> { diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/adapter/ApiResultCall.kt b/retrofit/src/main/java/com/funkymuse/retrofit/adapter/ApiResultCall.kt similarity index 82% rename from retrofit/src/main/java/com/crazylegend/retrofit/adapter/ApiResultCall.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/adapter/ApiResultCall.kt index 10332f6f2..d4134bc7e 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/adapter/ApiResultCall.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/adapter/ApiResultCall.kt @@ -1,7 +1,7 @@ -package com.crazylegend.retrofit.adapter +package com.funkymuse.retrofit.adapter -import com.crazylegend.retrofit.apiresult.ApiResult -import com.crazylegend.retrofit.apiresult.apiResultSubscribe +import com.funkymuse.retrofit.apiresult.ApiResult +import com.funkymuse.retrofit.apiresult.apiResultSubscribe import retrofit2.Call import retrofit2.Callback import retrofit2.Response diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/adapter/ResultCallDelegate.kt b/retrofit/src/main/java/com/funkymuse/retrofit/adapter/ResultCallDelegate.kt similarity index 95% rename from retrofit/src/main/java/com/crazylegend/retrofit/adapter/ResultCallDelegate.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/adapter/ResultCallDelegate.kt index d64a2e9c9..5abbde0e4 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/adapter/ResultCallDelegate.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/adapter/ResultCallDelegate.kt @@ -1,4 +1,4 @@ -package com.crazylegend.retrofit.adapter +package com.funkymuse.retrofit.adapter import okhttp3.Request import okio.Timeout diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/apiresult/ApiResult.kt b/retrofit/src/main/java/com/funkymuse/retrofit/apiresult/ApiResult.kt similarity index 88% rename from retrofit/src/main/java/com/crazylegend/retrofit/apiresult/ApiResult.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/apiresult/ApiResult.kt index 311acf68e..28fd6efb3 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/apiresult/ApiResult.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/apiresult/ApiResult.kt @@ -1,10 +1,9 @@ -package com.crazylegend.retrofit.apiresult +package com.funkymuse.retrofit.apiresult import okhttp3.ResponseBody /** - * Created by CrazyLegenD on 2/8/19 to long live and prosper ! * man this aged well */ sealed class ApiResult { diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/apiresult/ApiResultExtensions.kt b/retrofit/src/main/java/com/funkymuse/retrofit/apiresult/ApiResultExtensions.kt similarity index 97% rename from retrofit/src/main/java/com/crazylegend/retrofit/apiresult/ApiResultExtensions.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/apiresult/ApiResultExtensions.kt index 2f1330a01..4dfe5cb69 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/apiresult/ApiResultExtensions.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/apiresult/ApiResultExtensions.kt @@ -1,12 +1,10 @@ -package com.crazylegend.retrofit.apiresult +package com.funkymuse.retrofit.apiresult import okhttp3.ResponseBody import retrofit2.Response -/** - * Created by crazy on 6/15/20 to long live and prosper ! - */ + fun apiCallError(throwable: Throwable) = ApiResult.Error(throwable) fun apiError(code: Int, errorBody: ResponseBody?) = ApiResult.ApiError(code, errorBody) diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/BasicAuthInterceptor.kt b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/BasicAuthInterceptor.kt similarity index 82% rename from retrofit/src/main/java/com/crazylegend/retrofit/interceptors/BasicAuthInterceptor.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/interceptors/BasicAuthInterceptor.kt index 01741f7fd..53dbc358d 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/BasicAuthInterceptor.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/BasicAuthInterceptor.kt @@ -1,15 +1,10 @@ -package com.crazylegend.retrofit.interceptors +package com.funkymuse.retrofit.interceptors import okhttp3.Credentials import okhttp3.Interceptor import okhttp3.Response import java.io.IOException - -/** - * Created by hristijan on 8/23/19 to long live and prosper ! - */ - class BasicAuthInterceptor(user: String, password: String) : Interceptor { @Throws(IOException::class) diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/BearerAuthenticator.kt b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/BearerAuthenticator.kt similarity index 74% rename from retrofit/src/main/java/com/crazylegend/retrofit/interceptors/BearerAuthenticator.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/interceptors/BearerAuthenticator.kt index f7fadb991..665804e2d 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/BearerAuthenticator.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/BearerAuthenticator.kt @@ -1,14 +1,10 @@ -package com.crazylegend.retrofit.interceptors +package com.funkymuse.retrofit.interceptors -import com.crazylegend.retrofit.throwables.NoConnectionException +import com.funkymuse.retrofit.throwables.NoConnectionException import okhttp3.Interceptor import okhttp3.Response import java.io.IOException - -/** - * Created by hristijan on 8/23/19 to long live and prosper ! - */ class BearerAuthenticator(private val token: String, private val abbreviation: String = "Bearer") : Interceptor { @Throws(NoConnectionException::class, IOException::class) diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/BearerAuthenticatorFromProvider.kt b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/BearerAuthenticatorFromProvider.kt similarity index 75% rename from retrofit/src/main/java/com/crazylegend/retrofit/interceptors/BearerAuthenticatorFromProvider.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/interceptors/BearerAuthenticatorFromProvider.kt index 49ce684e0..8054994ed 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/BearerAuthenticatorFromProvider.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/BearerAuthenticatorFromProvider.kt @@ -1,14 +1,12 @@ -package com.crazylegend.retrofit.interceptors +package com.funkymuse.retrofit.interceptors -import com.crazylegend.retrofit.throwables.NoConnectionException +import com.funkymuse.retrofit.throwables.NoConnectionException import okhttp3.Interceptor import okhttp3.Response import java.io.IOException -/** - * Created by funkymuse on 11/20/21 to long live and prosper ! - */ + class BearerAuthenticatorFromProvider(private val token: () -> String, private val abbreviation: String = "Bearer") : Interceptor { @Throws(NoConnectionException::class, IOException::class) diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/ConnectivityInterceptor.kt b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/ConnectivityInterceptor.kt similarity index 68% rename from retrofit/src/main/java/com/crazylegend/retrofit/interceptors/ConnectivityInterceptor.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/interceptors/ConnectivityInterceptor.kt index f06fcd5c4..d2e92ad19 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/ConnectivityInterceptor.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/ConnectivityInterceptor.kt @@ -1,16 +1,14 @@ -package com.crazylegend.retrofit.interceptors +package com.funkymuse.retrofit.interceptors import android.content.Context -import com.crazylegend.common.isOnline -import com.crazylegend.retrofit.throwables.NoConnectionException +import com.funkymuse.common.isOnline +import com.funkymuse.retrofit.throwables.NoConnectionException import okhttp3.Interceptor import okhttp3.Response import java.io.IOException -/** - * Created by Hristijan on 1/25/19 to long live and prosper ! - */ + class ConnectivityInterceptor(private val context: Context) : Interceptor { @Throws(IOException::class) diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/ContentTypeInterceptor.kt b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/ContentTypeInterceptor.kt similarity index 75% rename from retrofit/src/main/java/com/crazylegend/retrofit/interceptors/ContentTypeInterceptor.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/interceptors/ContentTypeInterceptor.kt index fecbb4038..ed8e70ac9 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/ContentTypeInterceptor.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/ContentTypeInterceptor.kt @@ -1,11 +1,9 @@ -package com.crazylegend.retrofit.interceptors +package com.funkymuse.retrofit.interceptors import okhttp3.Interceptor import okhttp3.Response -/** - * Created by hristijan on 8/5/19 to long live and prosper ! - */ + class ContentTypeInterceptor(private val contentType: String = "application/json") : Interceptor { override fun intercept(chain: Interceptor.Chain): Response = chain diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/EmptyInterceptor.kt b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/EmptyInterceptor.kt similarity index 62% rename from retrofit/src/main/java/com/crazylegend/retrofit/interceptors/EmptyInterceptor.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/interceptors/EmptyInterceptor.kt index 1b52ea828..7e7b0f507 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/EmptyInterceptor.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/EmptyInterceptor.kt @@ -1,11 +1,9 @@ -package com.crazylegend.retrofit.interceptors +package com.funkymuse.retrofit.interceptors import okhttp3.Interceptor import okhttp3.Response -/** - * Created by hristijan on 8/5/19 to long live and prosper ! - */ + class EmptyInterceptor : Interceptor { override fun intercept(chain: Interceptor.Chain): Response = chain.proceed(chain.request()) diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/ForceCacheInterceptor.kt b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/ForceCacheInterceptor.kt similarity index 90% rename from retrofit/src/main/java/com/crazylegend/retrofit/interceptors/ForceCacheInterceptor.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/interceptors/ForceCacheInterceptor.kt index e0e2cf8d9..1acf69650 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/ForceCacheInterceptor.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/ForceCacheInterceptor.kt @@ -1,13 +1,11 @@ -package com.crazylegend.retrofit.interceptors +package com.funkymuse.retrofit.interceptors import okhttp3.CacheControl import okhttp3.Interceptor import okhttp3.Response -/** - * Created by crazy on 3/12/20 to long live and prosper ! - */ + /** * The cached response will be returned only when the Internet is available as OkHttp is designed like that. diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/GzipRequestInterceptor.kt b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/GzipRequestInterceptor.kt similarity index 94% rename from retrofit/src/main/java/com/crazylegend/retrofit/interceptors/GzipRequestInterceptor.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/interceptors/GzipRequestInterceptor.kt index c10046376..81526f110 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/GzipRequestInterceptor.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/GzipRequestInterceptor.kt @@ -1,12 +1,10 @@ -package com.crazylegend.retrofit.interceptors +package com.funkymuse.retrofit.interceptors import okhttp3.* import okio.* -/** - * Created by crazy on 3/12/20 to long live and prosper ! - */ + class GzipRequestInterceptor : Interceptor { @Throws(IOException::class) override fun intercept(chain: Interceptor.Chain): Response { diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/MockInterceptor.kt b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/MockInterceptor.kt similarity index 90% rename from retrofit/src/main/java/com/crazylegend/retrofit/interceptors/MockInterceptor.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/interceptors/MockInterceptor.kt index d7f75d39e..110e162db 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/MockInterceptor.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/MockInterceptor.kt @@ -1,4 +1,4 @@ -package com.crazylegend.retrofit.interceptors +package com.funkymuse.retrofit.interceptors import okhttp3.Interceptor import okhttp3.MediaType.Companion.toMediaType @@ -6,7 +6,6 @@ import okhttp3.Protocol import okhttp3.ResponseBody.Companion.toResponseBody /** - * Created by crazy on 1/7/21 to long live and prosper ! * Usage: * MockInterceptor( Pair("/bar", """{"foo":"baz"}""")) */ diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/NetworkCacheInterceptor.kt b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/NetworkCacheInterceptor.kt similarity index 89% rename from retrofit/src/main/java/com/crazylegend/retrofit/interceptors/NetworkCacheInterceptor.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/interceptors/NetworkCacheInterceptor.kt index 257261d03..9b5bdef0d 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/NetworkCacheInterceptor.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/NetworkCacheInterceptor.kt @@ -1,4 +1,4 @@ -package com.crazylegend.retrofit.interceptors +package com.funkymuse.retrofit.interceptors import okhttp3.CacheControl import okhttp3.Interceptor @@ -6,9 +6,7 @@ import okhttp3.Response import java.util.concurrent.TimeUnit -/** - * Created by hristijan on 10/4/19 to long live and prosper ! - */ + /** diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/RetryRequestInterceptor.kt b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/RetryRequestInterceptor.kt similarity index 86% rename from retrofit/src/main/java/com/crazylegend/retrofit/interceptors/RetryRequestInterceptor.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/interceptors/RetryRequestInterceptor.kt index b303963ad..15909fd06 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/RetryRequestInterceptor.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/RetryRequestInterceptor.kt @@ -1,4 +1,4 @@ -package com.crazylegend.retrofit.interceptors +package com.funkymuse.retrofit.interceptors import okhttp3.Interceptor import okhttp3.Response @@ -6,9 +6,7 @@ import java.io.IOException import java.util.concurrent.TimeUnit -/** - * Created by Hristijan on 1/25/19 to long live and prosper ! - */ + class RetryRequestInterceptor( private val maxTries: Int = 3, private val delayBetweenRetry: Long = TimeUnit.SECONDS.toMillis(3) diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/TooManyRequestsInterceptor.kt b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/TooManyRequestsInterceptor.kt similarity index 83% rename from retrofit/src/main/java/com/crazylegend/retrofit/interceptors/TooManyRequestsInterceptor.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/interceptors/TooManyRequestsInterceptor.kt index d81ec7878..ff5ce6887 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/TooManyRequestsInterceptor.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/TooManyRequestsInterceptor.kt @@ -1,9 +1,9 @@ -package com.crazylegend.retrofit.interceptors +package com.funkymuse.retrofit.interceptors -import com.crazylegend.retrofit.throwables.TooManyRequestsException -import java.io.IOException +import com.funkymuse.retrofit.throwables.TooManyRequestsException import okhttp3.Interceptor import okhttp3.Response +import java.io.IOException class TooManyRequestsInterceptor( private val tooManyRequestsResponseCode: Int = 429, diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/UnauthorizedInterceptor.kt b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/UnauthorizedInterceptor.kt similarity index 73% rename from retrofit/src/main/java/com/crazylegend/retrofit/interceptors/UnauthorizedInterceptor.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/interceptors/UnauthorizedInterceptor.kt index 31484b96d..e307092ea 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/UnauthorizedInterceptor.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/UnauthorizedInterceptor.kt @@ -1,15 +1,13 @@ -package com.crazylegend.retrofit.interceptors +package com.funkymuse.retrofit.interceptors -import com.crazylegend.retrofit.throwables.UnauthorizedException +import com.funkymuse.retrofit.throwables.UnauthorizedException import okhttp3.Authenticator import okhttp3.Request import okhttp3.Response import okhttp3.Route -/** - * Created by hristijan on 10/21/19 to long live and prosper ! - */ + class UnauthorizedInterceptor(private val customMessage: String? = null) : Authenticator { companion object { diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/UrlDecodedInterceptor.kt b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/UrlDecodedInterceptor.kt similarity index 92% rename from retrofit/src/main/java/com/crazylegend/retrofit/interceptors/UrlDecodedInterceptor.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/interceptors/UrlDecodedInterceptor.kt index 683ccc9f1..69949844f 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/interceptors/UrlDecodedInterceptor.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/interceptors/UrlDecodedInterceptor.kt @@ -1,4 +1,4 @@ -package com.crazylegend.retrofit.interceptors +package com.funkymuse.retrofit.interceptors import okhttp3.Interceptor import okhttp3.RequestBody @@ -7,9 +7,7 @@ import okhttp3.Response import okio.Buffer import java.io.IOException -/** - * Created by hristijan on 8/5/19 to long live and prosper ! - */ + class UrlDecodedInterceptor : Interceptor { diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/progressInterceptor/OnAttachmentDownloadListener.kt b/retrofit/src/main/java/com/funkymuse/retrofit/progressInterceptor/OnAttachmentDownloadListener.kt similarity index 86% rename from retrofit/src/main/java/com/crazylegend/retrofit/progressInterceptor/OnAttachmentDownloadListener.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/progressInterceptor/OnAttachmentDownloadListener.kt index 034bbd7fb..6639a51f0 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/progressInterceptor/OnAttachmentDownloadListener.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/progressInterceptor/OnAttachmentDownloadListener.kt @@ -1,9 +1,7 @@ -package com.crazylegend.retrofit.progressInterceptor +package com.funkymuse.retrofit.progressInterceptor + -/** - * Created by hristijan on 3/20/19 to long live and prosper ! - */ interface OnAttachmentDownloadListener { fun onAttachmentDownloadedStarted() fun onAttachmentDownloadedFinished() diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/progressInterceptor/OnProgressDownloadInterceptor.kt b/retrofit/src/main/java/com/funkymuse/retrofit/progressInterceptor/OnProgressDownloadInterceptor.kt similarity index 83% rename from retrofit/src/main/java/com/crazylegend/retrofit/progressInterceptor/OnProgressDownloadInterceptor.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/progressInterceptor/OnProgressDownloadInterceptor.kt index 9f7f97d90..0f8c7fedb 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/progressInterceptor/OnProgressDownloadInterceptor.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/progressInterceptor/OnProgressDownloadInterceptor.kt @@ -1,13 +1,11 @@ -package com.crazylegend.retrofit.progressInterceptor +package com.funkymuse.retrofit.progressInterceptor import okhttp3.Interceptor import okhttp3.Response import java.io.IOException -/** - * Created by hristijan on 3/20/19 to long live and prosper ! - */ + class OnProgressDownloadInterceptor(private val progressListenerDownload: OnAttachmentDownloadListener?) : Interceptor { @Throws(IOException::class) override fun intercept(chain: Interceptor.Chain): Response { diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/progressInterceptor/ProgressResponseBody.kt b/retrofit/src/main/java/com/funkymuse/retrofit/progressInterceptor/ProgressResponseBody.kt similarity index 92% rename from retrofit/src/main/java/com/crazylegend/retrofit/progressInterceptor/ProgressResponseBody.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/progressInterceptor/ProgressResponseBody.kt index 7f7796471..cc07ed662 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/progressInterceptor/ProgressResponseBody.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/progressInterceptor/ProgressResponseBody.kt @@ -1,4 +1,4 @@ -package com.crazylegend.retrofit.progressInterceptor +package com.funkymuse.retrofit.progressInterceptor import okhttp3.MediaType import okhttp3.ResponseBody @@ -6,9 +6,7 @@ import okio.* import java.io.IOException -/** - * Created by hristijan on 3/20/19 to long live and prosper ! - */ + class ProgressResponseBody( private val responseBody: ResponseBody, diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/responsecode/ResponseCode.kt b/retrofit/src/main/java/com/funkymuse/retrofit/responsecode/ResponseCode.kt similarity index 94% rename from retrofit/src/main/java/com/crazylegend/retrofit/responsecode/ResponseCode.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/responsecode/ResponseCode.kt index 3fbf4f77c..863c062d0 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/responsecode/ResponseCode.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/responsecode/ResponseCode.kt @@ -1,8 +1,6 @@ -package com.crazylegend.retrofit.responsecode +package com.funkymuse.retrofit.responsecode + -/** - * Created by funkymuse on 11/20/21 to long live and prosper ! - */ sealed interface ResponseCode { data object MovedPermanently : ResponseCode data object BadRequest : ResponseCode diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/throwables/NoConnectionException.kt b/retrofit/src/main/java/com/funkymuse/retrofit/throwables/NoConnectionException.kt similarity index 71% rename from retrofit/src/main/java/com/crazylegend/retrofit/throwables/NoConnectionException.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/throwables/NoConnectionException.kt index 0aba24131..598b45f06 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/throwables/NoConnectionException.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/throwables/NoConnectionException.kt @@ -1,11 +1,9 @@ -package com.crazylegend.retrofit.throwables +package com.funkymuse.retrofit.throwables import java.io.IOException -/** - * Created by Hristijan on 1/25/19 to long live and prosper ! - */ + class NoConnectionException(private val customMessage: String? = null) : IOException() { override val message: String diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/throwables/TooManyRequestsException.kt b/retrofit/src/main/java/com/funkymuse/retrofit/throwables/TooManyRequestsException.kt similarity index 87% rename from retrofit/src/main/java/com/crazylegend/retrofit/throwables/TooManyRequestsException.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/throwables/TooManyRequestsException.kt index 3f9c2b6f6..f238f7616 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/throwables/TooManyRequestsException.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/throwables/TooManyRequestsException.kt @@ -1,4 +1,4 @@ -package com.crazylegend.retrofit.throwables +package com.funkymuse.retrofit.throwables import java.io.IOException diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/throwables/UnauthorizedException.kt b/retrofit/src/main/java/com/funkymuse/retrofit/throwables/UnauthorizedException.kt similarity index 73% rename from retrofit/src/main/java/com/crazylegend/retrofit/throwables/UnauthorizedException.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/throwables/UnauthorizedException.kt index ecc67f3cc..32cf8e17d 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/throwables/UnauthorizedException.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/throwables/UnauthorizedException.kt @@ -1,11 +1,8 @@ -package com.crazylegend.retrofit.throwables +package com.funkymuse.retrofit.throwables import java.io.IOException -/** - * Created by hristijan on 10/21/19 to long live and prosper ! - */ class UnauthorizedException(private val customMessage: String?) : IOException() { override val message: String get() = customMessage ?: "Un-authorized, please check credentials or re-login/authorize" diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/viewstate/event/ViewEventContract.kt b/retrofit/src/main/java/com/funkymuse/retrofit/viewstate/event/ViewEventContract.kt similarity index 67% rename from retrofit/src/main/java/com/crazylegend/retrofit/viewstate/event/ViewEventContract.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/viewstate/event/ViewEventContract.kt index 7e057ab52..26e282633 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/viewstate/event/ViewEventContract.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/viewstate/event/ViewEventContract.kt @@ -1,4 +1,4 @@ -package com.crazylegend.retrofit.viewstate.event +package com.funkymuse.retrofit.viewstate.event fun interface ViewEventContract { suspend fun provideEvent(viewStatefulEvent: ViewStatefulEvent) diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/viewstate/event/ViewStatefulEvent.kt b/retrofit/src/main/java/com/funkymuse/retrofit/viewstate/event/ViewStatefulEvent.kt similarity index 96% rename from retrofit/src/main/java/com/crazylegend/retrofit/viewstate/event/ViewStatefulEvent.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/viewstate/event/ViewStatefulEvent.kt index 5fb3aaf47..256264381 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/viewstate/event/ViewStatefulEvent.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/viewstate/event/ViewStatefulEvent.kt @@ -1,10 +1,8 @@ -package com.crazylegend.retrofit.viewstate.event +package com.funkymuse.retrofit.viewstate.event import okhttp3.ResponseBody -/** - * Created by funkymuse on 11/20/21 to long live and prosper ! - */ + sealed interface ViewStatefulEvent { data class Error(val throwable: Throwable) : ViewStatefulEvent data class ApiError(val errorBody: ResponseBody?, val responseCode: Int) : ViewStatefulEvent diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/viewstate/state/ViewState.kt b/retrofit/src/main/java/com/funkymuse/retrofit/viewstate/state/ViewState.kt similarity index 72% rename from retrofit/src/main/java/com/crazylegend/retrofit/viewstate/state/ViewState.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/viewstate/state/ViewState.kt index 27bc538f9..f23c10d12 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/viewstate/state/ViewState.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/viewstate/state/ViewState.kt @@ -1,14 +1,12 @@ -package com.crazylegend.retrofit.viewstate.state +package com.funkymuse.retrofit.viewstate.state -import com.crazylegend.retrofit.apiresult.ApiResult -import com.crazylegend.retrofit.viewstate.event.ViewStatefulEvent -import com.crazylegend.retrofit.viewstate.event.ViewEventContract +import com.funkymuse.retrofit.apiresult.ApiResult +import com.funkymuse.retrofit.viewstate.event.ViewEventContract +import com.funkymuse.retrofit.viewstate.event.ViewStatefulEvent import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow -/** - * Created by funkymuse on 11/20/21 to long live and prosper ! - */ + class ViewState( private val viewEventContract: ViewEventContract? = null, defaultViewState: ViewStatefulEvent = ViewStatefulEvent.Idle diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/viewstate/state/ViewStateContract.kt b/retrofit/src/main/java/com/funkymuse/retrofit/viewstate/state/ViewStateContract.kt similarity index 62% rename from retrofit/src/main/java/com/crazylegend/retrofit/viewstate/state/ViewStateContract.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/viewstate/state/ViewStateContract.kt index aac76b3ee..20e0fcb6a 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/viewstate/state/ViewStateContract.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/viewstate/state/ViewStateContract.kt @@ -1,12 +1,10 @@ -package com.crazylegend.retrofit.viewstate.state +package com.funkymuse.retrofit.viewstate.state -import com.crazylegend.retrofit.apiresult.ApiResult -import com.crazylegend.retrofit.viewstate.event.ViewStatefulEvent +import com.funkymuse.retrofit.apiresult.ApiResult +import com.funkymuse.retrofit.viewstate.event.ViewStatefulEvent import kotlinx.coroutines.flow.StateFlow -/** - * Created by funkymuse on 11/20/21 to long live and prosper ! - */ + interface ViewStateContract { val viewState : StateFlow diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/viewstate/state/ViewStateExtensions.kt b/retrofit/src/main/java/com/funkymuse/retrofit/viewstate/state/ViewStateExtensions.kt similarity index 85% rename from retrofit/src/main/java/com/crazylegend/retrofit/viewstate/state/ViewStateExtensions.kt rename to retrofit/src/main/java/com/funkymuse/retrofit/viewstate/state/ViewStateExtensions.kt index 217610c94..56183ddb9 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/viewstate/state/ViewStateExtensions.kt +++ b/retrofit/src/main/java/com/funkymuse/retrofit/viewstate/state/ViewStateExtensions.kt @@ -1,20 +1,18 @@ -package com.crazylegend.retrofit.viewstate.state +package com.funkymuse.retrofit.viewstate.state import androidx.lifecycle.SavedStateHandle -import com.crazylegend.retrofit.apiresult.ApiResult -import com.crazylegend.retrofit.apiresult.onSuccess -import com.crazylegend.retrofit.throwables.isNoConnectionException -import com.crazylegend.retrofit.viewstate.event.ViewStatefulEvent -import com.crazylegend.retrofit.viewstate.event.asError -import com.crazylegend.retrofit.viewstate.event.isApiError -import com.crazylegend.retrofit.viewstate.event.isError -import com.crazylegend.retrofit.viewstate.event.isLoading -import com.crazylegend.retrofit.viewstate.event.isSuccess +import com.funkymuse.retrofit.apiresult.ApiResult +import com.funkymuse.retrofit.apiresult.onSuccess +import com.funkymuse.retrofit.throwables.isNoConnectionException +import com.funkymuse.retrofit.viewstate.event.ViewStatefulEvent +import com.funkymuse.retrofit.viewstate.event.asError +import com.funkymuse.retrofit.viewstate.event.isApiError +import com.funkymuse.retrofit.viewstate.event.isError +import com.funkymuse.retrofit.viewstate.event.isLoading +import com.funkymuse.retrofit.viewstate.event.isSuccess import okhttp3.ResponseBody -/** - * Created by funkymuse on 11/20/21 to long live and prosper ! - */ + fun ApiResult.asViewStatePayload(viewState: ViewStateContract): ApiResult { onSuccess { viewState.payload = it diff --git a/retrofit/src/test/java/com/crazylegend/retrofit/FakeInterface.kt b/retrofit/src/test/java/com/crazylegend/retrofit/FakeInterface.kt deleted file mode 100644 index 16ccc80ee..000000000 --- a/retrofit/src/test/java/com/crazylegend/retrofit/FakeInterface.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.crazylegend.retrofit - - -/** - * Created by crazy on 6/15/20 to long live and prosper ! - */ -interface FakeInterface { -} \ No newline at end of file diff --git a/retrofit/src/test/java/com/crazylegend/retrofit/MainCoroutineRule.kt b/retrofit/src/test/java/com/crazylegend/retrofit/MainCoroutineRule.kt deleted file mode 100644 index 7c61c3267..000000000 --- a/retrofit/src/test/java/com/crazylegend/retrofit/MainCoroutineRule.kt +++ /dev/null @@ -1,28 +0,0 @@ -package com.crazylegend.retrofit - -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.test.TestCoroutineDispatcher -import kotlinx.coroutines.test.TestCoroutineScope -import kotlinx.coroutines.test.resetMain -import kotlinx.coroutines.test.setMain -import org.junit.rules.TestWatcher -import org.junit.runner.Description - -/** - * Created by funkymuse on 11/20/21 to long live and prosper ! - */ -class MainCoroutineRule(val dispatcher: TestCoroutineDispatcher = TestCoroutineDispatcher()) : - TestWatcher(), - TestCoroutineScope by TestCoroutineScope(dispatcher) { - override fun starting(description: Description?) { - super.starting(description) - Dispatchers.setMain(dispatcher) - } - - override fun finished(description: Description?) { - super.finished(description) - Dispatchers.resetMain() - cleanupTestCoroutines() - dispatcher.cleanupTestCoroutines() - } -} \ No newline at end of file diff --git a/retrofit/src/test/java/com/funkymuse/retrofit/FakeInterface.kt b/retrofit/src/test/java/com/funkymuse/retrofit/FakeInterface.kt new file mode 100644 index 000000000..fe5e0c89d --- /dev/null +++ b/retrofit/src/test/java/com/funkymuse/retrofit/FakeInterface.kt @@ -0,0 +1,6 @@ +package com.funkymuse.retrofit + + + +interface FakeInterface { +} \ No newline at end of file diff --git a/retrofit/src/test/java/com/crazylegend/retrofit/FakeViewEvent.kt b/retrofit/src/test/java/com/funkymuse/retrofit/FakeViewEvent.kt similarity index 68% rename from retrofit/src/test/java/com/crazylegend/retrofit/FakeViewEvent.kt rename to retrofit/src/test/java/com/funkymuse/retrofit/FakeViewEvent.kt index 20a4ab755..c517b81b3 100644 --- a/retrofit/src/test/java/com/crazylegend/retrofit/FakeViewEvent.kt +++ b/retrofit/src/test/java/com/funkymuse/retrofit/FakeViewEvent.kt @@ -1,7 +1,7 @@ -package com.crazylegend.retrofit +package com.funkymuse.retrofit -import com.crazylegend.retrofit.viewstate.event.ViewEventContract -import com.crazylegend.retrofit.viewstate.event.ViewStatefulEvent +import com.funkymuse.retrofit.viewstate.event.ViewEventContract +import com.funkymuse.retrofit.viewstate.event.ViewStatefulEvent import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.receiveAsFlow diff --git a/retrofit/src/test/java/com/crazylegend/retrofit/ViewStateTest.kt b/retrofit/src/test/java/com/funkymuse/retrofit/ViewStateTest.kt similarity index 81% rename from retrofit/src/test/java/com/crazylegend/retrofit/ViewStateTest.kt rename to retrofit/src/test/java/com/funkymuse/retrofit/ViewStateTest.kt index 069ca362f..f43f6cd6c 100644 --- a/retrofit/src/test/java/com/crazylegend/retrofit/ViewStateTest.kt +++ b/retrofit/src/test/java/com/funkymuse/retrofit/ViewStateTest.kt @@ -1,15 +1,15 @@ -package com.crazylegend.retrofit - -import com.crazylegend.retrofit.apiresult.* -import com.crazylegend.retrofit.throwables.NoConnectionException -import com.crazylegend.retrofit.throwables.isNoConnectionException -import com.crazylegend.retrofit.viewstate.event.asError -import com.crazylegend.retrofit.viewstate.event.isError -import com.crazylegend.retrofit.viewstate.event.isLoading -import com.crazylegend.retrofit.viewstate.event.isSuccess -import com.crazylegend.retrofit.viewstate.state.ViewState -import com.crazylegend.retrofit.viewstate.state.asViewStatePayload -import com.crazylegend.retrofit.viewstate.state.asViewStatePayloadWithEvents +package com.funkymuse.retrofit + +import com.funkymuse.retrofit.apiresult.ApiResult +import com.funkymuse.retrofit.throwables.NoConnectionException +import com.funkymuse.retrofit.throwables.isNoConnectionException +import com.funkymuse.retrofit.viewstate.event.asError +import com.funkymuse.retrofit.viewstate.event.isError +import com.funkymuse.retrofit.viewstate.event.isLoading +import com.funkymuse.retrofit.viewstate.event.isSuccess +import com.funkymuse.retrofit.viewstate.state.ViewState +import com.funkymuse.retrofit.viewstate.state.asViewStatePayload +import com.funkymuse.retrofit.viewstate.state.asViewStatePayloadWithEvents import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.first import kotlinx.coroutines.test.TestScope @@ -18,9 +18,7 @@ import org.junit.Assert.assertEquals import org.junit.Assert.assertTrue import org.junit.Test -/** - * Created by funkymuse on 11/20/21 to long live and prosper ! - */ + @ExperimentalCoroutinesApi class ViewStateTest { diff --git a/retrofit/src/test/java/com/crazylegend/retrofit/retrofitResult/ApiResultExtensionsTest.kt b/retrofit/src/test/java/com/funkymuse/retrofit/retrofitResult/ApiResultExtensionsTest.kt similarity index 60% rename from retrofit/src/test/java/com/crazylegend/retrofit/retrofitResult/ApiResultExtensionsTest.kt rename to retrofit/src/test/java/com/funkymuse/retrofit/retrofitResult/ApiResultExtensionsTest.kt index 184a64867..3033b6048 100644 --- a/retrofit/src/test/java/com/crazylegend/retrofit/retrofitResult/ApiResultExtensionsTest.kt +++ b/retrofit/src/test/java/com/funkymuse/retrofit/retrofitResult/ApiResultExtensionsTest.kt @@ -1,15 +1,13 @@ -package com.crazylegend.retrofit.retrofitResult +package com.funkymuse.retrofit.retrofitResult -import com.crazylegend.retrofit.apiresult.ApiResult -import com.crazylegend.retrofit.apiresult.apiResultSubscribe +import com.funkymuse.retrofit.apiresult.ApiResult +import com.funkymuse.retrofit.apiresult.apiResultSubscribe import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.JUnit4 import retrofit2.Response -/** - * Created by crazy on 1/12/21 to long live and prosper ! - */ + @RunWith(JUnit4::class) class ApiResultExtensionsTest { diff --git a/root/build.gradle b/root/build.gradle deleted file mode 100644 index 1049e45e8..000000000 --- a/root/build.gradle +++ /dev/null @@ -1,3 +0,0 @@ -android { - namespace 'com.crazylegend.root' -} \ No newline at end of file diff --git a/root/build.gradle.kts b/root/build.gradle.kts new file mode 100644 index 000000000..ebf7ff699 --- /dev/null +++ b/root/build.gradle.kts @@ -0,0 +1,3 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} \ No newline at end of file diff --git a/root/src/main/AndroidManifest.xml b/root/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/root/src/main/AndroidManifest.xml +++ b/root/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/root/src/main/java/com/crazylegend/root/Root.kt b/root/src/main/java/com/funkymuse/root/Root.kt similarity index 94% rename from root/src/main/java/com/crazylegend/root/Root.kt rename to root/src/main/java/com/funkymuse/root/Root.kt index accd65387..74d9b13cb 100644 --- a/root/src/main/java/com/crazylegend/root/Root.kt +++ b/root/src/main/java/com/funkymuse/root/Root.kt @@ -1,13 +1,11 @@ -package com.crazylegend.root +package com.funkymuse.root import java.io.BufferedReader import java.io.File import java.io.InputStreamReader -/** - * Created by crazy on 2/6/19 to long live and prosper ! - */ + fun isRooted(): Boolean { diff --git a/root/src/main/java/com/crazylegend/root/RootUtils.kt b/root/src/main/java/com/funkymuse/root/RootUtils.kt similarity index 93% rename from root/src/main/java/com/crazylegend/root/RootUtils.kt rename to root/src/main/java/com/funkymuse/root/RootUtils.kt index 5067f2c65..0f3b5b63d 100644 --- a/root/src/main/java/com/crazylegend/root/RootUtils.kt +++ b/root/src/main/java/com/funkymuse/root/RootUtils.kt @@ -1,13 +1,11 @@ -package com.crazylegend.root +package com.funkymuse.root import java.io.BufferedReader import java.io.File import java.io.InputStreamReader -/** - * Created by crazy on 2/6/19 to long live and prosper ! - */ + object RootUtils { diff --git a/root/src/main/java/com/crazylegend/root/ShellCommands.kt b/root/src/main/java/com/funkymuse/root/ShellCommands.kt similarity index 94% rename from root/src/main/java/com/crazylegend/root/ShellCommands.kt rename to root/src/main/java/com/funkymuse/root/ShellCommands.kt index aa6252e70..65a90bac6 100644 --- a/root/src/main/java/com/crazylegend/root/ShellCommands.kt +++ b/root/src/main/java/com/funkymuse/root/ShellCommands.kt @@ -1,15 +1,15 @@ -package com.crazylegend.root +package com.funkymuse.root -import android.util.Log.* +import android.util.Log.d +import android.util.Log.e +import android.util.Log.getStackTraceString +import android.util.Log.i +import android.util.Log.w import java.io.File -import java.util.* +import java.util.Arrays import kotlin.system.measureTimeMillis -/** - * Created by hristijan on 8/5/19 to long live and prosper ! - */ - /** * Installs file as APK without asking permission. Requires root permissions. */ diff --git a/rx/build.gradle b/rx/build.gradle deleted file mode 100644 index 7913d3256..000000000 --- a/rx/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ -dependencies { - //rx - api "io.reactivex.rxjava3:rxkotlin:$rx" - api "io.reactivex.rxjava3:rxandroid:$rx" - - implementation "androidx.lifecycle:lifecycle-reactivestreams:$lifecycle" - -} - -android { - namespace 'com.crazylegend.rx' -} \ No newline at end of file diff --git a/rx/build.gradle.kts b/rx/build.gradle.kts new file mode 100644 index 000000000..c518a33a3 --- /dev/null +++ b/rx/build.gradle.kts @@ -0,0 +1,11 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + //rx + api(libs.rxkotlin) + api(libs.rxandroid) + + implementation(libs.androidx.lifecycle.reactivestreams) +} \ No newline at end of file diff --git a/rx/src/main/java/com/crazylegend/rx/Completable.kt b/rx/src/main/java/com/funkymuse/rx/Completable.kt similarity index 84% rename from rx/src/main/java/com/crazylegend/rx/Completable.kt rename to rx/src/main/java/com/funkymuse/rx/Completable.kt index 15be54a1b..1b7532b0e 100644 --- a/rx/src/main/java/com/crazylegend/rx/Completable.kt +++ b/rx/src/main/java/com/funkymuse/rx/Completable.kt @@ -1,12 +1,10 @@ -package com.crazylegend.rx +package com.funkymuse.rx import io.reactivex.rxjava3.core.Completable import io.reactivex.rxjava3.core.CompletableEmitter -/** - * Created by hristijan on 3/1/19 to long live and prosper ! - */ + fun completable(block: (CompletableEmitter) -> Unit): Completable = Completable.create(block) diff --git a/rx/src/main/java/com/crazylegend/rx/Flowable.kt b/rx/src/main/java/com/funkymuse/rx/Flowable.kt similarity index 96% rename from rx/src/main/java/com/crazylegend/rx/Flowable.kt rename to rx/src/main/java/com/funkymuse/rx/Flowable.kt index 18b68575e..bac248070 100644 --- a/rx/src/main/java/com/crazylegend/rx/Flowable.kt +++ b/rx/src/main/java/com/funkymuse/rx/Flowable.kt @@ -1,15 +1,18 @@ -package com.crazylegend.rx +package com.funkymuse.rx import io.reactivex.rxjava3.core.BackpressureStrategy import io.reactivex.rxjava3.core.Flowable import io.reactivex.rxjava3.core.FlowableEmitter -import io.reactivex.rxjava3.functions.* +import io.reactivex.rxjava3.functions.BiFunction +import io.reactivex.rxjava3.functions.Function3 +import io.reactivex.rxjava3.functions.Function4 +import io.reactivex.rxjava3.functions.Function5 +import io.reactivex.rxjava3.functions.Function6 +import io.reactivex.rxjava3.functions.Function7 +import io.reactivex.rxjava3.functions.Function8 +import io.reactivex.rxjava3.functions.Function9 -/** - * Created by hristijan on 3/1/19 to long live and prosper ! - */ - fun flowable( backPressureStrategy: BackpressureStrategy = BackpressureStrategy.LATEST, block: (FlowableEmitter) -> Unit diff --git a/rx/src/main/java/com/crazylegend/rx/Maybe.kt b/rx/src/main/java/com/funkymuse/rx/Maybe.kt similarity index 91% rename from rx/src/main/java/com/crazylegend/rx/Maybe.kt rename to rx/src/main/java/com/funkymuse/rx/Maybe.kt index ac78c3a19..53649fa20 100644 --- a/rx/src/main/java/com/crazylegend/rx/Maybe.kt +++ b/rx/src/main/java/com/funkymuse/rx/Maybe.kt @@ -1,4 +1,4 @@ -package com.crazylegend.rx +package com.funkymuse.rx import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.MaybeEmitter @@ -6,9 +6,7 @@ import java.util.concurrent.Callable import java.util.concurrent.Future -/** - * Created by hristijan on 3/1/19 to long live and prosper ! - */ + fun maybe(block: (MaybeEmitter) -> Unit): Maybe = Maybe.create(block) diff --git a/rx/src/main/java/com/crazylegend/rx/Observable.kt b/rx/src/main/java/com/funkymuse/rx/Observable.kt similarity index 96% rename from rx/src/main/java/com/crazylegend/rx/Observable.kt rename to rx/src/main/java/com/funkymuse/rx/Observable.kt index 85f3317cd..d7f0a7843 100644 --- a/rx/src/main/java/com/crazylegend/rx/Observable.kt +++ b/rx/src/main/java/com/funkymuse/rx/Observable.kt @@ -1,13 +1,15 @@ -package com.crazylegend.rx +package com.funkymuse.rx import io.reactivex.rxjava3.core.Observable import io.reactivex.rxjava3.core.ObservableEmitter -import io.reactivex.rxjava3.functions.* - - -/** - * Created by hristijan on 3/1/19 to long live and prosper ! - */ +import io.reactivex.rxjava3.functions.BiFunction +import io.reactivex.rxjava3.functions.Function3 +import io.reactivex.rxjava3.functions.Function4 +import io.reactivex.rxjava3.functions.Function5 +import io.reactivex.rxjava3.functions.Function6 +import io.reactivex.rxjava3.functions.Function7 +import io.reactivex.rxjava3.functions.Function8 +import io.reactivex.rxjava3.functions.Function9 fun observable(block: (ObservableEmitter) -> Unit): Observable = Observable.create(block) diff --git a/rx/src/main/java/com/crazylegend/rx/RxBus.kt b/rx/src/main/java/com/funkymuse/rx/RxBus.kt similarity index 81% rename from rx/src/main/java/com/crazylegend/rx/RxBus.kt rename to rx/src/main/java/com/funkymuse/rx/RxBus.kt index 7e6621464..cb0fa294e 100644 --- a/rx/src/main/java/com/crazylegend/rx/RxBus.kt +++ b/rx/src/main/java/com/funkymuse/rx/RxBus.kt @@ -1,11 +1,9 @@ -package com.crazylegend.rx +package com.funkymuse.rx import io.reactivex.rxjava3.core.Observable -/** - * Created by Hristijan on 2/1/19 to long live and prosper ! - */ + object RxBus { @PublishedApi diff --git a/rx/src/main/java/com/crazylegend/rx/RxExtensions.kt b/rx/src/main/java/com/funkymuse/rx/RxExtensions.kt similarity index 96% rename from rx/src/main/java/com/crazylegend/rx/RxExtensions.kt rename to rx/src/main/java/com/funkymuse/rx/RxExtensions.kt index fb14c7596..e3aff7abb 100644 --- a/rx/src/main/java/com/crazylegend/rx/RxExtensions.kt +++ b/rx/src/main/java/com/funkymuse/rx/RxExtensions.kt @@ -1,8 +1,18 @@ -package com.crazylegend.rx +package com.funkymuse.rx -import androidx.lifecycle.LiveData import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers -import io.reactivex.rxjava3.core.* +import io.reactivex.rxjava3.core.BackpressureStrategy +import io.reactivex.rxjava3.core.Completable +import io.reactivex.rxjava3.core.CompletableEmitter +import io.reactivex.rxjava3.core.Flowable +import io.reactivex.rxjava3.core.Maybe +import io.reactivex.rxjava3.core.MaybeEmitter +import io.reactivex.rxjava3.core.Notification +import io.reactivex.rxjava3.core.Observable +import io.reactivex.rxjava3.core.ObservableEmitter +import io.reactivex.rxjava3.core.Scheduler +import io.reactivex.rxjava3.core.Single +import io.reactivex.rxjava3.core.SingleEmitter import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.disposables.Disposable import io.reactivex.rxjava3.functions.BiFunction @@ -14,11 +24,6 @@ import io.reactivex.rxjava3.subjects.Subject import java.util.concurrent.TimeUnit -/** - * Created by hristijan on 3/5/19 to long live and prosper ! - */ - - fun Observable?.safe(factory: (() -> T)? = null) = this ?: factory?.let { Observable.just(it()) } ?: Observable.empty() diff --git a/rx/src/main/java/com/crazylegend/rx/RxExtensions2.kt b/rx/src/main/java/com/funkymuse/rx/RxExtensions2.kt similarity index 69% rename from rx/src/main/java/com/crazylegend/rx/RxExtensions2.kt rename to rx/src/main/java/com/funkymuse/rx/RxExtensions2.kt index 817c401c7..f90d87500 100644 --- a/rx/src/main/java/com/crazylegend/rx/RxExtensions2.kt +++ b/rx/src/main/java/com/funkymuse/rx/RxExtensions2.kt @@ -1,11 +1,9 @@ -package com.crazylegend.rx +package com.funkymuse.rx import io.reactivex.rxjava3.disposables.Disposable -/** - * Created by crazy on 2/25/20 to long live and prosper ! - */ + /** * Safely dispose = if not null and not already disposed diff --git a/rx/src/main/java/com/crazylegend/rx/Single.kt b/rx/src/main/java/com/funkymuse/rx/Single.kt similarity index 90% rename from rx/src/main/java/com/crazylegend/rx/Single.kt rename to rx/src/main/java/com/funkymuse/rx/Single.kt index 6bb8b1adb..a63face75 100644 --- a/rx/src/main/java/com/crazylegend/rx/Single.kt +++ b/rx/src/main/java/com/funkymuse/rx/Single.kt @@ -1,4 +1,4 @@ -package com.crazylegend.rx +package com.funkymuse.rx import io.reactivex.rxjava3.core.Single import io.reactivex.rxjava3.core.SingleEmitter @@ -6,9 +6,7 @@ import java.util.concurrent.Callable import java.util.concurrent.Future -/** - * Created by hristijan on 3/1/19 to long live and prosper ! - */ + fun single(block: (SingleEmitter) -> Unit): Single = Single.create(block) diff --git a/rx/src/main/java/com/crazylegend/rx/Subjects.kt b/rx/src/main/java/com/funkymuse/rx/Subjects.kt similarity index 60% rename from rx/src/main/java/com/crazylegend/rx/Subjects.kt rename to rx/src/main/java/com/funkymuse/rx/Subjects.kt index 05962ed23..31c39a427 100644 --- a/rx/src/main/java/com/crazylegend/rx/Subjects.kt +++ b/rx/src/main/java/com/funkymuse/rx/Subjects.kt @@ -1,11 +1,13 @@ -package com.crazylegend.rx - -import io.reactivex.rxjava3.subjects.* - - -/** - * Created by hristijan on 3/1/19 to long live and prosper ! - */ +package com.funkymuse.rx + +import io.reactivex.rxjava3.subjects.AsyncSubject +import io.reactivex.rxjava3.subjects.BehaviorSubject +import io.reactivex.rxjava3.subjects.CompletableSubject +import io.reactivex.rxjava3.subjects.MaybeSubject +import io.reactivex.rxjava3.subjects.PublishSubject +import io.reactivex.rxjava3.subjects.ReplaySubject +import io.reactivex.rxjava3.subjects.SingleSubject +import io.reactivex.rxjava3.subjects.UnicastSubject fun AsyncSubject(): AsyncSubject = AsyncSubject.create() diff --git a/rx/src/main/java/com/crazylegend/rx/Utils.kt b/rx/src/main/java/com/funkymuse/rx/Utils.kt similarity index 90% rename from rx/src/main/java/com/crazylegend/rx/Utils.kt rename to rx/src/main/java/com/funkymuse/rx/Utils.kt index 6c9e7009d..6e80842fb 100644 --- a/rx/src/main/java/com/crazylegend/rx/Utils.kt +++ b/rx/src/main/java/com/funkymuse/rx/Utils.kt @@ -1,16 +1,11 @@ -package com.crazylegend.rx +package com.funkymuse.rx import android.graphics.Bitmap import android.graphics.BitmapFactory -import io.reactivex.rxjava3.core.Flowable import io.reactivex.rxjava3.core.Single import java.io.ByteArrayOutputStream -/** - * Created by crazy on 9/1/20 to long live and prosper ! - */ - -fun ByteArray.toBitmap(): Single? { +fun ByteArray.toBitmap(): Single { return Single.fromCallable { BitmapFactory.decodeByteArray(this, 0, this.size) diff --git a/saf/build.gradle b/saf/build.gradle deleted file mode 100644 index 72e002467..000000000 --- a/saf/build.gradle +++ /dev/null @@ -1,11 +0,0 @@ -dependencies { - implementation "androidx.core:core-ktx:$coreKTX" - implementation "androidx.appcompat:appcompat:$appCompat" - implementation "androidx.exifinterface:exifinterface:$exifinterface" - implementation "androidx.documentfile:documentfile:$documentFile" - -} - -android { - namespace 'com.crazylegend.saf' -} \ No newline at end of file diff --git a/saf/build.gradle.kts b/saf/build.gradle.kts new file mode 100644 index 000000000..701a9d40a --- /dev/null +++ b/saf/build.gradle.kts @@ -0,0 +1,10 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.appcompat) + implementation(libs.androidx.exifinterface) + implementation(libs.androidx.documentfile) +} diff --git a/saf/src/main/AndroidManifest.xml b/saf/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/saf/src/main/AndroidManifest.xml +++ b/saf/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/saf/src/main/java/com/crazylegend/saf/SafExtensions.kt b/saf/src/main/java/com/funkymuse/saf/SafExtensions.kt similarity index 97% rename from saf/src/main/java/com/crazylegend/saf/SafExtensions.kt rename to saf/src/main/java/com/funkymuse/saf/SafExtensions.kt index 71c50c11a..09edc91b0 100644 --- a/saf/src/main/java/com/crazylegend/saf/SafExtensions.kt +++ b/saf/src/main/java/com/funkymuse/saf/SafExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.saf +package com.funkymuse.saf import android.Manifest.permission.ACCESS_MEDIA_LOCATION import android.content.Context @@ -10,13 +10,13 @@ import androidx.annotation.RequiresApi import androidx.annotation.RequiresPermission import androidx.documentfile.provider.DocumentFile import androidx.exifinterface.media.ExifInterface -import java.io.* +import java.io.File +import java.io.FileInputStream +import java.io.FileOutputStream +import java.io.InputStream +import java.io.OutputStream -/** - * Created by crazy on 11/11/19 to long live and prosper ! - */ - /** * Extracts user's location from images, requires permission * @see [ACCESS_MEDIA_LOCATION] diff --git a/security/build.gradle b/security/build.gradle deleted file mode 100644 index bfb7dbd7e..000000000 --- a/security/build.gradle +++ /dev/null @@ -1,8 +0,0 @@ -dependencies { - //security - api "androidx.security:security-crypto-ktx:$securityVersion" -} - -android { - namespace 'com.crazylegend.security' -} \ No newline at end of file diff --git a/security/build.gradle.kts b/security/build.gradle.kts new file mode 100644 index 000000000..8ba928bf2 --- /dev/null +++ b/security/build.gradle.kts @@ -0,0 +1,9 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + //security + api(libs.androidx.security.crypto.ktx) + testImplementation(libs.bundles.unit.test) +} \ No newline at end of file diff --git a/security/src/main/java/com/crazylegend/security/AndroidEncryption.kt b/security/src/main/java/com/funkymuse/security/AndroidEncryption.kt similarity index 98% rename from security/src/main/java/com/crazylegend/security/AndroidEncryption.kt rename to security/src/main/java/com/funkymuse/security/AndroidEncryption.kt index 053d06a1a..e822f9723 100644 --- a/security/src/main/java/com/crazylegend/security/AndroidEncryption.kt +++ b/security/src/main/java/com/funkymuse/security/AndroidEncryption.kt @@ -1,4 +1,4 @@ -package com.crazylegend.security +package com.funkymuse.security import android.os.Build import android.security.keystore.KeyGenParameterSpec @@ -16,9 +16,7 @@ import javax.crypto.spec.GCMParameterSpec import javax.security.cert.CertificateException -/** - * Created by hristijan on 4/2/19 to long live and prosper ! - */ + object AndroidEncryption { private val AndroidKeyStore = "AndroidKeyStore" diff --git a/security/src/main/java/com/crazylegend/security/AtbashCipher.kt b/security/src/main/java/com/funkymuse/security/AtbashCipher.kt similarity index 96% rename from security/src/main/java/com/crazylegend/security/AtbashCipher.kt rename to security/src/main/java/com/funkymuse/security/AtbashCipher.kt index 5e7a15469..f8d836554 100644 --- a/security/src/main/java/com/crazylegend/security/AtbashCipher.kt +++ b/security/src/main/java/com/funkymuse/security/AtbashCipher.kt @@ -1,9 +1,7 @@ -package com.crazylegend.security +package com.funkymuse.security + -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ /** * Atbash cipher is one of the oldest ciphers known. It is a substitution cipher which works by reversing the alphabet. diff --git a/security/src/main/java/com/crazylegend/security/CaesarCipher.kt b/security/src/main/java/com/funkymuse/security/CaesarCipher.kt similarity index 95% rename from security/src/main/java/com/crazylegend/security/CaesarCipher.kt rename to security/src/main/java/com/funkymuse/security/CaesarCipher.kt index c2fa657d2..1d4c73fd3 100644 --- a/security/src/main/java/com/crazylegend/security/CaesarCipher.kt +++ b/security/src/main/java/com/funkymuse/security/CaesarCipher.kt @@ -1,9 +1,7 @@ -package com.crazylegend.security +package com.funkymuse.security + -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ /** * Caesar cipher is a more advanced substitution cipher than Atbash cipher. diff --git a/security/src/main/java/com/crazylegend/security/CharacterSubstitutionCipher.kt b/security/src/main/java/com/funkymuse/security/CharacterSubstitutionCipher.kt similarity index 95% rename from security/src/main/java/com/crazylegend/security/CharacterSubstitutionCipher.kt rename to security/src/main/java/com/funkymuse/security/CharacterSubstitutionCipher.kt index 2657c5c80..f57eb2ce9 100644 --- a/security/src/main/java/com/crazylegend/security/CharacterSubstitutionCipher.kt +++ b/security/src/main/java/com/funkymuse/security/CharacterSubstitutionCipher.kt @@ -1,11 +1,9 @@ -package com.crazylegend.security +package com.funkymuse.security import kotlin.random.Random -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ + fun charSubstituteEncrypt(text: String, key: String): String { var newKey = key diff --git a/security/src/main/java/com/crazylegend/security/EncryptionExtensions.kt b/security/src/main/java/com/funkymuse/security/EncryptionExtensions.kt similarity index 89% rename from security/src/main/java/com/crazylegend/security/EncryptionExtensions.kt rename to security/src/main/java/com/funkymuse/security/EncryptionExtensions.kt index 49ef5cd17..a5ac26643 100644 --- a/security/src/main/java/com/crazylegend/security/EncryptionExtensions.kt +++ b/security/src/main/java/com/funkymuse/security/EncryptionExtensions.kt @@ -1,8 +1,6 @@ -package com.crazylegend.security +package com.funkymuse.security + -/** - * Created by crazy on 9/3/20 to long live and prosper ! - */ fun String.md5() = EncryptionUtils.encryptMD5ToString(this) diff --git a/security/src/main/java/com/crazylegend/security/EncryptionUtils.kt b/security/src/main/java/com/funkymuse/security/EncryptionUtils.kt similarity index 99% rename from security/src/main/java/com/crazylegend/security/EncryptionUtils.kt rename to security/src/main/java/com/funkymuse/security/EncryptionUtils.kt index 1dfa22c82..e73c1746f 100644 --- a/security/src/main/java/com/crazylegend/security/EncryptionUtils.kt +++ b/security/src/main/java/com/funkymuse/security/EncryptionUtils.kt @@ -1,4 +1,4 @@ -package com.crazylegend.security +package com.funkymuse.security import android.util.Base64 import java.security.InvalidKeyException @@ -9,11 +9,6 @@ import javax.crypto.Mac import javax.crypto.spec.SecretKeySpec -/** - * Created by hristijan on 7/30/19 to long live and prosper ! - */ - - object EncryptionUtils { diff --git a/security/src/main/java/com/crazylegend/security/FileEncryption.kt b/security/src/main/java/com/funkymuse/security/FileEncryption.kt similarity index 95% rename from security/src/main/java/com/crazylegend/security/FileEncryption.kt rename to security/src/main/java/com/funkymuse/security/FileEncryption.kt index a4a0d6fa4..bb1caa249 100644 --- a/security/src/main/java/com/crazylegend/security/FileEncryption.kt +++ b/security/src/main/java/com/funkymuse/security/FileEncryption.kt @@ -1,4 +1,4 @@ -package com.crazylegend.security +package com.funkymuse.security import java.io.IOException import java.io.InputStream @@ -11,9 +11,7 @@ import javax.crypto.spec.IvParameterSpec import javax.crypto.spec.SecretKeySpec -/** - * Created by hristijan on 3/28/19 to long live and prosper ! - */ + object FileEncryption { private val BUFFER_SIZE = 1024 diff --git a/security/src/main/java/com/crazylegend/security/HarmfulPackages.kt b/security/src/main/java/com/funkymuse/security/HarmfulPackages.kt similarity index 91% rename from security/src/main/java/com/crazylegend/security/HarmfulPackages.kt rename to security/src/main/java/com/funkymuse/security/HarmfulPackages.kt index 50e7db155..57bda4fb3 100644 --- a/security/src/main/java/com/crazylegend/security/HarmfulPackages.kt +++ b/security/src/main/java/com/funkymuse/security/HarmfulPackages.kt @@ -1,10 +1,4 @@ -package com.crazylegend.security - - -/** - * Created by crazy on 3/17/20 to long live and prosper ! - */ - +package com.funkymuse.security /** * You can use [Context.isAppInstalled()] and iterate through the list diff --git a/security/src/main/java/com/crazylegend/security/MagiskDetector.kt b/security/src/main/java/com/funkymuse/security/MagiskDetector.kt similarity index 98% rename from security/src/main/java/com/crazylegend/security/MagiskDetector.kt rename to security/src/main/java/com/funkymuse/security/MagiskDetector.kt index 2d45fb188..aa43b7898 100644 --- a/security/src/main/java/com/crazylegend/security/MagiskDetector.kt +++ b/security/src/main/java/com/funkymuse/security/MagiskDetector.kt @@ -1,4 +1,4 @@ -package com.crazylegend.security +package com.funkymuse.security import android.content.Context import android.content.pm.PackageManager diff --git a/security/src/main/java/com/crazylegend/security/OneTimePassword.kt b/security/src/main/java/com/funkymuse/security/OneTimePassword.kt similarity index 57% rename from security/src/main/java/com/crazylegend/security/OneTimePassword.kt rename to security/src/main/java/com/funkymuse/security/OneTimePassword.kt index 7bf3093cf..602bebb0f 100644 --- a/security/src/main/java/com/crazylegend/security/OneTimePassword.kt +++ b/security/src/main/java/com/funkymuse/security/OneTimePassword.kt @@ -1,15 +1,12 @@ -package com.crazylegend.security +package com.funkymuse.security import java.security.SecureRandom -/** - * Created by crazy on 1/4/21 to long live and prosper ! - */ - - -fun generateOneTimePassword(passwordLength: Int = 8, shuffleCharacters: Boolean = true, - random: SecureRandom = SecureRandom(), exemptChars: List = emptyList()): String { +fun generateOneTimePassword( + passwordLength: Int = 8, shuffleCharacters: Boolean = true, + random: SecureRandom = SecureRandom(), exemptChars: List = emptyList() +): String { val chars = ("abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "0123456789!@%$%&^?|~'\"#+=" @@ -28,11 +25,16 @@ fun generateOneTimePassword(passwordLength: Int = 8, shuffleCharacters: Boolean return pass.toString() } -fun generateOneTimePassword(chars: CharArray = ("abcdefghijklmnopqrstuvwxyz" - + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - + "0123456789!@%$%&^?|~'\"#+=" - + "\\*/.,:;[]()-_<>").toCharArray(), passwordLength: Int = 8, shuffleCharacters: Boolean = true, - random: SecureRandom = SecureRandom(), exemptChars: List = emptyList()): String { +fun generateOneTimePassword( + chars: CharArray = ("abcdefghijklmnopqrstuvwxyz" + + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + + "0123456789!@%$%&^?|~'\"#+=" + + "\\*/.,:;[]()-_<>").toCharArray(), + passwordLength: Int = 8, + shuffleCharacters: Boolean = true, + random: SecureRandom = SecureRandom(), + exemptChars: List = emptyList() +): String { if (shuffleCharacters) { chars.shuffle() diff --git a/security/src/main/java/com/crazylegend/security/PiracyCheckers.kt b/security/src/main/java/com/funkymuse/security/PiracyCheckers.kt similarity index 98% rename from security/src/main/java/com/crazylegend/security/PiracyCheckers.kt rename to security/src/main/java/com/funkymuse/security/PiracyCheckers.kt index 75dc44437..d74ac7580 100644 --- a/security/src/main/java/com/crazylegend/security/PiracyCheckers.kt +++ b/security/src/main/java/com/funkymuse/security/PiracyCheckers.kt @@ -1,4 +1,4 @@ -package com.crazylegend.security +package com.funkymuse.security import android.content.Context import android.content.pm.ApplicationInfo @@ -14,11 +14,6 @@ import java.io.FileReader import java.security.MessageDigest import java.security.NoSuchAlgorithmException - -/** - * Created by crazy on 9/10/20 to long live and prosper ! - */ - /** * Custom roms have this tag * @return Boolean diff --git a/security/src/main/java/com/crazylegend/security/RSA.kt b/security/src/main/java/com/funkymuse/security/RSA.kt similarity index 98% rename from security/src/main/java/com/crazylegend/security/RSA.kt rename to security/src/main/java/com/funkymuse/security/RSA.kt index 31ca7a06c..dc7c410d2 100644 --- a/security/src/main/java/com/crazylegend/security/RSA.kt +++ b/security/src/main/java/com/funkymuse/security/RSA.kt @@ -1,12 +1,10 @@ -package com.crazylegend.security +package com.funkymuse.security import java.math.BigInteger import kotlin.random.Random -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ + /** diff --git a/security/src/main/java/com/crazylegend/security/SecurityExtensions.kt b/security/src/main/java/com/funkymuse/security/SecurityExtensions.kt similarity index 97% rename from security/src/main/java/com/crazylegend/security/SecurityExtensions.kt rename to security/src/main/java/com/funkymuse/security/SecurityExtensions.kt index 68350cc2e..682db6610 100644 --- a/security/src/main/java/com/crazylegend/security/SecurityExtensions.kt +++ b/security/src/main/java/com/funkymuse/security/SecurityExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.security +package com.funkymuse.security import android.content.Context import android.os.Build @@ -13,9 +13,7 @@ import java.io.InputStream import java.nio.charset.Charset -/** - * Created by crazy on 8/5/20 to long live and prosper ! - */ + /** Proguard diff --git a/security/src/main/java/com/crazylegend/security/VigenereCipher.kt b/security/src/main/java/com/funkymuse/security/VigenereCipher.kt similarity index 97% rename from security/src/main/java/com/crazylegend/security/VigenereCipher.kt rename to security/src/main/java/com/funkymuse/security/VigenereCipher.kt index 740593e2b..6055e168d 100644 --- a/security/src/main/java/com/crazylegend/security/VigenereCipher.kt +++ b/security/src/main/java/com/funkymuse/security/VigenereCipher.kt @@ -1,11 +1,9 @@ -package com.crazylegend.security +package com.funkymuse.security import kotlin.random.Random -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ + fun vigenereEncrypt(text: String, key: String): String { val alphabet = listOf( diff --git a/security/src/test/java/com/crazylegend/security/OneTimePasswordTest.kt b/security/src/test/java/com/funkymuse/security/OneTimePasswordTest.kt similarity index 84% rename from security/src/test/java/com/crazylegend/security/OneTimePasswordTest.kt rename to security/src/test/java/com/funkymuse/security/OneTimePasswordTest.kt index 1161a8601..2b097e860 100644 --- a/security/src/test/java/com/crazylegend/security/OneTimePasswordTest.kt +++ b/security/src/test/java/com/funkymuse/security/OneTimePasswordTest.kt @@ -1,10 +1,7 @@ -package com.crazylegend.security +package com.funkymuse.security import org.junit.Test -/** - * Created by crazy on 1/4/21 to long live and prosper ! - */ class OneTimePasswordTest { diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 0b5789e5d..000000000 --- a/settings.gradle +++ /dev/null @@ -1,53 +0,0 @@ -include ':dataStructuresAndAlgorithms' -include ':recyclerview' -include ':glide' -include ':moshi' -include ':gson' -include ':customviews' -include ':jodaDateTime' -include ':viewbinding' -include ':biometrics' -include ':reflection' -include ':rx' -include ':coroutines' -include ':retrofit' -include ':security' -include ':kotlinextensions' -include ':app' -include ':accessibility' -include ':animations' -include ':audio' -include ':activity' -include ':contextGetters' -include ':context' -include ':internetDetector' -include ':common' -include ':string' -include ':bytearray' -include ':file' -include ':resources' -include ':networking' -include ':http' -include ':view' -include ':viewpager2' -include ':dateTime' -include ':collections' -include ':root' -include ':fragment' -include ':enums' -include ':generators' -include ':math' -include ':locale' -include ':numbers' -include ':livedata' -include ':color' -include ':lifecycle' -include ':permissions' -include ':regex' -include ':photos' -include ':sharedpreferences' -include ':toaster' -include ':saf' -include ':intent' -include ':receivers' -enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 000000000..8fafb8876 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,71 @@ +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + maven { setUrl("https://jitpack.io") } + } +} + +pluginManagement { + includeBuild("build-logic") + repositories { + gradlePluginPortal() + google() + mavenCentral() + } +} +rootProject.name = "KAHelpers" +include(":dataStructuresAndAlgorithms") +include(":recyclerview") +include(":glide") +include(":moshi") +include(":gson") +include(":customviews") +include(":jodaDateTime") +include(":viewbinding") +include(":biometrics") +include(":reflection") +include(":rx") +include(":coroutines") +include(":retrofit") +include(":security") +include(":kotlinextensions") +include(":app") +include(":accessibility") +include(":animations") +include(":audio") +include(":activity") +include(":contextGetters") +include(":context") +include(":internetDetector") +include(":common") +include(":string") +include(":bytearray") +include(":file") +include(":resources") +include(":networking") +include(":http") +include(":view") +include(":viewpager2") +include(":dateTime") +include(":collections") +include(":root") +include(":fragment") +include(":enums") +include(":generators") +include(":math") +include(":locale") +include(":numbers") +include(":livedata") +include(":color") +include(":lifecycle") +include(":permissions") +include(":regex") +include(":photos") +include(":sharedpreferences") +include(":toaster") +include(":saf") +include(":intent") +include(":receivers") +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") diff --git a/sharedpreferences/build.gradle b/sharedpreferences/build.gradle deleted file mode 100644 index 450ebb75a..000000000 --- a/sharedpreferences/build.gradle +++ /dev/null @@ -1,10 +0,0 @@ -dependencies { - implementation "androidx.core:core-ktx:$coreKTX" - implementation "androidx.appcompat:appcompat:$appCompat" - implementation "androidx.preference:preference:$preference" - -} - -android { - namespace 'com.crazylegend.sharedpreferences' -} \ No newline at end of file diff --git a/sharedpreferences/build.gradle.kts b/sharedpreferences/build.gradle.kts new file mode 100644 index 000000000..90bd33764 --- /dev/null +++ b/sharedpreferences/build.gradle.kts @@ -0,0 +1,9 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.appcompat) + implementation(libs.androidx.preference) +} \ No newline at end of file diff --git a/sharedpreferences/src/main/AndroidManifest.xml b/sharedpreferences/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/sharedpreferences/src/main/AndroidManifest.xml +++ b/sharedpreferences/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/sharedpreferences/src/main/java/com/crazylegend/sharedpreferences/SharedPreferenceChangeListener.kt b/sharedpreferences/src/main/java/com/funkymuse/sharedpreferences/SharedPreferenceChangeListener.kt similarity index 78% rename from sharedpreferences/src/main/java/com/crazylegend/sharedpreferences/SharedPreferenceChangeListener.kt rename to sharedpreferences/src/main/java/com/funkymuse/sharedpreferences/SharedPreferenceChangeListener.kt index abf964f11..92deda0cd 100644 --- a/sharedpreferences/src/main/java/com/crazylegend/sharedpreferences/SharedPreferenceChangeListener.kt +++ b/sharedpreferences/src/main/java/com/funkymuse/sharedpreferences/SharedPreferenceChangeListener.kt @@ -1,16 +1,14 @@ -package com.crazylegend.sharedpreferences +package com.funkymuse.sharedpreferences import android.content.SharedPreferences import androidx.lifecycle.DefaultLifecycleObserver import androidx.lifecycle.LifecycleOwner -/** - * Created by crazy on 8/13/20 to long live and prosper ! - */ + class SharedPreferenceChangeListener( private val sharedPreferences: SharedPreferences, - private val listener: (SharedPreferences, String) -> Unit + private val listener: (SharedPreferences?, String?) -> Unit ) : SharedPreferences.OnSharedPreferenceChangeListener, DefaultLifecycleObserver { override fun onCreate(owner: LifecycleOwner) { @@ -23,7 +21,7 @@ class SharedPreferenceChangeListener( sharedPreferences.unregisterOnSharedPreferenceChangeListener(this) } - override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) { + override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) { listener(sharedPreferences, key) } } diff --git a/sharedpreferences/src/main/java/com/crazylegend/sharedpreferences/SharedPrefsExtensions.kt b/sharedpreferences/src/main/java/com/funkymuse/sharedpreferences/SharedPrefsExtensions.kt similarity index 94% rename from sharedpreferences/src/main/java/com/crazylegend/sharedpreferences/SharedPrefsExtensions.kt rename to sharedpreferences/src/main/java/com/funkymuse/sharedpreferences/SharedPrefsExtensions.kt index c3ea2f423..3c799fa27 100644 --- a/sharedpreferences/src/main/java/com/crazylegend/sharedpreferences/SharedPrefsExtensions.kt +++ b/sharedpreferences/src/main/java/com/funkymuse/sharedpreferences/SharedPrefsExtensions.kt @@ -1,13 +1,11 @@ -package com.crazylegend.sharedpreferences +package com.funkymuse.sharedpreferences import android.content.SharedPreferences import androidx.core.content.edit import androidx.lifecycle.LifecycleOwner -/** - * Created by hristijan on 3/4/19 to long live and prosper ! - */ + fun SharedPreferences.putString(key: String, value: String) { edit { putString(key, value) } @@ -106,7 +104,7 @@ inline fun SharedPreferences.get(key: String, defaultValue: T) fun SharedPreferences.registerSharedPreferenceChangeListener( owner: LifecycleOwner, - listener: (SharedPreferences, String) -> Unit + listener: (SharedPreferences?, String?) -> Unit ) { owner.lifecycle.addObserver(SharedPreferenceChangeListener(this, listener)) } \ No newline at end of file diff --git a/spotless/.editorconfig b/spotless/.editorconfig new file mode 100644 index 000000000..7f14d8b0c --- /dev/null +++ b/spotless/.editorconfig @@ -0,0 +1,19 @@ +root = true + +[*] +charset = utf-8 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{kt,kts}] +indent_size = 4 +end_of_line = lf +ktlint_standard = enabled +ktlint_experimental = enabled +ktlint_code_style = official +ktlint_standard_comment-spacing = disabled +ktlint_standard_package-name = disabled +ktlint_experimental_package-naming = disabled +ij_kotlin_allow_trailing_comma = true +ij_kotlin_allow_trailing_comma_on_call_site = true diff --git a/string/build.gradle b/string/build.gradle deleted file mode 100644 index 7679ecb2f..000000000 --- a/string/build.gradle +++ /dev/null @@ -1,11 +0,0 @@ -dependencies { - implementation project(path: ':bytearray') - implementation project(path: ':common') - - implementation "androidx.core:core-ktx:$coreKTX" - implementation "androidx.appcompat:appcompat:$appCompat" -} - -android { - namespace 'com.crazylegend.string' -} \ No newline at end of file diff --git a/string/build.gradle.kts b/string/build.gradle.kts new file mode 100644 index 000000000..fa14706eb --- /dev/null +++ b/string/build.gradle.kts @@ -0,0 +1,10 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(projects.bytearray) + implementation(projects.common) + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.appcompat) +} \ No newline at end of file diff --git a/string/src/main/AndroidManifest.xml b/string/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/string/src/main/AndroidManifest.xml +++ b/string/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/string/src/main/java/com/crazylegend/string/StringExtensions.kt b/string/src/main/java/com/funkymuse/string/StringExtensions.kt similarity index 98% rename from string/src/main/java/com/crazylegend/string/StringExtensions.kt rename to string/src/main/java/com/funkymuse/string/StringExtensions.kt index 9a1b5c9da..5270973ee 100644 --- a/string/src/main/java/com/crazylegend/string/StringExtensions.kt +++ b/string/src/main/java/com/funkymuse/string/StringExtensions.kt @@ -1,4 +1,4 @@ -package com.crazylegend.string +package com.funkymuse.string import android.os.Build import android.text.Html @@ -7,7 +7,7 @@ import android.text.Spanned import android.text.style.StyleSpan import android.util.Base64 import androidx.annotation.StyleRes -import com.crazylegend.common.tryOrIgnore +import com.funkymuse.common.tryOrIgnore import java.io.File import java.io.FileOutputStream import java.net.URLDecoder @@ -15,16 +15,11 @@ import java.net.URLEncoder import java.security.MessageDigest import java.security.NoSuchAlgorithmException import java.text.Normalizer -import java.util.* import java.util.regex.Pattern import javax.crypto.Cipher import javax.crypto.spec.SecretKeySpec -/** - * Created by Hristijan on 2/1/19 to long live and prosper ! - */ - val String.decodeBase64: String get() = Base64.decode(this, Base64.DEFAULT).toString(Charsets.UTF_8) val String.encodeBase64: String get() = Base64.encodeToString(this.toByteArray(Charsets.UTF_8), Base64.DEFAULT) diff --git a/string/src/main/java/com/crazylegend/string/StringExtensions2.kt b/string/src/main/java/com/funkymuse/string/StringExtensions2.kt similarity index 96% rename from string/src/main/java/com/crazylegend/string/StringExtensions2.kt rename to string/src/main/java/com/funkymuse/string/StringExtensions2.kt index e261ab09d..9007c6e69 100644 --- a/string/src/main/java/com/crazylegend/string/StringExtensions2.kt +++ b/string/src/main/java/com/funkymuse/string/StringExtensions2.kt @@ -1,4 +1,4 @@ -package com.crazylegend.string +package com.funkymuse.string import android.graphics.Color import android.graphics.Typeface @@ -6,17 +6,20 @@ import android.text.SpannableString import android.text.Spanned import android.text.TextPaint import android.text.TextUtils -import android.text.style.* +import android.text.style.BackgroundColorSpan +import android.text.style.ClickableSpan +import android.text.style.ForegroundColorSpan +import android.text.style.StyleSpan +import android.text.style.UnderlineSpan import android.util.Base64 import android.util.Patterns import android.view.View import android.widget.TextView -import com.crazylegend.bytearray.base64Encode -import com.crazylegend.bytearray.base64EncodeToString +import com.funkymuse.bytearray.base64Encode +import com.funkymuse.bytearray.base64EncodeToString import java.io.UnsupportedEncodingException import java.net.URLDecoder import java.net.URLEncoder -import java.util.* import java.util.regex.Pattern diff --git a/string/src/main/java/com/crazylegend/string/StringExtensions3.kt b/string/src/main/java/com/funkymuse/string/StringExtensions3.kt similarity index 95% rename from string/src/main/java/com/crazylegend/string/StringExtensions3.kt rename to string/src/main/java/com/funkymuse/string/StringExtensions3.kt index f3b237455..8e710ba6b 100644 --- a/string/src/main/java/com/crazylegend/string/StringExtensions3.kt +++ b/string/src/main/java/com/funkymuse/string/StringExtensions3.kt @@ -1,4 +1,4 @@ -package com.crazylegend.string +package com.funkymuse.string import android.content.Context import android.content.pm.PackageManager @@ -6,16 +6,14 @@ import android.text.Spanned import android.util.Base64 import androidx.annotation.PluralsRes import androidx.annotation.StringRes -import com.crazylegend.common.string.toHtmlSpan +import com.funkymuse.common.string.toHtmlSpan import java.io.File import java.security.SignatureException import java.util.* import javax.crypto.Mac import javax.crypto.spec.SecretKeySpec -/** - * Created by funkymuse on 5/26/21 to long live and prosper ! - */ + /*** * Computes RFC 2104-compliant HMAC signature. This can be used to sign the Amazon S3 diff --git a/string/src/main/java/com/crazylegend/string/StringExtensions4.kt b/string/src/main/java/com/funkymuse/string/StringExtensions4.kt similarity index 97% rename from string/src/main/java/com/crazylegend/string/StringExtensions4.kt rename to string/src/main/java/com/funkymuse/string/StringExtensions4.kt index e4d55d9db..51200b885 100644 --- a/string/src/main/java/com/crazylegend/string/StringExtensions4.kt +++ b/string/src/main/java/com/funkymuse/string/StringExtensions4.kt @@ -1,4 +1,4 @@ -package com.crazylegend.string +package com.funkymuse.string import android.content.Context import android.content.Intent @@ -9,17 +9,14 @@ import android.text.Spanned import android.text.TextUtils import android.text.style.StrikethroughSpan import android.util.Patterns -import com.crazylegend.common.tryOrElse +import com.funkymuse.common.tryOrElse import org.intellij.lang.annotations.RegExp import java.io.File import java.net.URLEncoder import java.text.DateFormat import java.text.ParseException -import java.util.* +import java.util.Date -/** - * Created by funkymuse on 6/19/21 to long live and prosper ! - */ fun stringConcatenateArrays(first: List, second: List): List { var result = ArrayList(first.size + second.size) diff --git a/string/src/main/java/com/crazylegend/string/StringExtensions5.kt b/string/src/main/java/com/funkymuse/string/StringExtensions5.kt similarity index 98% rename from string/src/main/java/com/crazylegend/string/StringExtensions5.kt rename to string/src/main/java/com/funkymuse/string/StringExtensions5.kt index 00be6beb3..f9a065ba9 100644 --- a/string/src/main/java/com/crazylegend/string/StringExtensions5.kt +++ b/string/src/main/java/com/funkymuse/string/StringExtensions5.kt @@ -1,4 +1,4 @@ -package com.crazylegend.string +package com.funkymuse.string import android.annotation.TargetApi import android.content.Context @@ -20,9 +20,7 @@ import java.text.ParseException import java.text.SimpleDateFormat import java.util.* -/** - * Created by funkymuse on 6/19/21 to long live and prosper ! - */ + fun String.noNumbers(): Boolean { diff --git a/toaster/build.gradle b/toaster/build.gradle deleted file mode 100644 index 1530d9ad4..000000000 --- a/toaster/build.gradle +++ /dev/null @@ -1,8 +0,0 @@ - -dependencies { - implementation "androidx.core:core-ktx:$coreKTX" -} - -android { - namespace 'com.crazylegend.toaster' -} \ No newline at end of file diff --git a/toaster/build.gradle.kts b/toaster/build.gradle.kts new file mode 100644 index 000000000..e88c2951c --- /dev/null +++ b/toaster/build.gradle.kts @@ -0,0 +1,7 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(libs.androidx.core.ktx) +} \ No newline at end of file diff --git a/toaster/src/main/AndroidManifest.xml b/toaster/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/toaster/src/main/AndroidManifest.xml +++ b/toaster/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/toaster/src/main/java/com/crazylegend/toaster/Toaster.kt b/toaster/src/main/java/com/funkymuse/toaster/Toaster.kt similarity index 92% rename from toaster/src/main/java/com/crazylegend/toaster/Toaster.kt rename to toaster/src/main/java/com/funkymuse/toaster/Toaster.kt index e6a3654bb..3f240cbda 100644 --- a/toaster/src/main/java/com/crazylegend/toaster/Toaster.kt +++ b/toaster/src/main/java/com/funkymuse/toaster/Toaster.kt @@ -1,12 +1,9 @@ -package com.crazylegend.toaster +package com.funkymuse.toaster import android.content.Context import android.widget.Toast import androidx.annotation.StringRes -/** - * Created by FunkyMuse on 1/13/20 to long live and prosper ! - */ class Toaster(private val context: Context) : ToasterContract { private var currentToast: Toast? = null diff --git a/toaster/src/main/java/com/crazylegend/toaster/ToasterContract.kt b/toaster/src/main/java/com/funkymuse/toaster/ToasterContract.kt similarity index 69% rename from toaster/src/main/java/com/crazylegend/toaster/ToasterContract.kt rename to toaster/src/main/java/com/funkymuse/toaster/ToasterContract.kt index 5ecd3915b..157c4b7ec 100644 --- a/toaster/src/main/java/com/crazylegend/toaster/ToasterContract.kt +++ b/toaster/src/main/java/com/funkymuse/toaster/ToasterContract.kt @@ -1,10 +1,8 @@ -package com.crazylegend.toaster +package com.funkymuse.toaster import androidx.annotation.StringRes -/** - * Created by funkymuse on 3/8/21 to long live and prosper ! - */ + interface ToasterContract { fun shortToast(@StringRes string: Int) diff --git a/view/build.gradle b/view/build.gradle deleted file mode 100644 index b681421e5..000000000 --- a/view/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ - -dependencies { - implementation project(path: ':common') - implementation "androidx.core:core-ktx:$coreKTX" - implementation "com.google.android.material:material:$material" - implementation "androidx.swiperefreshlayout:swiperefreshlayout:$swipeRefresh" - -} - -android { - namespace 'com.crazylegend.view' -} \ No newline at end of file diff --git a/view/build.gradle.kts b/view/build.gradle.kts new file mode 100644 index 000000000..572b77aea --- /dev/null +++ b/view/build.gradle.kts @@ -0,0 +1,10 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(projects.common) + implementation(libs.androidx.core.ktx) + implementation(libs.material) + implementation(libs.androidx.swiperefreshlayout) +} \ No newline at end of file diff --git a/view/src/main/AndroidManifest.xml b/view/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/view/src/main/AndroidManifest.xml +++ b/view/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/view/src/main/java/com/crazylegend/view/CustomViewExtensions.kt b/view/src/main/java/com/funkymuse/view/CustomViewExtensions.kt similarity index 91% rename from view/src/main/java/com/crazylegend/view/CustomViewExtensions.kt rename to view/src/main/java/com/funkymuse/view/CustomViewExtensions.kt index bbc305303..abb9a3b97 100644 --- a/view/src/main/java/com/crazylegend/view/CustomViewExtensions.kt +++ b/view/src/main/java/com/funkymuse/view/CustomViewExtensions.kt @@ -1,11 +1,9 @@ -package com.crazylegend.view +package com.funkymuse.view import android.view.View -/** - * Created by crazy on 11/11/19 to long live and prosper ! - */ + /** * Use in [View.onMeasure] to simplify measurements diff --git a/view/src/main/java/com/crazylegend/view/ScaleListener.kt b/view/src/main/java/com/funkymuse/view/ScaleListener.kt similarity index 86% rename from view/src/main/java/com/crazylegend/view/ScaleListener.kt rename to view/src/main/java/com/funkymuse/view/ScaleListener.kt index a359b6074..6f86431c4 100644 --- a/view/src/main/java/com/crazylegend/view/ScaleListener.kt +++ b/view/src/main/java/com/funkymuse/view/ScaleListener.kt @@ -1,4 +1,4 @@ -package com.crazylegend.view +package com.funkymuse.view import android.view.ScaleGestureDetector import android.view.ScaleGestureDetector.SimpleOnScaleGestureListener @@ -7,9 +7,7 @@ import kotlin.math.max import kotlin.math.min -/** - * Created by crazy on 8/7/20 to long live and prosper ! - */ + class ScaleListener(private var mScaleFactor: Float, private val view: View) : SimpleOnScaleGestureListener() { diff --git a/view/src/main/java/com/crazylegend/view/ViewExtensions.kt b/view/src/main/java/com/funkymuse/view/ViewExtensions.kt similarity index 94% rename from view/src/main/java/com/crazylegend/view/ViewExtensions.kt rename to view/src/main/java/com/funkymuse/view/ViewExtensions.kt index 9dc97bf5a..e97bb8b68 100644 --- a/view/src/main/java/com/crazylegend/view/ViewExtensions.kt +++ b/view/src/main/java/com/funkymuse/view/ViewExtensions.kt @@ -1,30 +1,39 @@ -package com.crazylegend.view +package com.funkymuse.view import android.graphics.Bitmap import android.graphics.Canvas import android.graphics.Color -import android.os.Build import android.text.SpannableStringBuilder import android.text.Spanned import android.transition.TransitionManager import android.util.TypedValue -import android.view.* +import android.view.View +import android.view.ViewGroup +import android.view.ViewTreeObserver +import android.view.Window +import android.view.WindowManager import android.view.animation.AlphaAnimation -import android.widget.* -import android.widget.RelativeLayout.* +import android.widget.EditText +import android.widget.ImageView +import android.widget.LinearLayout +import android.widget.RelativeLayout.ALIGN_PARENT_END +import android.widget.RelativeLayout.ALIGN_PARENT_START +import android.widget.RelativeLayout.CENTER_HORIZONTAL +import android.widget.RelativeLayout.LayoutParams +import android.widget.TextView import androidx.annotation.ColorInt import androidx.annotation.ColorRes import androidx.annotation.DimenRes import androidx.annotation.UiThread import androidx.appcompat.widget.SearchView import androidx.core.content.ContextCompat -import androidx.core.view.* +import androidx.core.view.marginBottom +import androidx.core.view.marginLeft +import androidx.core.view.marginRight +import androidx.core.view.marginTop +import androidx.core.view.setMargins import kotlin.math.roundToInt -/** - * Created by Hristijan on 2/1/19 to long live and prosper ! - */ - fun View.visible() { this.visibility = View.VISIBLE diff --git a/view/src/main/java/com/crazylegend/view/ViewExtensions2.kt b/view/src/main/java/com/funkymuse/view/ViewExtensions2.kt similarity index 97% rename from view/src/main/java/com/crazylegend/view/ViewExtensions2.kt rename to view/src/main/java/com/funkymuse/view/ViewExtensions2.kt index 5aa82f290..8b80140e6 100644 --- a/view/src/main/java/com/crazylegend/view/ViewExtensions2.kt +++ b/view/src/main/java/com/funkymuse/view/ViewExtensions2.kt @@ -1,4 +1,4 @@ -package com.crazylegend.view +package com.funkymuse.view import android.annotation.TargetApi import android.content.res.TypedArray @@ -11,14 +11,22 @@ import android.graphics.drawable.GradientDrawable import android.os.Build import android.os.SystemClock import android.util.AttributeSet -import android.view.* +import android.view.DisplayCutout +import android.view.MotionEvent +import android.view.ScaleGestureDetector +import android.view.View +import android.view.ViewGroup +import android.view.ViewParent import android.view.animation.AlphaAnimation import android.view.animation.OvershootInterpolator import android.view.inputmethod.InputMethodManager import android.widget.LinearLayout import android.widget.SeekBar import android.widget.TextView -import androidx.annotation.* +import androidx.annotation.ColorInt +import androidx.annotation.ColorRes +import androidx.annotation.IdRes +import androidx.annotation.RequiresApi import androidx.appcompat.widget.PopupMenu import androidx.appcompat.widget.Toolbar import androidx.coordinatorlayout.widget.CoordinatorLayout @@ -28,19 +36,14 @@ import androidx.core.view.ViewCompat import androidx.core.view.WindowInsetsCompat import androidx.core.view.doOnLayout import androidx.core.view.isVisible -import com.crazylegend.common.use -import com.crazylegend.common.withOpacity +import com.funkymuse.common.use +import com.funkymuse.common.withOpacity import com.google.android.material.appbar.AppBarLayout import com.google.android.material.tabs.TabLayout import java.lang.reflect.Field import java.lang.reflect.Method -/** - * Created by hristijan on 8/5/19 to long live and prosper ! - */ - - private fun ViewGroup.enableDisableChildren(enable: Boolean): ViewGroup = apply { (0 until childCount).forEach { when (val view = getChildAt(it)) { diff --git a/view/src/main/java/com/crazylegend/view/ViewExtensions3.kt b/view/src/main/java/com/funkymuse/view/ViewExtensions3.kt similarity index 97% rename from view/src/main/java/com/crazylegend/view/ViewExtensions3.kt rename to view/src/main/java/com/funkymuse/view/ViewExtensions3.kt index 2790cc1ad..97b92608b 100644 --- a/view/src/main/java/com/crazylegend/view/ViewExtensions3.kt +++ b/view/src/main/java/com/funkymuse/view/ViewExtensions3.kt @@ -1,4 +1,4 @@ -package com.crazylegend.view +package com.funkymuse.view import android.animation.Animator import android.animation.ValueAnimator @@ -19,10 +19,6 @@ import com.google.android.material.animation.ArgbEvaluatorCompat import kotlin.math.max -/** - * Created by crazy on 7/24/20 to long live and prosper ! - */ - inline fun View.ifVisible(action: () -> Unit) { if (isVisible) action() } diff --git a/view/src/main/java/com/crazylegend/view/ViewExtensions4.kt b/view/src/main/java/com/funkymuse/view/ViewExtensions4.kt similarity index 96% rename from view/src/main/java/com/crazylegend/view/ViewExtensions4.kt rename to view/src/main/java/com/funkymuse/view/ViewExtensions4.kt index f6c975ae8..6afb2a360 100644 --- a/view/src/main/java/com/crazylegend/view/ViewExtensions4.kt +++ b/view/src/main/java/com/funkymuse/view/ViewExtensions4.kt @@ -1,4 +1,4 @@ -package com.crazylegend.view +package com.funkymuse.view import android.animation.Animator import android.animation.LayoutTransition @@ -17,16 +17,23 @@ import android.widget.FrameLayout import android.widget.LinearLayout import android.widget.RelativeLayout import androidx.activity.ComponentActivity -import androidx.annotation.* +import androidx.annotation.AttrRes +import androidx.annotation.BoolRes +import androidx.annotation.ColorRes +import androidx.annotation.DimenRes +import androidx.annotation.DrawableRes +import androidx.annotation.IntegerRes +import androidx.annotation.PluralsRes +import androidx.annotation.StringRes import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.content.ContextCompat -import androidx.core.view.* +import androidx.core.view.ViewCompat +import androidx.core.view.marginBottom +import androidx.core.view.marginLeft +import androidx.core.view.marginRight +import androidx.core.view.marginTop import com.google.android.material.snackbar.Snackbar -/** - * Created by Hristijan, date 5/26/21 - */ - fun View.xAnimator(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0): Animator { val animator = ObjectAnimator.ofFloat(this, View.X, *values) diff --git a/view/src/main/java/com/crazylegend/view/ViewExtensions5.kt b/view/src/main/java/com/funkymuse/view/ViewExtensions5.kt similarity index 99% rename from view/src/main/java/com/crazylegend/view/ViewExtensions5.kt rename to view/src/main/java/com/funkymuse/view/ViewExtensions5.kt index fc42adf74..7cddf0f3b 100644 --- a/view/src/main/java/com/crazylegend/view/ViewExtensions5.kt +++ b/view/src/main/java/com/funkymuse/view/ViewExtensions5.kt @@ -1,4 +1,4 @@ -package com.crazylegend.view +package com.funkymuse.view import android.animation.Animator import android.animation.ObjectAnimator @@ -16,9 +16,7 @@ import androidx.core.content.ContextCompat import com.google.android.material.bottomsheet.BottomSheetBehavior import com.google.android.material.snackbar.Snackbar -/** - * Created by Hristijan, date 5/26/21 - */ + fun List.gone() { diff --git a/view/src/main/java/com/crazylegend/view/ViewExtensions6.kt b/view/src/main/java/com/funkymuse/view/ViewExtensions6.kt similarity index 99% rename from view/src/main/java/com/crazylegend/view/ViewExtensions6.kt rename to view/src/main/java/com/funkymuse/view/ViewExtensions6.kt index 010988e18..be53a31b7 100644 --- a/view/src/main/java/com/crazylegend/view/ViewExtensions6.kt +++ b/view/src/main/java/com/funkymuse/view/ViewExtensions6.kt @@ -1,4 +1,4 @@ -package com.crazylegend.view +package com.funkymuse.view import android.content.Context import android.content.res.ColorStateList @@ -26,9 +26,7 @@ import com.google.android.material.textfield.TextInputLayout import kotlin.math.max import kotlin.math.min -/** - * Created by Hristijan, date 5/26/21 - */ + private const val DEFAULT_DRAWER_GRAVITY = GravityCompat.START diff --git a/view/src/main/java/com/crazylegend/view/ViewExtensions7.kt b/view/src/main/java/com/funkymuse/view/ViewExtensions7.kt similarity index 98% rename from view/src/main/java/com/crazylegend/view/ViewExtensions7.kt rename to view/src/main/java/com/funkymuse/view/ViewExtensions7.kt index 9b2c11547..aa0e0dcbb 100644 --- a/view/src/main/java/com/crazylegend/view/ViewExtensions7.kt +++ b/view/src/main/java/com/funkymuse/view/ViewExtensions7.kt @@ -1,4 +1,4 @@ -package com.crazylegend.view +package com.funkymuse.view import android.animation.IntEvaluator import android.animation.ValueAnimator @@ -7,7 +7,11 @@ import android.app.Activity import android.content.Context import android.content.res.ColorStateList import android.content.res.TypedArray -import android.graphics.* +import android.graphics.Bitmap +import android.graphics.Canvas +import android.graphics.Color +import android.graphics.PorterDuff +import android.graphics.Rect import android.graphics.drawable.Drawable import android.os.Handler import android.view.MotionEvent @@ -24,9 +28,6 @@ import com.google.android.material.bottomsheet.BottomSheetBehavior import com.google.android.material.floatingactionbutton.FloatingActionButton import com.google.android.material.tabs.TabLayout -/** - * Created by Hristijan, date 5/26/21 - */ /** * Gives focus to the passed view once the view has been completely inflated diff --git a/view/src/main/java/com/crazylegend/view/ViewExtensionsDSL.kt b/view/src/main/java/com/funkymuse/view/ViewExtensionsDSL.kt similarity index 99% rename from view/src/main/java/com/crazylegend/view/ViewExtensionsDSL.kt rename to view/src/main/java/com/funkymuse/view/ViewExtensionsDSL.kt index ed2717f7d..a3bbd6b43 100644 --- a/view/src/main/java/com/crazylegend/view/ViewExtensionsDSL.kt +++ b/view/src/main/java/com/funkymuse/view/ViewExtensionsDSL.kt @@ -1,4 +1,4 @@ -package com.crazylegend.view +package com.funkymuse.view import android.content.Context import android.content.res.Resources @@ -12,9 +12,7 @@ import androidx.constraintlayout.widget.ConstraintSet import androidx.core.content.ContextCompat -/** - * Created by hristijan on 6/7/19 to long live and prosper ! - */ + inline fun T.style(block: T.() -> Unit): T { return this.apply(block) diff --git a/view/src/main/java/com/crazylegend/view/ViewGroup.kt b/view/src/main/java/com/funkymuse/view/ViewGroup.kt similarity index 97% rename from view/src/main/java/com/crazylegend/view/ViewGroup.kt rename to view/src/main/java/com/funkymuse/view/ViewGroup.kt index b3a230531..d48c54b07 100644 --- a/view/src/main/java/com/crazylegend/view/ViewGroup.kt +++ b/view/src/main/java/com/funkymuse/view/ViewGroup.kt @@ -1,4 +1,4 @@ -package com.crazylegend.view +package com.funkymuse.view import android.view.LayoutInflater import android.view.View @@ -6,9 +6,7 @@ import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView -/** - * Created by hristijan on 2/22/19 to long live and prosper ! - */ + /** diff --git a/view/src/main/java/com/crazylegend/view/ViewHelpers.kt b/view/src/main/java/com/funkymuse/view/ViewHelpers.kt similarity index 96% rename from view/src/main/java/com/crazylegend/view/ViewHelpers.kt rename to view/src/main/java/com/funkymuse/view/ViewHelpers.kt index 11be86716..1eed02a28 100644 --- a/view/src/main/java/com/crazylegend/view/ViewHelpers.kt +++ b/view/src/main/java/com/funkymuse/view/ViewHelpers.kt @@ -1,9 +1,15 @@ -package com.crazylegend.view +package com.funkymuse.view import android.app.Activity import android.content.Context import android.content.res.Resources -import android.graphics.* +import android.graphics.Bitmap +import android.graphics.BitmapFactory +import android.graphics.Color +import android.graphics.LinearGradient +import android.graphics.Rect +import android.graphics.Shader +import android.graphics.Typeface import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.ColorDrawable import android.graphics.drawable.Drawable @@ -26,10 +32,6 @@ import androidx.appcompat.widget.SearchView import androidx.core.content.ContextCompat import androidx.swiperefreshlayout.widget.SwipeRefreshLayout -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ - fun View.setLayoutHeight(height: Int) { val params = layoutParams as RelativeLayout.LayoutParams diff --git a/view/src/main/java/com/crazylegend/view/ViewTools.kt b/view/src/main/java/com/funkymuse/view/ViewTools.kt similarity index 97% rename from view/src/main/java/com/crazylegend/view/ViewTools.kt rename to view/src/main/java/com/funkymuse/view/ViewTools.kt index d4372b105..b5907c425 100644 --- a/view/src/main/java/com/crazylegend/view/ViewTools.kt +++ b/view/src/main/java/com/funkymuse/view/ViewTools.kt @@ -1,4 +1,4 @@ -package com.crazylegend.view +package com.funkymuse.view import android.app.Activity import android.app.Dialog @@ -12,7 +12,11 @@ import android.view.Menu import android.view.MenuItem import android.view.View import android.view.WindowManager -import android.widget.* +import android.widget.AdapterView +import android.widget.ArrayAdapter +import android.widget.AutoCompleteTextView +import android.widget.CompoundButton +import android.widget.Spinner import androidx.annotation.ColorInt import androidx.annotation.ColorRes import androidx.annotation.IdRes @@ -26,11 +30,6 @@ import androidx.viewpager.widget.ViewPager import kotlin.math.min -/** - * Created by hristijan on 3/29/19 to long live and prosper ! - */ - - fun Activity.setSystemBarColor(@ColorRes color: Int) { window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS) diff --git a/viewbinding/build.gradle b/viewbinding/build.gradle deleted file mode 100644 index a0ff5e2d3..000000000 --- a/viewbinding/build.gradle +++ /dev/null @@ -1,14 +0,0 @@ -android { - buildFeatures { - viewBinding = true - } - namespace 'com.crazylegend.viewbinding' -} - -dependencies { - implementation "androidx.fragment:fragment-ktx:$fragment" - implementation "androidx.appcompat:appcompat:$appCompat" - implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle" - implementation "androidx.recyclerview:recyclerview:$recyclerview" - -} \ No newline at end of file diff --git a/viewbinding/build.gradle.kts b/viewbinding/build.gradle.kts new file mode 100644 index 000000000..9baf3c653 --- /dev/null +++ b/viewbinding/build.gradle.kts @@ -0,0 +1,16 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +android { + buildFeatures { + viewBinding = true + } +} + +dependencies { + implementation(libs.androidx.fragment.ktx) + implementation(libs.androidx.appcompat) + implementation(libs.androidx.lifecycle.common.java8) + implementation(libs.androidx.recyclerview) +} \ No newline at end of file diff --git a/viewbinding/src/main/java/com/crazylegend/viewbinding/FragmentViewBindingDelegate.kt b/viewbinding/src/main/java/com/funkymuse/viewbinding/FragmentViewBindingDelegate.kt similarity index 91% rename from viewbinding/src/main/java/com/crazylegend/viewbinding/FragmentViewBindingDelegate.kt rename to viewbinding/src/main/java/com/funkymuse/viewbinding/FragmentViewBindingDelegate.kt index f599f1b3e..5ff5cf03d 100644 --- a/viewbinding/src/main/java/com/crazylegend/viewbinding/FragmentViewBindingDelegate.kt +++ b/viewbinding/src/main/java/com/funkymuse/viewbinding/FragmentViewBindingDelegate.kt @@ -1,11 +1,14 @@ -package com.crazylegend.viewbinding +package com.funkymuse.viewbinding import android.os.Handler import android.os.Looper import android.view.View import androidx.fragment.app.Fragment -import androidx.lifecycle.* +import androidx.lifecycle.DefaultLifecycleObserver +import androidx.lifecycle.Lifecycle +import androidx.lifecycle.LifecycleOwner +import androidx.lifecycle.Observer import androidx.viewbinding.ViewBinding import kotlin.properties.ReadOnlyProperty import kotlin.reflect.KProperty diff --git a/viewbinding/src/main/java/com/crazylegend/viewbinding/GlobalViewBindingDelegate.kt b/viewbinding/src/main/java/com/funkymuse/viewbinding/GlobalViewBindingDelegate.kt similarity index 78% rename from viewbinding/src/main/java/com/crazylegend/viewbinding/GlobalViewBindingDelegate.kt rename to viewbinding/src/main/java/com/funkymuse/viewbinding/GlobalViewBindingDelegate.kt index 32e2cbdc0..8590557df 100644 --- a/viewbinding/src/main/java/com/crazylegend/viewbinding/GlobalViewBindingDelegate.kt +++ b/viewbinding/src/main/java/com/funkymuse/viewbinding/GlobalViewBindingDelegate.kt @@ -1,4 +1,4 @@ -package com.crazylegend.viewbinding +package com.funkymuse.viewbinding import android.view.View import androidx.viewbinding.ViewBinding @@ -6,9 +6,6 @@ import kotlin.properties.ReadOnlyProperty import kotlin.reflect.KProperty -/** - * Created by crazy on 3/3/20 to long live and prosper ! - */ class GlobalViewBindingDelegate(val viewBinder: (View) -> T) : ReadOnlyProperty { override fun getValue(thisRef: View, property: KProperty<*>): T { diff --git a/viewbinding/src/main/java/com/crazylegend/viewbinding/ViewBindingExtensions.kt b/viewbinding/src/main/java/com/funkymuse/viewbinding/ViewBindingExtensions.kt similarity index 91% rename from viewbinding/src/main/java/com/crazylegend/viewbinding/ViewBindingExtensions.kt rename to viewbinding/src/main/java/com/funkymuse/viewbinding/ViewBindingExtensions.kt index 3e2543943..2e9cd3ab5 100644 --- a/viewbinding/src/main/java/com/crazylegend/viewbinding/ViewBindingExtensions.kt +++ b/viewbinding/src/main/java/com/funkymuse/viewbinding/ViewBindingExtensions.kt @@ -1,13 +1,10 @@ -package com.crazylegend.viewbinding +package com.funkymuse.viewbinding import android.app.Activity -import android.os.Build import android.os.Looper import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import androidx.annotation.RequiresApi -import androidx.appcompat.app.AppCompatActivity import androidx.core.view.children import androidx.core.view.isInvisible import androidx.core.view.isVisible diff --git a/viewpager2/build.gradle b/viewpager2/build.gradle deleted file mode 100644 index 0beef7419..000000000 --- a/viewpager2/build.gradle +++ /dev/null @@ -1,15 +0,0 @@ - -dependencies { - - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation 'androidx.core:core-ktx:1.12.0' - implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'com.google.android.material:material:1.11.0' - testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.5' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' -} - -android { - namespace 'com.crazylegend.viewpager2' -} \ No newline at end of file diff --git a/viewpager2/build.gradle.kts b/viewpager2/build.gradle.kts new file mode 100644 index 000000000..51c428687 --- /dev/null +++ b/viewpager2/build.gradle.kts @@ -0,0 +1,12 @@ +plugins { + id(libs.plugins.convention.library.get().pluginId) +} + +dependencies { + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.appcompat) + implementation(libs.material) + testImplementation(libs.junit) + androidTestImplementation(libs.androidx.junit) + androidTestImplementation(libs.androidx.espresso.core) +} \ No newline at end of file diff --git a/viewpager2/src/main/AndroidManifest.xml b/viewpager2/src/main/AndroidManifest.xml index a5918e68a..44008a433 100644 --- a/viewpager2/src/main/AndroidManifest.xml +++ b/viewpager2/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/viewpager2/src/main/java/com/crazylegend/viewpager2/AlphaTransformer.kt b/viewpager2/src/main/java/com/funkymuse/viewpager2/AlphaTransformer.kt similarity index 86% rename from viewpager2/src/main/java/com/crazylegend/viewpager2/AlphaTransformer.kt rename to viewpager2/src/main/java/com/funkymuse/viewpager2/AlphaTransformer.kt index 70baec469..dda88a25b 100644 --- a/viewpager2/src/main/java/com/crazylegend/viewpager2/AlphaTransformer.kt +++ b/viewpager2/src/main/java/com/funkymuse/viewpager2/AlphaTransformer.kt @@ -1,13 +1,9 @@ -package com.crazylegend.viewpager2 +package com.funkymuse.viewpager2 import android.view.View import androidx.viewpager2.widget.ViewPager2 import kotlin.math.abs - -/** - * Created by crazy on 2/22/20 to long live and prosper ! - */ class AlphaTransformer : ViewPager2.PageTransformer { override fun transformPage(page: View, position: Float) { val absPos = abs(position) diff --git a/viewpager2/src/main/java/com/crazylegend/viewpager2/DepthPageTransformer.kt b/viewpager2/src/main/java/com/funkymuse/viewpager2/DepthPageTransformer.kt similarity index 94% rename from viewpager2/src/main/java/com/crazylegend/viewpager2/DepthPageTransformer.kt rename to viewpager2/src/main/java/com/funkymuse/viewpager2/DepthPageTransformer.kt index 4d266d50f..bf3fc3b4d 100644 --- a/viewpager2/src/main/java/com/crazylegend/viewpager2/DepthPageTransformer.kt +++ b/viewpager2/src/main/java/com/funkymuse/viewpager2/DepthPageTransformer.kt @@ -1,13 +1,9 @@ -package com.crazylegend.viewpager2 +package com.funkymuse.viewpager2 import android.view.View import androidx.viewpager2.widget.ViewPager2 import kotlin.math.abs - -/** - * Created by crazy on 1/17/20 to long live and prosper ! - */ class DepthPageTransformer : ViewPager2.PageTransformer { private val MIN_SCALE = 0.75f diff --git a/viewpager2/src/main/java/com/crazylegend/viewpager2/ViewPager2Extensions.kt b/viewpager2/src/main/java/com/funkymuse/viewpager2/ViewPager2Extensions.kt similarity index 97% rename from viewpager2/src/main/java/com/crazylegend/viewpager2/ViewPager2Extensions.kt rename to viewpager2/src/main/java/com/funkymuse/viewpager2/ViewPager2Extensions.kt index f64aafeb4..6c12ceb5c 100644 --- a/viewpager2/src/main/java/com/crazylegend/viewpager2/ViewPager2Extensions.kt +++ b/viewpager2/src/main/java/com/funkymuse/viewpager2/ViewPager2Extensions.kt @@ -1,15 +1,10 @@ -package com.crazylegend.viewpager2 +package com.funkymuse.viewpager2 import androidx.annotation.Px import androidx.recyclerview.widget.RecyclerView import androidx.viewpager2.widget.ViewPager2 import kotlin.math.roundToInt - -/** - * Created by hristijan on 7/26/19 to long live and prosper ! - */ - fun ViewPager2.listener(onPageScrollStateChanged: (state: Int) -> Unit = { _ -> }, onPageSelected: (position: Int) -> Unit = { _ -> }, onPageScrolled: (position: Int, positionOffset: Float, positionOffsetPixels: Int) -> Unit = { _, _, _ -> }) { diff --git a/viewpager2/src/main/java/com/crazylegend/viewpager2/ZoomOutPageTransformer.kt b/viewpager2/src/main/java/com/funkymuse/viewpager2/ZoomOutPageTransformer.kt similarity index 94% rename from viewpager2/src/main/java/com/crazylegend/viewpager2/ZoomOutPageTransformer.kt rename to viewpager2/src/main/java/com/funkymuse/viewpager2/ZoomOutPageTransformer.kt index 3dff8c469..9fc6a4446 100644 --- a/viewpager2/src/main/java/com/crazylegend/viewpager2/ZoomOutPageTransformer.kt +++ b/viewpager2/src/main/java/com/funkymuse/viewpager2/ZoomOutPageTransformer.kt @@ -1,16 +1,10 @@ -package com.crazylegend.viewpager2 +package com.funkymuse.viewpager2 import android.view.View import androidx.viewpager2.widget.ViewPager2 import kotlin.math.abs import kotlin.math.max - -/** - * Created by crazy on 1/17/20 to long live and prosper ! - */ - - class ZoomOutPageTransformer : ViewPager2.PageTransformer { private val MIN_SCALE = 0.85f