Merge branch 'TeamNewPipe:dev' into dev

This commit is contained in:
LingYinTianMeng 2022-04-19 16:36:42 +08:00 committed by GitHub
commit fd5626e9e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 4 deletions

View file

@ -262,7 +262,7 @@ dependencies {
implementation "com.nononsenseapps:filepicker:4.2.1" implementation "com.nononsenseapps:filepicker:4.2.1"
// Crash reporting // Crash reporting
implementation "ch.acra:acra-core:5.8.4" implementation "ch.acra:acra-core:5.9.1"
// Properly restarting // Properly restarting
implementation 'com.jakewharton:process-phoenix:2.1.2' implementation 'com.jakewharton:process-phoenix:2.1.2'

View file

@ -205,7 +205,7 @@ public class App extends MultiDexApplication {
return; return;
} }
final CoreConfigurationBuilder acraConfig = new CoreConfigurationBuilder(this) final CoreConfigurationBuilder acraConfig = new CoreConfigurationBuilder()
.withBuildConfigClass(BuildConfig.class); .withBuildConfigClass(BuildConfig.class);
ACRA.init(this, acraConfig); ACRA.init(this, acraConfig);
} }

View file

@ -97,7 +97,10 @@ public final class PlayQueueActivity extends AppCompatActivity
getMenuInflater().inflate(R.menu.menu_play_queue, m); getMenuInflater().inflate(R.menu.menu_play_queue, m);
getMenuInflater().inflate(R.menu.menu_play_queue_bg, m); getMenuInflater().inflate(R.menu.menu_play_queue_bg, m);
onMaybeMuteChanged(); onMaybeMuteChanged();
// to avoid null reference
if (player != null) {
onPlaybackParameterChanged(player.getPlaybackParameters()); onPlaybackParameterChanged(player.getPlaybackParameters());
}
return true; return true;
} }

View file

@ -24,9 +24,21 @@ public final class KeyboardUtil {
if (editText.requestFocus()) { if (editText.requestFocus()) {
final InputMethodManager imm = ContextCompat.getSystemService(activity, final InputMethodManager imm = ContextCompat.getSystemService(activity,
InputMethodManager.class); InputMethodManager.class);
if (!imm.showSoftInput(editText, InputMethodManager.SHOW_FORCED)) {
/*
* Sometimes the keyboard can't be shown because Android's ImeFocusController is in
* a incorrect state e.g. when animations are disabled or the unfocus event of the
* previous view arrives in the wrong moment (see #7647 for details).
* The invalid state can be fixed by to re-focusing the editText.
*/
editText.clearFocus();
editText.requestFocus();
// Try again
imm.showSoftInput(editText, InputMethodManager.SHOW_FORCED); imm.showSoftInput(editText, InputMethodManager.SHOW_FORCED);
} }
} }
}
public static void hideKeyboard(final Activity activity, final EditText editText) { public static void hideKeyboard(final Activity activity, final EditText editText) {
if (activity == null || editText == null) { if (activity == null || editText == null) {