This file has been truncated, but you can view the full file.
This file contains 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
<?xml version="1.0" ?> | |
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"> | |
<channel> | |
<title>Read it Later feed</title> | |
<generator>Hugo -- gohugo.io</generator> | |
<atom:link href="https://www.marcogomiero.com/index.xml" rel="self" type="application/rss+xml"/> | |
<item> | |
<title>Why is xcodebuild slower than the Xcode GUI? | by Thomas Ricouard | Oct, 2024 | Medium</title> | |
<link>https://dimillian.medium.com/why-is-xcodebuild-slower-than-the-xcode-gui-38f3d7b0c0bc?s=09</link> | |
<pubDate>2024-10-28T11:13:59.217 +0000</pubDate> |
This file contains 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
import androidx.compose.foundation.Text | |
import androidx.compose.foundation.clickable | |
import androidx.compose.foundation.layout.* | |
import androidx.compose.material.* | |
import androidx.compose.material.icons.Icons | |
import androidx.compose.material.icons.filled.KeyboardArrowDown | |
import androidx.compose.runtime.Composable | |
import androidx.compose.runtime.mutableStateOf | |
import androidx.compose.runtime.remember | |
import androidx.compose.ui.Alignment |
This file contains 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
apply plugin: 'com.jfrog.bintray' | |
group 'com.your.awesome.lib' | |
version '1.0.0' | |
project.ext { | |
mavGitUrl = 'https://github.com/prof18/AwesomeLib.git' | |
mavProjectName = 'AwesomeLib' | |
mavLibraryLicenses = ["Apache-2.0":'http://www.apache.org/licenses/LICENSE-2.0.txt'] | |
mavLibraryDescription = "An Awesome Android library" |
This file contains 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
apply plugin: 'maven-publish' | |
apply plugin: 'com.jfrog.bintray' | |
group 'com.your.awesome.lib' | |
version '1.0.0' | |
publishing { | |
publications { | |
Production(MavenPublication) { | |
artifact("$buildDir/outputs/aar/awesomelibrary-release.aar") { |
This file contains 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
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import androidx.recyclerview.widget.RecyclerView | |
class ${NAME}(val items: MutableList<${ITEM_CLASS}>) : RecyclerView.Adapter<${NAME}.ViewHolder>() { | |
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = ViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.${LAYOUT_RES_ID}, parent, false)) |
This file contains 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
coroutineScope.launch(Dispatchers.Main) { | |
try { | |
val parser = Parser() | |
val articleList = parser.getArticles(url) | |
setArticleList(articleList) | |
} catch (e: Exception) { | |
e.printStackTrace() | |
_snackbar.value = "An error has occurred. Please retry" | |
setArticleList(mutableListOf()) | |
} |
This file contains 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
@Throws(Exception::class) | |
suspend fun getArticles(url: String) = | |
withContext(Dispatchers.IO) { | |
val xml = async { CoroutineEngine.fetchXML(url) } | |
return@withContext CoroutineEngine.parseXML(xml) | |
} |
This file contains 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
object CoroutineEngine { | |
@Throws(Exception::class) | |
suspend fun fetchXML(url: String) = | |
withContext(Dispatchers.IO) { | |
return@withContext CoreXMLFetcher.fetchXML(url) | |
} | |
@Throws(Exception::class) | |
suspend fun parseXML(xml: Deferred<String>) = | |
withContext(Dispatchers.IO) { |
This file contains 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
fun execute(url: String) { | |
Executors.newSingleThreadExecutor().submit{ | |
val service = Executors.newFixedThreadPool(2) | |
val f1 = service.submit<String>(XMLFetcher(url)) | |
try { | |
val rssFeed = f1.get() | |
val f2 = service.submit(XMLParser(rssFeed)) | |
onComplete.onTaskCompleted(f2.get()) | |
} catch (e: Exception) { | |
onComplete.onError(e) |
This file contains 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 XMLFetcher(private val url: String) : Callable<String> { | |
@Throws(Exception::class) | |
override fun call(): String { | |
return CoreXMLFetcher.fetchXML(url) | |
} | |
} |
NewerOlder