mirror of
https://github.com/zhigang1992/ProMotion.git
synced 2026-05-31 01:35:41 +08:00
Build out PM::Support
This commit is contained in:
@@ -16,7 +16,11 @@ Motion::Project::App.setup do |app|
|
||||
"#{core_lib}/table/cell/table_view_cell_module.rb" => [ "#{core_lib}/styling/styling.rb" ],
|
||||
"#{core_lib}/delegate/delegate.rb" => [ "#{core_lib}/delegate/delegate_parent.rb" ],
|
||||
"#{core_lib}/delegate/delegate_parent.rb" => [ "#{core_lib}/delegate/delegate_module.rb" ],
|
||||
"#{core_lib}/delegate/delegate_module.rb" => [ "#{core_lib}/tabs/tabs.rb", "#{core_lib}/ipad/split_screen.rb" ],
|
||||
"#{core_lib}/delegate/delegate_module.rb" => [
|
||||
"#{core_lib}/support/support.rb",
|
||||
"#{core_lib}/tabs/tabs.rb",
|
||||
"#{core_lib}/ipad/split_screen.rb"
|
||||
],
|
||||
"#{core_lib}/screen/screen.rb" => [ "#{core_lib}/screen/screen_module.rb" ],
|
||||
"#{core_lib}/screen/screen_module.rb" => [ "#{core_lib}/screen/screen_navigation.rb" ],
|
||||
"#{core_lib}/table/data/table_data.rb" => [ "#{core_lib}/table/table.rb" ],
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
module ProMotion
|
||||
module DelegateModule
|
||||
include ProMotion::Support
|
||||
include ProMotion::Tabs
|
||||
include ProMotion::SplitScreen if UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad
|
||||
|
||||
@@ -42,18 +43,6 @@ module ProMotion
|
||||
try :on_open_url, { url: url, source_app: source_app, annotation: annotation }
|
||||
end
|
||||
|
||||
def app
|
||||
UIApplication.sharedApplication
|
||||
end
|
||||
|
||||
def app_delegate
|
||||
self
|
||||
end
|
||||
|
||||
def app_window
|
||||
window
|
||||
end
|
||||
|
||||
def ui_window
|
||||
(defined?(Motion) && defined?(Motion::Xray) && defined?(Motion::Xray::XrayWindow)) ? Motion::Xray::XrayWindow : UIWindow
|
||||
end
|
||||
@@ -83,10 +72,6 @@ module ProMotion
|
||||
self.class.send(:apply_status_bar)
|
||||
end
|
||||
|
||||
def try(method, *args)
|
||||
send(method, *args) if respond_to?(method)
|
||||
end
|
||||
|
||||
public
|
||||
|
||||
module ClassMethods
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
module ProMotion
|
||||
module ScreenModule
|
||||
include ProMotion::Support
|
||||
include ProMotion::ScreenNavigation
|
||||
include ProMotion::Styling
|
||||
include ProMotion::NavBarModule
|
||||
@@ -184,10 +185,6 @@ module ProMotion
|
||||
end
|
||||
end
|
||||
|
||||
def try(method, *args)
|
||||
send(method, *args) if respond_to?(method)
|
||||
end
|
||||
|
||||
# Class methods
|
||||
module ClassMethods
|
||||
def title(t=nil)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
module ProMotion
|
||||
module ScreenNavigation
|
||||
include ProMotion::Support
|
||||
|
||||
def open_screen(screen, args = {})
|
||||
args = { animated: true }.merge(args)
|
||||
@@ -32,14 +33,6 @@ module ProMotion
|
||||
open screen, args.merge({ modal: true })
|
||||
end
|
||||
|
||||
def app
|
||||
UIApplication.sharedApplication
|
||||
end
|
||||
|
||||
def app_delegate
|
||||
UIApplication.sharedApplication.delegate
|
||||
end
|
||||
|
||||
def close_screen(args = {})
|
||||
args ||= {}
|
||||
args = { sender: args } unless args.is_a?(Hash)
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
module ProMotion
|
||||
module Support
|
||||
|
||||
def app
|
||||
UIApplication.sharedApplication
|
||||
end
|
||||
|
||||
def app_delegate
|
||||
UIApplication.sharedApplication.delegate
|
||||
end
|
||||
|
||||
def app_window
|
||||
UIApplication.sharedApplication.delegate.window
|
||||
end
|
||||
|
||||
def try(method, *args)
|
||||
send(method, *args) if respond_to?(method)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user