android 路由框架,實現頁面跳轉的統一管理並與activity解耦
通過自定義註解處理器在編譯時完成對所有activity的註冊,不影響效能。
register
(cons.scheme,cons.host)
;顯示(原生跳轉)
routerbuilder.
getbuilder()
.putextra
(commonrouteractivity.username,
"str-origin").
activityrequestcode
(1001).
overridependingtransition
(r.anim.enter,r.anim.exit)
.setintentflags
(intent.flag_activity_new_task)
.startoriginuri
(mainactivity.
this
,"commonrouteractivity");
//對應的activity
@routeruri
(path =
"commonrouteractivity"
)public
class
commonrouteractivity
extends
隱示(web跳轉)routerbuilder.
getbuilder()
.putextra
(secondactivity.username,
"web").
startweburi
(mainactivity.
this
,"/jumpsecondactivity");
//對應的activity
@routeruri
(path =
"/jumpsecondactivity"
)public
class
secondactivity
extends
獲取引數string username = intent.
getstringextra()
;//與原生api一樣
可以新增乙個或多個路由***。繼承uriinterceptor,實現intercept()攔截方法即可。public
class
locationinterceptor
implements
uriinterceptor
}public
class
logininterceptor
implements
uriinterceptor
}//對應activity
@routeruri
(path =
"commonrouteractivity"
, interceptors =
)public
class
commonrouteractivity
extends
混淆配置-keep class
com.personal.joefly.inte***ces.**
-dontwarn com.personal.joefly.inte***ces.**
-keep class
com.personal.joefly.compile.**
-dontwarn com.personal.joefly.compile.**
-keep class
com.personal.joefly.qrouter.uri.**
-dontwarn com.personal.joefly.qrouter.uri.**
-keep class
com.personal.joefly.qrouter.api.**
-dontwarn com.personal.joefly.qrouter.api.**
React 封裝路由
封裝路由import movie from views movie import cinema from views cinema import mine from views mine import city from views city import search from views sea...
關於元件封裝
1善於總結,通常乙個公司大部分專案,頁面排版型別相近,比如管理系統 1.1從布局上講 大都是上左右結構,適合用easyui做為主框架右邊主頁面用iframe巢狀 1.2從模組上講 常用元件就是 查詢,表單提交,彈出模態框,選項樹,表單驗證,tab選項卡 1.3從頁面樣式風格上講 一般就是紅色和藍色為...
Angular元件封裝
前言 在專案中我們常看到乙個頁面裡的 在很多頁面裡面用到,我們會把它封裝成乙個元件供多個頁面引用我們在頁面看到類似於下圖的標籤,就是引用的封裝好的元件 changepage event editbutton btnedit addopen addopen event,addmodal editdat...