diff options
-rw-r--r-- | res/anim/enter_from_left.xml | 12 | ||||
-rw-r--r-- | res/anim/enter_from_right.xml | 12 | ||||
-rw-r--r-- | res/anim/exit_to_left.xml | 12 | ||||
-rw-r--r-- | res/anim/exit_to_right.xml | 12 | ||||
-rw-r--r-- | res/values-hu/strings.xml | 32 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/activity/SubsonicActivity.java | 22 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java | 39 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/fragments/SubsonicFragment.java | 4 |
8 files changed, 107 insertions, 38 deletions
diff --git a/res/anim/enter_from_left.xml b/res/anim/enter_from_left.xml new file mode 100644 index 00000000..2d5c1737 --- /dev/null +++ b/res/anim/enter_from_left.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?>
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shareInterpolator="false">
+
+ <translate
+ android:fromXDelta="-100%" android:toXDelta="0%"
+ android:duration="@android:integer/config_shortAnimTime"
+ android:interpolator="@android:anim/accelerate_interpolator"/>
+
+ <alpha android:fromAlpha="0.0" android:toAlpha="1.0"
+ android:duration="@android:integer/config_shortAnimTime" />
+</set>
\ No newline at end of file diff --git a/res/anim/enter_from_right.xml b/res/anim/enter_from_right.xml new file mode 100644 index 00000000..60a0ac05 --- /dev/null +++ b/res/anim/enter_from_right.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?>
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shareInterpolator="false">
+
+ <translate
+ android:fromXDelta="100%" android:toXDelta="0%"
+ android:duration="@android:integer/config_shortAnimTime"
+ android:interpolator="@android:anim/accelerate_interpolator"/>
+
+ <alpha android:fromAlpha="0.0" android:toAlpha="1.0"
+ android:duration="@android:integer/config_shortAnimTime" />
+</set>
\ No newline at end of file diff --git a/res/anim/exit_to_left.xml b/res/anim/exit_to_left.xml new file mode 100644 index 00000000..65ad4290 --- /dev/null +++ b/res/anim/exit_to_left.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?>
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shareInterpolator="false">
+
+ <translate
+ android:fromXDelta="0%" android:toXDelta="-100%"
+ android:duration="@android:integer/config_shortAnimTime"
+ android:interpolator="@android:anim/accelerate_interpolator"/>
+
+ <alpha android:fromAlpha="1.0" android:toAlpha="0.0"
+ android:duration="@android:integer/config_shortAnimTime" />
+</set>
\ No newline at end of file diff --git a/res/anim/exit_to_right.xml b/res/anim/exit_to_right.xml new file mode 100644 index 00000000..893a7ef6 --- /dev/null +++ b/res/anim/exit_to_right.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?>
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shareInterpolator="false">
+
+ <translate
+ android:fromXDelta="0%" android:toXDelta="100%"
+ android:duration="@android:integer/config_shortAnimTime"
+ android:interpolator="@android:anim/accelerate_interpolator"/>
+
+ <alpha android:fromAlpha="1.0" android:toAlpha="0.0"
+ android:duration="@android:integer/config_shortAnimTime" />
+</set>
\ No newline at end of file diff --git a/res/values-hu/strings.xml b/res/values-hu/strings.xml index 5ac4f652..e3197bee 100644 --- a/res/values-hu/strings.xml +++ b/res/values-hu/strings.xml @@ -12,7 +12,7 @@ <string name="common.download">Letöltés gyorsítótárba</string>
<string name="common.pin">Letöltés tárolásra (megőrzés)</string>
<string name="common.delete">Törlés</string>
- <string name="common.star">Csillagozás be</string>
+ <string name="common.star">Csillagozás</string>
<string name="common.unstar">Csillagozás ki</string>
<string name="common.info">Részletek</string>
<string name="common.name">Név</string>
@@ -21,7 +21,7 @@ <string name="common.play_external">Videólejátszás</string>
<string name="common.stream_external">Videó streamelése</string>
<string name="common.confirm">Jóváhagyás</string>
- <string name="common.confirm_message">Biztos benne: %1$s %2$s?</string>
+ <string name="common.confirm_message">Biztos benne? %1$s -> \"%2$s\"</string>
<string name="common.confirm_message_cache">cache</string>
<string name="common.empty">Nem található!</string>
<string name="common.warning">Figyelem!</string>
@@ -68,7 +68,7 @@ <string name="main.albums_frequent">Legtöbbször lejátszottak</string>
<string name="main.albums_highest">Legjobbra értékeltek</string>
<string name="main.albums_starred">Csillagozottak</string>
- <string name="main.albums_random">Véletlenszerű</string>
+ <string name="main.albums_random">Véletlenszerű kiválasztás</string>
<string name="main.albums_genres">Műfajok</string>
<string name="main.albums_year">Évtizedek</string>
<string name="main.songs_genres">@string/main.albums_genres</string>
@@ -238,12 +238,12 @@ \nUtolsó módosítás: %4$s
\nMegjegyzés: %5$s</string>
<string name="bookmark.resume_title">Folytatja a lejátszást?</string>
- <string name="bookmark.resume">\'%1$s\' folytatása innen: \'%2$s\'</string>
+ <string name="bookmark.resume">\"%1$s\" folytatása innen: \"%2$s\"</string>
<string name="bookmark.action_resume">Folytatás</string>
<string name="bookmark.action_start_over">Kezdés</string>
- <string name="rating.title">\"%s\" értékelése</string>
- <string name="rating.set_rating">\"%s\" értékelése</string>
+ <string name="rating.title">\"%s\" értékelve</string>
+ <string name="rating.set_rating">\"%s\" értékelve</string>
<string name="rating.set_rating_failed">\"%s\" értékelése sikertelen!</string>
<string name="rating.remove_rating">\"%s\" értékelése visszavonva</string>
<string name="rating.remove_rating_failed">\"%s\" értékelésének visszavonása sikertelen!</string>
@@ -429,6 +429,10 @@ <string name="settings.large_album_art_summary">Albumok megjelenítése rácsnézetben és nagy méretű albumborítóval, a listanézet helyett.</string>
<string name="settings.admin_enabled">Admin engedélyezése</string>
<string name="settings.admin_enabled_summary">Admin menüpont megjelenítése az elhúzható oldalsávon.</string>
+ <string name="settings.replay_gain">Hangerő-kiegyenlítés (Replay Gain)</string>
+ <string name="settings.replay_gain_summary">Hangerő kiegyenlítése (normalizálása) a dal és az album hangerőszint értékei alapján.</string>
+ <string name="settings.replay_gain_bump">Hangerő-kiegyenlítés előerősítés</string>
+ <string name="settings.replay_gain_untagged">Dalok hangerő-kiegyenlítés nélkül</string>
<string name="shuffle.title">Sorrend keverése</string>
<string name="shuffle.startYear">Kezdő év:</string>
@@ -463,21 +467,21 @@ <string name="admin.create_user_error">A felhasználó létrehozása sikertelen!</string>
<string name="admin.change_username_invalid">Adjon meg egy érvényes felhasználónevet!</string>
<string name="admin.update_permissions">Jogosultságok módosítása</string>
- <string name="admin.update_permissions_success">%1$s jogosultságainak módosítása sikerült</string>
- <string name="admin.update_permissions_error">%1$s jogosultságainak módosítása sikertelen!</string>
+ <string name="admin.update_permissions_success">\"%1$s\" jogosultságainak módosítása sikerült</string>
+ <string name="admin.update_permissions_error">\"%1$s\" jogosultságainak módosítása sikertelen!</string>
<string name="admin.change_email">Email csere</string>
- <string name="admin.change_email_success">%1$s email címének módosítása sikerült</string>
- <string name="admin.change_email_error">%1$s email címének módosítása sikertelen!</string>
+ <string name="admin.change_email_success">\"%1$s\" email címének módosítása sikerült</string>
+ <string name="admin.change_email_error">\"%1$s\" email címének módosítása sikertelen!</string>
<string name="admin.change_email_label">Új email:</string>
<string name="admin.change_email_invalid">Adjon meg egy érvényes email címet!</string>
<string name="admin.change_password">Jelszó csere</string>
- <string name="admin.change_password_success">%1$s jelszavának módosítása sikerült</string>
- <string name="admin.change_password_error">%1$s jelszavának módosítása sikertelen!</string>
+ <string name="admin.change_password_success">\"%1$s\" jelszavának módosítása sikerült</string>
+ <string name="admin.change_password_error">\"%1$s\" jelszavának módosítása sikertelen!</string>
<string name="admin.change_password_label">Új jelszó:</string>
<string name="admin.change_password_invalid">Adjon meg egy érvényes jelszót!</string>
<string name="admin.delete_user">Felhasználó törlése</string>
- <string name="admin.delete_user_success">%1$s felhasználó létrehozva</string>
- <string name="admin.delete_user_error">%1$s felhasználó törlése sikertelen!</string>
+ <string name="admin.delete_user_success">\"%1$s\" felhasználó létrehozva</string>
+ <string name="admin.delete_user_error">\"%1$s\" felhasználó törlése sikertelen!</string>
<string name="admin.confirm_password">Jelszó megerősítése</string>
<string name="admin.confirm_password_bad">A beírt jelszó nem egyezik!</string>
diff --git a/src/github/daneren2005/dsub/activity/SubsonicActivity.java b/src/github/daneren2005/dsub/activity/SubsonicActivity.java index 6544b685..4d60dd77 100644 --- a/src/github/daneren2005/dsub/activity/SubsonicActivity.java +++ b/src/github/daneren2005/dsub/activity/SubsonicActivity.java @@ -45,6 +45,7 @@ import android.view.View; import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
+import android.view.animation.AnimationUtils;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
@@ -371,8 +372,10 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte @Override
public void setTitle(CharSequence title) {
- getSupportActionBar().setTitle(title);
- recreateSpinner();
+ if(!title.equals(getSupportActionBar().getTitle())) {
+ getSupportActionBar().setTitle(title);
+ recreateSpinner();
+ }
}
public void setSubtitle(CharSequence title) {
getSupportActionBar().setSubtitle(title);
@@ -542,6 +545,7 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte if(secondaryContainer == null) {
FragmentTransaction trans = getSupportFragmentManager().beginTransaction();
+ trans.setCustomAnimations(R.anim.enter_from_right, R.anim.exit_to_left, R.anim.enter_from_left, R.anim.exit_to_right);
trans.hide(oldFragment);
trans.add(R.id.fragment_container, fragment, tag + "");
trans.commit();
@@ -555,12 +559,16 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte if(backStack.size() > 1) {
// Move old right to left if there is a backstack already
SubsonicFragment newLeftFragment = backStack.get(backStack.size() - 1);
+ if(replaceCurrent) {
+ trans.setCustomAnimations(R.anim.enter_from_right, R.anim.exit_to_left, R.anim.enter_from_left, R.anim.exit_to_right);
+ }
trans.remove(newLeftFragment);
// Only move right to left if replaceCurrent is false
if(!replaceCurrent) {
SubsonicFragment oldLeftFragment = backStack.get(backStack.size() - 2);
oldLeftFragment.setSecondaryFragment(false);
+ trans.setCustomAnimations(R.anim.enter_from_right, R.anim.exit_to_left, R.anim.enter_from_left, R.anim.exit_to_right);
trans.hide(oldLeftFragment);
// Make sure remove is finished before adding
@@ -568,6 +576,7 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte getSupportFragmentManager().executePendingTransactions();
trans = getSupportFragmentManager().beginTransaction();
+ trans.setCustomAnimations(R.anim.enter_from_right, R.anim.exit_to_left, R.anim.enter_from_left, R.anim.exit_to_right);
trans.add(R.id.fragment_container, newLeftFragment, newLeftFragment.getSupportTag() + "");
} else {
backStack.remove(backStack.size() - 1);
@@ -594,6 +603,7 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte if(secondaryContainer == null) {
FragmentTransaction trans = getSupportFragmentManager().beginTransaction();
+ trans.setCustomAnimations(R.anim.enter_from_left, R.anim.exit_to_right, R.anim.enter_from_right, R.anim.exit_to_left);
trans.remove(oldFrag);
trans.show(currentFragment);
trans.commit();
@@ -601,10 +611,12 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte FragmentTransaction trans = getSupportFragmentManager().beginTransaction();
// Remove old right fragment
+ trans.setCustomAnimations(R.anim.enter_from_left, R.anim.exit_to_right, R.anim.enter_from_right, R.anim.exit_to_left);
trans.remove(oldFrag);
// Only switch places if there is a backstack, otherwise primary container is correct
if(backStack.size() > 0) {
+ trans.setCustomAnimations(0, 0, 0, 0);
// Add current left fragment to right side
trans.remove(currentFragment);
@@ -613,12 +625,14 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte getSupportFragmentManager().executePendingTransactions();
trans = getSupportFragmentManager().beginTransaction();
+ trans.setCustomAnimations(R.anim.enter_from_left, R.anim.exit_to_right, R.anim.enter_from_right, R.anim.exit_to_left);
trans.add(R.id.fragment_second_container, currentFragment, currentFragment.getSupportTag() + "");
SubsonicFragment newLeftFragment = backStack.get(backStack.size() - 1);
newLeftFragment.setSecondaryFragment(true);
trans.show(newLeftFragment);
} else {
+ secondaryContainer.startAnimation(AnimationUtils.loadAnimation(this, R.anim.exit_to_right));
secondaryContainer.setVisibility(View.GONE);
}
@@ -641,6 +655,10 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte }
protected void recreateSpinner() {
+ if(currentFragment.getTitle() == null) {
+ return;
+ }
+
if(backStack.size() > 0) {
spinnerAdapter.clear();
for(int i = 0; i < backStack.size(); i++) {
diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index 6cbb7e9b..4b845753 100644 --- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -612,22 +612,21 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter protected Pair<MusicDirectory, Boolean> doInBackground() throws Throwable {
MusicService musicService = MusicServiceFactory.getMusicService(context);
MusicDirectory dir = load(musicService);
- boolean valid = musicService.isLicenseValid(context, this);
- return new Pair<MusicDirectory, Boolean>(dir, valid);
+ licenseValid = musicService.isLicenseValid(context, this);
+
+ albums = dir.getChildren(true, false);
+ if(largeAlbums) {
+ entries = dir.getChildren(false, true);
+ } else {
+ entries = dir.getChildren();
+ }
+
+ return new Pair<MusicDirectory, Boolean>(dir, licenseValid);
}
@Override
protected void done(Pair<MusicDirectory, Boolean> result) {
- if(largeAlbums) {
- albums = result.getFirst().getChildren(true, false);
- entries = result.getFirst().getChildren(false, true);
- } else {
- albums = result.getFirst().getChildren(true, false);
- entries = result.getFirst().getChildren();
- }
- licenseValid = result.getSecond();
- finishLoading();
-
+ finishLoading();
currentTask = null;
}
}
@@ -643,7 +642,7 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter } else {
showHeader = false;
if(!"root".equals(id) && (entries.size() == 0 || !largeAlbums && albums.size() == entries.size())) {
- hideButtons = true;
+ hideButtons = true;
}
}
@@ -696,7 +695,7 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter if(validData) {
entryList.setVisibility(View.VISIBLE);
}
- context.supportInvalidateOptionsMenu();
+ context.supportInvalidateOptionsMenu();
if(lookupEntry != null) {
for(int i = 0; i < entries.size(); i++) {
@@ -708,12 +707,12 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter }
}
- Bundle args = getArguments();
- boolean playAll = args.getBoolean(Constants.INTENT_EXTRA_NAME_AUTOPLAY, false);
- if (playAll && !restoredInstance) {
- playAll(args.getBoolean(Constants.INTENT_EXTRA_NAME_SHUFFLE, false), false);
- }
- }
+ Bundle args = getArguments();
+ boolean playAll = args.getBoolean(Constants.INTENT_EXTRA_NAME_AUTOPLAY, false);
+ if (playAll && !restoredInstance) {
+ playAll(args.getBoolean(Constants.INTENT_EXTRA_NAME_SHUFFLE, false), false);
+ }
+ }
private void setupAlbumList() {
albumList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
diff --git a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java index 914aa36c..66900b55 100644 --- a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java +++ b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java @@ -98,7 +98,7 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR private int tag;
protected SubsonicActivity context;
- protected CharSequence title = "DSub";
+ protected CharSequence title = null;
protected CharSequence subtitle = null;
protected View rootView;
protected boolean primaryFragment = false;
@@ -447,7 +447,7 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR public void setPrimaryFragment(boolean primary) {
primaryFragment = primary;
if(primary) {
- if(context != null) {
+ if(context != null && title != null) {
context.setTitle(title);
context.setSubtitle(subtitle);
}
|