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.example.myapplication | |
import android.content.pm.PackageManager | |
import androidx.activity.result.ActivityResultLauncher | |
import androidx.activity.result.contract.ActivityResultContracts | |
import androidx.core.app.ActivityCompat | |
import androidx.core.content.ContextCompat | |
import androidx.fragment.app.Fragment | |
import androidx.lifecycle.Lifecycle | |
import androidx.lifecycle.LifecycleObserver |
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.youtube.sorcjc.proyectoprofesionales.io; | |
import com.google.gson.Gson; | |
import com.google.gson.GsonBuilder; | |
import com.squareup.okhttp.OkHttpClient; | |
import com.squareup.okhttp.logging.HttpLoggingInterceptor; | |
import com.youtube.sorcjc.proyectoprofesionales.io.deserializers.LoginDeserializer; | |
import com.youtube.sorcjc.proyectoprofesionales.io.responses.LoginResponse; | |
import retrofit.GsonConverterFactory; |
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.westwingnow.android.utils | |
import android.os.SystemClock | |
import android.view.View | |
import java.util.* | |
/** | |
* A Throttled OnClickListener | |
* Rejects clicks that are too close together in time. | |
* This class is safe to use as an OnClickListener for multiple views, and will throttle each one separately. |
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.Canvas; | |
import android.graphics.Paint; | |
import android.support.annotation.NonNull; | |
import android.support.annotation.Nullable; | |
import android.text.style.ReplacementSpan; | |
public class CircleTextSpan extends ReplacementSpan { | |
private final int backgroundColor; | |
private final int textColor; |
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
/** | |
* Add this to (e.g.) an EditText via addTextChangedListener() to prevent any user input | |
* that doesn't match its supplied regex. | |
* | |
* Inspired by original Java code here: http://stackoverflow.com/a/11545229/1405990 | |
*/ | |
class RegexMaskTextWatcher(regexForInputToMatch : String) : TextWatcher { | |
private val regex = Pattern.compile(regexForInputToMatch) | |
private var previousText: String = "" |
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.app; | |
import android.os.Bundle; | |
import android.support.v4.app.Fragment; | |
import android.view.View; | |
/** | |
* Fragment for handling view after it has been created and visible to user for the first time. | |
* | |
* <p>Specially in {@link android.support.v4.view.ViewPager}, the page will be created beforehand |
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.os.SystemClock; | |
import android.view.View; | |
import java.util.Map; | |
import java.util.WeakHashMap; | |
/** | |
* A Debounced OnClickListener | |
* Rejects clicks that are too close together in time. | |
* This class is safe to use as an OnClickListener for multiple views, and will debounce each one separately. |