mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-25 02:18:23 +01:00
Fix crashes on scrolling posts using volume keys.
This commit is contained in:
parent
73980544db
commit
6e211a5821
@ -161,9 +161,13 @@ public class AccountPostsActivity extends BaseActivity implements SortTypeSelect
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
|
if (mFragment != null) {
|
||||||
return ((FragmentCommunicator) mFragment).handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
return ((FragmentCommunicator) mFragment).handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return super.onKeyDown(keyCode, event);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SharedPreferences getSharedPreferences() {
|
public SharedPreferences getSharedPreferences() {
|
||||||
return mSharedPreferences;
|
return mSharedPreferences;
|
||||||
|
@ -154,9 +154,13 @@ public class AccountSavedThingActivity extends BaseActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
|
if (sectionsPagerAdapter != null) {
|
||||||
return sectionsPagerAdapter.handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
return sectionsPagerAdapter.handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return super.onKeyDown(keyCode, event);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SharedPreferences getSharedPreferences() {
|
public SharedPreferences getSharedPreferences() {
|
||||||
return mSharedPreferences;
|
return mSharedPreferences;
|
||||||
|
@ -180,9 +180,13 @@ public class FilteredThingActivity extends BaseActivity implements SortTypeSelec
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
|
if (mFragment != null) {
|
||||||
return ((FragmentCommunicator) mFragment).handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
return ((FragmentCommunicator) mFragment).handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return super.onKeyDown(keyCode, event);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SharedPreferences getSharedPreferences() {
|
public SharedPreferences getSharedPreferences() {
|
||||||
return mSharedPreferences;
|
return mSharedPreferences;
|
||||||
|
@ -942,9 +942,13 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
|
if (sectionsPagerAdapter != null) {
|
||||||
return sectionsPagerAdapter.handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
return sectionsPagerAdapter.handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return super.onKeyDown(keyCode, event);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onSaveInstanceState(@NonNull Bundle outState) {
|
protected void onSaveInstanceState(@NonNull Bundle outState) {
|
||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
|
@ -173,8 +173,11 @@ public class SearchResultActivity extends BaseActivity implements SortTypeSelect
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
|
if (sectionsPagerAdapter != null) {
|
||||||
return sectionsPagerAdapter.handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
return sectionsPagerAdapter.handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
||||||
}
|
}
|
||||||
|
return super.onKeyDown(keyCode, event);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SharedPreferences getSharedPreferences() {
|
public SharedPreferences getSharedPreferences() {
|
||||||
|
@ -1564,10 +1564,14 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void lockSwipeRightToGoBack() {
|
public void lockSwipeRightToGoBack() {
|
||||||
|
if (mSlidrInterface != null) {
|
||||||
mSlidrInterface.lock();
|
mSlidrInterface.lock();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void unlockSwipeRightToGoBack() {
|
public void unlockSwipeRightToGoBack() {
|
||||||
|
if (mSlidrInterface != null) {
|
||||||
mSlidrInterface.unlock();
|
mSlidrInterface.unlock();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -336,9 +336,13 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
|
if (mFragment != null) {
|
||||||
return ((FragmentCommunicator)(mFragment)).handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
return ((FragmentCommunicator)(mFragment)).handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return super.onKeyDown(keyCode, event);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SharedPreferences getSharedPreferences() {
|
public SharedPreferences getSharedPreferences() {
|
||||||
return mSharedPreferences;
|
return mSharedPreferences;
|
||||||
@ -645,8 +649,10 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
|
|||||||
mSharedPreferences.edit().putString(SharedPreferencesUtils.SORT_TIME_SUBREDDIT_POST, sortType.getTime().name()).apply();
|
mSharedPreferences.edit().putString(SharedPreferencesUtils.SORT_TIME_SUBREDDIT_POST, sortType.getTime().name()).apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mFragment != null) {
|
||||||
((PostFragment) mFragment).changeSortType(sortType);
|
((PostFragment) mFragment).changeSortType(sortType);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sortTypeSelected(String sortType) {
|
public void sortTypeSelected(String sortType) {
|
||||||
|
@ -399,9 +399,13 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
|
if (sectionsPagerAdapter != null) {
|
||||||
return sectionsPagerAdapter.handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
return sectionsPagerAdapter.handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return super.onKeyDown(keyCode, event);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SharedPreferences getSharedPreferences() {
|
public SharedPreferences getSharedPreferences() {
|
||||||
return mSharedPreferences;
|
return mSharedPreferences;
|
||||||
|
Loading…
Reference in New Issue
Block a user