|
|
@ -250,6 +250,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
|
|
|
|
|
|
|
|
private synchronized void initialize() { |
|
|
|
private synchronized void initialize() { |
|
|
|
mToolbar = (Toolbar) findViewById(R.id.toolbar); |
|
|
|
mToolbar = (Toolbar) findViewById(R.id.toolbar); |
|
|
|
|
|
|
|
initializeToolbarHeight(getResources().getConfiguration()); |
|
|
|
setSupportActionBar(mToolbar); |
|
|
|
setSupportActionBar(mToolbar); |
|
|
|
ActionBar actionBar = getSupportActionBar(); |
|
|
|
ActionBar actionBar = getSupportActionBar(); |
|
|
|
|
|
|
|
|
|
|
@ -1061,15 +1062,21 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
|
|
|
|
|
|
|
|
initializeTabHeight(); |
|
|
|
initializeTabHeight(); |
|
|
|
supportInvalidateOptionsMenu(); |
|
|
|
supportInvalidateOptionsMenu(); |
|
|
|
|
|
|
|
initializeToolbarHeight(newConfig); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initializeToolbarHeight(@NonNull final Configuration configuration){ |
|
|
|
|
|
|
|
// TODO externalize the dimensions
|
|
|
|
doOnLayout(mUiLayout, new Runnable() { |
|
|
|
doOnLayout(mUiLayout, new Runnable() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
public void run() { |
|
|
|
int toolbarSize; |
|
|
|
int toolbarSize; |
|
|
|
if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) { |
|
|
|
if (configuration.orientation == Configuration.ORIENTATION_PORTRAIT) { |
|
|
|
|
|
|
|
// In portrait toolbar should be 56 dp tall
|
|
|
|
toolbarSize = Utils.dpToPx(56); |
|
|
|
toolbarSize = Utils.dpToPx(56); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
toolbarSize = Utils.dpToPx(48); |
|
|
|
// In landscape toolbar should be 48 dp tall
|
|
|
|
|
|
|
|
toolbarSize = Utils.dpToPx(52); |
|
|
|
} |
|
|
|
} |
|
|
|
mToolbar.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, toolbarSize)); |
|
|
|
mToolbar.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, toolbarSize)); |
|
|
|
mToolbar.setMinimumHeight(toolbarSize); |
|
|
|
mToolbar.setMinimumHeight(toolbarSize); |
|
|
|