Example #1
0
    def request_coins(self, instance, *tmp):
        """
        формирует зпрос по http монет
        :param instance:
        :param largs:
        :return:
        """

        coins_layout = self.root.ids.coins_layout
        coins_scroll_view = self.root.ids.coins_scroll_view
        post_data = {'what': instance.name, 'type': instance.gettype()}
        self.coins = self.send_http_post('/euro/what', post_data)

        if self.coins is not None:
            if Loader.pool is not None:     # если что то было в овчерди на загрузку,отключаем
                Loader.stop()
            coins_layout.clear_widgets()    # удаляем все что было вставлено
            coins_scroll_view.scroll_y = 1  # скроллер на начало

            coins_scroll_view.height = self.root.height

            height = 0
            while self.coins:
                view_coin = CoinViewFactory.factory(instance=instance, coin=self.coins.pop(0))
                coins_layout.add_widget(view_coin)
                height += view_coin.height
                if coins_scroll_view.height + 2*view_coin.height < height:
                    break
Example #2
0
	def _clear_loader(self, *largs):
		Loader.stop()
		self.carousel.clear_widgets()
		self.loadnum = 0	
		self.image = []
		self.pb.value =  0
		self.ltext.text  = "total: "
				
		# now load 
		Clock.schedule_once(self._load_values,0.2)
Example #3
0
 def _abort_download(self, dt):
     '''Stop the image from downloading'''
     Loader.stop()