Skip to content

Instantly share code, notes, and snippets.

@kived
kived / tablettest.py
Created March 18, 2016 18:18
Kivy: Android settings style tablet panes
import kivy
kivy.require('1.8.1')
from kivy.app import App
from kivy.lang import Builder
from kivy.properties import ObjectProperty
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.floatlayout import FloatLayout
@kived
kived / centerbutton.kv
Last active March 3, 2016 20:30
Kivy: centered button
BoxLayout:
Widget
Button:
size_hint_x: 6 # 6/8 == 0.75
Widget
@kived
kived / setup.py.patch
Created February 25, 2016 23:40
Kivy: build with EGL/GLESv2
diff --git a/setup.py b/setup.py
index d1f9801..86e4337 100644
--- a/setup.py
+++ b/setup.py
@@ -581,7 +581,12 @@ def determine_gl_flags():
flags['libraries'] = ['GLESv2']
c_options['use_x11'] = True
c_options['use_egl'] = True
- else:
+ if c_options['use_egl'] and 'EGL' not in flags['libraries']:
@kived
kived / gridscroll.py
Created February 23, 2016 19:42
Kivy: Filling images in a GridLayout
#!/usr/bin/env python
from kivy.config import Config
from kivy.uix.image import AsyncImage
Config.set('kivy', 'log_level', 'debug')
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
@kived
kived / modaltest.py
Created February 19, 2016 20:43
Kivy: small ModalView
import kivy
kivy.require('1.8.1')
from kivy.app import App
from kivy.lang import Builder
from kivy.factory import Factory
root = Builder.load_string('''
<MyModalView@ModalView>:
size_hint: 0.5, 0.5
@kived
kived / settings.json
Created February 10, 2016 21:40
Kivy: custom settings password entry
[
{"type": "password",
"title": "PASSWORD",
"section": "test",
"key": "pw"}
]
@kived
kived / localmanifest.xml
Created February 9, 2016 17:02
localmanifest.xml sample
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="ee-github" fetch="ssh://[email protected]" />
<remote name="ee-gitlab" fetch="ssh://[email protected]" />
<!-- extra apps -->
<project path="packages/apps/DTLauncher"
name="aerispos/DTLauncher-prebuilt"
@kived
kived / ccache-fix.patch
Created December 28, 2015 18:42
p4a ccache fix
diff --git a/pythonforandroid/archs.py b/pythonforandroid/archs.py
index 3692c87..1b737ad 100644
--- a/pythonforandroid/archs.py
+++ b/pythonforandroid/archs.py
@@ -52,6 +52,11 @@ class Arch(object):
env['TOOLCHAIN_PREFIX'] = toolchain_prefix
env['TOOLCHAIN_VERSION'] = toolchain_version
+ ccache = ''
+ if self.ctx.ccache:
@kived
kived / LICENSE.txt
Created December 1, 2015 16:23
LICENSE for all my Public Gists
The following license shall apply to all Public Gists owned by account. It
shall never apply to any Secret Gists, for which no license of any sort is
granted.
Copyright (c) 2015- Ryan Pessa
Permission is hereby granted, free of charge, to any person obtaining a copy
@kived
kived / options.py
Last active October 14, 2015 21:00
Kivy: options on spinner
MyWidget:
Spinner:
values: root.options