This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd $1 | |
declare -a BRANCHES=(`git for-each-ref --format='%(refname:short)' refs/heads/`) | |
CURRENT=(`git rev-parse --abbrev-ref HEAD`) | |
for BRANCH in "${BRANCHES[@]}" | |
do | |
EXISTS=(`git ls-remote --heads origin refs/heads/"$BRANCH" | wc -l`) | |
if [ "$CURRENT" != "$BRANCH" ] && [ "$EXISTS" = 0 ] | |
then | |
git branch -D "$BRANCH" | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd $1 | |
declare -a BRANCHES=(`git for-each-ref --format='%(refname:short)' refs/heads/`) | |
CURRENT=(`git rev-parse --abbrev-ref HEAD`) | |
for BRANCH in "${BRANCHES[@]}" | |
do | |
if [ "$CURRENT" = "$BRANCH" ] | |
then | |
git pull | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Gradle | |
org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2048M" | |
org.gradle.java.installations.fromEnv=JDK_17 | |
org.gradle.configureondemand=true | |
org.gradle.daemon=true | |
org.gradle.parallel=true | |
org.gradle.workers.max=8 | |
java.mainToolchainVersion=17 | |
java.modularToolchainVersion=17 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencyResolutionManagement { | |
repositories { | |
google() | |
mavenCentral() | |
} | |
versionCatalogs { | |
create("commonlibs") { | |
from(files("./catalogs/common.versions.toml")) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[versions] | |
library-group = "com.my.library" | |
library-version = "0.0.1" | |
android = "8.0.2" | |
kotlin = "1.8.20" | |
kover = "0.6.1" | |
ksp = "1.8.20-1.0.11" | |
[libraries] | |
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib-common", version.ref = "kotlin" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DemoApp : Application() { | |
override fun onCreate() { | |
super.onCreate() | |
startKoin { | |
androidContext(this@DemoApp) | |
modules(searchViewActivityModule) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val searchViewActivityModule = module { | |
viewModel { SearchViewModel() } | |
factory { DataSource() } | |
factory { (elements: ArrayList<DesiredObject>) -> SearchRecyclerViewAdapter(elements) } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SearchRecyclerViewAdapter(var elements: ArrayList<DesiredObject>): | |
RecyclerView.Adapter<SearchRecyclerViewAdapter.ViewHolder>() { | |
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { | |
val layout = LayoutInflater.from(parent.context) | |
.inflate(R.layout.list_item, parent, false) | |
return ViewHolder(layout) | |
} | |
override fun getItemCount(): Int { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class DesiredObject(var text: String) | |
class DataSource() { | |
var elements: MutableArrayList<DesiredObject> | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SearchViewModel(): ViewModel(), KoinComponent { | |
val datasource: DataSource by inject() | |
val adapter: SearchRecyclerViewAdapter by inject { | |
parametersOf(datasource.elements) | |
} | |
var searchOrder = SortOrder.ASCENDING | |
set(value) { |
NewerOlder