aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-06-01 11:44:24 -0700
committerScott Jackson <daneren2005@gmail.com>2014-06-01 11:44:24 -0700
commit30516c513bb7174e91dbc338c2011c6a300d069d (patch)
treeaf5d4eaf00d2be62e14d6ce092707a66ed4d13c7
parentec0a512d9f8f704f431d56cc08ffd776a04ead93 (diff)
downloaddsub-30516c513bb7174e91dbc338c2011c6a300d069d.tar.gz
dsub-30516c513bb7174e91dbc338c2011c6a300d069d.tar.bz2
dsub-30516c513bb7174e91dbc338c2011c6a300d069d.zip
#327 Add color to titles of sections in FAQ
-rw-r--r--res/values/strings.xml10
-rw-r--r--src/github/daneren2005/dsub/fragments/MainFragment.java2
-rw-r--r--src/github/daneren2005/dsub/util/Util.java14
3 files changed, 21 insertions, 5 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index de9360c7..3bc04eb6 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -49,10 +49,12 @@
\nAvailable Space: %5$s of %6$s</string>
<string name="main.faq_title">FAQ</string>
<string name="main.faq_text">
- Cache vs Permanent Cache:
- \nWhen songs are downloaded by DSub, they can be deleted to make room for new downloads. Permanently cached music on the other hand will never be automatically deleted.
- \n\nChromeCast fails:
- \nMake sure you are not using a self-signed certificate, because the Chromecast will automatically reject them.
+ <![CDATA[
+ <font color="red">Cache vs Permanent Cache</font>:
+ <br/>When songs are downloaded by DSub, they can be deleted to make room for new downloads. Permanently cached music on the other hand will never be automatically deleted.
+ <p/><font color="red">ChromeCast fails</font>:
+ <br/>Make sure you are not using a self-signed certificate, because the Chromecast will automatically reject them.
+ ]]>
</string>
<string name="main.select_server">Select server</string>
<string name="main.shuffle">Shuffle play</string>
diff --git a/src/github/daneren2005/dsub/fragments/MainFragment.java b/src/github/daneren2005/dsub/fragments/MainFragment.java
index 4d934e78..88baf717 100644
--- a/src/github/daneren2005/dsub/fragments/MainFragment.java
+++ b/src/github/daneren2005/dsub/fragments/MainFragment.java
@@ -356,7 +356,7 @@ public class MainFragment extends SubsonicFragment {
}
private void showFAQDialog() {
- Util.info(context, R.string.main_faq_title, R.string.main_faq_text);
+ Util.showHTMLDialog(context, R.string.main_faq_title, R.string.main_faq_text);
}
private void getLogs() {
diff --git a/src/github/daneren2005/dsub/util/Util.java b/src/github/daneren2005/dsub/util/Util.java
index 413e7cfc..91cca04b 100644
--- a/src/github/daneren2005/dsub/util/Util.java
+++ b/src/github/daneren2005/dsub/util/Util.java
@@ -43,6 +43,7 @@ import android.os.Build;
import android.os.Environment;
import android.os.Handler;
import android.support.v4.app.NotificationCompat;
+import android.text.Html;
import android.text.SpannableString;
import android.text.method.LinkMovementMethod;
import android.text.util.Linkify;
@@ -971,6 +972,19 @@ public final class Util {
((TextView)dialog.findViewById(android.R.id.message)).setMovementMethod(LinkMovementMethod.getInstance());
}
+ public static void showHTMLDialog(Context context, int title, int message) {
+ AlertDialog dialog = new AlertDialog.Builder(context)
+ .setIcon(android.R.drawable.ic_dialog_info)
+ .setTitle(title)
+ .setMessage(Html.fromHtml(context.getResources().getString(message)))
+ .setPositiveButton(R.string.common_ok, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int i) {
+ dialog.dismiss();
+ }
+ })
+ .show();
+ }
public static void showPlayingNotification(final Context context, final DownloadService downloadService, Handler handler, MusicDirectory.Entry song) {
// Set the icon, scrolling text and timestamp