Skip to content

Commit

Permalink
支持沉浸式状态栏
Browse files Browse the repository at this point in the history
  • Loading branch information
NoEndToLF committed Dec 12, 2017
1 parent 7567a84 commit d10695d
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,23 @@ public void register(Activity activity,final LoadRetryRefreshListener loadRetryR
hashMap_activity_isSuccess.put(activity,false);
hashMap_activity_loadRetryListener.put(activity, loadRetryRefreshListener);
ViewGroup mRoot= (ViewGroup) activity.getWindow().getDecorView().findViewById(android.R.id.content);
ViewGroup mContentView=null;
for (int i=0;i<mRoot.getChildCount();i++){
View view=mRoot.getChildAt(i);
if (view instanceof FrameLayout){
mContentView=(ViewGroup)view;
break;
}
}
//判断是否有ToolBar
isHaveToolbar(mRoot,activity);
View loadView = LayoutInflater.from(activity).inflate(R.layout.loadretry_view, null);
loadView.setVisibility(View.GONE);
mRoot.addView(loadView);
if (mContentView!=null){
mContentView.addView(loadView);
}else{
mRoot.addView(loadView);
}
hashMap_activity_loadView.put(activity,loadView);
if (hashMap_activity_toolbar.get(activity)) {
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
Expand Down

0 comments on commit d10695d

Please sign in to comment.