Skip to content

Commit 2c9a6ad

Browse files
committed
add «Always expand description» in appearance settings, closes #1113
1 parent f8cc318 commit 2c9a6ad

4 files changed

Lines changed: 13 additions & 2 deletions

File tree

app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,11 @@ private void setHeightThumbnail() {
974974

975975
private void showContent() {
976976
contentRootLayoutHiding.setVisibility(View.VISIBLE);
977+
final boolean showDescriptionOnLoad = PreferenceManager.getDefaultSharedPreferences(activity)
978+
.getBoolean(getString(R.string.always_expand_description_key), false);
979+
if (showDescriptionOnLoad) {
980+
toggleTitleAndDescription();
981+
}
977982
}
978983

979984
protected void setInitialData(int serviceId, String url, String name) {

app/src/main/res/values/settings_keys.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1125,5 +1125,5 @@
11251125
<item>@string/list</item>
11261126
<item>@string/grid</item>
11271127
</string-array>
1128-
1128+
<string name="always_expand_description_key" translatable="false">always_expand_description</string>
11291129
</resources>

app/src/main/res/values/strings.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,4 +644,5 @@
644644
<string name="feed_use_dedicated_fetch_method_enable_button">Enable fast mode</string>
645645
<string name="feed_use_dedicated_fetch_method_disable_button">Disable fast mode</string>
646646
<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>
647-
</resources>
647+
<string name="always_expand_description">Always expand description</string>
648+
</resources>

app/src/main/res/xml/appearance_settings.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,9 @@
3535
android:title="@string/caption_setting_title"
3636
android:summary="@string/caption_setting_description"/>
3737

38+
<SwitchPreference
39+
app:iconSpaceReserved="false"
40+
android:defaultValue="false"
41+
android:key="@string/always_expand_description_key"
42+
android:title="@string/always_expand_description"/>
3843
</PreferenceScreen>

0 commit comments

Comments
 (0)