Added dark theme support

This commit is contained in:
luca0N! 2021-03-28 21:03:03 -03:00
parent a6ae301c39
commit 0a0b8011c4
Signed by: luca0N
GPG Key ID: 2E7B4655CF16D7D6
12 changed files with 338 additions and 172 deletions

View File

@ -11,7 +11,7 @@
android:label="@string/app_name" android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme.Dark"> android:theme="@style/AppTheme">
<activity android:name=".activities.MainActivity"> <activity android:name=".activities.MainActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />

View File

@ -24,6 +24,7 @@ Contact us at <joguitos+pluck@luca0n.com>.
package com.luca0n.joguitos.pluck.activities; package com.luca0n.joguitos.pluck.activities;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.view.Menu; import android.view.Menu;
import android.view.MenuInflater; import android.view.MenuInflater;
@ -35,48 +36,65 @@ import com.mikepenz.aboutlibraries.LibsBuilder;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import com.luca0n.joguitos.pluck.R; import com.luca0n.joguitos.pluck.R;
import com.luca0n.joguitos.pluck.settings.SettingsActivity; import com.luca0n.joguitos.pluck.settings.SettingsActivity;
import com.luca0n.joguitos.pluck.util.UiUtil;
@SuppressLint("Registered") @SuppressLint("Registered")
public class BaseActivity extends AppCompatActivity { public class BaseActivity extends AppCompatActivity {
public static final int REQUEST_ACTIVITY_CLOSED = 1;
@Override @Override
public boolean onCreateOptionsMenu(Menu menu) { public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater(); MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.app_menu, menu); inflater.inflate(R.menu.app_menu, menu);
return true; return true;
} }
@Override @Override
public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) { switch (item.getItemId()) {
case R.id.settings: case R.id.settings:
onSettings(); onSettings();
return true; return true;
case R.id.about: case R.id.about:
onAbout(); onAbout();
return true; return true;
case android.R.id.home: case android.R.id.home:
onBackPressed(); onBackPressed();
default: default:
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }
} }
private void onSettings() { @Override
Intent intent = new Intent(this, SettingsActivity.class); public void onActivityResult(int requestCode, int resultCode, Intent extras){
startActivity(intent); switch (requestCode){
} case REQUEST_ACTIVITY_CLOSED:
if (resultCode == Activity.RESULT_OK){
// Check if the theme changed.
recreate();
}
break;
default:
super.onActivityResult(requestCode, resultCode, extras);
break;
}
}
private void onAbout() { private void onSettings() {
String appName = getResources().getString(R.string.app_name); Intent intent = new Intent(this, SettingsActivity.class);
String appDescription = getResources().getString(R.string.app_description); startActivityForResult(intent, REQUEST_ACTIVITY_CLOSED);
}
new LibsBuilder() private void onAbout() {
.withActivityStyle(Libs.ActivityStyle.LIGHT_DARK_TOOLBAR) String appName = getResources().getString(R.string.app_name);
.withAboutIconShown(true) String appDescription = getResources().getString(R.string.app_description);
.withAboutAppName(appName)
.withAboutVersionShownName(true) new LibsBuilder()
.withAboutDescription(appDescription) .withActivityStyle(UiUtil.getTheme(this).equals(getString(R.string.pref_ui_theme_entryValues_dark)) ? Libs.ActivityStyle.DARK : Libs.ActivityStyle.LIGHT)
.start(this); .withAboutIconShown(true)
} .withAboutAppName(appName)
.withAboutVersionShownName(true)
.withAboutDescription(appDescription)
.start(this);
}
} }

View File

