Skip to content

Instantly share code, notes, and snippets.

View akshayaurora's full-sized avatar
🌴
Looking for a change

Akshay Arora akshayaurora

🌴
Looking for a change
View GitHub Profile
@akshayaurora
akshayaurora / filechooser.py
Created June 11, 2021 20:41
Hacky code to experiment with opening media on iOS , copy paste code below `plyer/platforms/ios/filechooser`
'''
IOS file chooser
--------------------
This module houses the iOS implementation of the plyer FileChooser.
.. versionadded:: 1.4.4
'''
from plyer.facades import FileChooser
@akshayaurora
akshayaurora / ios_orientation_detector.py
Last active April 5, 2023 16:38
kivy kivy-ios iOS Listen for orientation changes and adjust for safe_areas/notch
import ios
from pyobjus import autoclass
UIDevice = autoclass('UIDevice')
CurrentDevice = UIDevice.currentDevice()
Logger.info(f'WaverianApp: iOs device name : {CurrentDevice.name.cString()}')
UIApplication = autoclass('UIApplication')
sharedApplication = UIApplication.sharedApplication()
NotchDetector = autoclass("NotchDetector").alloc().init()
@akshayaurora
akshayaurora / gist:34711aee4890345319bfab2b88ad69b2
Created May 12, 2022 19:40
Sample recipe on iOS using CMAKE
from kivy_ios.toolchain import Recipe, shprint
from os.path import join
import sys
import sh
class LFKBenchmarkRecipe(Recipe):
version = "main"
url = f'<your url here {version}.tar.gz>'
libraries = "lfk_benchmark/liblfk-benchmark.a", "lfk_benchmark/core/liblfk-core-nonoptimized.a", "lfk_benchmark/core/liblfk-core-optimized.a"
@akshayaurora
akshayaurora / do_share_ios_kivy.py
Created May 31, 2022 15:27
Kivy Share file on iOS
app = App.get_running_app()
import ios
from pyobjus import autoclass
NSURL = autoclass('NSURL')
UIApplication = autoclass('UIApplication')
sharedApplication = UIApplication.sharedApplication()
def do_share_ios(data, title):
URL = NSURL.fileURLWithPath_(data)
UIActivityViewController = autoclass('UIActivityViewController')
@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