Commit 19ba20cd authored by DrKLO's avatar DrKLO

Fixed screen orientation lock on tablets, more bug fixes

https://github.com/DrKLO/Telegram/pull/453
parent fc14e8b4
...@@ -81,7 +81,7 @@ android { ...@@ -81,7 +81,7 @@ android {
defaultConfig { defaultConfig {
minSdkVersion 8 minSdkVersion 8
targetSdkVersion 19 targetSdkVersion 19
versionCode 252 versionCode 253
versionName "1.5.1" versionName "1.5.2"
} }
} }
...@@ -4529,7 +4529,6 @@ public class MessagesController implements NotificationCenter.NotificationCenter ...@@ -4529,7 +4529,6 @@ public class MessagesController implements NotificationCenter.NotificationCenter
notification.ledOnMS = 1000; notification.ledOnMS = 1000;
notification.ledOffMS = 1000; notification.ledOffMS = 1000;
if (needVibrate) { if (needVibrate) {
notification.defaults = Notification.DEFAULT_VIBRATE;
notification.vibrate = new long[]{0, 100, 0, 100}; notification.vibrate = new long[]{0, 100, 0, 100};
} else { } else {
notification.vibrate = new long[]{0, 0}; notification.vibrate = new long[]{0, 0};
......
...@@ -15,6 +15,7 @@ import android.content.Context; ...@@ -15,6 +15,7 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.pm.ActivityInfo; import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.database.Cursor; import android.database.Cursor;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.Point; import android.graphics.Point;
...@@ -166,19 +167,47 @@ public class Utilities { ...@@ -166,19 +167,47 @@ public class Utilities {
WindowManager manager = (WindowManager)activity.getSystemService(Activity.WINDOW_SERVICE); WindowManager manager = (WindowManager)activity.getSystemService(Activity.WINDOW_SERVICE);
if (manager != null && manager.getDefaultDisplay() != null) { if (manager != null && manager.getDefaultDisplay() != null) {
int rotation = manager.getDefaultDisplay().getRotation(); int rotation = manager.getDefaultDisplay().getRotation();
int orientation = activity.getResources().getConfiguration().orientation;
if (rotation == Surface.ROTATION_270) { if (rotation == Surface.ROTATION_270) {
if (Build.VERSION.SDK_INT >= 9) { if (orientation == Configuration.ORIENTATION_PORTRAIT) {
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE); activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
} else { } else {
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); if (Build.VERSION.SDK_INT >= 9) {
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE);
} else {
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
}
} }
} else if (rotation == Surface.ROTATION_90) { } else if (rotation == Surface.ROTATION_90) {
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); if (orientation == Configuration.ORIENTATION_PORTRAIT) {
if (Build.VERSION.SDK_INT >= 9) {
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT);
} else {
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
} else {
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
}
} else if (rotation == Surface.ROTATION_0) { } else if (rotation == Surface.ROTATION_0) {
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
} else {
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
} else { } else {
if (Build.VERSION.SDK_INT >= 9) { if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT); if (Build.VERSION.SDK_INT >= 9) {
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE);
} else {
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
}
} else {
if (Build.VERSION.SDK_INT >= 9) {
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT);
} else {
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
} }
} }
} }
......
...@@ -2859,7 +2859,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ...@@ -2859,7 +2859,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
} }
public void createMenu(View v, boolean single) { public void createMenu(View v, boolean single) {
if (actionBarLayer.isActionModeShowed()) { if (getParentActivity() == null || actionBarLayer.isActionModeShowed()) {
return; return;
} }
......
...@@ -101,6 +101,8 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat ...@@ -101,6 +101,8 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
private boolean overlayViewVisible = true; private boolean overlayViewVisible = true;
private int animationInProgress = 0; private int animationInProgress = 0;
private PlaceProviderObject showAfterAnimation;
private PlaceProviderObject hideAfterAnimation;
private boolean disableShowCheck = false; private boolean disableShowCheck = false;
private Animation.AnimationListener animationListener; private Animation.AnimationListener animationListener;
...@@ -327,6 +329,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat ...@@ -327,6 +329,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
if (setToImage != -1) { if (setToImage != -1) {
setImageIndex(setToImage, true); setImageIndex(setToImage, true);
} else { } else {
imagesArrLocations.add(0, currentFileLocation);
setImageIndex(0, true); setImageIndex(0, true);
} }
if (fromCache) { if (fromCache) {
...@@ -1147,15 +1150,20 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat ...@@ -1147,15 +1150,20 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
} }
} }
if (!init) {
if (android.os.Build.VERSION.SDK_INT >= 11 && currentPlaceObject != null) { if (android.os.Build.VERSION.SDK_INT >= 11 && currentPlaceObject != null) {
if (animationInProgress == 0) {
currentPlaceObject.imageReceiver.setVisible(true, true); currentPlaceObject.imageReceiver.setVisible(true, true);
} else {
showAfterAnimation = currentPlaceObject;
} }
} }
currentPlaceObject = placeProvider.getPlaceForPhoto(currentMessageObject, currentFileLocation, currentIndex); currentPlaceObject = placeProvider.getPlaceForPhoto(currentMessageObject, currentFileLocation, currentIndex);
if (!init) { if (android.os.Build.VERSION.SDK_INT >= 11 && currentPlaceObject != null) {
if (android.os.Build.VERSION.SDK_INT >= 11 && currentPlaceObject != null) { if (animationInProgress == 0) {
currentPlaceObject.imageReceiver.setVisible(false, true); currentPlaceObject.imageReceiver.setVisible(false, true);
} else {
hideAfterAnimation = currentPlaceObject;
} }
} }
...@@ -1343,6 +1351,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat ...@@ -1343,6 +1351,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
} }
disableShowCheck = true; disableShowCheck = true;
animationInProgress = 1;
onPhotoShow(messageObject, fileLocation, messages, photos, index, object); onPhotoShow(messageObject, fileLocation, messages, photos, index, object);
isVisible = true; isVisible = true;
backgroundDrawable.setAlpha(255); backgroundDrawable.setAlpha(255);
...@@ -1352,8 +1361,6 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat ...@@ -1352,8 +1361,6 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
if(android.os.Build.VERSION.SDK_INT >= 11) { if(android.os.Build.VERSION.SDK_INT >= 11) {
Utilities.lockOrientation(parentActivity); Utilities.lockOrientation(parentActivity);
animationInProgress = 1;
animatingImageView.setVisibility(View.VISIBLE); animatingImageView.setVisibility(View.VISIBLE);
animatingImageView.setImageBitmap(object.thumb); animatingImageView.setImageBitmap(object.thumb);
...@@ -1419,6 +1426,12 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat ...@@ -1419,6 +1426,12 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
containerView.invalidate(); containerView.invalidate();
animatingImageView.setVisibility(View.GONE); animatingImageView.setVisibility(View.GONE);
Utilities.unlockOrientation(parentActivity); Utilities.unlockOrientation(parentActivity);
if (showAfterAnimation != null) {
showAfterAnimation.imageReceiver.setVisible(true, true);
}
if (hideAfterAnimation != null) {
hideAfterAnimation.imageReceiver.setVisible(false, true);
}
} }
}); });
animatorSet.start(); animatorSet.start();
...@@ -1437,6 +1450,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat ...@@ -1437,6 +1450,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
} }
}); });
} else { } else {
animationInProgress = 0;
containerView.invalidate(); containerView.invalidate();
AnimationSet animationSet = new AnimationSet(true); AnimationSet animationSet = new AnimationSet(true);
AlphaAnimation animation = new AlphaAnimation(0.0f, 1.0f); AlphaAnimation animation = new AlphaAnimation(0.0f, 1.0f);
......
...@@ -40,9 +40,21 @@ import java.util.ArrayList; ...@@ -40,9 +40,21 @@ import java.util.ArrayList;
public class ActionBarActivity extends Activity { public class ActionBarActivity extends Activity {
private class FrameLayoutAnimationListener extends FrameLayout {
public FrameLayoutAnimationListener(Context context) {
super(context);
}
@Override
protected void onAnimationEnd() {
super.onAnimationEnd();
ActionBarActivity.this.onAnimationEnd();
}
}
protected ActionBar actionBar; protected ActionBar actionBar;
private FrameLayout containerView; private FrameLayoutAnimationListener containerView;
private FrameLayout containerViewBack; private FrameLayoutAnimationListener containerViewBack;
protected FrameLayout contentView; protected FrameLayout contentView;
private View shadowView; private View shadowView;
...@@ -116,10 +128,10 @@ public class ActionBarActivity extends Activity { ...@@ -116,10 +128,10 @@ public class ActionBarActivity extends Activity {
contentView = new FrameLayoutTouch(this); contentView = new FrameLayoutTouch(this);
setContentView(contentView, new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT)); setContentView(contentView, new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT));
containerViewBack = new FrameLayout(this); containerViewBack = new FrameLayoutAnimationListener(this);
contentView.addView(containerViewBack); contentView.addView(containerViewBack);
containerView = new FrameLayout(this); containerView = new FrameLayoutAnimationListener(this);
contentView.addView(containerView); contentView.addView(containerView);
shadowView = new FrameLayout(this); shadowView = new FrameLayout(this);
...@@ -172,7 +184,6 @@ public class ActionBarActivity extends Activity { ...@@ -172,7 +184,6 @@ public class ActionBarActivity extends Activity {
lastFragment.onResume(); lastFragment.onResume();
actionBar.setCurrentActionBarLayer(lastFragment.actionBarLayer); actionBar.setCurrentActionBarLayer(lastFragment.actionBarLayer);
onShowFragment();
} }
} }
...@@ -198,7 +209,7 @@ public class ActionBarActivity extends Activity { ...@@ -198,7 +209,7 @@ public class ActionBarActivity extends Activity {
lastFragment.setParentActivity(null); lastFragment.setParentActivity(null);
fragmentsStack.remove(fragmentsStack.size() - 1); fragmentsStack.remove(fragmentsStack.size() - 1);
FrameLayout temp = containerView; FrameLayoutAnimationListener temp = containerView;
containerView = containerViewBack; containerView = containerViewBack;
containerViewBack = temp; containerViewBack = temp;
ViewGroup parent = (ViewGroup)containerView.getParent(); ViewGroup parent = (ViewGroup)containerView.getParent();
...@@ -391,6 +402,7 @@ public class ActionBarActivity extends Activity { ...@@ -391,6 +402,7 @@ public class ActionBarActivity extends Activity {
public boolean checkTransitionAnimation() { public boolean checkTransitionAnimation() {
if (transitionAnimationInProgress && transitionAnimationStartTime < System.currentTimeMillis() - 400) { if (transitionAnimationInProgress && transitionAnimationStartTime < System.currentTimeMillis() - 400) {
transitionAnimationInProgress = false; transitionAnimationInProgress = false;
onAnimationEnd();
} }
return transitionAnimationInProgress; return transitionAnimationInProgress;
} }
...@@ -465,6 +477,7 @@ public class ActionBarActivity extends Activity { ...@@ -465,6 +477,7 @@ public class ActionBarActivity extends Activity {
} }
} }
} }
containerViewBack.setVisibility(View.GONE);
} }
public boolean presentFragment(BaseFragment fragment) { public boolean presentFragment(BaseFragment fragment) {
...@@ -485,13 +498,10 @@ public class ActionBarActivity extends Activity { ...@@ -485,13 +498,10 @@ public class ActionBarActivity extends Activity {
boolean needAnimation = openAnimation != null && !forceWithoutAnimation && getSharedPreferences("mainconfig", Activity.MODE_PRIVATE).getBoolean("view_animations", true); boolean needAnimation = openAnimation != null && !forceWithoutAnimation && getSharedPreferences("mainconfig", Activity.MODE_PRIVATE).getBoolean("view_animations", true);
final BaseFragment currentFragment = !fragmentsStack.isEmpty() ? fragmentsStack.get(fragmentsStack.size() - 1) : null; final BaseFragment currentFragment = !fragmentsStack.isEmpty() ? fragmentsStack.get(fragmentsStack.size() - 1) : null;
if (!needAnimation) {
presentFragmentInternalRemoveOld(removeLast, currentFragment);
}
fragment.setParentActivity(this); fragment.setParentActivity(this);
View fragmentView = fragment.createView(getLayoutInflater(), null); View fragmentView = fragment.createView(getLayoutInflater(), null);
containerView.addView(fragmentView); containerViewBack.addView(fragmentView);
ViewGroup.LayoutParams layoutParams = fragmentView.getLayoutParams(); ViewGroup.LayoutParams layoutParams = fragmentView.getLayoutParams();
layoutParams.width = FrameLayout.LayoutParams.MATCH_PARENT; layoutParams.width = FrameLayout.LayoutParams.MATCH_PARENT;
layoutParams.height = FrameLayout.LayoutParams.MATCH_PARENT; layoutParams.height = FrameLayout.LayoutParams.MATCH_PARENT;
...@@ -502,7 +512,19 @@ public class ActionBarActivity extends Activity { ...@@ -502,7 +512,19 @@ public class ActionBarActivity extends Activity {
if (fragmentView.getBackground() == null) { if (fragmentView.getBackground() == null) {
fragmentView.setBackgroundColor(0xffffffff); fragmentView.setBackgroundColor(0xffffffff);
} }
onShowFragment();
FrameLayoutAnimationListener temp = containerView;
containerView = containerViewBack;
containerViewBack = temp;
containerView.setVisibility(View.VISIBLE);
ViewGroup parent = (ViewGroup)containerView.getParent();
parent.removeView(containerView);
parent.addView(containerView, 1);
if (!needAnimation) {
presentFragmentInternalRemoveOld(removeLast, currentFragment);
}
if (needAnimation) { if (needAnimation) {
transitionAnimationStartTime = System.currentTimeMillis(); transitionAnimationStartTime = System.currentTimeMillis();
transitionAnimationInProgress = true; transitionAnimationInProgress = true;
...@@ -514,23 +536,7 @@ public class ActionBarActivity extends Activity { ...@@ -514,23 +536,7 @@ public class ActionBarActivity extends Activity {
} }
}; };
openAnimation.reset(); openAnimation.reset();
openAnimation.setAnimationListener(new Animation.AnimationListener() { containerView.startAnimation(openAnimation);
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
onOpenAnimationEnd(true);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
fragmentView.startAnimation(openAnimation);
} else { } else {
fragment.onOpenAnimationEnd(); fragment.onOpenAnimationEnd();
} }
...@@ -551,6 +557,10 @@ public class ActionBarActivity extends Activity { ...@@ -551,6 +557,10 @@ public class ActionBarActivity extends Activity {
fragment.onFragmentDestroy(); fragment.onFragmentDestroy();
fragment.setParentActivity(null); fragment.setParentActivity(null);
fragmentsStack.remove(fragment); fragmentsStack.remove(fragment);
containerViewBack.setVisibility(View.GONE);
ViewGroup parent = (ViewGroup)containerView.getParent();
parent.removeView(containerViewBack);
parent.addView(containerViewBack, 0);
} }
public void closeLastFragment(boolean animated) { public void closeLastFragment(boolean animated) {
...@@ -563,13 +573,15 @@ public class ActionBarActivity extends Activity { ...@@ -563,13 +573,15 @@ public class ActionBarActivity extends Activity {
boolean needAnimation = animated && closeAnimation != null && getSharedPreferences("mainconfig", Activity.MODE_PRIVATE).getBoolean("view_animations", true); boolean needAnimation = animated && closeAnimation != null && getSharedPreferences("mainconfig", Activity.MODE_PRIVATE).getBoolean("view_animations", true);
final BaseFragment currentFragment = fragmentsStack.get(fragmentsStack.size() - 1); final BaseFragment currentFragment = fragmentsStack.get(fragmentsStack.size() - 1);
BaseFragment previousFragment = fragmentsStack.get(fragmentsStack.size() - 2); BaseFragment previousFragment = fragmentsStack.get(fragmentsStack.size() - 2);
if (!needAnimation) {
closeLastFragmentInternalRemoveOld(currentFragment); FrameLayoutAnimationListener temp = containerView;
} containerView = containerViewBack;
containerViewBack = temp;
containerView.setVisibility(View.VISIBLE);
previousFragment.setParentActivity(this); previousFragment.setParentActivity(this);
View fragmentView = previousFragment.createView(getLayoutInflater(), null); View fragmentView = previousFragment.createView(getLayoutInflater(), null);
containerView.addView(fragmentView, 0); containerView.addView(fragmentView);
ViewGroup.LayoutParams layoutParams = fragmentView.getLayoutParams(); ViewGroup.LayoutParams layoutParams = fragmentView.getLayoutParams();
layoutParams.width = FrameLayout.LayoutParams.MATCH_PARENT; layoutParams.width = FrameLayout.LayoutParams.MATCH_PARENT;
layoutParams.height = FrameLayout.LayoutParams.MATCH_PARENT; layoutParams.height = FrameLayout.LayoutParams.MATCH_PARENT;
...@@ -579,35 +591,22 @@ public class ActionBarActivity extends Activity { ...@@ -579,35 +591,22 @@ public class ActionBarActivity extends Activity {
if (fragmentView.getBackground() == null) { if (fragmentView.getBackground() == null) {
fragmentView.setBackgroundColor(0xffffffff); fragmentView.setBackgroundColor(0xffffffff);
} }
onShowFragment();
if (!needAnimation) {
closeLastFragmentInternalRemoveOld(currentFragment);
}
if (needAnimation) { if (needAnimation) {
transitionAnimationStartTime = System.currentTimeMillis(); transitionAnimationStartTime = System.currentTimeMillis();
transitionAnimationInProgress = true; transitionAnimationInProgress = true;
closeAnimation.reset(); closeAnimation.reset();
closeAnimation.setFillAfter(true);
onCloseAnimationEndRunnable = new Runnable() { onCloseAnimationEndRunnable = new Runnable() {
@Override @Override
public void run() { public void run() {
closeLastFragmentInternalRemoveOld(currentFragment); closeLastFragmentInternalRemoveOld(currentFragment);
} }
}; };
closeAnimation.setAnimationListener(new Animation.AnimationListener() { containerViewBack.startAnimation(closeAnimation);
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
onCloseAnimationEnd(true);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
currentFragment.fragmentView.startAnimation(closeAnimation);
} }
} }
...@@ -625,7 +624,6 @@ public class ActionBarActivity extends Activity { ...@@ -625,7 +624,6 @@ public class ActionBarActivity extends Activity {
if (fragmentView.getBackground() == null) { if (fragmentView.getBackground() == null) {
fragmentView.setBackgroundColor(0xffffffff); fragmentView.setBackgroundColor(0xffffffff);
} }
onShowFragment();
} }
public void removeFragmentFromStack(BaseFragment fragment) { public void removeFragmentFromStack(BaseFragment fragment) {
...@@ -645,10 +643,6 @@ public class ActionBarActivity extends Activity { ...@@ -645,10 +643,6 @@ public class ActionBarActivity extends Activity {
} }
protected void onShowFragment() {
}
public void showActionBar() { public void showActionBar() {
actionBar.setVisibility(View.VISIBLE); actionBar.setVisibility(View.VISIBLE);
needLayout(); needLayout();
...@@ -725,6 +719,11 @@ public class ActionBarActivity extends Activity { ...@@ -725,6 +719,11 @@ public class ActionBarActivity extends Activity {
} }
} }
private void onAnimationEnd() {
onCloseAnimationEnd(false);
onOpenAnimationEnd(false);
}
@Override @Override
public void startActivityForResult(final Intent intent, final int requestCode) { public void startActivityForResult(final Intent intent, final int requestCode) {
if (transitionAnimationInProgress) { if (transitionAnimationInProgress) {
......
...@@ -128,13 +128,12 @@ public class ActionBarMenuItem extends ImageView { ...@@ -128,13 +128,12 @@ public class ActionBarMenuItem extends ImageView {
popupWindow.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_UNSPECIFIED); popupWindow.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_UNSPECIFIED);
popupLayout.measure(MeasureSpec.makeMeasureSpec(Utilities.dp(1000), MeasureSpec.AT_MOST), MeasureSpec.makeMeasureSpec(Utilities.dp(1000), MeasureSpec.AT_MOST)); popupLayout.measure(MeasureSpec.makeMeasureSpec(Utilities.dp(1000), MeasureSpec.AT_MOST), MeasureSpec.makeMeasureSpec(Utilities.dp(1000), MeasureSpec.AT_MOST));
} }
popupWindow.setFocusable(true);
if (popupLayout.getMeasuredWidth() == 0) { if (popupLayout.getMeasuredWidth() == 0) {
popupWindow.showAsDropDown(this, parentActionBar.getMeasuredWidth() - popupLayout.getMeasuredWidth() - getLeft() - parentMenu.getLeft(), 0); popupWindow.showAsDropDown(this, parentActionBar.getMeasuredWidth() - popupLayout.getMeasuredWidth() - getLeft() - parentMenu.getLeft(), 0);
popupWindow.update(this, parentActionBar.getMeasuredWidth() - popupLayout.getMeasuredWidth() - getLeft() - parentMenu.getLeft(), 0, -1, -1); popupWindow.update(this, parentActionBar.getMeasuredWidth() - popupLayout.getMeasuredWidth() - getLeft() - parentMenu.getLeft(), 0, -1, -1);
popupWindow.setFocusable(true);
} else { } else {
popupWindow.showAsDropDown(this, parentActionBar.getMeasuredWidth() - popupLayout.getMeasuredWidth() - getLeft() - parentMenu.getLeft(), 0); popupWindow.showAsDropDown(this, parentActionBar.getMeasuredWidth() - popupLayout.getMeasuredWidth() - getLeft() - parentMenu.getLeft(), 0);
popupWindow.setFocusable(true);
} }
} }
......
...@@ -100,8 +100,8 @@ ...@@ -100,8 +100,8 @@
<string name="EncryptedPlaceholderTitleIncoming">%s convidou você para uma conversa secreta.</string> <string name="EncryptedPlaceholderTitleIncoming">%s convidou você para uma conversa secreta.</string>
<string name="EncryptedPlaceholderTitleOutgoing">Você convidou %s para uma conversa secreta.</string> <string name="EncryptedPlaceholderTitleOutgoing">Você convidou %s para uma conversa secreta.</string>
<string name="EncryptedDescriptionTitle">Conversas secretas:</string> <string name="EncryptedDescriptionTitle">Conversas secretas:</string>
<string name="EncryptedDescription1">Utilizam criptografia ponta a ponta</string> <string name="EncryptedDescription1">Utilizam criptografia ponto a ponto</string>
<string name="EncryptedDescription2">Não deixam rasto em nossos servidores</string> <string name="EncryptedDescription2">Não deixam rastro em nossos servidores</string>
<string name="EncryptedDescription3">Têm temporizador para a autodestruição das mensagens</string> <string name="EncryptedDescription3">Têm temporizador para a autodestruição das mensagens</string>
<string name="EncryptedDescription4">Não permitem o reencaminhamento</string> <string name="EncryptedDescription4">Não permitem o reencaminhamento</string>
<string name="OneNewMessage">%1$d nova mensagem</string> <string name="OneNewMessage">%1$d nova mensagem</string>
......
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