@ -43,6 +43,7 @@ import com.luca0n.joguitos.pluck.trivia.TriviaCategory;
import com.luca0n.joguitos.pluck.trivia.TriviaDifficulty; import com.luca0n.joguitos.pluck.trivia.TriviaDifficulty;
import com.luca0n.joguitos.pluck.trivia.TriviaQuery; import com.luca0n.joguitos.pluck.trivia.TriviaQuery;
import com.luca0n.joguitos.pluck.trivia.TriviaFilters; import com.luca0n.joguitos.pluck.trivia.TriviaFilters;
import com.luca0n.joguitos.pluck.util.UiUtil;
public class MainActivity extends BaseActivity { public class MainActivity extends BaseActivity {
@ -61,6 +62,7 @@ public class MainActivity extends BaseActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
UiUtil.setTheme(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);
ButterKnife.bind(this); ButterKnife.bind(this);
@ -129,7 +131,7 @@ public class MainActivity extends BaseActivity {
.category(category) .category(category)
.difficulty(difficulty) .difficulty(difficulty)
.build()); .build());
startActivity(intent); startActivityForResult(intent, BaseActivity.REQUEST_ACTIVITY_CLOSED);
}); });
// Create a String array that holds all options for spinnerNumber. // Create a String array that holds all options for spinnerNumber.
@ -191,6 +193,10 @@ public class MainActivity extends BaseActivity {
.show(); .show();
} }
break; break;
case BaseActivity.REQUEST_ACTIVITY_CLOSED:
// Check if the theme changed.
recreate();
break;
default: default:
super.onActivityResult(requestCode, resultCode, extras); super.onActivityResult(requestCode, resultCode, extras);
break; break;

View File

