###Sketch trial non stop
Open hosts files:
$ open /private/etc/hosts
Edit the file adding:
127.0.0.1 backend.bohemiancoding.com
127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com
import java.lang.reflect.ParameterizedType; | |
import java.lang.reflect.Type; | |
import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.Iterator; | |
import com.google.gson.Gson; | |
import com.google.gson.JsonArray; | |
import com.google.gson.JsonDeserializationContext; | |
import com.google.gson.JsonDeserializer; |
public class SingletonClass implements Serializable { | |
private static volatile SingletonClass sSoleInstance; | |
//private constructor. | |
private SingletonClass(){ | |
//Prevent form the reflection api. | |
if (sSoleInstance != null){ | |
throw new RuntimeException("Use getInstance() method to get the single instance of this class."); |
package com.handstandsam.mutablestateflow | |
import kotlinx.coroutines.flow.MutableStateFlow | |
import kotlinx.coroutines.test.runBlockingTest | |
import org.junit.Test | |
class UseImmutableDataWithMutableStateFlow { | |
data class SomePojo(var name: String = "placeholder") |
public class MLRoundedImageView extends ImageView { | |
public MLRoundedImageView(Context context) { | |
super(context); | |
} | |
public MLRoundedImageView(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
} |
/* | |
* Copyright 2015 Michael Rozumyanskiy | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
private class HttpInterceptor implements Interceptor { | |
@Override | |
public Response intercept(Chain chain) throws IOException { | |
Request request = chain.request(); | |
//Build new request | |
Request.Builder builder = request.newBuilder(); | |
builder.header("Accept", "application/json"); //if necessary, say to consume JSON | |
MIT License | |
Copyright (c) 2020 Jan Heinrich Reimer | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
/** | |
_____ _____ _ | |
| __ \ / ____| | | | |
| | | | ___| | _ __ _ _ _ __ | |_ ___ _ __ | |
| | | |/ _ \ | | '__| | | | '_ \| __/ _ \| '__| | |
| |__| | __/ |____| | | |_| | |_) | || (_) | | | |
|_____/ \___|\_____|_| \__, | .__/ \__\___/|_| | |
__/ | | | |
|___/|_| | |
*/ |
class Thing( | |
private val savedStateHandle: SavedStateHandle, | |
private val key: String, | |
) { | |
private val someExistingStateFlow = MutableStateFlow<String>(savedStateHandle[key] ?: "default Initial") | |
private val myStateFlow = someExistingStateFlow.saveWith(savedStateHandle = savedStateHandle, key = key) | |
private val myNewStateFlow = SaveableMutableStateFlow<String>(savedStateHandle = savedStateHandle, key = key) | |
} |
###Sketch trial non stop
Open hosts files:
$ open /private/etc/hosts
Edit the file adding:
127.0.0.1 backend.bohemiancoding.com
127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com