Skip to content

Instantly share code, notes, and snippets.

View mrenouf's full-sized avatar

Mark Renouf mrenouf

View GitHub Profile
#!/usr/bin/env bash
#
# Enable port forwarding when using Private Internet Access
#
# Usage:
# ./port_forwarding.sh
error( )
{
echo "$@" 1>&2
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black">
<android.support.constraint.Guideline
android:id="@+id/guideline_h50"
package com.example.mrenouf.touchtest;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import android.view.View;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
package com.example.mrenouf.touchtest;
import android.graphics.Rect;
import android.support.v4.view.ViewCompat;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import java.util.ArrayList;
import java.util.List;
@mrenouf
mrenouf / NonGreedyNestedScrollView.JAVA
Created February 9, 2018 19:19
NonGreedyNestedScrollView
package com.example.mrenouf.touchtest;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.widget.NestedScrollView;
import android.util.AttributeSet;
import android.view.MotionEvent;
public class NonGreedyNestedScrollView extends NestedScrollView {
@mrenouf
mrenouf / ViewGroups.java
Created February 9, 2018 19:18
ViewGroups
package com.example.mrenouf.touchtest;
import android.support.v4.view.ViewCompat;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
ViewRootImpl.deliverInputEvent
....
ViewRootImpl.processPointerEvent
View.dispatchPointerEvent (DecorView)
View.dispatchTouchEvent (DecorView)
Activity.dispatchTouchEvent (Window.Callback)
Window.superDispatchTouchEvent (PhoneWindow)
DecorView.superDispatchTouchEvent
super.dispatchTouchEvent(event) (ViewGroup)
@mrenouf
mrenouf / keybase.md
Created January 21, 2015 02:56
My Keybase proof

Keybase proof

I hereby claim:

  • I am mrenouf on github.
  • I am mrenouf (https://keybase.io/mrenouf) on keybase.
  • I have a public key whose fingerprint is 3A76 13EC 9AF1 79E5 0A84 E29F C42A 8652 1ACD 8184

To claim this, I am signing this object:

@mrenouf
mrenouf / gist:9aef2e10fc677432cbae
Created May 9, 2014 15:27
ViewGroup.dispatchTouchEvent(MotionEvent)
/**
* {@inheritDoc}
*/
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
if (mInputEventConsistencyVerifier != null) {
mInputEventConsistencyVerifier.onTouchEvent(ev, 1);
}
boolean handled = false;
if (onFilterTouchEventForSecurity(ev)) {
/**
* Manually render this view (and all of its children) to the given Canvas.
* The view must have already done a full layout before this function is
* called. When implementing a view, implement
* {@link #onDraw(android.graphics.Canvas)} instead of overriding this method.
* If you do need to override this method, call the superclass version.
*
* @param canvas The Canvas to which the View is rendered.
*/