@ -23,6 +23,7 @@ Contact us at <joguitos+pluck@luca0n.com>.
package com.luca0n.joguitos.pluck.activities; package com.luca0n.joguitos.pluck.activities;
import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.content.res.ColorStateList; import android.content.res.ColorStateList;
import android.graphics.PorterDuff; import android.graphics.PorterDuff;
@ -66,6 +67,7 @@ import com.luca0n.joguitos.pluck.trivia.TriviaSource;
import com.luca0n.joguitos.pluck.trivia.TriviaFilters; import com.luca0n.joguitos.pluck.trivia.TriviaFilters;
import com.luca0n.joguitos.pluck.util.ApiUtil; import com.luca0n.joguitos.pluck.util.ApiUtil;
import com.luca0n.joguitos.pluck.util.SoundUtil; import com.luca0n.joguitos.pluck.util.SoundUtil;
import com.luca0n.joguitos.pluck.util.UiUtil;
public class TriviaGameActivity extends BaseActivity public class TriviaGameActivity extends BaseActivity
implements IDownloadTriviaQuestionReceiver { implements IDownloadTriviaQuestionReceiver {
@ -92,10 +94,13 @@ public class TriviaGameActivity extends BaseActivity
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
UiUtil.setTheme(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_trivia_game); setContentView(R.layout.activity_trivia_game);
ButterKnife.bind(this); ButterKnife.bind(this);
setResult(Activity.RESULT_OK);
ActionBar actionBar = getSupportActionBar(); ActionBar actionBar = getSupportActionBar();
if (actionBar != null) if (actionBar != null)
actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true);

View File

@ -31,55 +31,57 @@ import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import com.luca0n.joguitos.pluck.R; import com.luca0n.joguitos.pluck.R;
import com.luca0n.joguitos.pluck.trivia.TriviaGame; import com.luca0n.joguitos.pluck.trivia.TriviaGame;
import com.luca0n.joguitos.pluck.util.UiUtil;
public class TriviaGameResultsActivity extends BaseActivity { public class TriviaGameResultsActivity extends BaseActivity {
static final String EXTRA_TRIVIA_GAME = "extra_trivia_game"; static final String EXTRA_TRIVIA_GAME = "extra_trivia_game";
@BindView(R.id.text_results_correct) @BindView(R.id.text_results_correct)
TextView textResultsCorrect; TextView textResultsCorrect;
@BindView(R.id.text_results_wrong) @BindView(R.id.text_results_wrong)
TextView textResultsWrong; TextView textResultsWrong;
@BindView(R.id.text_results_total) @BindView(R.id.text_results_total)
TextView textResultsTotal; TextView textResultsTotal;
@BindView(R.id.text_results_time_elapsed) @BindView(R.id.text_results_time_elapsed)
TextView textResultsTimeElapsed; TextView textResultsTimeElapsed;
@BindView(R.id.button_return_to_menu) @BindView(R.id.button_return_to_menu)
Button buttonReturnToMenu; Button buttonReturnToMenu;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); UiUtil.setTheme(this);
setContentView(R.layout.activity_trivia_game_results); super.onCreate(savedInstanceState);
ButterKnife.bind(this); setContentView(R.layout.activity_trivia_game_results);
ButterKnife.bind(this);
Bundle bundle = getIntent().getExtras(); Bundle bundle = getIntent().getExtras();
TriviaGame game = (TriviaGame) bundle.get(EXTRA_TRIVIA_GAME); TriviaGame game = (TriviaGame) bundle.get(EXTRA_TRIVIA_GAME);
int correctTotal = 0; int correctTotal = 0;
for (boolean result : game.getResults()) { for (boolean result : game.getResults()) {
if (result) { if (result) {
correctTotal++; correctTotal++;
} }
} }
// Calculate the difference between startEpoch and endEpoch // Calculate the difference between startEpoch and endEpoch
float timeDifference = (game.getEndEpoch() - game.getStartEpoch())/1000F; float timeDifference = (game.getEndEpoch() - game.getStartEpoch())/1000F;
textResultsCorrect.setText(String.valueOf(correctTotal)); textResultsCorrect.setText(String.valueOf(correctTotal));
textResultsWrong.setText(String.valueOf(game.getQuestionsCount() - correctTotal)); textResultsWrong.setText(String.valueOf(game.getQuestionsCount() - correctTotal));
textResultsTotal.setText(String.valueOf(game.getQuestionsCount())); textResultsTotal.setText(String.valueOf(game.getQuestionsCount()));
if (timeDifference < 60000L) if (timeDifference < 60000L)
// Use the "n seconds" string since the time difference was less than 60 seconds. // Use the "n seconds" string since the time difference was less than 60 seconds.
textResultsTimeElapsed.setText( textResultsTimeElapsed.setText(
String.format(getString(R.string.ui_results_time_elapsed_format_seconds), timeDifference) String.format(getString(R.string.ui_results_time_elapsed_format_seconds), timeDifference)
); );
else else
// Use the "n minutes" string since the time difference was equal to or more than 60 seconds. // Use the "n minutes" string since the time difference was equal to or more than 60 seconds.
textResultsTimeElapsed.setText( textResultsTimeElapsed.setText(
String.format(getString(R.string.ui_results_time_elapsed_format_minutes), timeDifference / 60F) String.format(getString(R.string.ui_results_time_elapsed_format_minutes), timeDifference / 60F)
); );
buttonReturnToMenu.setOnClickListener(v -> finish()); buttonReturnToMenu.setOnClickListener(v -> finish());
} }
} }

View File

@ -23,6 +23,7 @@ Contact us at <joguitos+pluck@luca0n.com>.
package com.luca0n.joguitos.pluck.settings; package com.luca0n.joguitos.pluck.settings;
import android.app.Activity;
import android.os.Bundle; import android.os.Bundle;
import android.view.MenuItem; import android.view.MenuItem;
@ -30,19 +31,23 @@ import androidx.annotation.Nullable;
import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import com.luca0n.joguitos.pluck.util.UiUtil;
public class SettingsActivity extends AppCompatActivity { public class SettingsActivity extends AppCompatActivity {
@Override @Override
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(@Nullable Bundle savedInstanceState) {
UiUtil.setTheme(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
ActionBar actionBar = getSupportActionBar(); ActionBar actionBar = getSupportActionBar();
if (actionBar != null) if (actionBar != null)
actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true);
getFragmentManager() getSupportFragmentManager()
.beginTransaction() .beginTransaction()
.replace(android.R.id.content, new SettingsFragment()) .replace(android.R.id.content, new SettingsFragment())
.commit(); .commit();
setResult(Activity.RESULT_OK);
} }
@Override @Override

View File

@ -24,15 +24,32 @@ Contact us at <joguitos+pluck@luca0n.com>.
package com.luca0n.joguitos.pluck.settings; package com.luca0n.joguitos.pluck.settings;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceFragment; import androidx.preference.PreferenceFragmentCompat;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.luca0n.joguitos.pluck.R; import androidx.preference.ListPreference;
import androidx.preference.Preference;
public class SettingsFragment extends PreferenceFragment { import com.luca0n.joguitos.pluck.R;
@Override import com.luca0n.joguitos.pluck.util.UiUtil;
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState); public class SettingsFragment extends PreferenceFragmentCompat {
addPreferencesFromResource(R.xml.preferences); @Override
} public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey){
addPreferencesFromResource(R.xml.preferences);
// Listen for theme preference changes
ListPreference preferenceTheme = (ListPreference) findPreference(getString(R.string.pref_ui_theme));
preferenceTheme.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener(){
@Override
public boolean onPreferenceChange(Preference preference, Object newValue){
getActivity().recreate();
return true;
}
});
}
} }

View File

@ -0,0 +1,61 @@
/*
Pluck: an open source trivia game for Android
Copyright (C) 2021 Joguitos do luca0N!
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>.
This game is a fork of LibreTrivia, and its source code is available at
<https://github.com/tryton-vanmeer/LibreTrivia>.
Contact us at <joguitos+pluck@luca0n.com>.
*/
package com.luca0n.joguitos.pluck.util;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import com.luca0n.joguitos.pluck.R;
public class UiUtil {
/**
* Applies the theme selected by the user to the context.
* @param context The activity context.
* @since 2021-03-17
*/
public static void setTheme(Context context){
SharedPreferences s = PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext());
String dark = context.getString(R.string.pref_ui_theme_entryValues_dark),
theme = getTheme(context);
if (theme.equals(dark))
context.setTheme(R.style.AppTheme_Dark);
else
context.setTheme(R.style.AppTheme);
}
/**
* @return The app theme selected by the user.
* @param context The activity context.
* @since 2021-03-17
*/
public static String getTheme(Context context){
SharedPreferences s = PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext());
String themeKey = context.getString(R.string.pref_ui_theme),
themeLight = context.getString(R.string.pref_ui_theme_entryValues_light);
return s.getString(themeKey, themeLight);
}
}

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Pluck: an open source trivia game for Android
Copyright (C) 2021 Joguitos do luca0N!
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>.
This game is a fork of LibreTrivia, and its source code is available at
<https://github.com/tryton-vanmeer/LibreTrivia>.
Contact us at <joguitos+pluck@luca0n.com>.
-->
<resources>
<string-array name="pref_ui_theme_entryValues">
<item>pref_ui_theme_entryValues_light</item>
<item>pref_ui_theme_entryValues_dark</item>
</string-array>
</resources>

View File

@ -28,4 +28,8 @@ Contact us at <joguitos+pluck@luca0n.com>.
<string name="pref_network_tor">pref_network_tor</string> <string name="pref_network_tor">pref_network_tor</string>
<string name="pref_network_server">pref_network_server</string> <string name="pref_network_server">pref_network_server</string>
<string name="pref_network_server_default">https://opentdb.com/api.php</string> <string name="pref_network_server_default">https://opentdb.com/api.php</string>
<string name="pref_ui_theme">pref_ui_theme</string>
<string name="pref_ui_theme_entryValues_light">pref_ui_theme_entryValues_light</string>
<string name="pref_ui_theme_entryValues_dark">pref_ui_theme_entryValues_dark</string>
<string name="pref_ui_theme_default">pref_ui_theme_entryValues_light</string>
</resources> </resources>

View File

