Skip to content

Instantly share code, notes, and snippets.

View armcha's full-sized avatar

Arman armcha

View GitHub Profile
@armcha
armcha / EasingsConstants.java
Created May 26, 2016 17:58
Android interpolators using the bezier function in Path.class. From https://github.com/ai/easings.net/blob/master/easings.yml
package com.fisglobal.lfi.pnc.framework.util;
import android.support.v4.view.animation.PathInterpolatorCompat;
import android.view.animation.Interpolator;
/**
* Cheatsheet: http://easings.net/
*/
public class EasingsConstants {
public static final Interpolator easeInSine = PathInterpolatorCompat.create(0.47f, 0f, 0.745f, 0.715f);
@armcha
armcha / SmartViewPager.java
Created June 28, 2016 18:52 — forked from jacek-marchwicki/SmartViewPager.java
ViewPager with getActiveFragment for position
package com.yapert.view.viewpager;
import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import com.google.common.base.Charsets;
import java.io.ByteArrayOutputStream;
@armcha
armcha / AndroidManifest.xml
Created July 16, 2016 19:12 — forked from cdsap/AndroidManifest.xml
Example ManifestPlaceHolder
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myapplication" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
@armcha
armcha / gist:f7d43821a1b2c349416f1e78bd4ba7e5
Created August 9, 2016 16:56 — forked from AliMD/gist:3344523
All github Emoji (Smiles)

All github Emoji (Smiles)

:bowtie: | 😄 | 😆 | 😊 | 😃 | ☺️ | 😏 | 😍 | 😘 | :kissing_face: | 😳 | 😌 | 😆 | 😁 | 😉 | :wink2: | 👅 | 😒 | 😅 | 😓

😩 | 😔 | 😞 | 😖 | 😨 | 😰 | 😣 | 😢 | 😭 | 😂 | 😲 | 😱 | :neckbeard: | 😫 | 😠 | 😡 | 😤 | 😪 | 😋 | 😷

😎 | 😵 | 👿 | 😈 | 😐 | 😶 | 😇 | 👽 | 💛 | 💙 | 💜 | ❤️ | 💚 | 💔 | 💓 | 💗 | 💕 | 💞 | 💘 | ✨

⭐ | 🌟 | 💫 | 💥 | 💢 | ❗ | ❓ | ❕ | ❔ | 💤 | 💨 | 💦 | 🎶 | 🎵 | 🔥 | 💩 | 💩 | 💩 | 👍 | :thumbs

@armcha
armcha / permissions.txt
Created October 9, 2016 16:04 — forked from Arinerron/permissions.txt
A list of all Android permissions...
android.permission.ACCESS_ALL_DOWNLOADS
android.permission.ACCESS_BLUETOOTH_SHARE
android.permission.ACCESS_CACHE_FILESYSTEM
android.permission.ACCESS_CHECKIN_PROPERTIES
android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY
android.permission.ACCESS_DOWNLOAD_MANAGER
android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED
android.permission.ACCESS_DRM_CERTIFICATES
android.permission.ACCESS_EPHEMERAL_APPS
android.permission.ACCESS_FM_RADIO
@armcha
armcha / Kotlin Date Iterator
Created October 15, 2017 19:22 — forked from elye/Kotlin Date Iterator
Kotlin Date Iterator
class TestingClass {
fun testingFunction() {
for (everyday in this year 2017) {
// Do something with everyday
println(everyday.toString())
}
}
private infix fun year(year: Int): DateRange {
return Date(year, 1, 1)..Date(year, 12, 31)
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.motion.widget.MotionLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/videoMotionLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent">
<ImageView
android:id="@+id/videoViewContainer"
<?xml version="1.0" encoding="utf-8"?>
<MotionScene xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<Transition
app:constraintSetEnd="@id/expanded"
app:constraintSetStart="@id/collapsed">
<OnSwipe
app:dragDirection="dragUp"/>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.motion.widget.MotionLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/mainMotionLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
class SingleViewTouchableMotionLayout(context: Context, attributeSet: AttributeSet? = null) : MotionLayout(context, attributeSet) {
private val viewToDetectTouch by lazy {
findViewById<View>(R.id.videoViewContainer) //TODO move to Attributes
}
private val viewRect = Rect()
private var touchStarted = false
init {
setTransitionListener(object : MotionLayout.TransitionListener {