Skip to content

Commit 7da28f2

Browse files
authored
Merge branch 'dev' into unhook-save-restore
2 parents 4b8474b + 0bc769b commit 7da28f2

68 files changed

Lines changed: 1167 additions & 1329 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
.gitignore
22
/build
3-
app.iml
3+
*.iml

app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ android {
1111
applicationId "org.schabi.newpipe"
1212
minSdkVersion 19
1313
targetSdkVersion 28
14-
versionCode 820
15-
versionName "0.18.2"
14+
versionCode 840
15+
versionName "0.18.4"
1616

1717
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1818
vectorDrawables.useSupportLibrary = true
@@ -63,7 +63,7 @@ dependencies {
6363
exclude module: 'support-annotations'
6464
})
6565

66-
implementation 'com.github.TeamNewPipe:NewPipeExtractor:9112a10'
66+
implementation 'com.github.TeamNewPipe:NewPipeExtractor:v0.18.4'
6767
testImplementation 'junit:junit:4.12'
6868
testImplementation 'org.mockito:mockito-core:2.23.0'
6969

app/src/main/java/org/schabi/newpipe/MainActivity.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -453,15 +453,9 @@ protected void onResume() {
453453
NavigationHelper.openMainActivity(this);
454454
}
455455

456-
if (sharedPreferences.getBoolean(Constants.KEY_ENABLE_WATCH_HISTORY, true)) {
457-
if (DEBUG) Log.d(TAG, "do not show History-menu as its disabled in settings");
458-
drawerItems.getMenu().findItem(ITEM_ID_HISTORY).setVisible(true);
459-
}
460-
461-
if (!sharedPreferences.getBoolean(Constants.KEY_ENABLE_WATCH_HISTORY, true)) {
462-
if (DEBUG) Log.d(TAG, "show History-menu as its enabled in settings");
463-
drawerItems.getMenu().findItem(ITEM_ID_HISTORY).setVisible(false);
464-
}
456+
final boolean isHistoryEnabled = sharedPreferences.getBoolean(
457+
getString(R.string.enable_watch_history_key), true);
458+
drawerItems.getMenu().findItem(ITEM_ID_HISTORY).setVisible(isHistoryEnabled);
465459
}
466460

467461
@Override

app/src/main/java/org/schabi/newpipe/ReCaptchaActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import org.schabi.newpipe.util.ThemeHelper;
2020

21-
import javax.annotation.Nonnull;
21+
import androidx.annotation.NonNull;
2222