@ -23,97 +23,105 @@ Contact us at <joguitos+pluck@luca0n.com>.
--> -->
<resources> <resources>
<string name="app_name" translatable="false">Pluck</string> <string name="app_name" translatable="false">Pluck</string>
<string name="app_description">An open source trivia game.</string> <string name="app_description">An open source trivia game.</string>
<!-- Category Names --> <!-- Category Names -->
<string name="category_general_knowledge">General Knowledge</string> <string name="category_general_knowledge">General Knowledge</string>
<string name="category_entertainment_books">Entertainment: Books</string> <string name="category_entertainment_books">Entertainment: Books</string>
<string name="category_entertainment_film">Entertainment: Film</string> <string name="category_entertainment_film">Entertainment: Film</string>
<string name="category_entertainment_music">Entertainment: Music</string> <string name="category_entertainment_music">Entertainment: Music</string>
<string name="category_entertainment_musicals_theatres">Entertainment: Musicals &amp; Theatres</string> <string name="category_entertainment_musicals_theatres">Entertainment: Musicals &amp; Theatres</string>
<string name="category_entertainment_television">Entertainment: Television</string> <string name="category_entertainment_television">Entertainment: Television</string>
<string name="category_entertainment_video_games">Entertainment: Video Games</string> <string name="category_entertainment_video_games">Entertainment: Video Games</string>
<string name="category_entertainment_board_games">Entertainment: Board Games</string> <string name="category_entertainment_board_games">Entertainment: Board Games</string>
<string name="category_entertainment_japanese_anime_manga">Entertainment: Japanese Anime &amp; Manga</string> <string name="category_entertainment_japanese_anime_manga">Entertainment: Japanese Anime &amp; Manga</string>
<string name="category_entertainment_cartoon_animations">Entertainment: Cartoons &amp; Animation</string> <string name="category_entertainment_cartoon_animations">Entertainment: Cartoons &amp; Animation</string>
<string name="category_entertainment_comics">Entertainment: Comics</string> <string name="category_entertainment_comics">Entertainment: Comics</string>
<string name="category_science_nature">Science &amp; Nature</string> <string name="category_science_nature">Science &amp; Nature</string>
<string name="category_science_computers">Science: Computers</string> <string name="category_science_computers">Science: Computers</string>
<string name="category_science_mathematics">Science: Mathematics</string> <string name="category_science_mathematics">Science: Mathematics</string>
<string name="category_science_gadgets">Science: Gadgets</string> <string name="category_science_gadgets">Science: Gadgets</string>
<string name="category_mythology">Mythology</string> <string name="category_mythology">Mythology</string>
<string name="category_sports">Sports</string> <string name="category_sports">Sports</string>
<string name="category_geography">Geography</string> <string name="category_geography">Geography</string>
<string name="category_history">History</string> <string name="category_history">History</string>
<string name="category_politics">Politics</string> <string name="category_politics">Politics</string>
<string name="category_art">Art</string> <string name="category_art">Art</string>
<string name="category_celebrities">Celebrities</string> <string name="category_celebrities">Celebrities</string>
<string name="category_animals">Animals</string> <string name="category_animals">Animals</string>
<string name="category_vehicles">Vehicles</string> <string name="category_vehicles">Vehicles</string>
<!-- Difficulty Names --> <!-- Difficulty Names -->
<string name="difficulty_easy">Easy</string> <string name="difficulty_easy">Easy</string>
<string name="difficulty_medium">Medium</string> <string name="difficulty_medium">Medium</string>
<string name="difficulty_hard">Hard</string> <string name="difficulty_hard">Hard</string>
<!-- Question Type Names --> <!-- Question Type Names -->
<string name="question_type_multiple">Multiple Choice</string> <string name="question_type_multiple">Multiple Choice</string>
<string name="question_type_boolean">True / False</string> <string name="question_type_boolean">True / False</string>
<!-- Source Names --> <!-- Source Names -->
<string name="source_server">Server</string> <string name="source_server">Server</string>
<string name="source_file">File</string> <string name="source_file">File</string>
<!-- UI --> <!-- UI -->
<string name="ui_settings">Settings</string> <string name="ui_settings">Settings</string>
<string name="ui_about">About</string> <string name="ui_about">About</string>
<string name="ui_play">Play</string> <string name="ui_play">Play</string>
<string name="ui_start_game">Start Game</string> <string name="ui_start_game">Start Game</string>
<string name="ui_any">Any</string> <string name="ui_any">Any</string>
<string name="ui_all">All</string> <string name="ui_all">All</string>
<string name="ui_true">True</string> <string name="ui_true">True</string>
<string name="ui_false">False</string> <string name="ui_false">False</string>
<string name="ui_correct">Correct</string> <string name="ui_correct">Correct</string>
<string name="ui_wrong">Wrong</string> <string name="ui_wrong">Wrong</string>
<string name="ui_amount">Questions</string> <string name="ui_amount">Questions</string>
<string name="ui_category">Category</string> <string name="ui_category">Category</string>
<string name="ui_difficulty">Difficulty</string> <string name="ui_difficulty">Difficulty</string>
<string name="ui_question_progress">%1$d%2$d</string> <string name="ui_question_progress">%1$d%2$d</string>
<string name="ui_quit_game">Quit Game</string> <string name="ui_quit_game">Quit Game</string>
<string name="ui_quit_game_msg">Are you sure you want to quit this game?</string> <string name="ui_quit_game_msg">Are you sure you want to quit this game?</string>
<string name="ui_results_correct">Correct Answers</string> <string name="ui_results_correct">Correct Answers</string>
<string name="ui_results_wrong">Wrong Answers</string> <string name="ui_results_wrong">Wrong Answers</string>
<string name="ui_results_total">Total Questions</string> <string name="ui_results_total">Total Questions</string>
<string name="ui_results_time_elapsed">Time Elapsed</string> <string name="ui_results_time_elapsed">Time Elapsed</string>
<string name="ui_results_time_elapsed_format_seconds">%.1f seconds</string> <string name="ui_results_time_elapsed_format_seconds">%.1f seconds</string>
<string name="ui_results_time_elapsed_format_minutes">%.1f minutes</string> <string name="ui_results_time_elapsed_format_minutes">%.1f minutes</string>
<string name="ui_return_to_menu">Return To Menu</string> <string name="ui_return_to_menu">Return To Menu</string>
<string name="ui_source">Source</string> <string name="ui_source">Source</string>
<string name="ui_source_about">This value specifies where the game should retrieve trivia data. By default, the game gathers trivia data from a server, but you can load trivia files with the "File" source option.</string> <string name="ui_source_about">This value specifies where the game should retrieve trivia data. By default, the game gathers trivia data from a server, but you can load trivia files with the "File" source option.</string>
<string name="ui_network_notice">Notice: when using a server as the game source, this game connects to Open Trivia Database by default to gather trivia questions. Open Trivia Database is a collection of user-contributed questions that are licensed under the Creative Commons Attribution-ShareAlike 4.0 International (CC-BY-SA 4.0) license.\n\nYou can select a custom server in the game settings.\n\nIf you want to open a trivia file instead of getting trivia questions from a server, select "File" as the trivia game source above.</string> <string name="ui_network_notice">Notice: when using a server as the game source, this game connects to Open Trivia Database by default to gather trivia questions. Open Trivia Database is a collection of user-contributed questions that are licensed under the Creative Commons Attribution-ShareAlike 4.0 International (CC-BY-SA 4.0) license.\n\nYou can select a custom server in the game settings.\n\nIf you want to open a trivia file instead of getting trivia questions from a server, select "File" as the trivia game source above.</string>
<!-- Error Strings --> <!-- Error Strings -->
<string name="error">Error</string> <string name="error">Error</string>
<string name="error_network"><b>Network error!</b>\n\nCould not connect to a network. Check if your custom server address is correct. If Tor is enabled in the game settings, check if Orbot is running and then try again.</string> <string name="error_network"><b>Network error!</b>\n\nCould not connect to a network. Check if your custom server address is correct. If Tor is enabled in the game settings, check if Orbot is running and then try again.</string>
<string name="error_no_trivia_results"><b>No trivia results!</b>\n\nWas not able to find trivia questions that satisfied all options.</string> <string name="error_no_trivia_results"><b>No trivia results!</b>\n\nWas not able to find trivia questions that satisfied all options.</string>
<string name="error_server_response_invalid"><b>Server response error!</b>\n\nCould not parse the server response. The server response may be in a unsupported version. If you are using a custom server, make sure the server address points to a valid address and then try again.</string> <string name="error_server_response_invalid"><b>Server response error!</b>\n\nCould not parse the server response. The server response may be in a unsupported version. If you are using a custom server, make sure the server address points to a valid address and then try again.</string>
<string name="error_unknown"><b>An unknown error occurred!</b></string> <string name="error_unknown"><b>An unknown error occurred!</b></string>
<string name="error_source_file_android_version_unsupported">Trivia files are not supported in this version of Android.</string> <string name="error_source_file_android_version_unsupported">Trivia files are not supported in this version of Android.</string>
<string name="error_trivia_file_invalid"><b>Invalid trivia file!</b>\n\nTrivia files should be in a plain text JSON format.</string> <string name="error_trivia_file_invalid"><b>Invalid trivia file!</b>\n\nTrivia files should be in a plain text JSON format.</string>
<string name="error_trivia_file_fetch_unknown">An unknown error occurred while attempting to read the opened file.</string> <string name="error_trivia_file_fetch_unknown">An unknown error occurred while attempting to read the opened file.</string>
<string name="error_option_all_unavailable">The selected question amount is only available for the "File" trivia game source.</string> <string name="error_option_all_unavailable">The selected question amount is only available for the "File" trivia game source.</string>
<string name="title_activity_settings">Settings</string> <string name="title_activity_settings">Settings</string>
<!-- Setting Strings--> <!-- Setting Strings-->
<string name="pref_category_sound_title">Sound</string> <string name="pref_category_sound_title">Sound</string>
<string name="pref_sound_answer_title">Answer Sound Effect</string> <string name="pref_sound_answer_title">Answer Sound Effect</string>
<string name="pref_sound_answer_summary">Toggles game sound effects.</string> <string name="pref_sound_answer_summary">Toggles game sound effects.</string>
<string name="pref_category_network_title">Network</string> <string name="pref_category_network_title">Network</string>
<string name="pref_network_tor_title">Connect Using Tor</string> <string name="pref_network_tor_title">Connect Using Tor</string>
<string name="pref_network_tor_summary">Retrieves trivia data via the Tor network. Requires Orbot (recommended) or a Tor daemon with a SOCKS5 proxy listening on port 9050.</string> <string name="pref_network_tor_summary">Retrieves trivia data via the Tor network. Requires Orbot (recommended) or a Tor daemon with a SOCKS5 proxy listening on port 9050.</string>
<string name="pref_network_server_title">Server Address</string> <string name="pref_network_server_title">Server Address</string>
<string name="pref_network_server_summary">Specifies the server location used by the game to fetch questions when using a server as the trivia source. Leave this setting empty to use the default server.</string> <string name="pref_network_server_summary">Specifies the server location used by the game to fetch questions when using a server as the trivia source. Leave this setting empty to use the default server.</string>
<string name="pref_category_ui_title">Interface</string>
<string name="pref_ui_theme_title">Theme</string>
<string name="pref_ui_theme_summary">Defines the game theme.</string>
<string-array name="pref_ui_theme_entries">
<item>Light</item>
<item>Dark</item>
</string-array>
</resources> </resources>

View File

@ -48,4 +48,14 @@ Contact us at <joguitos+pluck@luca0n.com>.
android:title="@string/pref_network_tor_title" android:title="@string/pref_network_tor_title"
android:summary="@string/pref_network_tor_summary" /> android:summary="@string/pref_network_tor_summary" />
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory
android:title="@string/pref_category_ui_title">
<ListPreference
android:defaultValue="@string/pref_ui_theme_default"
android:key="@string/pref_ui_theme"
android:title="@string/pref_ui_theme_title"
android:summary="@string/pref_ui_theme_summary"
android:entries="@array/pref_ui_theme_entries"
android:entryValues="@array/pref_ui_theme_entryValues" />
</PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>