tdf#103524 - Fix Bottom Toolbars closing operation
Added variables to control state of bottom toolbars, and based on their state open/close the bars Change-Id: I5f9429b336451a354b95dcee18b71fb577c28559 Reviewed-on: https://gerrit.libreoffice.org/30298 Reviewed-by: jan iversen <jani@documentfoundation.org> Tested-by: jan iversen <jani@documentfoundation.org>
This commit is contained in:
parent
dd89c68edf
commit
252008d492
@ -97,6 +97,8 @@ public class LibreOfficeMainActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isKeyboardOpen = false;
|
private boolean isKeyboardOpen = false;
|
||||||
|
private boolean isFormattingToolbarOpen = false;
|
||||||
|
private boolean isSearchToolbarOpen = false;
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
Log.w(LOGTAG, "onCreate..");
|
Log.w(LOGTAG, "onCreate..");
|
||||||
@ -391,6 +393,8 @@ public class LibreOfficeMainActivity extends AppCompatActivity {
|
|||||||
inputMethodManager.showSoftInput(layerView, InputMethodManager.SHOW_FORCED);
|
inputMethodManager.showSoftInput(layerView, InputMethodManager.SHOW_FORCED);
|
||||||
}
|
}
|
||||||
isKeyboardOpen=true;
|
isKeyboardOpen=true;
|
||||||
|
isSearchToolbarOpen=false;
|
||||||
|
isFormattingToolbarOpen=false;
|
||||||
hideBottomToolbar();
|
hideBottomToolbar();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -445,6 +449,8 @@ public class LibreOfficeMainActivity extends AppCompatActivity {
|
|||||||
findViewById(R.id.toolbar_bottom).setVisibility(View.GONE);
|
findViewById(R.id.toolbar_bottom).setVisibility(View.GONE);
|
||||||
findViewById(R.id.formatting_toolbar).setVisibility(View.GONE);
|
findViewById(R.id.formatting_toolbar).setVisibility(View.GONE);
|
||||||
findViewById(R.id.search_toolbar).setVisibility(View.GONE);
|
findViewById(R.id.search_toolbar).setVisibility(View.GONE);
|
||||||
|
isFormattingToolbarOpen=false;
|
||||||
|
isSearchToolbarOpen=false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -453,10 +459,17 @@ public class LibreOfficeMainActivity extends AppCompatActivity {
|
|||||||
LOKitShell.getMainHandler().post(new Runnable() {
|
LOKitShell.getMainHandler().post(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
if(isFormattingToolbarOpen == true){
|
||||||
|
hideBottomToolbar();
|
||||||
|
}else{
|
||||||
showBottomToolbar();
|
showBottomToolbar();
|
||||||
findViewById(R.id.formatting_toolbar).setVisibility(View.VISIBLE);
|
findViewById(R.id.formatting_toolbar).setVisibility(View.VISIBLE);
|
||||||
findViewById(R.id.search_toolbar).setVisibility(View.GONE);
|
findViewById(R.id.search_toolbar).setVisibility(View.GONE);
|
||||||
hideSoftKeyboardDirect();
|
hideSoftKeyboardDirect();
|
||||||
|
isSearchToolbarOpen=false;
|
||||||
|
isFormattingToolbarOpen=true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -475,10 +488,16 @@ public class LibreOfficeMainActivity extends AppCompatActivity {
|
|||||||
LOKitShell.getMainHandler().post(new Runnable() {
|
LOKitShell.getMainHandler().post(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
if(isSearchToolbarOpen==true){
|
||||||
|
hideBottomToolbar();
|
||||||
|
}else{
|
||||||
showBottomToolbar();
|
showBottomToolbar();
|
||||||
findViewById(R.id.formatting_toolbar).setVisibility(View.GONE);
|
findViewById(R.id.formatting_toolbar).setVisibility(View.GONE);
|
||||||
findViewById(R.id.search_toolbar).setVisibility(View.VISIBLE);
|
findViewById(R.id.search_toolbar).setVisibility(View.VISIBLE);
|
||||||
hideSoftKeyboardDirect();
|
hideSoftKeyboardDirect();
|
||||||
|
isFormattingToolbarOpen=false;
|
||||||
|
isSearchToolbarOpen=true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user