2323
/*
2424
* Created by beneth <bmauduit@beneth.fr> on 06.12.16.
@@ -147,7 +147,7 @@ private void handleCookies(String url) {
147147
// add other methods to extract cookies here
148148
}
149149

150-
private void addYoutubeCookies(@Nonnull String cookies) {
150+
private void addYoutubeCookies(@NonNull String cookies) {
151151
if (cookies.contains("s_gl=") || cookies.contains("goojf=") || cookies.contains("VISITOR_INFO1_LIVE=")) {
152152
// youtube seems to also need the other cookies:
153153
addCookie(cookies);

app/src/main/java/org/schabi/newpipe/about/AboutActivity.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,6 @@ protected void onCreate(Bundle savedInstanceState) {
8888
}
8989

9090

91-
@Override
92-
public boolean onCreateOptionsMenu(Menu menu) {
93-
// Inflate the menu; this adds items to the action bar if it is present.
94-
getMenuInflater().inflate(R.menu.menu_about, menu);
95-
return true;
96-
}
97-
9891
@Override
9992
public boolean onOptionsItemSelected(MenuItem item) {
10093

app/src/main/java/org/schabi/newpipe/download/DownloadActivity.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import android.view.ViewTreeObserver;
1313

1414
import org.schabi.newpipe.R;
15+
import org.schabi.newpipe.util.NavigationHelper;
1516
import org.schabi.newpipe.util.ThemeHelper;
1617

1718
import us.shandian.giga.service.DownloadManagerService;
@@ -76,11 +77,9 @@ public boolean onCreateOptionsMenu(Menu menu) {
7677
@Override
7778
public boolean onOptionsItemSelected(MenuItem item) {
7879
switch (item.getItemId()) {
79-
case android.R.id.home: {
80+
case android.R.id.home:
8081
onBackPressed();
8182
return true;
82-
}
83-
8483
default:
8584
return super.onOptionsItemSelected(item);
8685
}

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -600,22 +600,27 @@ private void updateMenuItemVisibility() {
600600

601601
@Override
602602
public boolean onOptionsItemSelected(MenuItem item) {
603+
int id = item.getItemId();
604+
if (id == R.id.action_settings) {
605+
NavigationHelper.openSettings(requireContext());
606+
return true;
607+
}
608+
603609
if (isLoading.get()) {
604-
// if is still loading block menu
610+
// if still loading, block menu buttons related to video info
605611
return true;
606612
}
607613

608-
int id = item.getItemId();
609614
switch (id) {
610615
case R.id.menu_item_share: {
611616
if (currentInfo != null) {
612-
ShareUtils.shareUrl(this.getContext(), currentInfo.getName(), currentInfo.getOriginalUrl());
617+
ShareUtils.shareUrl(requireContext(), currentInfo.getName(), currentInfo.getOriginalUrl());
613618
}
614619
return true;
615620
}
616621
case R.id.menu_item_openInBrowser: {
617622
if (currentInfo != null) {
618-
ShareUtils.openUrlInBrowser(this.getContext(), currentInfo.getOriginalUrl());
623+
ShareUtils.openUrlInBrowser(requireContext(), currentInfo.getOriginalUrl());
619624
}
620625
return true;
621626
}
@@ -1074,7 +1079,7 @@ public void handleResult(@NonNull StreamInfo info) {
10741079
if (info.getStreamType().equals(StreamType.AUDIO_LIVE_STREAM)) {
10751080
videoCountView.setText(Localization.listeningCount(activity, info.getViewCount()));
10761081
} else if (info.getStreamType().equals(StreamType.LIVE_STREAM)) {
1077-
videoCountView.setText(Localization.watchingCount(activity, info.getViewCount()));
1082+
videoCountView.setText(Localization.localizeWatchingCount(activity, info.getViewCount()));
10781083
} else {
10791084
videoCountView.setText(Localization.localizeViewCount(activity, info.getViewCount()));
10801085
}

app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,17 +175,20 @@ private void openRssFeed() {
175175
@Override
176176
public boolean onOptionsItemSelected(MenuItem item) {
177177
switch (item.getItemId()) {
178+
case R.id.action_settings:
179+
NavigationHelper.openSettings(requireContext());
180+
break;
178181
case R.id.menu_item_rss:
179182
openRssFeed();
180183
break;
181184
case R.id.menu_item_openInBrowser:
182185
if (currentInfo != null) {
183-
ShareUtils.openUrlInBrowser(this.getContext(), currentInfo.getOriginalUrl());
186+
ShareUtils.openUrlInBrowser(requireContext(), currentInfo.getOriginalUrl());
184187
}
185188
break;
186189
case R.id.menu_item_share:
187190
if (currentInfo != null) {
188-
ShareUtils.shareUrl(this.getContext(), name, currentInfo.getOriginalUrl());
191+
ShareUtils.shareUrl(requireContext(), name, currentInfo.getOriginalUrl());
189192
}
190193
break;
191194
default:
@@ -370,7 +373,7 @@ public void handleResult(@NonNull ChannelInfo result) {
370373

371374
headerSubscribersTextView.setVisibility(View.VISIBLE);
372375
if (result.getSubscriberCount() >= 0) {
373-
headerSubscribersTextView.setText(Localization.localizeSubscribersCount(activity, result.getSubscriberCount()));
376+
headerSubscribersTextView.setText(Localization.shortSubscriberCount(activity, result.getSubscriberCount()));
374377
} else {
375378
headerSubscribersTextView.setText(R.string.subscribers_count_not_available);
376379
}

app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,14 @@ protected Single<PlaylistInfo> loadResult(boolean forceLoad) {
222222
@Override
223223
public boolean onOptionsItemSelected(MenuItem item) {
224224
switch (item.getItemId()) {
225+
case R.id.action_settings:
226+
NavigationHelper.openSettings(requireContext());
227+
break;
225228
case R.id.menu_item_openInBrowser:
226-
ShareUtils.openUrlInBrowser(this.getContext(), url);
229+
ShareUtils.openUrlInBrowser(requireContext(), url);
227230
break;
228231
case R.id.menu_item_share:
229-
ShareUtils.shareUrl(this.getContext(), name, url);
232+
ShareUtils.shareUrl(requireContext(), name, url);
230233
break;
231234
case R.id.menu_item_bookmark:
232235
onBookmarkClicked();

app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public void onCreate(Bundle savedInstanceState) {
190190

191191
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(activity);
192192
isSuggestionsEnabled = preferences.getBoolean(getString(R.string.show_search_suggestions_key), true);
193-
contentCountry = preferences.getString(getString(R.string.content_country_key), getString(R.string.default_country_value));
193+
contentCountry = preferences.getString(getString(R.string.content_country_key), getString(R.string.default_localization_key));
194194
}
195195

196196
@Override

0 commit comments

Comments
 (0)