|
|
|
@ -15,6 +15,7 @@ import android.window.OnBackInvokedDispatcher; |
|
|
|
|
|
|
|
|
|
|
|
import androidx.activity.OnBackPressedCallback; |
|
|
|
import androidx.activity.OnBackPressedCallback; |
|
|
|
import androidx.appcompat.app.AppCompatActivity; |
|
|
|
import androidx.appcompat.app.AppCompatActivity; |
|
|
|
|
|
|
|
import androidx.core.view.WindowCompat; |
|
|
|
import androidx.viewbinding.ViewBinding; |
|
|
|
import androidx.viewbinding.ViewBinding; |
|
|
|
|
|
|
|
|
|
|
|
import com.fongmi.android.tv.ui.custom.CustomWallView; |
|
|
|
import com.fongmi.android.tv.ui.custom.CustomWallView; |
|
|
|
@ -33,7 +34,7 @@ public abstract class BaseActivity extends AppCompatActivity { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected void onCreate(Bundle savedInstanceState) { |
|
|
|
protected void onCreate(Bundle savedInstanceState) { |
|
|
|
super.onCreate(savedInstanceState); |
|
|
|
super.onCreate(savedInstanceState); |
|
|
|
if (transparent()) setTransparent(this); |
|
|
|
if (transparent()) setTransparent(); |
|
|
|
setContentView(getBinding().getRoot()); |
|
|
|
setContentView(getBinding().getRoot()); |
|
|
|
EventBus.getDefault().register(this); |
|
|
|
EventBus.getDefault().register(this); |
|
|
|
initView(savedInstanceState); |
|
|
|
initView(savedInstanceState); |
|
|
|
@ -107,11 +108,12 @@ public abstract class BaseActivity extends AppCompatActivity { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void setTransparent(Activity activity) { |
|
|
|
private void setTransparent() { |
|
|
|
activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); |
|
|
|
getWindow().setStatusBarColor(Color.TRANSPARENT); |
|
|
|
activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); |
|
|
|
getWindow().setNavigationBarColor(Color.TRANSPARENT); |
|
|
|
activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); |
|
|
|
WindowCompat.setDecorFitsSystemWindows(getWindow(), false); |
|
|
|
activity.getWindow().setStatusBarColor(Color.TRANSPARENT); |
|
|
|
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); |
|
|
|
|
|
|
|
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Subscribe(threadMode = ThreadMode.MAIN) |
|
|
|
@Subscribe(threadMode = ThreadMode.MAIN) |
|
|
|
|