From 5458acfcad29506eb5ac92ec429ee60fa858d7d1 Mon Sep 17 00:00:00 2001 From: 59436419 Date: Sat, 31 Dec 2016 13:46:52 +0530 Subject: [PATCH] Added dark theme --- .../main/java/org/schabi/newpipe/Themer.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 app/src/main/java/org/schabi/newpipe/Themer.java diff --git a/app/src/main/java/org/schabi/newpipe/Themer.java b/app/src/main/java/org/schabi/newpipe/Themer.java new file mode 100644 index 000000000..07a9f89a4 --- /dev/null +++ b/app/src/main/java/org/schabi/newpipe/Themer.java @@ -0,0 +1,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; + +public class Themer extends AppCompatActivity { + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if (Objects.equals(PreferenceManager.getDefaultSharedPreferences(this) + .getString("theme", "1"), "0")) { + setTheme(R.style.DarkTheme); + } + } +}