Permalink
Browse files

wip

  • Loading branch information...
1 parent ddf4590 commit 91f2ad794f8ccb34dc661419b5cf28d67860fe84 Neeraj Singh committed Feb 26, 2014
@@ -1,7 +1,7 @@
class LanguageDetailsController < UITableViewController
def initWithLanguage language_name
- @language_name = language_name
+ @language = Language.where(:name).eq(language_name).first
self
end
@@ -10,7 +10,7 @@ def viewDidLoad
rmq.stylesheet = LanguageDetailsControllerStylesheet
- self.title = @language_name
+ self.title = @language.name
view.tap do |table|
table.delegate = self
@@ -39,10 +39,34 @@ def tableView(tableView, cellForRowAtIndexPath: indexPath)
def create_header_view
rmq.create(UIView, :header).tap do |q|
+
q.append(UILabel, :language_name).style do |st|
- st.text = @language_name
+ st.text = @language.name
st.size_to_fit
end
+
+ q.append(UILabel, :author_name_label).style do |st|
+ st.text = 'Author name:'
+ end
+ q.append(UILabel, :author_name).style do |st|
+ st.text = @language.inventor_name
+ end
+
+ q.append(UILabel, :static_label).style do |st|
+ st.text = 'Static:'
+ end
+ q.append(UILabel, :static_value).style do |st|
+ st.text = @language.static ? 'True' : 'False'
+ end
+
+ q.append(UILabel, :dynamic_label).style do |st|
+ st.text = 'Dynamic:'
+ end
+ q.append(UILabel, :dynamic_value).style do |st|
+ st.text = @language.dynamic ? 'True' : 'False'
+ end
+
+
rmq.stylesheet.layout_header q
view.tableHeaderView = q.get
end
@@ -8,6 +8,37 @@ def language_name st
st.frame = { l: margin, t: margin_double, w: app_width, h: 25 }
st.number_of_lines = :unlimited
st.font = font.larger
+ st.background_color = color.light_gray
+ end
+
+ def author_name_label st
+ info_label st
+ end
+
+ def author_name st
+ st.padded = {l: (app_width/2), t: 0, r: 0}
+ st.height = 25
+ st.font = font.large
+ st.frame = { l: margin }
+ end
+
+ def static_label st
+ info_label st
+ end
+
+ def static_value st
+ st.padded = {l: 0, t: 0, r: 0}
+ st.height = 25
+ st.font = font.large
+ st.frame = { l: margin }
+ end
+
+ def dynamic_label st
+ static_label st
+ end
+
+ def dynamic_value st
+ static_value st
end
def layout_header(header_view_rmq)
@@ -23,4 +54,12 @@ def table(st)
st.view.allowsSelection = false
end
+ def info_label(st)
+ st.frame = :full
+ st.height = 20
+ st.font = font.medium
+ st.color = color.dim_gray
+ st.frame = { l: margin }
+ end
+
end

0 comments on commit 91f2ad7

Please sign in to comment.