Skip to content

Instantly share code, notes, and snippets.

View ashishjohn1908's full-sized avatar
🎯
Focusing

Ashish John ashishjohn1908

🎯
Focusing
  • Bhavna Soft India Pvt Ltd
  • Noida
View GitHub Profile

Interview Questions

Kotlin

Q1: What is a primary constructor in Kotlin? β˜†β˜†

Answer: The primary constructor is part of the class header. Unlike Java, you don't need to declare a constructor in the body of the class. Here's an example:

@ashishjohn1908
ashishjohn1908 / README.md
Created July 11, 2019 10:50 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

All hex value from 100% to 0% alpha:

@ashishjohn1908
ashishjohn1908 / expand-collapse.java
Created June 27, 2017 06:17 — forked from ZkHaider/expand-collapse.java
Simple Expand / Collapse RecyclerView Item
public static class ExampleViewHolder extends RecyclerView.ViewHolder
implements View.OnClickListener {
private int originalHeight = 0;
private boolean isViewExpanded = false;
private YourCustomView yourCustomView
public ExampleViewHolder(View v) {
super(v);
v.setOnClickListener(this);