Skip to content

Instantly share code, notes, and snippets.

View Yazon2006's full-sized avatar

Maksim Motorny Yazon2006

View GitHub Profile
@Yazon2006
Yazon2006 / movies.json
Created August 4, 2022 15:49
Json example
{ "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@Yazon2006
Yazon2006 / FragmentArg.kt
Created February 20, 2018 07:42
Frgment arg helper
/**
* Eases the Fragment.newInstance ceremony by marking the fragment's args with this delegate
* Just write the property in newInstance and read it like any other property after the fragment has been created
*
* Inspired by Jake Wharton, he mentioned it during his IO/17 talk about Kotlin
*/
class FragmentArg<T : Any?> : kotlin.properties.ReadWriteProperty<Fragment, T?> {
var value: T? = null
@Yazon2006
Yazon2006 / FragmentContainer.kt
Created January 31, 2018 13:31
FragmentContainer that allow to use fitsSystemWindow in fragments that added using fragment transaction
package com.imslp.app.presentation.base
import android.content.Context
import android.graphics.Rect
import android.os.Parcel
import android.os.Parcelable
import android.util.AttributeSet
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
@Yazon2006
Yazon2006 / AndroidManifest.xml
Last active December 25, 2017 14:07
change photo on the fly
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.app.myapplication">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:name="com.example.app.App"
android:allowBackup="true"
public class ReaderViewPagerTransformer implements ViewPager.PageTransformer {
public static enum TransformType {
FLOW,
DEPTH,
ZOOM,
SLIDE_OVER
}
private final TransformType mTransformType;
@Yazon2006
Yazon2006 / CartRecyclerViewAdapter.java
Created July 19, 2016 13:40
RecyclerViewAdapter with header and footer
package me.uryuk.uryukandroid.ui.adapters;
import android.content.Context;
import android.graphics.Typeface;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
public class FriendsExpandableRecyclerViewAdapter extends RecyclerView.Adapter<FriendsExpandableRecyclerViewAdapter.FriendViewHolder> {
private final List<Friend> friends;
private final Context context;
private final ErrorHandlingCallback errorHandlingCallback;
private final StopRefreshCallback stopRefreshCallback;
private IApiManager apiManager = NudgeApp.getApplication().getAppComponent().provideApiManager();
public FriendsExpandableRecyclerViewAdapter(Context context, List<Friend> friends, @NonNull ErrorHandlingCallback errorHandlingCallback, @NonNull StopRefreshCallback stopRefreshCallback) {
this.context = context;