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 java.text.ParseException; | |
| import java.text.SimpleDateFormat; | |
| import java.util.Date; | |
| import java.util.TimeZone; | |
| import android.util.Log; | |
| /** | |
| * Utility class for parsing and formatting dates and times. | |
| * |
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.content.Context; | |
| import android.text.TextUtils; | |
| import android.text.format.DateUtils; | |
| import java.text.DateFormat; | |
| import java.text.ParseException; | |
| import java.text.SimpleDateFormat; | |
| import java.util.*; | |
| /** |
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.content.Context; | |
| import android.support.v7.widget.RecyclerView; | |
| import android.util.AttributeSet; | |
| import android.view.View; | |
| import org.jetbrains.annotations.NotNull; | |
| import org.jetbrains.annotations.Nullable; | |
| public class EmptyRecyclerView extends RecyclerView { | |
| @Nullable View emptyView; |
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 class ExcellentAdventure { | |
| @Retention(SOURCE) | |
| @StringDef({ERA_BC, ERA_AD}) | |
| public @interface Era { | |
| } | |
| public static final String ERA_BC = "BC"; | |
| public static final String ERA_AD = "AD"; |
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 class CountingFileRequestBody extends RequestBody { | |
| private static final int SEGMENT_SIZE = 2048; // okio.Segment.SIZE | |
| private final File file; | |
| private final ProgressListener listener; | |
| private final String contentType; | |
| public CountingFileRequestBody(File file, String contentType, ProgressListener listener) { | |
| this.file = file; |
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
| /** | |
| * Our demo fragment | |
| */ | |
| public static class CircularRevealingFragment extends Fragment { | |
| OnFragmentTouched listener; | |
| public CircularRevealingFragment() { | |
| } |
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 "Henry Tao <hi@henrytao.me>" | |
| * | |
| * 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
| package com.etiennelawlor.quickreturn.library.utils; | |
| import android.content.Context; | |
| import android.support.v7.widget.LinearLayoutManager; | |
| import android.support.v7.widget.RecyclerView; | |
| import android.util.DisplayMetrics; | |
| import android.util.Log; | |
| import android.util.TypedValue; | |
| import android.view.Display; | |
| import android.view.View; |
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 static WebRequestTimeout sendGetRequestToServer(Context mContext, URL para_URL) | |
| { | |
| HttpURLConnection getRequest = null; | |
| WebRequestTimeout webRequestTimeout = new WebRequestTimeout(); | |
| try | |
| { | |
| getRequest = (HttpURLConnection) para_URL.openConnection(); | |
| String authtoken = PrefUtils.getAuthToken(mContext); | |
| DefaultOAuthConsumer consumer = new DefaultOAuthConsumer(WebUtils.CONSUMER_KEY, WebUtils.CONSUMER_SECERT); | |
| // sign the request (consumer is a Signpost DefaultOAuthConsumer) |
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.content.Context; | |
| import android.support.v4.content.AsyncTaskLoader; | |
| public abstract class AsyncLoader<T> extends AsyncTaskLoader<T> { | |
| private T mResult; | |
| public AsyncLoader(Context context) { | |
| super(context); | |
| } |