mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 21:55:48 +03:00
Merge pull request #3680 from nextcloud/activityLocale
Enhance activities activity
This commit is contained in:
commit
f4dec19e28
4 changed files with 16 additions and 7 deletions
|
@ -1 +1 @@
|
|||
482
|
||||
481
|
|
@ -25,6 +25,7 @@ import android.content.Context;
|
|||
import android.os.AsyncTask;
|
||||
|
||||
import com.owncloud.android.MainApp;
|
||||
import com.owncloud.android.R;
|
||||
import com.owncloud.android.authentication.AccountUtils;
|
||||
import com.owncloud.android.datamodel.OCFile;
|
||||
import com.owncloud.android.lib.common.OwnCloudAccount;
|
||||
|
@ -101,16 +102,16 @@ public class FilesServiceApiImpl implements FilesServiceApi {
|
|||
return true;
|
||||
} catch (com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundException e) {
|
||||
Log_OC.e(TAG, "Account not found", e);
|
||||
errorMessage = "Account not found";
|
||||
errorMessage = baseActivity.getString(R.string.account_not_found);
|
||||
} catch (IOException e) {
|
||||
Log_OC.e(TAG, "IO error", e);
|
||||
errorMessage = "IO error";
|
||||
errorMessage = baseActivity.getString(R.string.io_error);
|
||||
} catch (OperationCanceledException e) {
|
||||
Log_OC.e(TAG, "Operation has been canceled", e);
|
||||
errorMessage = "Operation has been canceled";
|
||||
errorMessage = baseActivity.getString(R.string.operation_canceled);
|
||||
} catch (AuthenticatorException e) {
|
||||
Log_OC.e(TAG, "Authentication Exception", e);
|
||||
errorMessage = "Authentication Exception";
|
||||
errorMessage = baseActivity.getString(R.string.authentication_exception);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -125,7 +126,7 @@ public class FilesServiceApiImpl implements FilesServiceApi {
|
|||
callback.onLoaded(remoteOcFile);
|
||||
return;
|
||||
} else {
|
||||
errorMessage = "File not found";
|
||||
errorMessage = baseActivity.getString(R.string.file_not_found);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -72,6 +72,7 @@ import com.owncloud.android.utils.svg.SvgSoftwareLayerSetter;
|
|||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
@ -407,7 +408,11 @@ public class ActivityListAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
|
|||
return DisplayUtils.getRelativeDateTimeString(context, modificationTimestamp, DateUtils.DAY_IN_MILLIS,
|
||||
DateUtils.WEEK_IN_MILLIS, 0);
|
||||
} else {
|
||||
return DateFormat.format("EEEE, MMMM d", modificationTimestamp);
|
||||
String pattern = "EEEE, MMMM d";
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR2) {
|
||||
pattern = DateFormat.getBestDateTimePattern(Locale.getDefault(), "EEEE, MMMM d");
|
||||
}
|
||||
return DateFormat.format(pattern, modificationTimestamp);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -870,4 +870,7 @@
|
|||
<string name="storage_music">Music</string>
|
||||
<string name="storage_documents">Documents</string>
|
||||
<string name="storage_downloads">Downloads</string>
|
||||
<string name="io_error">IO error</string>
|
||||
<string name="operation_canceled">Operation has been canceled</string>
|
||||
<string name="authentication_exception">Authentication Exception</string>
|
||||
</resources>
|
||||
|
|
Loading…
Reference in a new issue