Skip to content

Instantly share code, notes, and snippets.

View tahakorkem's full-sized avatar
🔥

Taha Körkem tahakorkem

🔥
View GitHub Profile
@liamkernighan
liamkernighan / AndroidCommunicator.d.ts
Created April 23, 2020 09:25
Android + WebView communication example
declare module 'AndroidCommunicator' {
global {
interface Window {
Android: AndroidCommunicator | undefined;
}
type AndroidCommunicator = {
setCallbackExists: (v: boolean) => void;
reload: () => void;
@ardovic
ardovic / SampleGIFWallpaperService.java
Last active August 15, 2023 04:06
Sample GIF Wallpaper Service implementation (Android WallpaperService)
import android.graphics.Canvas;
import android.graphics.Movie;
import android.os.Handler;
import android.service.wallpaper.WallpaperService;
import android.util.Log;
import android.view.SurfaceHolder;
import java.io.IOException;
public class SampleGIFWallpaperService extends WallpaperService {
@iangilman
iangilman / MyLWPService.java
Last active August 10, 2023 18:36
Android WallpaperService with WebView
import android.content.BroadcastReceiver;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.graphics.Canvas;
import android.graphics.Point;
import android.preference.PreferenceManager;
import android.service.wallpaper.WallpaperService;
import android.content.Context;
import android.support.v4.content.LocalBroadcastManager;
@NielsMasdorp
NielsMasdorp / ElevationAppBarLayout.md
Created November 22, 2018 12:05
AppBarLayout that sets elevation when scrolling view is scrolling and no elevation when scrolling view is at the top
/**
 * [AppBarLayout] that monitors behavior of a scrolling view in the same layout and changes elevation on its Toolbar
 *
 * Usage:
 *
 * <ElevationAppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:elevation="0dp"
@mikecastrodemaria
mikecastrodemaria / test-doc-see-as-virus-by-clamav.txt
Last active April 10, 2025 15:46
A simple text file to be used as positive test for ClamAv virus scanner
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
@deepakpk009
deepakpk009 / media.json
Created November 8, 2017 14:02
sample free video urls
{
"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"
],
@artzmb
artzmb / layout#activity_main.xml
Created August 1, 2017 22:55
Android - Selector in vector drawables
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="ru.artzmb.solar.MainActivity">
<ImageView
@paulocaldeira17
paulocaldeira17 / AppBarStateChangeListener.java
Last active August 22, 2024 06:23
Android AppBarLayout collapsed/expanded state listener
import android.support.design.widget.AppBarLayout;
/**
* App bar collapsing state
* @author Paulo Caldeira <[email protected]>.
*/
public abstract class AppBarStateChangeListener implements AppBarLayout.OnOffsetChangedListener {
// State
public enum State {
EXPANDED,
@lucasad
lucasad / dabblet.css
Created August 13, 2013 20:16
Indeterminate progress bar
/**
* Indeterminate progress bar
*/
@import url('http://netdna.bootstrapcdn.com/bootstrap/3.0.0-rc1/css/bootstrap.min.css');
@keyframes push
{
0% {width: 0%;}
50% {width: 70%;}
100% {width: 0%;}
@codebutler
codebutler / JsonHelper.java
Created April 8, 2012 20:20
Convert Android JSONObject/JSONArray to a standard Map/List.
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.*;
public class JsonHelper {
public static Object toJSON(Object object) throws JSONException {
if (object instanceof Map) {
JSONObject json = new JSONObject();