Skip to content

Instantly share code, notes, and snippets.

View Alezhka's full-sized avatar
🎈
Focusing

Sturov Aleksey Alezhka

🎈
Focusing
View GitHub Profile
@Alezhka
Alezhka / IntentHelper.java
Last active July 23, 2021 10:07
Open file with default application using Intents
/**
* Send email.
*
* @param context the context
* @param email the email
* @param subject the subject
* @param text the text
*/
public void sendEmail(Context context, String email, String subject,
String text) {
@Alezhka
Alezhka / API.md
Created August 1, 2016 13:39 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

class PreCachingLinearLayoutManager : LinearLayoutManager {
companion object {
val DEFAULT_EXTRA_LAYOUT_SPACE = 600
}
var extraLayoutSpace = -1
private var context: Context
constructor(context: Context) : super(context) {
0x94311875A9b94a183e85F13e1e64DBe1Ed0896BD
@Alezhka
Alezhka / ExpandableLayout.kt
Created February 5, 2018 10:43
ExpandableLayout
class ExpandableLayout : FrameLayout {
companion object {
private val DEFAULT_INTERPOLATOR = AccelerateDecelerateInterpolator()
private const val DEFAULT_DURATION = 500
}
enum class Status {
EXPANDED, COLLAPSED, MOVING
@Alezhka
Alezhka / SwipeViewPager.java
Created July 2, 2018 10:29
Swipe control ViewPager
public class SwipeViewPager extends ViewPager {
public enum SwipeDirection {
all, left, right, none
}
private float initialXValue;
private SwipeDirection direction;
public CustomViewPager(Context context, AttributeSet attrs) {
@Alezhka
Alezhka / AppComponent.java
Last active July 2, 2018 10:42
Dagger2 viewmodel mapping.
@Singleton
@Component(modules = {
AndroidSupportInjectionModule.class,
AppModule.class,
BuildersModule.class})
public interface AppComponent {
void inject(Application app);
@Component.Builder
--> GET https://api.level.travel/client/orders/39054372?auth_token=23856f11-e71c-4c39-8359-1ed60bb53a03&all_payment_methods=true
<-- 200 https://api.level.travel/client/orders/39054372?auth_token=23856f11-e71c-4c39-8359-1ed60bb53a03&all_payment_methods=true (2487ms)
server: nginx/1.18.0
date: Mon, 08 Feb 2021 10:02:16 GMT
content-type: application/json; charset=utf-8
vary: Accept-Encoding
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
x-download-options: noopen