Skip to content

Instantly share code, notes, and snippets.

RxView.clicks(btLogin)
.subscribe(new Action1<Void>() {
@Override
public void call(Void aVoid) {
Toast.makeText(MainActivity.this,"开始登录",Toast.LENGTH_SHORT).show();
}
});
RxCompoundButton.checkedChanges(checkBox)
.subscribe(new Action1<Boolean>() {
@Override
public void onBindViewHolder(RecyclerViewHolder holder,final int position) {
holder.textName.setText("login:"+contributor.login);
setAnimation(holder.container, position);
}
@Override
public void onViewDetachedFromWindow(RecyclerViewHolder holder) {
super.onViewDetachedFromWindow(holder);
RecyclerViewHolder recyclerViewHolder = (RecyclerViewHolder)holder;
public class ListActivity extends AppCompatActivity {
private static final int LIMIT = 30;
private boolean mIsRequest = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_list);
RxRecyclerView.scrollEvents(binding.recyclerView)
.compose(bindUntilEvent(ActivityEvent.DESTROY))
.map(scrollEvent -> {
boolean isBottom = false;
if (ConfigUtils.isOrientationPortrait(this)) {
isBottom = layoutManager.findLastCompletelyVisibleItemPositions(
new int[2])[1] >= mImages.size() - 4;
} else if (ConfigUtils.isOrientationLandscape(this)) {
isBottom = layoutManager.findLastCompletelyVisibleItemPositions(
new int[3])[2] >= mImages.size() - 4;
@thanhtoan1196
thanhtoan1196 / phabricator.md
Last active September 16, 2017 03:47
phabricator

Phabricator Ubuntu Installation Guide

This is a supplement to the official Phabricator Installation Guide, because their guide will leave you with all kinds of permission and config errors and ~15,000 setup issues on startup.

Install bonus packages:

sudo apt-get install python-pygments

And create repo directory if phabricator will be hosting repos:

@thanhtoan1196
thanhtoan1196 / ansible_semaphore_ubuntu.md
Last active September 16, 2017 03:46 — forked from thedumbtechguy/ansible_semaphore_ubuntu.md
Install Ansible Semaphore on Ubuntu

Ansible Installation

Ansible is a powerful configuration management tool that we use in managing our infrastructure and applications.

It requires a centralized Control server and can connect to hosts over an array of connection types including SSH.

Controller Setup

The Ansible controller will run our playbooks. This needs both Ansible and Semaphore (web based management console) setup.

@thanhtoan1196
thanhtoan1196 / build.gradle
Created September 16, 2017 04:32 — forked from maxirosson/build.gradle
Versioning Android apps
apply plugin: 'com.android.application'
ext.versionMajor = 1
ext.versionMinor = 2
ext.versionPatch = 3
ext.versionClassifier = null
ext.isSnapshot = true
ext.minimumSdkVersion = 15
android {
minSdkVersion = 21
targetSdkVersion = 23
compileSdkVersion = 26
buildToolsVersion = "26.0.2"
kotlinVersion = "1.2.10"
supportLibraryVersion = "26.0.2"
constraintLayoutVersion = "1.0.2"
multidexVersion = "1.0.1"

install nodejs

sudo apt-get update
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev nodejs yarn
@thanhtoan1196
thanhtoan1196 / my hosts
Created May 14, 2019 07:39 — forked from ptk911/my hosts
Link tải tool getlink Fshare, 4share, tailieu, mp3/tv.zing, nhaccuatui, chiasenhac....
1. GetLink Fs4sTL:
<version1>5.7b</version1>
<download1>https://www.fshare.vn/file/GD7M96QXA84K</download1>
link tải: https://www.upload.ee/files/9691451/GetLink_Fs4sTL_5.7b.exe.html
2. Music-Video Downloader:
<version2>4.2</version2>
<download2>https://www.fshare.vn/file/CDI762GUM96U</download2>
link tải: https://www.upload.ee/files/9652713/Music-Video_Downloader_4.2.exe.html