Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
whats-open-android
Commits
0504c4d1
Commit
0504c4d1
authored
Sep 19, 2018
by
michael lundquist
Browse files
Detecting a click on the dark/light theme toggle.
parent
f61b0c0e
Pipeline
#2934
passed with stages
in 3 minutes and 32 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/srct/whatsopen/views/activities/SettingsActivity.java
View file @
0504c4d1
...
@@ -7,6 +7,7 @@ import android.os.Bundle;
...
@@ -7,6 +7,7 @@ import android.os.Bundle;
import
android.support.v7.app.AppCompatActivity
;
import
android.support.v7.app.AppCompatActivity
;
import
android.support.v7.preference.PreferenceManager
;
import
android.support.v7.preference.PreferenceManager
;
import
android.support.v7.widget.Toolbar
;
import
android.support.v7.widget.Toolbar
;
import
android.util.Log
;
import
android.view.Menu
;
import
android.view.Menu
;
import
android.view.MenuItem
;
import
android.view.MenuItem
;
...
@@ -72,6 +73,10 @@ public class SettingsActivity extends AppCompatActivity {
...
@@ -72,6 +73,10 @@ public class SettingsActivity extends AppCompatActivity {
public
void
onSharedPreferenceChanged
(
SharedPreferences
prefs
,
String
key
)
{
public
void
onSharedPreferenceChanged
(
SharedPreferences
prefs
,
String
key
)
{
if
(
key
.
equals
(
"turn_off_rotation_preference"
))
{
if
(
key
.
equals
(
"turn_off_rotation_preference"
))
{
MyApplication
.
setRotation
(
SettingsActivity
.
this
);
MyApplication
.
setRotation
(
SettingsActivity
.
this
);
}
else
if
(
key
.
equals
(
"dark_theme"
)){
boolean
dark
=
prefs
.
getBoolean
(
"dark_theme"
,
false
);
String
darkText
=
dark
?
"dark"
:
"light"
;
//TODO: remove this after you set the theme
Log
.
e
(
"Mike's log"
,
"onSharedPreferenceChanged: "
+
darkText
);
}
}
}
}
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment