Skip to content

Instantly share code, notes, and snippets.

View kylin17's full-sized avatar
🍺
I may be slow to respond.

PasserYi kylin17

🍺
I may be slow to respond.
View GitHub Profile
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewParent;
import android.view.ViewTreeObserver;
import android.widget.FrameLayout;
@CodeK1988
CodeK1988 / TabLayout custom change tabTextSize
Last active February 18, 2021 06:28
TabLayout custom change tabTextSize
1.tabTextAppearance
<style name="YourTextAppearance" parent="TextAppearance.AppCompat.Button">
<item name="android:textSize">20sp</item>
...
</style>
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabLayout"
android:layout_width="match_parent"
@xujiaao
xujiaao / android-set-ntp-server.md
Last active April 17, 2024 03:40
Set the NTP server of your android device
tags
Android
Android Things

Set the NTP server of your android device

@k-kagurazaka
k-kagurazaka / DebounceTest.kt
Created December 1, 2017 14:18
RxJava debounce like operator implementation for kotlin coroutine
launch(UI) {
editText.onTextChanged()
.debounce(1, TimeUnit.SECONDS)
.consumeEach {
Log.d("DebounceTest", "value: $it")
}
}
}
fun EditText.onTextChanged(): ReceiveChannel<String> =

Disable Device Enrollment Notification on Mac.md

Restart the Mac in Recovery Mode by holding Comment-R during restart

Open Terminal in the recovery screen and type

csrutil disable
@rakawestu
rakawestu / build.gradle
Created March 12, 2017 14:09
Library Module Proguard
buildTypes {
release {
minifyEnabled true
consumerProguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
@codetalks-new
codetalks-new / main.py
Created January 25, 2017 13:26
微信 Android 自动发红包脚本
# -*- coding: utf-8 -*-
from com.android.monkeyrunner import MonkeyRunner as mr,MonkeyDevice as md
# Imports the monkeyrunner modules used by this program
# usage : $monkeyrunner main.py
# 下面的坐标是针对 1080 x 1920 的设备的 如果是其他分辨率的设备请自行调整
__author__ = 'banxi'
# Connects to the current device, returning a MonkeyDevice object
print("Waiting for connect...")
device = mr.waitForConnection()
@jacknie84
jacknie84 / mybatis.xml
Last active March 1, 2019 04:08
It's tip that write functional code on default script language of mybatis
Don't speak English well. Thank you for your patience.
It's functions xml file.
<mapper namespace="org.jacknie.mybatis.Functions">
<sql id="isBlank">
<bind name="isBlank" value=":[@org.apache.commons.lang3.StringUtils@isBlank(#this)]" />
</sql>
<sql id="sysout">
<bind name="sysout" value=":[@System@out.println(#this)]" />
</sql>
@jakubkinst
jakubkinst / SequentialRecyclerViewAnimationAdapter.java
Last active May 25, 2021 07:45
Simply add sequential animations to any RecyclerView
package com.example.view;
import android.animation.Animator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.RecyclerView.Adapter;
import android.support.v7.widget.RecyclerView.ViewHolder;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Interpolator;
@sromku
sromku / ImageScaleView.java
Created November 20, 2015 15:32
Image View Top Crop / Bottom Crop
/**
* Scale to center top or scale to center bottom
*
* @author sromku
*/
public class ImageScaleView extends ImageView {
private MatrixCropType mMatrixType = MatrixCropType.TOP_CENTER; // default
private enum MatrixCropType {