Added Dark Theme

This commit is contained in:
59436419 2017-01-17 16:07:36 +05:30
parent a2e4585fe8
commit 60dc19d2bc
21 changed files with 318 additions and 256 deletions

View file

@ -2,19 +2,20 @@ package org.schabi.newpipe;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import java.util.Objects;
import static org.schabi.newpipe.R.attr.theme;
public class Themer extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (Objects.equals(PreferenceManager.getDefaultSharedPreferences(this)
.getString("theme", "1"), "0")) {
.getString("theme", getResources().getString(R.string.light_theme_title)), getResources().getString(R.string.dark_theme_title))) {
setTheme(R.style.DarkTheme);
}
}
}
}