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
| package com.pixite.fragment.widget; | |
| import android.content.res.Resources; | |
| import android.graphics.Canvas; | |
| import android.graphics.ColorFilter; | |
| import android.graphics.Rect; | |
| import android.graphics.drawable.Drawable; | |
| import android.graphics.drawable.Drawable.Callback; | |
| import android.view.Gravity; |
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
| /* | |
| * The MIT License (MIT) | |
| * | |
| * Copyright (c) 2015 ARNAUD FRUGIER | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is |
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
| // Cordova - Push Notifications - Android | |
| // How to check notifications are disabled for the application? | |
| // Works on Andoid 4.4+ (KitKat) | |
| // Otherwise returns 'true' | |
| // original: | |
| // http://stackoverflow.com/questions/11649151/ | |
| public class NotificationsUtils { |
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
| List<ChatChooseItem> chatChooseItems = getMockItems(); | |
| List<ChatChooseItem> testList = new ArrayList<>(); | |
| PublishSubject<String> publishSubject = PublishSubject.create(); | |
| publishSubject | |
| .throttleWithTimeout(300, TimeUnit.MILLISECONDS) | |
| .flatMap(s -> Observable.from(chatChooseItems) | |
| .filter(chatChooseItem -> chatChooseItem.getName().toLowerCase().contains(s.toLowerCase())) | |
| .toSortedList((lhs, rhs) -> lhs.getName().toLowerCase().compareTo(rhs.getName().toLowerCase())) | |
| ) |
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
| package com.gabesechan.android.reusable.receivers; | |
| import java.util.Date; | |
| import android.content.BroadcastReceiver; | |
| import android.content.Context; | |
| import android.content.Intent; | |
| import android.telephony.TelephonyManager; | |
| public abstract class PhonecallReceiver extends BroadcastReceiver { |
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 com.google.inject.Singleton; | |
| import java.util.regex.Matcher; | |
| import java.util.regex.Pattern; | |
| @Singleton | |
| public class YouTubeHelper { | |
| final String youTubeUrlRegEx = "^(https?)?(://)?(www.)?(m.)?((youtube.com)|(youtu.be))/"; | |
| final String[] videoIdRegex = { "\\?vi?=([^&]*)","watch\\?.*v=([^&]*)", "(?:embed|vi?)/([^/?]*)", "^([A-Za-z0-9\\-]*)"}; |
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
| package productmeister.com.productmeister.view; | |
| import android.annotation.TargetApi; | |
| import android.os.Build; | |
| import android.support.design.widget.AppBarLayout; | |
| import android.support.v4.view.ViewCompat; | |
| import android.support.v7.app.ActionBar; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.support.v7.widget.Toolbar; |
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 EndlessRecyclerViewScrollListener extends RecyclerView.OnScrollListener { | |
| // The minimum amount of items to have below your current scroll position | |
| // before loading more. | |
| private int visibleThreshold = 5; | |
| // The current offset index of data you have loaded | |
| private int currentPage = 0; | |
| // The total number of items in the dataset after the last load | |
| private int previousTotalItemCount = 0; | |
| // True if we are still waiting for the last set of data to load. | |
| private boolean loading = true; |
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
| package com.gabesechan.android.reusable.receivers; | |
| import java.util.Date; | |
| import android.content.BroadcastReceiver; | |
| import android.content.Context; | |
| import android.content.Intent; | |
| import android.telephony.TelephonyManager; | |
| public abstract class PhonecallReceiver extends BroadcastReceiver { |
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
| package cc.cubone.turbo.core.os; | |
| import android.os.Environment; | |
| import java.io.File; | |
| import java.io.FileInputStream; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import java.util.Collection; | |
| import java.util.Enumeration; |