Skip to content

Instantly share code, notes, and snippets.

View HeaTTheatR's full-sized avatar
🕶️
Python Developer

Yuri Ivanov HeaTTheatR

🕶️
Python Developer
View GitHub Profile
@kengoon
kengoon / recycleview.py
Last active November 27, 2023 11:57
Kivy RecycleView with extra features
from kivy.uix.recycleview import RecycleView
from kivy.clock import Clock
from kivy.properties import OptionProperty, BooleanProperty, ObjectProperty, NumericProperty, ListProperty
from kivy.animation import Animation
from kivymd.uix.behaviors import StencilBehavior, SpecificBackgroundColorBehavior
from kivymd.uix.boxlayout import MDBoxLayout
from kivy.uix.widget import Widget
from Components.effects import LowerScrollEffect, LowerDampedScrollEffect
@akshayaurora
akshayaurora / behaviors.py
Created January 22, 2023 11:17
Date picker: Sample: Not directly usable. You need some additions with this like images for focus, glow, a theme folder in, a app.theme property etc.
'''
Custom Behaviors are defined in this module.
'''
from kivy.app import App
from kivy.animation import Animation
from kivy.lang import Builder
from kivy.clock import Clock
from kivy.config import Config
@quitegreensky
quitegreensky / snowfall_kivy.py
Last active January 22, 2021 20:51
snowfall made with kivy
from kivy.uix.floatlayout import FloatLayout
from kivy.lang import Builder
from kivy.properties import StringProperty, NumericProperty, ListProperty
from kivy.clock import Clock
from kivy.animation import Animation
from random import randint
from kivy.metrics import dp
Builder.load_string(
@salt-die
salt-die / wobblywidget.py
Last active June 21, 2020 19:42
Make any widget wobble with wobbly widget!
"""For this to work, WobblyEffect should be parent to WobblyScatter.
"""
from kivy.clock import Clock
from kivy.uix.effectwidget import AdvancedEffectBase, EffectWidget
from kivy.uix.scatter import Scatter
from itertools import product
FRICTION = .95
K = 8
@salt-die
salt-die / kivy_custom_console.py
Last active February 25, 2025 11:19
python console in kivy
"""TODO: ctrl + left/right (move past word), ctrl + backspace/del (del word), shift + del (del line)
...: Smart movement through leading indentation.
...: Except for first line, up/down to work normally on multi-line console input.
"""
from code import InteractiveConsole
from collections import deque
from dataclasses import dataclass
from io import StringIO
from itertools import chain, takewhile
from more_itertools import ilen
@tshirtman
tshirtman / rv_animate_items.py
Last active June 16, 2022 01:39
use a proxy widget to animate items of a recycleview without leaking on other widgets.
from copy import copy
from kivy.app import App
from kivy.clock import triggered
from kivy.lang import Builder
from kivy.animation import Animation
from kivy.factory import Factory as F
from kivy.properties import (
ObjectProperty, ListProperty
)
from datetime import datetime
from kivy.app import App
from kivy.lang import Builder
from kivy.factory import Factory
from kivy.properties import NumericProperty
from kivy.clock import Clock
KV = '''
#:import rgba kivy.utils.rgba
@tshirtman
tshirtman / fixed_rv.py
Last active April 6, 2021 17:40
Example of a RecycleView that keeps the current view position when new data is added, unless we are at the very bottom, in which case we follow the scroll.
from random import sample, randint
from string import ascii_lowercase
from time import asctime
from kivy.app import App
from kivy.factory import Factory
from kivy.lang import Builder
from kivy.properties import NumericProperty, ListProperty
from kivy.clock import Clock
from array import array
from kivy.app import App
from kivy.lang import Builder
from kivy.graphics.fbo import Fbo
from kivy.graphics.texture import Texture
from kivy.uix.widget import Widget
from kivy.properties import ListProperty, ObjectProperty
KV = '''
from kivy.app import App
from kivy.lang import Builder
from kivy.clock import Clock
from kivy.properties import ListProperty
from kivy.animation import Animation
KV = '''
#:import RGBA kivy.utils.rgba
<ImageButton@ButtonBehavior+Image>: