Skip to content

Instantly share code, notes, and snippets.

View noneorone's full-sized avatar

mars.wong noneorone

  • ShenZhen, China
View GitHub Profile
@alexmiragall
alexmiragall / NestedScrollWebView.java
Last active March 1, 2024 01:45
NestedWebView compatible with CoordinatorLayout
package com.tuenti.nestedwebscrollview;
import android.content.Context;
import android.support.v4.view.MotionEventCompat;
import android.support.v4.view.NestedScrollingChild;
import android.support.v4.view.NestedScrollingChildHelper;
import android.support.v4.view.NestedScrollingParent;
import android.support.v4.view.VelocityTrackerCompat;
import android.support.v4.view.ViewCompat;
import android.support.v4.widget.ScrollerCompat;
@egslava
egslava / WrapContentHeightViewPager.java
Created August 12, 2014 12:28
Wrap content height ViewPager (Android)
package org.cnii.layoutloader.ui;
import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.View;
/**
* Special thanks to Daniel López Lacalle for his response
* (http://stackoverflow.com/questions/8394681/android-i-am-unable-to-have-viewpager-wrap-content/20784791#20784791)
@noneorone
noneorone / selectText
Created March 21, 2012 08:46
To choose the specific characters of the content which included in the specific component.
/**
* To choose the specific characters of the content which included in the specific component.
* @param {String} tagName: the name of a tag(eg.textarea,input etc.)
* @param {Object} obj: component
* @param {Integer} begin: the start index
* @param {Integer} end: the end index.
* @author wangmeng
* @date 2011-10-10
*/
function selectText(tagName, obj, begin, end){