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
import android.content.Context; | |
import android.support.annotation.Nullable; | |
import android.support.v7.widget.AppCompatImageView; | |
import android.util.AttributeSet; | |
import android.widget.Checkable; | |
public class CheckableImageView extends AppCompatImageView implements Checkable { | |
private boolean checked; | |
private boolean broadcasting; |
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
Unless specified otherwise, all of the below tinting applies to both Lollipop and pre-Lollipop using AppCompat v21. | |
To use the support version of these attributes, remove the android namespace. | |
For instance, "android:colorControlNormal" becomes "colorControlNormal". | |
These attributes will be propagated to their corresponding attributes within the android namespace | |
for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix. | |
All Clickable Views: | |
----------- |
- Clone https://github.com/facebook/stetho
- Launch the app
$ cd stetho-master/scripts
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 RxFirebaseUtils { | |
public static <T> Observable<T> observeTask(final Task<T> task) { | |
return Observable.<T>create(subscriber -> RxHandler.assignOnTask(subscriber, task)).observeOn( | |
Schedulers.io()); | |
} | |
public static Observable<List<DataSnapshot>> join(final DatabaseReference keysRef, | |
final DatabaseReference objectsRef) { | |
return RxFirebaseDatabase.observeValueEvent(keysRef) |
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 SmsReceiver extends BroadcastReceiver { | |
public static final String SMS_RECEIVED_ACTION = "android.provider.Telephony.SMS_RECEIVED"; | |
private static final String KEY_PDUS = "pdus"; | |
@Override public void onReceive(final Context context, final Intent intent) { | |
if (getActionFromIntent(intent).equals(SMS_RECEIVED_ACTION)) { | |
final Intent smsServiceIntent = new Intent(context, SmsService.class); | |
smsServiceIntent.putExtra(SmsService.KEY_SMS, getSmsFromIntent(intent)); |
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
# Built application files | |
*.apk | |
*.ap_ | |
*.jar | |
# Do not remove ('app' = app's module name) | |
!gradle/wrapper/gradle-wrapper.jar | |
!app/libs/**/*.jar | |
# Files for the dex VM |
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
<!-- Clickable and selectableItemBackground are optional --> | |
<RelativeLayout | |
android:id="@+id/two_line_item" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:background="?selectableItemBackground" | |
android:clickable="true" | |
android:minHeight="72dp" | |
android:paddingEnd="?listPreferredItemPaddingRight" | |
android:paddingLeft="?listPreferredItemPaddingLeft" |