mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-05-15 06:22:49 +00:00
Rename package to com.beemdevelopment.aegis
This commit is contained in:
parent
ceb03de240
commit
62425511a1
101 changed files with 366 additions and 362 deletions
|
@ -0,0 +1,43 @@
|
|||
package com.beemdevelopment.aegis.ui;
|
||||
|
||||
import android.os.Bundle;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.beemdevelopment.aegis.AegisApplication;
|
||||
import com.beemdevelopment.aegis.Preferences;
|
||||
import com.beemdevelopment.aegis.R;
|
||||
|
||||
public abstract class AegisActivity extends AppCompatActivity {
|
||||
private AegisApplication _app;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
_app = (AegisApplication) getApplication();
|
||||
|
||||
// set FLAG_SECURE on the window of every AegisActivity
|
||||
if (getPreferences().isSecureScreenEnabled()) {
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
|
||||
}
|
||||
|
||||
// set the theme
|
||||
setPreferredTheme(getPreferences().isDarkModeEnabled());
|
||||
}
|
||||
|
||||
protected AegisApplication getApp() {
|
||||
return _app;
|
||||
}
|
||||
|
||||
protected Preferences getPreferences() {
|
||||
return _app.getPreferences();
|
||||
}
|
||||
|
||||
protected void setPreferredTheme(boolean darkMode) {
|
||||
if (darkMode) {
|
||||
setTheme(R.style.AppTheme_Dark);
|
||||
} else {
|
||||
setTheme(R.style.AppTheme);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue