mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-24 18:08:23 +01:00
Fix crashes on scrolling posts using volume keys.
This commit is contained in:
parent
73980544db
commit
6e211a5821
@ -161,7 +161,11 @@ public class AccountPostsActivity extends BaseActivity implements SortTypeSelect
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
return ((FragmentCommunicator) mFragment).handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
if (mFragment != null) {
|
||||||
|
return ((FragmentCommunicator) mFragment).handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onKeyDown(keyCode, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -154,7 +154,11 @@ public class AccountSavedThingActivity extends BaseActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
return sectionsPagerAdapter.handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
if (sectionsPagerAdapter != null) {
|
||||||
|
return sectionsPagerAdapter.handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onKeyDown(keyCode, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -180,7 +180,11 @@ public class FilteredThingActivity extends BaseActivity implements SortTypeSelec
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
return ((FragmentCommunicator) mFragment).handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
if (mFragment != null) {
|
||||||
|
return ((FragmentCommunicator) mFragment).handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onKeyDown(keyCode, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -942,7 +942,11 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
return sectionsPagerAdapter.handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
if (sectionsPagerAdapter != null) {
|
||||||
|
return sectionsPagerAdapter.handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onKeyDown(keyCode, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -173,7 +173,10 @@ public class SearchResultActivity extends BaseActivity implements SortTypeSelect
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
return sectionsPagerAdapter.handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
if (sectionsPagerAdapter != null) {
|
||||||
|
return sectionsPagerAdapter.handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
||||||
|
}
|
||||||
|
return super.onKeyDown(keyCode, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1564,10 +1564,14 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void lockSwipeRightToGoBack() {
|
public void lockSwipeRightToGoBack() {
|
||||||
mSlidrInterface.lock();
|
if (mSlidrInterface != null) {
|
||||||
|
mSlidrInterface.lock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void unlockSwipeRightToGoBack() {
|
public void unlockSwipeRightToGoBack() {
|
||||||
mSlidrInterface.unlock();
|
if (mSlidrInterface != null) {
|
||||||
|
mSlidrInterface.unlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -336,7 +336,11 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
return ((FragmentCommunicator)(mFragment)).handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
if (mFragment != null) {
|
||||||
|
return ((FragmentCommunicator)(mFragment)).handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onKeyDown(keyCode, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -645,7 +649,9 @@ 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();
|
||||||
}
|
}
|
||||||
|
|
||||||
((PostFragment) mFragment).changeSortType(sortType);
|
if (mFragment != null) {
|
||||||
|
((PostFragment) mFragment).changeSortType(sortType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -399,7 +399,11 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
return sectionsPagerAdapter.handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
if (sectionsPagerAdapter != null) {
|
||||||
|
return sectionsPagerAdapter.handleKeyDown(keyCode) || super.onKeyDown(keyCode, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onKeyDown(keyCode, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user