This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.Activity; | |
import android.app.Application; | |
import android.arch.lifecycle.GenericLifecycleObserver; | |
import android.arch.lifecycle.Lifecycle; | |
import android.arch.lifecycle.LifecycleObserver; | |
import android.arch.lifecycle.LifecycleOwner; | |
import android.content.Context; | |
import android.os.Bundle; | |
import android.support.v4.app.Fragment; | |
import android.support.v4.app.FragmentManager; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.legendmohe.webviewtest; | |
import android.support.annotation.NonNull; | |
import android.util.Log; | |
import java.util.Arrays; | |
import java.util.Deque; | |
import java.util.HashSet; | |
import java.util.LinkedList; | |
import java.util.Map; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 预加载工具类 | |
* <p> | |
* 适用范围:列表形式的数据进行预加载. | |
* 注意这里的预加载是指预加载数据项的详细信息(例如预拉取视频列表里面某些视频的播放地址等),不是指预先拉取更多的列表项。 | |
* <p> | |
* 概念:加载窗口--即需要发起预加载的项目的index区间; 焦点--即当前外围逻辑所关心的中心点的index,决定了区间的中心 | |
* <p> | |
* 该工具类引入加载窗口的概念(由upperPosition和LowerPosition组成的闭区间),外围调用triggerPreload()传入当前 | |
* 焦点的index,该工具类即回调哪些index离开了加载窗口和哪些index进入了加载窗口(即窗口的变化情况)。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 用于缓存View使用 | |
* | |
* @author legendmohe | |
*/ | |
public final class ViewCache { | |
private static final String TAG = "ViewCache"; | |
private final ExecutorService service; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.util.Log; | |
import android.util.TypedValue; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.view.inputmethod.InputMethodManager; | |
import android.widget.LinearLayout; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""""""""""""""""""""""""""""" | |
" vundle setting | |
"""""""""""""""""""""""""""""" | |
filetype off " required! | |
if has('win32') || has('win64') | |
set rtp+=$HOME/vimfiles/vundle/ | |
call vundle#rc('$HOME/vimfiles/bundle/') | |
else | |
" Usual quickstart instructions | |
set rtp+=~/.vim/vundle/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.ScheduledExecutorService; | |
import java.util.concurrent.ScheduledFuture; | |
import java.util.concurrent.TimeUnit; | |
import java.util.concurrent.locks.Lock; | |
import java.util.concurrent.locks.ReentrantLock; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.concurrent.Executors; | |
import java.util.concurrent.ScheduledExecutorService; | |
/** | |
* Created by legendmohe on 2017/7/7. | |
*/ | |
public class Looper { | |
private static class LazyHolder { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.concurrent.ScheduledFuture; | |
/** | |
* Created by legendmohe on 2017/7/7. | |
*/ | |
public class Message { | |
public int what; | |
public int arg1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
import itertools | |
import os | |
import re | |
INDEX_PATTERN = re.compile(r'\s*((\d\.?)+)\s*', re.DOTALL) |