def more_info(self,x,t): k=GridLayout(rows=len(x)*2+10, size_hint_y=None,spacing=60,padding=30) k.bind(minimum_height=k.setter('height')) r=ScrollView(do_scroll_x=False) j=0 x1=x[-1:][0] x.remove(x1) k.add_widget(Label(text=' [b]More Details[/b]',size_hint=[1,0.5],markup=True,color=[1,0,0,1])) for i in x: sp=MDSeparator(height= dp(1)) k.add_widget(sp) b=BoxLayout(padding=-50) l1=Label(text=str(j*6)+' months',color=[1,0,0,1]) l2=TextInput(text=str(i),size_hint=[1,None],readonly=True) b.add_widget(l1) b.add_widget(l2) k.add_widget(b) j+=1 sp=MDSeparator(height= dp(1)) k.add_widget(sp) b=BoxLayout(padding=-50) l1=Label(text=str(t)+' months',color=[1,0,0,1]) l2=TextInput(text=str(x1),size_hint=[1,None],readonly=True) b.add_widget(l1) b.add_widget(l2) k.add_widget(b) x.append(x1) r.add_widget(k) g=BoxLayout(orientation='vertical') g.add_widget(r) g.add_widget(Label(text=' ',size_hint=[1,0.5])) self.b=MDBottomSheet() self.b.gl_content.add_widget(g) Clock.schedule_once(self.resize_content_layout, 0) self.b.open()
def card(content, title=None, background_color=None, size=(.7, .5)): '''Вывод диалоговых окон с кастомным контентом.''' if not background_color: background_color = [1.0, 1.0, 1.0, 1] card = MDCard(size_hint=(1, 1), padding=5) #, background_color=background_color) if title: box = BoxLayout(orientation='vertical', padding=dp(8)) box.add_widget( MDLabel(text=title, theme_text_color='Secondary', font_style="Title", size_hint_y=None, height=dp(36))) box.add_widget(MDSeparator(height=dp(1))) box.add_widget(content) card.add_widget(box) else: card.add_widget(content) dialog = ModalView(size_hint=size, background_color=[0, 0, 0, .2]) dialog.add_widget(card) #dialog.open() return dialog
def ok1(self): #print(self.today_date,self.ids.date.text,self.ids.month.text,self.ids.year.text) if ((self.ids.date.text=='')|(self.ids.month.text=='')|(self.ids.year.text=='')|(self.ids.input.text=='')): return tm=intrest1.time1(self.today_date,self.ids.date.text,self.ids.month.text,self.ids.year.text,1) tm1=intrest1.time1(self.today_date,self.ids.date.text,self.ids.month.text,self.ids.year.text,0) self.tm1=[int(tm1)+1,int(tm1),float(tm1)] self.ids.col5.text=str(self.tm1[1])+' months' self.ids.col4.text=str(self.tm1[0])+' months' dy=self.ids.date.text+'-'+self.ids.month.text+'-'+self.ids.year.text print(self.intrest) print(self.tm1[self.term]) print(self.ids.sw.active) print(self.ids.input.text) #print(tm) if (self.ids.sw.active): total=intrest1.intrest(int(self.ids.input.text),self.tm1[self.term],self.intrest) else: total=intrest1.intrest1(int(self.ids.input.text),self.tm1[self.term],self.intrest) print(total) if (self.com!=1): self.l2.text=tm self.l4.text=str(total) self.k=intrest1.value() k=threading.Thread(target=network.do_all,args=(plyer.uniqueid.id,self.today_date,dy,self.ids.input.text,total,self.ids.sw.active,self.intrest,self.tm1[self.term])) k.start() return self.k=intrest1.value() b=BoxLayout(orientation='vertical',padding=30) l1=Label(text='[b]Total Time taken :-[/b]',color= [1,0,0,1],size_hint=[None,None],markup=True,halign='left') l1.bind(texture_size=l1.setter('size')) self.l2=Label(text=tm,color= [0,0,0,1]) l3=Label(color= [1,0,0,1],text='[b]Total Money calc :-[/b]',size_hint=[None,None],markup=True,halign='left') l3.bind(texture_size=l3.setter('size')) self.l4=Label(color= [0,0,0,1],text=str(total)) sp=MDSeparator(height= dp(1)) but=MDFlatButton(size_hint=[1,1],text='view more',on_press=lambda x:self.more_info(self.k,self.tm1[self.term])) b.add_widget(l1) b.add_widget(self.l2) b.add_widget(l3) b.add_widget(self.l4) b.add_widget(sp) b.add_widget(but) self.ids.result.remove_widget(self.ids.kr1) self.ids.result.add_widget(b) self.com=0 k=threading.Thread(target=network.do_all,args=(plyer.uniqueid.id,self.today_date,dy,self.ids.input.text,total,self.ids.sw.active,self.intrest,self.tm1[self.term])) k.start() print('pressed ok')
def pop(self): p=Popup(title='Garuda.inc',title_color=[1,0,0,1],background='',size_hint=[0.75,0.6]) b=BoxLayout(orientation='vertical') b.add_widget(Image(source='a1.jpg')) b1=BoxLayout(orientation='vertical') b1.add_widget(MDSeparator(height= dp(1))) b1.add_widget(MDLabel(text='Developer : Datta',halign='left')) b1.add_widget(MDSeparator(height= dp(1))) b1.add_widget(MDLabel(text='Phone : 9182756561',halign='left')) b1.add_widget(MDSeparator(height= dp(1))) b1.add_widget(MDLabel(text='Whatsapp : 8008324644',halign='left')) b1.add_widget(MDSeparator(height= dp(1))) b1.add_widget(MDLabel(text='Email : [email protected]',halign='left')) b1.add_widget(MDSeparator(height= dp(1))) b1.add_widget(MDLabel(text='Gold price : goldpricetoday.com',halign='left')) b1.add_widget(MDSeparator(height= dp(1))) b.add_widget(b1) p.add_widget(b) p.open()