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
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 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
@WebServlet("/error") | |
public class ErrorHandler extends HttpServlet { | |
private static final long serialVersionUID = 1L; | |
protected void doGet(HttpServletRequest request, | |
HttpServletResponse response) throws ServletException, IOException { | |
processError(request, response); | |
} | |
protected void doPost(HttpServletRequest request, |
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 final class ObjectIdUtils { | |
private static final Logger LOGGER = LoggerFactory.getLogger(ObjectIdUtils.class); | |
private static final char[] BASE36 = { | |
'0', '1', '2', '3', '4', '5', | |
'6', '7', '8', '9', 'A', 'B', | |
'C', 'D', 'E', 'F', 'G', 'H', | |
'I', 'J', 'K', 'L', 'M', 'N', | |
'O', 'P', 'Q', 'R', 'S', 'T', |
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 SystemUtils { | |
private static final Logger LOGGER = LoggerFactory.getLogger(SystemUtils.class); | |
private static final String HOSTNAME_VARIABLE = "HOSTNAME"; | |
private static final String HOSTNAME_COMMAND = "hostname"; | |
private SystemUtils() {} |
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: | |
----------- | |
* ripple effect (Lollipop only) -- "colorControlHighlight" | |
Status Bar: | |
------------ | |
* background (Lollipop only) - "colorPrimaryDark" |
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.res.Resources; | |
import android.graphics.drawable.Drawable; | |
import android.text.Spannable; | |
import android.text.SpannableStringBuilder; | |
import android.text.style.ImageSpan; | |
import android.view.View; | |
import android.widget.ImageView; | |
import android.widget.LinearLayout; | |
import android.widget.SearchView; | |
import android.widget.TextView; |
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
/** | |
* An {@link AsyncTaskLoader} implementation for loading objects like entities, cursors, etc. | |
* which takes care of delivering and reseting results. For Cursors you need to override | |
* onReleaseResources and perform all kind there, e.g. call close() method. | |
*/ | |
public abstract class AsyncGenericLoader<T> extends AsyncTaskLoader<T> { | |
protected T mItems; | |
public AsyncGenericLoader(final Context context) { |
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 final class KeyboardUtils { | |
private KeyboardUtils(){} | |
public static void hideSoftKeyboard(final Activity activity) | |
{ | |
final InputMethodManager imm = (InputMethodManager) activity.getSystemService( | |
Context.INPUT_METHOD_SERVICE); | |
if (activity.getWindow() != null && activity.getWindow().getCurrentFocus() != null) { | |
imm.hideSoftInputFromWindow(activity.getWindow().getCurrentFocus().getWindowToken(), 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
# built application files | |
*.apk | |
*.ap_ | |
# files for the dex VM | |
*.dex | |
# Java class files | |
*.class |
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
/** | |
* Filter for handling and logging uncaught exceptions. | |
*/ | |
@WebFilter(filterName="UncaughtExceptionFilter", urlPatterns = {"/*"}) | |
public class UncaughtExceptionFilter implements Filter { | |
private static final Logger LOGGER = Logger.getLogger(UncaughtExceptionFilter.class); | |
@Override | |
public void doFilter(ServletRequest request, ServletResponse response, |
NewerOlder