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
@Composable | |
fun Main(list: List<String>) { | |
var items by remember { mutableStateOf(list) } | |
LazyColumn { | |
items(items) { item -> | |
RowView(item) { str -> | |
val pos = items.indexOf(str) | |
Log.v(TAG, "pos $pos") | |
if(pos!= -1) { |
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
[I'm an inline-style link](https://www.somewebsite.com) | |
[I'm an inline-style link with title](https://www.somewebsite.com "somewebsite's Homepage") | |
[I'm a reference-style link][Arbitrary case-insensitive reference text] | |
[I'm a relative reference to a repository file](../blob/master/LICENSE) | |
[You can use numbers for reference-style link definitions][1] |
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
build.gradle (app) | |
dependencies { | |
implementation 'androidx.core:core-ktx:1.8.0' | |
implementation platform('org.jetbrains.kotlin:kotlin-bom:1.8.0') | |
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1' | |
implementation 'androidx.activity:activity-compose:1.5.1' | |
implementation platform('androidx.compose:compose-bom:2022.10.00') | |
implementation 'androidx.compose.ui:ui' |
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
-keep class com.app.demo.model.* { *; } | |
-keep class com.app.demo.remote.SomeResponse { <fields>; } | |
-keep class com.app.demo.SomeEntity { *; } | |
-keep interface com.app.demo.SomeInterface { *; } | |
-keepclassmembers class com.app.demo.SomeClass { | |
public static ** Companion; | |
} |
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
socketio='1.0.0'//‘io.socket:socket.io-client:1.0.0' https://mvnrepository.com/artifact/io.socket/socket.io-client/1.0.0 | |
implementation "io.socket:socket.io-client:$rootProject.socketio" | |
package com.emedinaa.kotlinapp.data.socket | |
import io.socket.client.Ack | |
import io.socket.emitter.Emitter | |
import androidx.annotation.Nullable | |
import io.socket.client.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 <T: ViewModel> T.createFactory() : ViewModelProvider.Factory { | |
val viewModel = this | |
@Suppress("UNCHECKED_CAST") | |
return object :ViewModelProvider.Factory{ | |
override fun <T : ViewModel?> create(modelClass: Class<T>): T = viewModel as T | |
} | |
} |
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
override suspend fun notesByUser( | |
userId: String | |
): OperationResult<List<Note>> { | |
return try { | |
val response = serviceApi.notesByUser(userId) | |
val statusCode = response.code() | |
//200 300 400 | |
if (response.isSuccessful) { //200 | |
val body: NotesResponse? = response.body() | |
OperationResult.Success(body?.data?.map { |
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
package com.emedinaa.kotlin | |
import android.support.v7.app.AppCompatActivity | |
import android.os.Bundle | |
import android.view.MotionEvent | |
import kotlinx.android.synthetic.main.activity_main.* | |
class MainActivity : AppCompatActivity() { | |
var pDownX=0 |
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
Error : | |
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath: | |
/Users/xx/.gradle/caches/transforms-2/files-2.1/5ddeaae6ee15f19826b9dd5f1cf7b0a4/jetified-kotlin-stdlib-jdk7-1.3.72.jar (version 1.3) | |
/Users/xx/.gradle/caches/transforms-2/files-2.1/3951109aac4671bfe341f4dc43e131ef/jetified-kotlin-stdlib-1.4.32.jar (version 1.4) | |
/Users/xx/.gradle/caches/transforms-2/files-2.1/1d67f6842b59bd1bd3d06c3bca4e4ac4/jetified-kotlin-stdlib-common-1.4.32.jar (version 1.4) | |
Inspect dependencies : | |
./gradlew :module:dependencies |
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
Android developers resources | |
Getting started in Android development | |
Android developers | |
- official website https://developer.android.com/ | |
- Codelabs https://codelabs.developers.google.com/ | |
- Youtube https://www.youtube.com/user/androiddevelopers | |
- Android developers Blog https://android-developers.googleblog.com/ | |
NewerOlder