rename Themer to ThemableActivity
This commit is contained in:
parent
492aad9d70
commit
5d81358c15
5 changed files with 8 additions and 19 deletions
21
app/src/main/java/org/schabi/newpipe/ThemableActivity.java
Normal file
21
app/src/main/java/org/schabi/newpipe/ThemableActivity.java
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package org.schabi.newpipe;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import static org.schabi.newpipe.R.attr.theme;
|
||||
|
||||
public class ThemableActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (Objects.equals(PreferenceManager.getDefaultSharedPreferences(this)
|
||||
.getString("theme", getResources().getString(R.string.light_theme_title)), getResources().getString(R.string.dark_theme_title))) {
|
||||
setTheme(R.style.DarkTheme);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue