In this video I’ll build out a basic Image Swiper app with KivyMD and Python.

Image swiper apps are fun little apps that allow you to create a portfolio of images that you can swipe thru easily. KivyMD makes it really easy to build them and that’s what I’m going to do in this video.

We’ll use MySwiper@MDSwiperItem, MDSwiper, and MySwiper in the kv file to do most of the work.

#kivy #codemy

Python Code: swiper.py
GitHub Code: swiper.py

from kivy.lang import Builder
from kivymd.app import MDApp


class MainApp(MDApp):

	def build(self):
		self.theme_cls.theme_style = "Dark"
		self.theme_cls.primary_palette = "BlueGray"
		return Builder.load_file('swiper.kv')
	
	
MainApp().run()

Kivy Design Code: swiper.kv
GitHub Code: swiper.kv

<MySwiper@MDSwiperItem>
    
    #FitImage:
    #    source: "images/aspen.png"
    #    radius: [20,]

MDScreen:
    
    MDToolbar:
        id: toolbar
        title: "Our Swiper App"
        elevation: 10
        pos_hint: {"top": 1}

    MDSwiper:
        size_hint_y: None
        height: root.height - toolbar.height - dp(40)
        y: root.height - self.height - toolbar.height - dp(20)

        MySwiper:
            FitImage:
                source: "images/aspen.png"
                radius: [20,]
   
        MySwiper:
            FitImage:
                source: "images/aspen2.png"
                radius: [20,]
        
        MySwiper:
            FitImage:
                source: "images/aspen3.png"
                radius: [20,]
        
        MySwiper:
            FitImage:
                source: "images/aspen4.png"
                radius: [20,]

        MySwiper:
            FitImage:
                source: "images/me.png"
                radius: [20,]


  

John Elder

John is the CEO of Codemy.com where he teaches over 100,000 students how to code! He founded one of the Internet's earliest advertising networks and sold it to a publicly company at the height of the first dot com boom. After that he developed the award-winning Submission-Spider search engine submission software that's been used by over 3 million individuals, businesses, and governments in over 42 countries. He's written several Amazon #1 best selling books on coding, and runs a popular Youtube coding channel.

View all posts

Add comment

Your email address will not be published. Required fields are marked *

John Elder