Commit 01e0b7ae authored by DrKLO's avatar DrKLO

More bug fixes, new locales

parent 1cda12c7
......@@ -81,7 +81,7 @@ android {
defaultConfig {
minSdkVersion 8
targetSdkVersion 19
versionCode 248
versionCode 250
versionName "1.5.0"
}
}
......@@ -160,6 +160,22 @@ public class LocaleController {
sortedLanguages.add(localeInfo);
languagesDict.put(localeInfo.shortName, localeInfo);
localeInfo = new LocaleInfo();
localeInfo.name = "Português (Brasil)";
localeInfo.nameEnglish = "Portuguese (Brazil)";
localeInfo.shortName = "pt_BR";
localeInfo.pathToFile = null;
sortedLanguages.add(localeInfo);
languagesDict.put(localeInfo.shortName, localeInfo);
localeInfo = new LocaleInfo();
localeInfo.name = "Português (Portugal)";
localeInfo.nameEnglish = "Portuguese (Portugal)";
localeInfo.shortName = "pt_PT";
localeInfo.pathToFile = null;
sortedLanguages.add(localeInfo);
languagesDict.put(localeInfo.shortName, localeInfo);
loadOtherLanguages();
for (LocaleInfo locale : otherLanguages) {
......@@ -382,7 +398,12 @@ public class LocaleController {
try {
Locale newLocale = null;
if (localeInfo.shortName != null) {
String[] args = localeInfo.shortName.split("_");
if (args.length == 1) {
newLocale = new Locale(localeInfo.shortName);
} else {
newLocale = new Locale(args[0], args[1]);
}
if (newLocale != null) {
if (override) {
languageOverride = localeInfo.shortName;
......
......@@ -949,6 +949,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
currentTotalPcmDuration = getTotalPcmDuration();
audioTrackPlayer = new AudioTrack(AudioManager.STREAM_MUSIC, 48000, AudioFormat.CHANNEL_OUT_MONO, AudioFormat.ENCODING_PCM_16BIT, playerBufferSize, AudioTrack.MODE_STREAM);
audioTrackPlayer.setStereoVolume(1.0f, 1.0f);
//audioTrackPlayer.setNotificationMarkerPosition((int)currentTotalPcmDuration);
audioTrackPlayer.setPlaybackPositionUpdateListener(new AudioTrack.OnPlaybackPositionUpdateListener() {
@Override
......@@ -1606,7 +1607,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
long dateTaken = cursor.getLong(dateColumn);
int orientation = cursor.getInt(orientationColumn);
if (path == null || path.isEmpty()) {
if (path == null || path.length() == 0) {
continue;
}
......
......@@ -102,6 +102,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
private int animationInProgress = 0;
private boolean disableShowCheck = false;
private Animation.AnimationListener animationListener;
private ImageReceiver leftImage = new ImageReceiver();
private ImageReceiver centerImage = new ImageReceiver();
......@@ -245,6 +246,14 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
setWillNotDraw(false);
}
@Override
protected void onAnimationEnd() {
super.onAnimationEnd();
if (getInstance().animationListener != null) {
getInstance().animationListener.onAnimationEnd(null);
}
}
@Override
protected void onDraw(Canvas canvas) {
getInstance().onDraw(canvas);
......@@ -725,6 +734,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
if (overlayViewVisible == show) {
return;
}
if (currentOverlay.getVisibility() == View.VISIBLE) {
overlayViewVisible = show;
if (android.os.Build.VERSION.SDK_INT >= 11) {
AnimatorSet animatorSet = new AnimatorSet();
......@@ -740,6 +750,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
currentOverlay.startAnimation(animation);
}
}
}
private void toggleActionBar(boolean show, boolean animated) {
if (show) {
......@@ -1122,7 +1133,6 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
}
actionBarLayer.setTitle(LocaleController.formatString("Of", R.string.Of, (totalImagesCount - imagesArr.size()) + currentIndex + 1, totalImagesCount));
}
updateActionOverlays();
} else if (!imagesArrLocations.isEmpty()) {
currentFileLocation = imagesArrLocations.get(index);
actionBarLayer.setTitle(LocaleController.formatString("Of", R.string.Of, currentIndex + 1, imagesArrLocations.size()));
......@@ -1563,7 +1573,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
animationSet.addAnimation(scaleAnimation);
animationSet.setDuration(150);
animationInProgress = 2;
animationSet.setAnimationListener(new Animation.AnimationListener() {
animationSet.setAnimationListener(animationListener = new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
......@@ -1571,8 +1581,11 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
@Override
public void onAnimationEnd(Animation animation) {
if (animationListener != null) {
animationInProgress = 0;
onPhotoClosed(object);
animationListener = null;
}
}
@Override
......
......@@ -17,6 +17,7 @@ import android.content.Intent;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.view.ActionMode;
import android.view.Gravity;
import android.view.KeyEvent;
......@@ -442,7 +443,7 @@ public class ActionBarActivity extends Activity {
return actionBar;
}
private void presentFragmentInternalRemoveOld(boolean removeLast, BaseFragment fragment) {
private void presentFragmentInternalRemoveOld(boolean removeLast, final BaseFragment fragment) {
if (fragment == null) {
return;
}
......@@ -513,7 +514,12 @@ public class ActionBarActivity extends Activity {
transitionAnimationInProgress = false;
transitionAnimationStartTime = 0;
fragment.onOpenAnimationEnd();
new Handler().post(new Runnable() {
@Override
public void run() {
presentFragmentInternalRemoveOld(removeLast, currentFragment);
}
});
listener = null;
}
}
......@@ -577,6 +583,7 @@ public class ActionBarActivity extends Activity {
transitionAnimationStartTime = System.currentTimeMillis();
transitionAnimationInProgress = true;
closeAnimation.reset();
closeAnimation.setFillAfter(true);
closeAnimation.setAnimationListener(listener = new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
......@@ -588,7 +595,11 @@ public class ActionBarActivity extends Activity {
if (transitionAnimationInProgress) {
transitionAnimationInProgress = false;
transitionAnimationStartTime = 0;
new Handler().post(new Runnable() {
public void run() {
closeLastFragmentInternalRemoveOld(currentFragment);
}
});
listener = null;
}
}
......
......@@ -127,6 +127,7 @@ public class ActionBarMenuItem extends ImageView {
popupWindow.setClippingEnabled(true);
popupWindow.setInputMethodMode(ActionBarPopupWindow.INPUT_METHOD_NOT_NEEDED);
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));
}
if (popupLayout.getMeasuredWidth() == 0) {
popupWindow.showAsDropDown(this, parentActionBar.getMeasuredWidth() - popupLayout.getMeasuredWidth() - getLeft() - parentMenu.getLeft(), 0);
......
......@@ -294,7 +294,6 @@
<string name="Gallery">الألبوم</string>
<string name="AllPhotos">All Photos</string>
<string name="NoPhotos">No photos yet</string>
<string name="SendingPhotos">Sending photos... %1$d of %2$d</string>
<!--button titles-->
<string name="Next">التالي</string>
......
......@@ -294,7 +294,6 @@
<string name="Gallery">Galerie</string>
<string name="AllPhotos">All Photos</string>
<string name="NoPhotos">No photos yet</string>
<string name="SendingPhotos">Sending photos... %1$d of %2$d</string>
<!--button titles-->
<string name="Next">Weiter</string>
......
......@@ -294,7 +294,6 @@
<string name="Gallery">Galería</string>
<string name="AllPhotos">All Photos</string>
<string name="NoPhotos">No photos yet</string>
<string name="SendingPhotos">Sending photos... %1$d of %2$d</string>
<!--button titles-->
<string name="Next">Siguiente</string>
......
......@@ -294,7 +294,6 @@
<string name="Gallery">Galleria</string>
<string name="AllPhotos">All Photos</string>
<string name="NoPhotos">No photos yet</string>
<string name="SendingPhotos">Sending photos... %1$d of %2$d</string>
<!--button titles-->
<string name="Next">Avanti</string>
......
......@@ -294,7 +294,6 @@
<string name="Gallery">Galerij</string>
<string name="AllPhotos">All Photos</string>
<string name="NoPhotos">No photos yet</string>
<string name="SendingPhotos">Sending photos... %1$d of %2$d</string>
<!--button titles-->
<string name="Next">Volgende</string>
......
This diff is collapsed.
This diff is collapsed.
......@@ -294,7 +294,6 @@
<string name="Gallery">Gallery</string>
<string name="AllPhotos">All Photos</string>
<string name="NoPhotos">No photos yet</string>
<string name="SendingPhotos">Sending photos... %1$d of %2$d</string>
<!--button titles-->
<string name="Next">Next</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