Previous commit fixes
This commit is contained in:
parent
3fecce9645
commit
e657c4f010
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user