The radiobullet


Case study of the RadioBullet element

img

Example

Swift:

let container = addSubview(Section(0,0,self,"radioBulletContainer")
let btn1 = container.addSubView(RadioBullet(0,0,true,container))
let btn2 = container.addSubView(RadioBullet(0,0,false,container))
addSubview(SelectGroup([btn1,btn2],btn1))

CSS:

#radioBulletContainer{
	fill:#dddddd;
	float:left;
	clear:left;
	width:52px;
	height:19px;
	padding-left:12px;
	padding-top:5px;
	corner-radius:4px;
	drop-shadow:<InsetShadow>;
}
/*RadioBullet*/
RadioBullet{
	float:left;
	fill:<RadioBulletBase>,none,none,none,none;
	width,height:14px;
	corner-radius:7px;
	drop-shadow:<SubtleShadow>,none,none,none,none;
	margin-right:12px;
}
RadioBullet:selected{
	fill:<RadioBulletBase:selected>,<RadioBulletBottomShine>,<RadioBulletTopShine>,<RadioBulletBulletShine>,#021931;
	width,height:14px,14px,14px,14px,5px;
	corner-radius:7px,7px,7px,7px,2.5px;
	margin-left,margin-top:0px,0px,0px,0px,4.5px;
}

Notes:

  • The variables in the css named <InsetShadow> etc. Are generic theme styles stored in a css file. An article describing how to use generic styles is coming soon.
  • The CSS floating system is also included in this example. Read more about that here

Tasks:

  • [ ] Implement support for hit-testing the skin layers
  • [ ] Fully debug the floating system

Related Posts

Startup Oslo

“Kulturhuset” is a new place in the startup scene in Oslo. It’s “free” and can be used by anyone to collaborate or work on different projects.

Infinite Tree List

My notes on Infinite tree list

Protocol Inheritance

My notes on Protocol Inheritance

Protocol Ambiguity

How to differentiate protocol ambiguity

The Ultimate Xcode Workflow

Spend zero time managing dependencies

Faster Xcode With Spm

How you can speed up compile times in XCode with Swift Package Manager

Spm And Ci Travis

My notes on Swift PM + CI Travis

Spm And Nested Frameworks

My notes on Swift package manager + XCode + Nested frameworks

Xcode And Spm

Here is how you use Swift package manager in your XCode app projects

Carthage And Nested Frameworks

A few workflows concerning Carthage and nested framework