Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

kivy menu bar

1#:kivy 1.8.0
  2#:import KivyLexer kivy.extras.highlight.KivyLexer
  3#:import Factory kivy.factory.Factory
  4
  5<ActionSpinnerOptions@SpinnerOption>
  6    background_color: .4, .4, .4, 1
  7
  8<ActionSpinner@Spinner+ActionItem>
  9    canvas.before:
 10        Color:
 11            rgba: 0.128, 0.128, 0.128, 1
 12        Rectangle:
 13            size: self.size
 14            pos: self.pos
 15    border: 27, 20, 12, 12
 16    background_normal: 'atlas://data/images/defaulttheme/action_group'
 17    option_cls: Factory.ActionSpinnerOptions
 18
 19<ActionDropdown>:
 20    on_size: self.width = '220dp'
 21
 22<ShowcaseScreen>:
 23    ScrollView:
 24        do_scroll_x: False
 25        do_scroll_y: False if root.fullscreen else (content.height > root.height - dp(16))
 26        AnchorLayout:
 27            size_hint_y: None
 28            height: root.height if root.fullscreen else max(root.height, content.height)
 29            GridLayout:
 30                id: content
 31                cols: 1
 32                spacing: '8dp'
 33                padding: '8dp'
 34                size_hint: (1, 1) if root.fullscreen else (.8, None)
 35                height: self.height if root.fullscreen else self.minimum_height
 36
 37
 38BoxLayout:
 39    orientation: 'vertical'
 40
 41    canvas.before:
 42        Color:
 43            rgb: .6, .6, .6
 44        Rectangle:
 45            size: self.size
 46            source: 'data/background.png'
 47
 48    ActionBar:
 49
 50        ActionView:
 51            id: av
 52            ActionPrevious:
 53                with_previous: (False if sm.current_screen.name == 'button' else True) if sm.current_screen else False
 54                title: 'Showcase' + ('' if not app.current_title else ' - {}'.format(app.current_title))
 55                on_release: app.go_hierarchy_previous()
 56
 57            ActionSpinner:
 58                id: spnr
 59                important: True
 60                text: 'Jump to Screen'
 61                values: app.screen_names
 62                on_text:
 63                    if sm.current != args[1]:
 64                    idx = app.screen_names.index(args[1]);
 65                    app.go_screen(idx)
 66            ActionToggleButton:
 67                text: 'Toggle sourcecode'
 68                icon: 'data/icons/bug.png'
 69                on_release: app.toggle_source_code()
 70            ActionButton:
 71                text: 'Previous screen'
 72                icon: 'data/icons/chevron-left.png'
 73                on_release: app.go_previous_screen()
 74
 75            ActionButton:
 76                text: 'Next screen'
 77                icon: 'data/icons/chevron-right.png'
 78                on_release: app.go_next_screen()
 79                important: True
 80
 81    ScrollView:
 82        id: sv
 83        size_hint_y: None
 84        height: 0
 85
 86        CodeInput:
 87            id: sourcecode
 88            lexer: KivyLexer()
 89            text: app.sourcecode
 90            readonly: True
 91            size_hint_y: None
 92            font_size: '12sp'
 93            height: self.minimum_height
 94
 95    ScreenManager:
 96        id: sm
 97        on_current_screen:
 98            spnr.text = args[1].name
 99            idx = app.screen_names.index(args[1].name)
100            if idx > -1: app.hierarchy.append(idx)
Comment

PREVIOUS NEXT
Code Example
Java :: java active displays 
Java :: is java good then c++ is good 
Java :: libgdx load file 
Java :: java operator 
Java :: sudoku 6x6 java 
Java :: alternatives jdk1.8 rhel6 
Java :: Java Stack class empty() method 
Java :: txt not chnage on fragment 
Java :: URI/BEE problem no-1101 solution in Java 
Java :: como codificar pilas en java creeper 
Java :: ring check if the operating system is Android or not 
Java :: image primitive 
Java :: check if combobox has specified value 
Java :: prevent creating instance of singleton from thread 
Java :: string tmp java 
Java :: like clause with param in spring jpa 
Java :: change password swing gui 
Java :: como llamar a un metodo static en java 
Java :: Java headSet(element, booleanValue) 
Java :: switch expression 
Java :: Java Overloading by changing the number of parameters 
Java :: what is instance block in java 
Java :: random number in java between 10 and 20 
Java :: missingWords 
Java :: popcat 
Java :: how to add value in jcombobox in java 
Java :: springBoot Disable a Specific Auto-Configuration 
Java :: spring boot rest api 
Java :: java 8 retrieve all list from object into single list and ignore duplicates 
Java :: clear array in java 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =