mirror of
https://github.com/syncthing/syncthing-android.git
synced 2025-01-09 03:31:46 +00:00
Fix action bar not showing on sub-prefs screen (fixes #317)
on Android < 7
This commit is contained in:
parent
3a7705bde6
commit
ca17291561
1 changed files with 6 additions and 1 deletions
|
@ -412,7 +412,12 @@ public class SettingsActivity extends SyncthingActivity {
|
||||||
// User has clicked on a sub-preferences screen.
|
// User has clicked on a sub-preferences screen.
|
||||||
try {
|
try {
|
||||||
mCurrentPrefScreenDialog = ((PreferenceScreen) preference).getDialog();
|
mCurrentPrefScreenDialog = ((PreferenceScreen) preference).getDialog();
|
||||||
LinearLayout root = (LinearLayout) mCurrentPrefScreenDialog.findViewById(android.R.id.list).getParent().getParent();
|
LinearLayout root;
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
|
root = (LinearLayout) mCurrentPrefScreenDialog.findViewById(android.R.id.list).getParent().getParent();
|
||||||
|
} else {
|
||||||
|
root = (LinearLayout) mCurrentPrefScreenDialog.findViewById(android.R.id.list).getParent();
|
||||||
|
}
|
||||||
SyncthingActivity syncthingActivity = (SyncthingActivity) getActivity();
|
SyncthingActivity syncthingActivity = (SyncthingActivity) getActivity();
|
||||||
LayoutInflater layoutInflater = syncthingActivity.getLayoutInflater();
|
LayoutInflater layoutInflater = syncthingActivity.getLayoutInflater();
|
||||||
Toolbar toolbar = (Toolbar) layoutInflater.inflate(R.layout.widget_toolbar, root, false);
|
Toolbar toolbar = (Toolbar) layoutInflater.inflate(R.layout.widget_toolbar, root, false);
|
||||||
|
|
Loading…
Reference in a new issue