- beautify Timestamps

This commit is contained in:
tobiasKaminsky 2014-10-26 21:12:45 +01:00
parent 8d3a956c97
commit 56d9529b14

View file

@ -29,6 +29,7 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.preference.PreferenceManager;
import android.text.format.DateUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -181,9 +182,8 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter {
fileSizeV.setVisibility(View.VISIBLE);
fileSizeV.setText(DisplayUtils.bytesToHumanReadable(file.getFileLength()));
lastModV.setVisibility(View.VISIBLE);
lastModV.setText(
DisplayUtils.unixTimeToHumanReadable(file.getModificationTimestamp())
);
lastModV.setText(DateUtils.getRelativeDateTimeString(mContext, file.getModificationTimestamp(),
DateUtils.SECOND_IN_MILLIS, DateUtils.WEEK_IN_MILLIS, 0));
// this if-else is needed even thoe fav icon is visible by default
// because android reuses views in listview
if (!file.keepInSync()) {
@ -251,9 +251,8 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter {
// }
lastModV.setVisibility(View.VISIBLE);
lastModV.setText(
DisplayUtils.unixTimeToHumanReadable(file.getModificationTimestamp())
);
lastModV.setText(DateUtils.getRelativeDateTimeString(mContext, file.getModificationTimestamp(),
DateUtils.SECOND_IN_MILLIS, DateUtils.WEEK_IN_MILLIS, 0));
checkBoxV.setVisibility(View.GONE);
view.findViewById(R.id.imageView3).setVisibility(View.GONE);