Skip to content

Instantly share code, notes, and snippets.


Victor Campos vic797

View GitHub Profile
vic797 /
Last active Oct 21, 2020
Grid layout pager adapter
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.GridView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.viewpager.widget.PagerAdapter;
vic797 /
Last active Oct 21, 2020
Simple line indicator for ViewPager
import android.content.Context;
import android.database.DataSetObserver;
import android.util.AttributeSet;
import android.view.View;
import androidx.annotation.NonNull;
vic797 / getparams.js
Created May 28, 2019
Function to read the GET parameters from JavaScript
View getparams.js
function loadGet() {
var getData = {};
var url = decodeURI(window.location.href);
try {
var getArr = url.split("?")[1];
var args = getArr.split("&");
for (var a = 0; a < args.length; a++) {
var kv = args[a].split("=");
getData[kv[0]] = kv[1];
import android.appwidget.AppWidgetHost;
import android.appwidget.AppWidgetHostView;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProviderInfo;
import android.content.Intent;
import android.view.Gravity;
import android.view.ViewGroup;
import android.widget.FrameLayout;
View AudioManager.cs
using System;
using System.Runtime.InteropServices;
// ReSharper disable SuspiciousTypeConversion.Global
// ReSharper disable InconsistentNaming
namespace VideoPlayerController
/// <summary>
/// Controls audio using the Windows CoreAudio API
/// from:
View android_material_design_colours.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- google's material design colours from -->
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
<color name="md_red_200">#EF9A9A</color>
vic797 / mcfunction.xml
Last active Jan 15, 2018
This is the syntax hylighter for Notepad++ for Minecraft functions introduced in version 1.12. Includes all the commands. When Mojang releases the 1.13 I will update this.
View mcfunction.xml
<UserLang name="Minecraft" ext="mcfunction" udlVersion="2.1">
<Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
<Prefix Keywords1="yes" Keywords2="yes" Keywords3="yes" Keywords4="yes" Keywords5="yes" Keywords6="yes" Keywords7="no" Keywords8="no" />
<Keywords name="Comments">00 01 02 03 04</Keywords>
<Keywords name="Numbers, prefix1">~</Keywords>
<Keywords name="Numbers, prefix2">-</Keywords>
vic797 /
Last active May 28, 2018
This is a simple class for basic gestures detection on Android. The original class that I found on internet includes only the swipe gestures.
import android.content.Context;
import android.util.Log;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
public abstract class OnSwipeTouchListener implements View.OnTouchListener {
private final GestureDetector gestureDetector;