For example, you want to set 40% alpha transparence to #000000
(black color), you need to add 66
like this #66000000
.
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
public abstract class Mask { | |
public static String unmask(String s) { | |
return s.replaceAll("[.]", "") | |
.replaceAll("[-]", "") | |
.replaceAll("[/]", "") | |
.replaceAll("[(]", "") | |
.replaceAll("[)]", ""); | |
} |
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.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 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
/* | |
* Copyright 2015 Uwe Trottmann | |
* | |
* 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 |
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
/* | |
* Copyright (C) 2013 The Android Open Source Project | |
* | |
* 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 |
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 void removeAllChildFragments() { | |
List<String> childFragmentTags = CHILD_FRAGMENT_TAGS_MAP.get(mParentId); | |
if (childFragmentTags != null && !childFragmentTags.isEmpty()) { | |
List<Fragment> childFragments = getChildFragmentManager().getFragments(); | |
if (childFragments != null && !childFragments.isEmpty()) { | |
FragmentTransaction fragmentTransaction = getChildFragmentManager().beginTransaction(); | |
for (Fragment childFragment : childFragments) { | |
if (childFragment != null) { | |
if (childFragmentTags.contains(childFragment.getTag())) { | |
fragmentTransaction.remove(childFragment); |
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 void removeAllChildFragments() { | |
List<String> childFragmentTags = CHILD_FRAGMENT_TAGS_MAP.get(mParentId); | |
if (childFragmentTags != null && !childFragmentTags.isEmpty()) { | |
List<Fragment> childFragments = getChildFragmentManager().getFragments(); | |
if (childFragments != null && !childFragments.isEmpty()) { | |
FragmentTransaction fragmentTransaction = getChildFragmentManager().beginTransaction(); | |
for (Fragment childFragment : childFragments) { | |
if (childFragment != null) { | |
if (childFragmentTags.contains(childFragment.getTag())) { | |
fragmentTransaction.remove(childFragment); |
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 void removeAllChildFragments() { | |
List<String> childFragmentTags = CHILD_FRAGMENT_TAGS_MAP.get(mParentId); | |
if (childFragmentTags != null && !childFragmentTags.isEmpty()) { | |
List<Fragment> childFragments = getChildFragmentManager().getFragments(); | |
if (childFragments != null && !childFragments.isEmpty()) { | |
FragmentTransaction fragmentTransaction = getChildFragmentManager().beginTransaction(); | |
for (Fragment childFragment : childFragments) { | |
if (childFragment != null) { | |
if (childFragmentTags.contains(childFragment.getTag())) { | |
fragmentTransaction.remove(childFragment); |
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 void removeAllChildFragments() { | |
List<String> childFragmentTags = CHILD_FRAGMENT_TAGS_MAP.get(mParentId); | |
if (childFragmentTags != null && !childFragmentTags.isEmpty()) { | |
List<Fragment> childFragments = getChildFragmentManager().getFragments(); | |
if (childFragments != null && !childFragments.isEmpty()) { | |
FragmentTransaction fragmentTransaction = getChildFragmentManager().beginTransaction(); | |
for (Fragment childFragment : childFragments) { | |
if (childFragment != null) { | |
if (childFragmentTags.contains(childFragment.getTag())) { | |
fragmentTransaction.remove(childFragment); |
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 void removeAllChildFragments() { | |
List<String> childFragmentTags = CHILD_FRAGMENT_TAGS_MAP.get(mParentId); | |
if (childFragmentTags != null && !childFragmentTags.isEmpty()) { | |
List<Fragment> childFragments = getChildFragmentManager().getFragments(); | |
if (childFragments != null && !childFragments.isEmpty()) { | |
FragmentTransaction fragmentTransaction = getChildFragmentManager().beginTransaction(); | |
for (Fragment childFragment : childFragments) { | |
if (childFragment != null) { | |
if (childFragmentTags.contains(childFragment.getTag())) { | |
fragmentTransaction.remove(childFragment); |