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
import io.ktor.client.plugins.onUpload | |
import io.ktor.client.request.forms.MultiPartFormDataContent | |
import io.ktor.client.request.forms.formData | |
import io.ktor.client.request.post | |
import io.ktor.client.request.setBody | |
import io.ktor.client.statement.HttpResponse | |
import io.ktor.client.statement.bodyAsText | |
import io.ktor.http.Headers | |
import io.ktor.http.HttpHeaders | |
import kotlinx.coroutines.runBlocking |
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
@Composable | |
@OptIn(ExperimentalMaterial3Api::class) | |
fun HomeTabs(navController: NavHostController, modifier: Modifier = Modifier) { | |
val tabs = homeTabItems | |
var selectedTab: Int by rememberSaveable { mutableIntStateOf(0) } | |
Scaffold( | |
modifier = Modifier.fillMaxSize(), | |
floatingActionButton = { | |
// if (selectedTab == HomeTabItems.AccountFeed.ordinal) { |
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
Tip if you use bash just replace . zshrc with .bash_profile ? | |
Open Terminal and type in.. | |
open ~/.zshrc | |
Add the below paths | |
The path should be where your android installation is located | |
// check in your android studio the JAVA path used | |
export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jbr/Contents/Home |
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
plugins { | |
alias(libs.plugins.android.application) | |
alias(libs.plugins.kotlin.android) | |
alias(libs.plugins.kotlin.compose) | |
alias(libs.plugins.kotlin.serialization) | |
alias(libs.plugins.kotlin.kapt) | |
alias(libs.plugins.dagger.hilt.android) | |
} | |
dependencies { |
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 | |
root_dir="" | |
find "$root_dir" -type d \( -path "*/network" -o -path "*/build" -o -path "*/backup" \) -prune -o -type f -name "*.kt" -exec grep -Hn "import com\.x\.android\.network\." {} \; |
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
dependencies { | |
implementation 'androidx.core:core-ktx:1.6.0' | |
implementation 'androidx.appcompat:appcompat:1.3.1' | |
implementation 'com.google.android.material:material:1.4.0' | |
implementation 'androidx.constraintlayout:constraintlayout:2.0.4' | |
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' | |
implementation "androidx.fragment:fragment-ktx:1.3.6" | |
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1' |
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
find . -name "build" -type d -exec rm -rf "{}" \; | |
rm -rf ~/.gradle/caches/ |
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
fun requestWidgetPinning(context: Context) { | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | |
val appWidgetManager = AppWidgetManager.getInstance(context) | |
val componentName = ComponentName(context, YourAppWidget::class.java) | |
if (appWidgetManager.isRequestPinAppWidgetSupported) { | |
val pinnedWidgetCallbackIntent = Intent(context, YourAppWidget::class.java) | |
val successCallback = PendingIntent.getBroadcast( | |
context, 0, | |
pinnedWidgetCallbackIntent, 0 |
NewerOlder