Skip to content

Instantly share code, notes, and snippets.

@hl5pma
hl5pma / NestedCoordinatorLayout.kt
Created April 27, 2022 04:32
NestedCoordinatorLayout
class NestedCoordinatorLayout @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
@AttrRes defStyleAttr: Int = 0
) : CoordinatorLayout(context, attrs, defStyleAttr), NestedScrollingChild3 {
private val childHelper = NestedScrollingChildHelper(this)
init {
isNestedScrollingEnabled = true
@hl5pma
hl5pma / build.gradle
Last active December 29, 2015 10:19
ViewPagerIndicator Maven 중앙 저장소에 등록하는 빌드 스크립트
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android-library'
apply plugin: 'maven'
@hl5pma
hl5pma / gist:6518622
Created September 11, 2013 02:18 — forked from skyisle/gist:3870191
try {
// force to use overflow menu
ViewConfiguration config = ViewConfiguration.get(this);
Field menuKeyField = ViewConfiguration.class
.getDeclaredField("sHasPermanentMenuKey");
if (menuKeyField != null) {
menuKeyField.setAccessible(true);
menuKeyField.setBoolean(config, false);
}
} catch (Exception ex) {
package com.example.checkableviews;
/*******************************************************************************
* Copyright 2013 Chris Banes.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
import android.content.Context;
import android.content.res.Resources;
import android.util.TypedValue;
public class UiUtils {
private UiUtils() {
}
public static int getStatusBarHeight(Context context) {