Skip to content

Commit

Permalink
add «Always expand description» in appearance settings, closes #1113
Browse files Browse the repository at this point in the history
  • Loading branch information
B0pol committed Mar 14, 2020
1 parent f8cc318 commit 2c9a6ad
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,11 @@ private void setHeightThumbnail() {

private void showContent() {
contentRootLayoutHiding.setVisibility(View.VISIBLE);
final boolean showDescriptionOnLoad = PreferenceManager.getDefaultSharedPreferences(activity)
.getBoolean(getString(R.string.always_expand_description_key), false);
if (showDescriptionOnLoad) {
toggleTitleAndDescription();
}
}

protected void setInitialData(int serviceId, String url, String name) {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/settings_keys.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1125,5 +1125,5 @@
<item>@string/list</item>
<item>@string/grid</item>
</string-array>

<string name="always_expand_description_key" translatable="false">always_expand_description</string>
</resources>
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 @@ -644,4 +644,5 @@
<string name="feed_use_dedicated_fetch_method_enable_button">Enable fast mode</string>
<string name="feed_use_dedicated_fetch_method_disable_button">Disable fast mode</string>
<string name="feed_use_dedicated_fetch_method_help_text">Do you think feed loading is too slow? If so, try enabling fast loading (you can change it in settings or by pressing the button below).\n\nNewPipe offers two feed loading strategies:\n• Fetching the whole subscription channel, which is slow but complete.\n• Using a dedicated service endpoint, which is fast but usually not complete.\n\nThe difference between the two is that the fast one usually lacks some information, like the item\'s duration or type (can\'t distinguish between live videos and normal ones) and it may return less items.\n\nYouTube is an example of a service that offers this fast method with its RSS feed.\n\nSo the choice boils down to what you prefer: speed or precise information.</string>
</resources>
<string name="always_expand_description">Always expand description</string>
</resources>
5 changes: 5 additions & 0 deletions app/src/main/res/xml/appearance_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,9 @@
android:title="@string/caption_setting_title"
android:summary="@string/caption_setting_description"/>

<SwitchPreference
app:iconSpaceReserved="false"
android:defaultValue="false"
android:key="@string/always_expand_description_key"
android:title="@string/always_expand_description"/>
</PreferenceScreen>

0 comments on commit 2c9a6ad

Please sign in to comment.