Skip to content

Instantly share code, notes, and snippets.

View quentin23soleil's full-sized avatar

Quentin Dommerc quentin23soleil

View GitHub Profile
@RubyLichtenstein
RubyLichtenstein / PainlessFragmentArguments.md
Last active May 10, 2024 14:41
Painless android fragments with Kotlin

Starting new fragments with Kotlin is easy

Example

val user = User(id = "id", name = "Ruby")
val userFragment: UserFragment = newFragment<User, UserFragment>(user)

How this magic works

@tzmartin
tzmartin / m3u8-to-mp4.md
Last active July 2, 2024 18:19
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
#parse("File Header.java")
public class ${NAME} extends AppCompatActivity {
private static final String TAG = ${NAME}.class.getSimpleName();
/**
@ouchadam
ouchadam / gist:876aa29b80752ecaaa08
Created January 25, 2016 15:18
exoplayer x86 hack
private static Pair<String, CodecCapabilities> getMediaCodecInfoInternal(CodecKey key,
MediaCodecListCompat mediaCodecList) {
String mimeType = key.mimeType;
int numberOfCodecs = mediaCodecList.getCodecCount();
boolean secureDecodersExplicit = mediaCodecList.secureDecodersExplicit();
// Note: MediaCodecList is sorted by the framework such that the best decoders come first.
Log.e("!!!", " --------- secure explicit? : " + secureDecodersExplicit);
for (int i = 0; i < numberOfCodecs; i++) {
MediaCodecInfo info = mediaCodecList.getCodecInfoAt(i);
@alexfacciorusso
alexfacciorusso / KtRetrofit.kt
Last active September 12, 2019 12:05
Retrofit Kotlin extensions
import retrofit.Call
import retrofit.Callback
import retrofit.Response
import retrofit.Retrofit
/**
* @author Alex Facciorusso
* @since 06/11/15
*/
@gabrielemariotti
gabrielemariotti / README.md
Last active February 24, 2021 10:52
How to manage the support libraries in a multi-module projects. Thanks to Fernando Cejas (http://fernandocejas.com/)

Centralize the support libraries dependencies in gradle

Working with multi-modules project, it is very useful to centralize the dependencies, especially the support libraries.

A very good way is to separate gradle build files, defining something like:

root
  --gradleScript
 ----dependencies.gradle
@seanKenkeremath
seanKenkeremath / Android Lollipop Widget Tinting Guide
Last active November 17, 2023 12:40
How base colors in Lollipop apply to different UI elements
Unless specified otherwise, all of the below tinting applies to both Lollipop and pre-Lollipop using AppCompat v21. To use the support version of these attributes, remove the android namespace. For instance, "android:colorControlNormal" becomes "colorControlNormal". These attributes will be propagated to their corresponding attributes within the android namespace for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix.
All Clickable Views:
-----------
* ripple effect (Lollipop only) -- "colorControlHighlight"
Status Bar:
------------
* background (Lollipop only) - "colorPrimaryDark"
@marianeum
marianeum / FloatingActionButton.java
Last active November 25, 2015 11:24
FloatingActionButton with custom ripple colours
package com.marianeum.fab;
import android.animation.AnimatorInflater;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Outline;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.RippleDrawable;
import android.util.AttributeSet;
@xrigau
xrigau / AndroidManifest.xml
Last active October 22, 2022 02:36
Disable animations for Espresso tests - run with `gradle cATDD`
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.novoda.espresso">
<!-- For espresso testing purposes, this is removed in live builds, but not in dev builds -->
<uses-permission android:name="android.permission.SET_ANIMATION_SCALE" />
<!-- ... -->
@ignasi
ignasi / db_getter.sh
Created January 30, 2014 11:43
Get database from an Android app (Android 4.3+)
#!/bin/bash
# Android 4.3+ changes app's internal directory permissions and you can not just pull your
# databases to your computer, so I did this as a workaround to extract my databases.
# I only use it for debug, use it under your responsability.
package=$1
db_name=$2
path="/data/data/$package/"