diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-09-02 19:27:16 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-09-02 19:27:16 -0700 |
commit | 50171f3c0a5524159081d76414636a53513de233 (patch) | |
tree | 5f09c296d09848aa136c27e77c21032367cf4011 /src/github | |
parent | 7e014451727f4dad729ce2f3b0889df53aecdf51 (diff) | |
download | dsub-50171f3c0a5524159081d76414636a53513de233.tar.gz dsub-50171f3c0a5524159081d76414636a53513de233.tar.bz2 dsub-50171f3c0a5524159081d76414636a53513de233.zip |
More work on Set Rating
Diffstat (limited to 'src/github')
-rw-r--r-- | src/github/daneren2005/dsub/fragments/SubsonicFragment.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java index 6e7aa9e2..b1548bb7 100644 --- a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java +++ b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java @@ -46,6 +46,7 @@ import android.widget.Button; import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.LinearLayout;
+import android.widget.RatingBar;
import android.widget.TextView;
import github.daneren2005.dsub.R;
import github.daneren2005.dsub.activity.DownloadActivity;
@@ -1179,7 +1180,7 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR msg += "\nLength: " + Util.formatDuration(song.getDuration());
}
if(song.getBookmark() != null) {
- msg += "\nBookmark Position: " + Util.formatDuration(song.getBookmark().getPosition());
+ msg += "\nBookmark Position: " + Util.formatDuration(song.getBookmark().getPosition() / 1000);
}
if(song.getRating() != 0) {
msg += "\nRating: " + song.getRating() + " stars";
@@ -1505,13 +1506,13 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR }
protected void setRating(final Entry entry) {
- final RatingBar ratingBar = new RatingBar(context);
- ratingBar.setNumStars(5);
+ View layout = context.getLayoutInflater().inflate(R.layout.rating, null);
+ final RatingBar ratingBar = (RatingBar) layout.findViewById(R.id.rating_bar);
ratingBar.setRating((float) entry.getRating());
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(context.getResources().getString(R.string.rating_title, entry.getTitle()))
- .setView(ratingBar)
+ .setView(layout)
.setPositiveButton(R.string.common_ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
@@ -1519,7 +1520,7 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR setRating(entry, rating);
}
})
- .setNegativeButton(R.string.common_cancel);
+ .setNegativeButton(R.string.common_cancel, null);
AlertDialog dialog = builder.create();
dialog.show();
|