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
Column( | |
modifier = Modifier.fillMaxSize() | |
) { | |
StandardTopBar(title = stringResource(id = R.string.chats)) | |
PullToRefreshBox( | |
state = pullToRefreshState, | |
refreshing = state.refreshing, | |
modifier = Modifier | |
.fillMaxSize() | |
.pullRefresh(state = pullToRefreshState) |
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
public class LocationUtil { | |
public static int calculateDistanceInKm(double latitude1, double longitude1, double latitude2, double longitude2) { | |
Location location1 = new Location("location_1"); | |
location1.setLatitude(latitude1); | |
location1.setLongitude(longitude1); | |
Location location2 = new Location("location_2"); | |
location2.setLatitude(latitude2); | |
location2.setLongitude(longitude2); | |
return (int) Math.ceil(location1.distanceTo(location2) / 1000); | |
} |
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 GradiantLinearProgressBar( | |
gradientsColors: List<Color>, | |
percent: Double, | |
modifier: Modifier = Modifier, | |
preferredHeight: Dp = 9.dp, | |
shape: Shape = RoundedCornerShape(20.dp), | |
backgroundColor: Color = Color.Transparent, | |
) { | |
val context = LocalContext.current.resources |
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 fun getWordInfo(word: String): Flow<Resource<List<WordInfo>>> = flow { | |
emit(Resource.Loading()) | |
val wordInfos = dao.getCachedWordInfos(word).map { it.toWordInfo() } | |
emit(Resource.Loading(wordInfos)) | |
try { | |
val remoteWorkApi = api.getWorkInfo(word) | |
dao.deleteWordInfos(remoteWorkApi.map { it.word!! }) | |
dao.insertWordInfo(remoteWorkApi.map { it.toWordInfoEntity() }) |
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.tutorial.runningapp.stopwatch | |
import javax.inject.Inject | |
class ClockTimestampProvider @Inject constructor() : TimestampProvider { | |
override fun getMilliseconds(): Long { | |
return System.currentTimeMillis() | |
} | |
} |
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 android.view.LayoutInflater | |
import android.view.View | |
import androidx.appcompat.app.AppCompatActivity | |
import androidx.databinding.ViewDataBinding | |
import androidx.fragment.app.Fragment | |
import androidx.lifecycle.DefaultLifecycleObserver | |
import androidx.lifecycle.Lifecycle | |
import androidx.lifecycle.LifecycleOwner | |
import androidx.lifecycle.Observer | |
import kotlin.properties.ReadOnlyProperty |
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.octopus.searchviewwithrecycler; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.Filter; | |
import android.widget.Filterable; | |
import android.widget.TextView; | |
import androidx.annotation.NonNull; |
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
[ | |
{"code":"ab","name":"Abkhaz","nativeName":"аҧсуа"}, | |
{"code":"aa","name":"Afar","nativeName":"Afaraf"}, | |
{"code":"af","name":"Afrikaans","nativeName":"Afrikaans"}, | |
{"code":"ak","name":"Akan","nativeName":"Akan"}, | |
{"code":"sq","name":"Albanian","nativeName":"Shqip"}, | |
{"code":"am","name":"Amharic","nativeName":"አማርኛ"}, | |
{"code":"ar","name":"Arabic","nativeName":"العربية"}, | |
{"code":"an","name":"Aragonese","nativeName":"Aragonés"}, | |
{"code":"hy","name":"Armenian","nativeName":"Հայերեն"}, |