🤵♂️
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
drawRect( | |
color = Color(0xFFFEC93E), | |
topLeft = Offset(greenSize.toPx(), 0f), | |
size = Size(yellowSize.toPx(), 8.dp.toPx()) | |
) | |
//draw red progress with offset = yellow progress + green progress | |
drawRect( | |
color = Color(0xFFED5554), | |
topLeft = Offset(greenSize.toPx() + yellowSize.toPx(), 0f), |
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 | |
fun MultiColorProgressCanvas() { | |
Canvas( | |
modifier = Modifier | |
.height(16.dp) | |
.fillMaxSize() | |
) { | |
} |
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 | |
fun MultiColorProgressCanvas() { | |
Canvas( | |
modifier = Modifier | |
.fillMaxSize() | |
.padding(16.dp) | |
) { | |
//draw shapes here | |
// get canvas width in dp |
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 android.content.Context | |
import android.graphics.* | |
import android.util.AttributeSet | |
import androidx.appcompat.widget.AppCompatSeekBar | |
import androidx.core.content.ContextCompat | |
import com.peoplemesh.now.R | |
class TagTickBar(context: Context, attrs: AttributeSet?, defStyleAttr:Int) :AppCompatSeekBar(context,attrs,defStyleAttr){ | |
constructor(context: Context) : this(context,null) |
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
{ | |
"uiKey": "p440ZPs", | |
"text": "Test 3", | |
"to": { | |
"uuid": "3049" | |
}, | |
"macros": { | |
"employees": {}, | |
"demographics": {}, | |
"attributes": { |
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
I: --> PUT https://app-ws.mesh.ai/service/custom/auth/tasks/322676 | |
I: Content-Type: application/json; charset=UTF-8 | |
I: Content-Length: 28570 | |
I: deviceType: APP | |
I: deviceOsType: Android | |
I: deviceOsVersion: 1 | |
I: Cookie: authToken=uM4vK7zSqB6kZggT9dAfPw | |
I: {"actions":null,"activityCardTask":null,"actual":10.0,"alternateText":null,"commentStatus":null,"completionTS":null,"contentState":null,"createdTS":1619123864000,"delayed":false,"description":null,"detailedStatus":"ONGOING","discussionCommentsCount":null,"dueTS":1625018658000,"from":{"active":true,"lastUserEvent":null,"metadata":{"department":"Technology","designation":"SDE","displayName":"Arun Kumar","email":"[email protected]","firstName":"Arun","gender":"MALE","lastName":"Kumar","level":null,"location":"Hyderabad","managerEmail":"[email protected]"},"organization":{"active":true,"aggregatedvarues":null,"applauseRefillFrequency":"MONTHLY","checkinFrequency":"WEEKLY","country":null,"created":"2020-05-29T18:11:25.000+0000","currency":"INR","defaul |
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 android.graphics.Canvas | |
import android.graphics.Color | |
import android.graphics.ColorFilter | |
import android.graphics.Paint | |
import android.graphics.PixelFormat | |
import android.graphics.RectF | |
import android.graphics.Typeface | |
import android.graphics.drawable.ShapeDrawable | |
import android.graphics.drawable.shapes.OvalShape | |
import android.graphics.drawable.shapes.RectShape |
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
private val vendorDetailsRepo = VendorDetailsRepo() | |
private val _vendorType: MutableLiveData<Vendor> = MutableLiveData() | |
val vendorType: LiveData<Vendor> | |
get() = _vendorType | |
var vendor: LiveData<Result<Vendors>> = _vendorType.switchMap { vendor -> | |
vendor.ifExists { | |
liveData(context = viewModelScope.coroutineContext + Dispatchers.IO) { | |
emit(vendorDetailsRepo.getVendorDetails(it)) | |
} |
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
viewModel.vendor.observe(viewLifecycleOwner) { | |
it?.let { result -> | |
when (result) { | |
is Result.Success -> { | |
// do something on success | |
} | |
is Result.Error -> { | |
// print stack trace | |
} | |
is Result.Loading -> { |
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 okhttp3.MediaType | |
import okhttp3.RequestBody | |
import okio.BufferedSink | |
import okio.source | |
import java.io.IOException | |
import java.io.InputStream | |
class InputStreamRequestBody(private val contentType: MediaType, private val inputStream: InputStream) : RequestBody() { | |
override fun contentType(): MediaType { | |
return contentType |