Commit e657c4f0 authored by DrKLO's avatar DrKLO

Previous commit fixes

parent 3fecce96
......@@ -147,7 +147,8 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
if (datacenters != null) {
MessagesController.getInstance().updateTimerProc();
if (datacenterWithId(currentDatacenterId).authKey != null) {
Datacenter datacenter = datacenterWithId(currentDatacenterId);
if (datacenter != null && datacenter.authKey != null) {
if (lastPingTime < System.currentTimeMillis() - 19000) {
lastPingTime = System.currentTimeMillis();
generatePing();
......
......@@ -1036,6 +1036,9 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
private String getTrimmedString(String src) {
String result = src.trim();
if (result.length() == 0) {
return result;
}
while (src.startsWith("\n")) {
src = src.substring(1);
}
......
......@@ -107,9 +107,10 @@ public class ActionBar extends FrameLayout {
private void updateBackOverlay(int widthMeasureSpec, int heightMeasureSpec) {
if (currentLayer != null) {
currentLayer.setBackLayoutVisible(currentBackOverlay == null ? VISIBLE : INVISIBLE);
currentLayer.setBackLayoutVisible(currentLayer.isSearchFieldVisible || currentBackOverlay == null ? VISIBLE : INVISIBLE);
}
if (currentBackOverlay != null) {
currentBackOverlay.setVisibility(currentLayer.isSearchFieldVisible ? GONE : VISIBLE);
ViewGroup.LayoutParams layoutParams = currentBackOverlay.getLayoutParams();
if (currentLayer != null) {
currentLayer.measure(widthMeasureSpec, heightMeasureSpec);
......
......@@ -40,6 +40,7 @@ public class ActionBarLayer extends FrameLayout {
private ActionBar parentActionBar;
private boolean oldUseLogo;
private boolean oldUseBack;
private boolean isBackLayoutHidden = false;
protected boolean isSearchFieldVisible;
public ActionBarMenuOnItemClick actionBarMenuOnItemClick;
......@@ -329,7 +330,8 @@ public class ActionBarLayer extends FrameLayout {
}
public void setBackLayoutVisible(int visibility) {
backButtonFrameLayout.setVisibility(visibility);
isBackLayoutHidden = visibility != VISIBLE;
backButtonFrameLayout.setVisibility(isSearchFieldVisible ? VISIBLE : visibility);
}
public int getBackLayoutWidth() {
......@@ -406,6 +408,11 @@ public class ActionBarLayer extends FrameLayout {
} else {
setDisplayHomeAsUpEnabled(oldUseBack);
}
if (visible) {
backButtonFrameLayout.setVisibility(VISIBLE);
} else {
backButtonFrameLayout.setVisibility(isBackLayoutHidden ? INVISIBLE : VISIBLE);
}
logoImageView.setImageResource(visible ? R.drawable.ic_ab_search : R.drawable.ic_ab_logo);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment