| | |
| | | import android.graphics.drawable.ColorDrawable; |
| | | import android.graphics.drawable.Drawable; |
| | | import android.util.TypedValue; |
| | | import android.widget.TextView; |
| | | |
| | | import androidx.appcompat.content.res.AppCompatResources; |
| | | |
| | | import com.android.app_base.utils.ScreenSizeUtils; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.hjq.bar.style.CommonBarStyle; |
| | | |
| | |
| | | |
| | | @Override |
| | | public Drawable getTitleBarBackground(Context context) { |
| | | return new ColorDrawable(context.getColor(R.color.color_title_bar_background)); |
| | | //根据当前主题获取不同的背景颜色 |
| | | TypedValue typedValue = new TypedValue(); |
| | | context.getTheme().resolveAttribute(R.attr.titleBarBackgroundColor, typedValue, true); |
| | | return new ColorDrawable(typedValue.data); |
| | | } |
| | | |
| | | @Override |