|
|
@ -22,6 +22,8 @@ import android.view.Window; |
|
|
|
import android.view.WindowManager; |
|
|
|
import android.view.WindowManager; |
|
|
|
import android.widget.FrameLayout; |
|
|
|
import android.widget.FrameLayout; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.android.base.R; |
|
|
|
|
|
|
|
|
|
|
|
import timber.log.Timber; |
|
|
|
import timber.log.Timber; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -172,13 +174,17 @@ public class SystemBarCompat { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@SuppressWarnings("WeakerAccess,unused") |
|
|
|
@SuppressWarnings("WeakerAccess,unused") |
|
|
|
public static View setupStatusBarView(Context context, ViewGroup rootView, @ColorInt int color) { |
|
|
|
public static View setupStatusBarView(Context context, ViewGroup rootView, @ColorInt int color) { |
|
|
|
View mStatusBarTintView = new View(context); |
|
|
|
View statusBarTintView = rootView.findViewById(R.id.base_status_view_id); |
|
|
|
mStatusBarTintView.setBackgroundColor(color); |
|
|
|
if (statusBarTintView == null) { |
|
|
|
FrameLayout.LayoutParams mStatusBarParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, getStatusBarHeight(context)); |
|
|
|
statusBarTintView = new View(context); |
|
|
|
mStatusBarParams.gravity = Gravity.TOP; |
|
|
|
statusBarTintView.setId(R.id.base_status_view_id); |
|
|
|
mStatusBarTintView.setLayoutParams(mStatusBarParams); |
|
|
|
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, getStatusBarHeight(context)); |
|
|
|
rootView.addView(mStatusBarTintView, 0); |
|
|
|
layoutParams.gravity = Gravity.TOP; |
|
|
|
return mStatusBarTintView; |
|
|
|
statusBarTintView.setLayoutParams(layoutParams); |
|
|
|
|
|
|
|
rootView.addView(statusBarTintView, 0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
statusBarTintView.setBackgroundColor(color); |
|
|
|
|
|
|
|
return statusBarTintView; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|