For example, you want to set 40% alpha transparence to #000000
(black color), you need to add 66
like this #66000000
.
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
/** | |
Usage for extensions. | |
Initialize Moshi in your Converter class | |
*/ | |
private val moshi: Moshi = Moshi.Builder() | |
.add(KotlinJsonAdapterFactory()) | |
.build() | |
/** | |
* [Moshi] extension to transform a [List] to Json |
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
class CurlInterceptor extends Interceptor { | |
@override | |
void onRequest(RequestOptions options, RequestInterceptorHandler handler) { | |
try { | |
final qp = options.queryParameters; | |
final h = options.headers; | |
final d = options.data; | |
final curl = | |
'curl -X ${options.method} \'${options.baseUrl}${options.path}' + | |
(qp.length != 0 ? qp.keys.fold('', (value, key) => '$value${value.length == 0 ? '?' : '&'}$key=${qp[key]}\'') : '\'') + |
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
// generate app-release.apks | |
java -jar bundletool-all-1.4.0.jar build-apks --local-testing --bundle=app-release.aab --output=app-release.apks --connected-device | |
// Install apk from genrated app-release apks | |
java -jar bundletool-all-1.4.0.jar install-apks --apks app-release.apks |
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.text.SpannableStringBuilder | |
import android.text.Spanned | |
import android.text.TextPaint | |
import android.text.method.LinkMovementMethod | |
import android.text.style.ClickableSpan | |
import android.view.View | |
import androidx.appcompat.widget.AppCompatTextView | |
fun AppCompatTextView.highLightWord(word: String, onClick: () -> Unit) { | |
val ssBuilder = SpannableStringBuilder(this.text) |
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 onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | |
mView = inflater.inflate(R.layout.fragment_base_section, container, false) | |
KeyboardUtil(requireActivity(), mView.coordinatorLayout) | |
return mView | |
} |
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 MySwipeToRefresh extends SwipeRefreshLayout { | |
private int mTouchSlop; | |
private float mPrevX; | |
public MySwipeToRefresh (Context context, AttributeSet attrs) { | |
super(context, attrs); | |
mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); | |
} |
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
codecov: | |
branch: master | |
bot: null | |
coverage: | |
precision: 2 | |
round: down | |
range: "70...100" | |
status: |
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
## Pre-requisite: You have to know your last commit message from your deleted branch. | |
git reflog | |
# Search for message in the list | |
# a901eda HEAD@{18}: commit: <last commit message> | |
# Now you have two options, either checkout revision or HEAD | |
git checkout a901eda | |
# Or | |
git checkout HEAD@{18} |
Picking the right architecture = Picking the right battles + Managing trade-offs
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
NewerOlder