Skip to content

Instantly share code, notes, and snippets.

View khj0704's full-sized avatar
๐Ÿ˜„

๊น€ํ˜„์ค€ khj0704

๐Ÿ˜„
View GitHub Profile
@bolot
bolot / PeekingLinearLayoutManager.kt
Last active August 30, 2023 07:19
LinearLayoutManager subclass that "peeks", shows a portion of the adjacent child views.
class PeekingLinearLayoutManager : LinearLayoutManager {
@Suppress("Unused")
@JvmOverloads
constructor(context: Context?, @RecyclerView.Orientation orientation: Int = RecyclerView.VERTICAL, reverseLayout: Boolean = false) : super(context, orientation, reverseLayout)
@Suppress("Unused")
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes)
override fun generateDefaultLayoutParams() =
scaledLayoutParams(super.generateDefaultLayoutParams())
@p-fischer
p-fischer / DialogUtils.java
Last active October 26, 2018 08:58
Create a fullscreen dialog with margins - either in normal or in immersive mode
package com.exmample.utils;
import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.view.Gravity;
import android.view.Window;
import android.view.WindowManager.LayoutParams;
@raphaelbussa
raphaelbussa / CustomSnackbar.java
Last active October 30, 2018 12:01
Helper for inflate custom layout in google support design snackbar
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 Raphaรซl Bussa
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@NikolaDespotoski
NikolaDespotoski / BottomNavigationBehavior.java
Last active December 19, 2022 06:14
Bottom Navigation behavior
/*
* BottomNavigationLayout library for Android
* Copyright (c) 2016. Nikola Despotoski (http://github.com/NikolaDespotoski).
* 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
*
* Unless required by applicable law or agreed to in writing, software
@seongchan
seongchan / ExecuteAppOrGoStore.html
Last active June 20, 2019 11:13
Execute App at Mobile WebPage
<!--
2015.10.29
Hong SeongChan (seongchan116@gmail.com)
-------------------------------------------
๋ชจ๋ฐ”์ผ ์›น ํŽ˜์ด์—์„œ ๊ฐœ๋ฐœํ•˜๊ณ  ์žˆ๋Š” ์•ฑ์ด ์‹คํ–‰์ด ์•ˆ๋˜๊ธธ๋ž˜ ์ƒ˜ํ”Œ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•ด ๋ด„.
์ด ์†Œ์Šค์˜ ์ „์ œ ์กฐ๊ฑด์€ uri scheme ๋ฐฉ์‹์ด ์ ์šฉ๋œ ์•ฑ์„ ๊ธฐ์ค€์œผ๋กœ ํ•œ๋‹ค.
Android ์•ฑ์˜ ๊ฒฝ์šฐ intent๋ฅผ ์ด์šฉํ•œ ๋ฐฉ์‹์„ ์ฃผ๋กœ ์‚ฌ์šฉํ–ˆ๊ฒ ์ง€๋งŒ, ๋ชจ๋ฐ”์ผ ์›น์„ ๊ณ ๋ คํ•œ๋‹ค๋ฉด uri scheme์„ ์ ์šฉํ•˜๋Š”๊ฒŒ ์œ ๋ฆฌํ•˜๋‹ค.
(์›น์ชฝ ์ฝ”๋“œ๊ฐ€ ๋‹จ์ˆœํ•ด ์ง„๋‹ค.)
์•„๋ž˜ ์ฝ”๋“œ๋Š” ์ด๋Ÿฌํ•œ ์ „์ œ๋กœ ์ž‘์„ฑ๋˜์—ˆ๋‹ค.
-->
@janheinrichmerker
janheinrichmerker / LICENSE
Last active August 29, 2023 14:28
LinearLayoutManager implementation that stretches to fit all list items on screen and disables scrolling. Useful for dashboards etc.
MIT License
Copyright (c) 2020 Jan Heinrich Reimer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@StefMa
StefMa / README.md
Created July 8, 2015 11:04
TextInputLayoutWrapperView

TextInputLayoutWrapperView


What is it?

This is a simple wrapper View for the new TextInputLayout from Design Library.


Why?

Normaly you use the TextInputLayout like this

@ypresto
ypresto / SubscriptionUtils.java
Last active March 30, 2017 09:13
.lift(SubscriptionUtils.composite(mCompositeSubscription)) and forget about subscriptions but composite one.
import rx.Observable;
import rx.Subscriber;
import rx.functions.Action0;
import rx.subscriptions.CompositeSubscription;
import rx.subscriptions.Subscriptions;
public class SubscriptionUtils {
/**
* Automatically adds to / removes from specified {@link CompositeSubscription} when subscribe / unsubscribe is called.
* Useful when subscribing observable repeatedly, as you do not need to manipulate CompositeSubscription manually.
@iPaulPro
iPaulPro / include_list_viewpager.xml
Last active March 7, 2024 11:13
CollapsingToolbarLayout with TabLayout
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (C) 2015 The Android Open Source Project
~
~ 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
~
~ Unless required by applicable law or agreed to in writing, software
@SyllaJay
SyllaJay / LetterSpacingTextView.java
Last active October 24, 2022 19:18
Android TextView, that allows changing the letter spacing of the text. @author: Pedro Barros
/**
* Text view that allows changing the letter spacing of the text.
*
* @author Pedro Barros (pedrobarros.dev at gmail.com)
* @since May 7, 2013
*/
public static class LetterSpacingTextView extends TextView {
private float spacing = Spacing.NORMAL;
private CharSequence originalText = "";