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
// Take photo from camera and save it to public gallery | |
// Before Q and After Q implementations | |
// Answer riginally taken from this SO answer | |
// https://stackoverflow.com/a/59482148/5695091 | |
private val REQUEST_TAKE_PHOTO = 101 | |
private val REQUEST_PICK_PHOTO = 102 | |
private var photoURI : Uri? = null | |
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.os.AsyncTask | |
import android.util.Log | |
import androidx.test.ext.junit.runners.AndroidJUnit4 | |
import org.junit.Test | |
import org.junit.runner.RunWith | |
import java.io.BufferedInputStream | |
import java.net.URL | |
/** | |
* Created by Mustafa Urgupluoglu on 12.04.2019. |
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
fun View.visible() { | |
visibility = View.VISIBLE | |
} | |
fun View.invisible() { | |
visibility = View.INVISIBLE | |
} | |
fun View.gone() { | |
visibility = View.GONE |
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 CustomInfoWindowAdapter implements GoogleMap.InfoWindowAdapter { | |
private Activity context; | |
public CustomInfoWindowAdapter(Activity context){ | |
this.context = context; | |
} | |
@Override |
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.graphics.Rect; | |
import android.support.v7.widget.GridLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.View; | |
public class EqualSpacingItemDecoration extends RecyclerView.ItemDecoration { | |
private final int spacing; | |
private int displayMode; | |
public static final int HORIZONTAL = 0; |
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.os.Parcel; | |
import android.os.Parcelable; | |
public class ParcelableHelper { | |
/** | |
* There is not always a guarantee that Parcelable values will be immediately written out and | |
* read back in. For data data that mutable (its own issue), this can be a problem. This is | |
* for the times when it would be great to have confidence that you will be working with a copy | |
* of that data. | |
*/ |