Skip to content

Commit

Permalink
help
Browse files Browse the repository at this point in the history
Adds 'online help' for widget title substitutions.
  • Loading branch information
forrestguice committed Sep 5, 2022
1 parent cdaa5a9 commit d4ebe8a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Typeface;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
Expand Down Expand Up @@ -99,6 +100,8 @@ public class SuntimesConfigActivity0 extends AppCompatActivity
protected static final String DIALOGTAG_ABOUT = "about";
protected static final String DIALOGTAG_HELP = "help";

protected static final String HELPTAG_SUBSTITUTIONS = "help_substitutions";

protected int appWidgetId = AppWidgetManager.INVALID_APPWIDGET_ID;
protected boolean reconfigure = false;
protected ContentValues themeValues;
Expand Down Expand Up @@ -726,6 +729,8 @@ public void onClick(View v)
{
HelpDialog helpDialog = new HelpDialog();
helpDialog.setContent(getString(R.string.help_appearance_title));
helpDialog.setShowNeutralButton(getString(R.string.configAction_onlineHelp));
helpDialog.setNeutralButtonListener(helpDialogListener_substitutions, HELPTAG_SUBSTITUTIONS);
helpDialog.show(getSupportFragmentManager(), DIALOGTAG_HELP);
}
});
Expand Down Expand Up @@ -2266,6 +2271,17 @@ public void onBackPressed() {
overridePendingTransition(R.anim.transition_cancel_in, R.anim.transition_cancel_out);
}

/**
* HelpDialog (title substitutions)
*/
private final View.OnClickListener helpDialogListener_substitutions = new View.OnClickListener()
{
@Override
public void onClick(View v) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.help_substitutions_url))));
}
};

////////////////////////////////////////////////////////////////////////////////////////////////

/**
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1872,7 +1872,8 @@
* <b>%m</b> for mode (short) (e.g. Solstice) <br/>
* <b>%M</b> for mode (long) (e.g. Winter Solstice) <br/>
* <b>%o</b> for order (e.g. Closest Event, Upcoming Event) <br/>
]]></string>
]]></string> <!-- TODO: add "%em, %et, %eT, %eA" (#599) to online-help -->
<string name="help_substitutions_url" translatable="false">https://github.com/forrestguice/SuntimesWidget/wiki/Help#data-substitutions</string>

<string name="help_general2"> <!-- general app help; composites a couple help topics together. -->
<xliff:g id="help_topic1">%1$s</xliff:g><![CDATA[<br />]]>
Expand Down

0 comments on commit d4ebe8a

Please sign in to comment.