Iteration 2 for file detail & new sharing #2573
Conversation
cec0eb8 to
a7ca665
Compare
|
All DONE and rebased, ready for final approval/review @tobiasKaminsky @mario @ardevd |
| ArbitraryDataProvider arbitraryDataProvider = new ArbitraryDataProvider(mContext.getContentResolver()); | ||
|
|
||
| String eTag = arbitraryDataProvider.getValue(accountName, ThumbnailsCacheManager.AVATAR); | ||
| String avatarKey = "a_" + mUserId + "_" + mServerName + "_" + eTag; |
There was a problem hiding this comment.
Because I don't and don't wanna know what "a" is, please change to "avatar".
There was a problem hiding this comment.
This is the key for our cache:
a_: avatar
t_: thumbnail
r_: resizedImage
As the key is changing for avatar, we can rename it, but then it is not consistent to the other.
Hopefully we/I find the time to change to glide, then this all will change again…
There was a problem hiding this comment.
so leave it as-is then for now?
| if (avatar != null && !TextUtils.isEmpty(newETag)) { | ||
| avatar = handlePNG(avatar, px, px); | ||
| String newImageKey = "a_" + username + "_" + eTag; | ||
| String newImageKey = "a_" + mUserId + "_" + mServerName + "_" + newETag; |
|
|
||
| // SHARE FILE | ||
| private void filterShareFile(List<Integer> toShow, List<Integer> toHide, OCCapability capability) { | ||
| boolean shareViaLinkAllowed = (mContext != null && |
There was a problem hiding this comment.
Useless variable. I already removed them in a private branch, but please remove them as they bring nothing. Just use their content in the one place where needed. I know it's not related to this PR, but you touch the file so :P
| private void filterShareFile(List<Integer> toShow, List<Integer> toHide, OCCapability capability) { | ||
| boolean shareViaLinkAllowed = (mContext != null && | ||
| mContext.getResources().getBoolean(R.bool.share_via_link_feature)); | ||
| boolean shareWithUsersAllowed = (mContext != null && |
| mContext.getResources().getBoolean(R.bool.share_with_users_feature)); | ||
|
|
||
| OCCapability capability = mComponentsGetter.getStorageManager().getCapability(mAccount.name); | ||
| boolean shareApiEnabled = capability != null && |
| // SEE DETAILS | ||
| if (!isSingleFile()) { | ||
| private void filterDetails(List<Integer> toShow, List<Integer> toHide) { | ||
| if (!isSingleSelection()) { |
|
|
||
| // Kept available offline | ||
| private void filterKeepAvailableOffline(List<Integer> toShow, List<Integer> toHide, boolean synchronizing) { | ||
| if (!allFiles() || synchronizing || allKeptAvailableOffline()) { |
There was a problem hiding this comment.
kept since it'll end up with
if (allFiles() || !synchronizing || !allKeptAvailableOffline()) {
|
|
||
| // Not kept available offline | ||
| private void filterDontKeepAvailableOffline(List<Integer> toShow, List<Integer> toHide, boolean synchronizing) { | ||
| if (!allFiles() || synchronizing || allNotKeptAvailableOffline()) { |
There was a problem hiding this comment.
kept since it'll end up with
if (allFiles() || !synchronizing || !allKeptAvailableOffline()) {
| } | ||
|
|
||
| private void filterDeselectAll(List<Integer> toShow, List<Integer> toHide, boolean inSingleFileFragment) { | ||
| if (!inSingleFileFragment) { |
There was a problem hiding this comment.
Invert again. Positive first.
| private static final String ARG_ACCOUNT = "ACCOUNT"; | ||
| private static final String ARG_ACTIVE_TAB = "TAB"; | ||
|
|
||
| @Nullable @BindView(R.id.fdProgressBlock) |
| @BindView(R.id.searchView) | ||
| SearchView searchView; | ||
|
|
||
| @BindView(R.id.fdshareUsersList) |
|
|
||
|
|
||
| /// BEWARE: next methods will failed with NullPointerException if called before onCreateView() finishes | ||
| // BEWARE: next methods will failed with NullPointerException if called before onCreateView() finishes |
There was a problem hiding this comment.
"will fail" instead of "will failed".
also "next" -> "the following"
| searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { | ||
| @Override | ||
| public boolean onQueryTextSubmit(String query) { | ||
| // return true to prevent the query is processed to be queried; |
There was a problem hiding this comment.
Uh. Can you rephrase this entire sentence? xD
| String eTag = arbitraryDataProvider.getValue(account, ThumbnailsCacheManager.AVATAR); | ||
| String serverName = account.name.substring(account.name.lastIndexOf('@') + 1, account.name.length()); | ||
| String eTag = arbitraryDataProvider.getValue(userId + "@" + serverName, ThumbnailsCacheManager.AVATAR); | ||
| String avatarKey = "a_" + userId + "_" + serverName + "_" + eTag; |
src/main/res/drawable/divider.xml
Outdated
| <size android:height="1dp" /> | ||
| </shape> | ||
| </item> | ||
| </layer-list> No newline at end of file |
| android:title="@string/common_rename" | ||
| app:showAsAction="never" | ||
| android:showAsAction="never" | ||
| android:orderInCategory="1" /> |
src/main/res/values/strings.xml
Outdated
| <string name="tags">Tags</string> | ||
| <string name="sharee_add_failed">Adding sharee failed</string> | ||
| <string name="unsharing_failed">Unsharing failed</string> | ||
| <string name="updating_share_failed">Updateing share failed</string> |
|
Just waiting for Drone to "succeed"... |
|
Lint check is green, everything is green, Drone is not working right again... so merging |
|
Yay, awesome work! :) Really looking forward to this landing in the release! |
Iteration 1 can be found here: #2533 ☑️
WiP for #2485 and collab with @tobiasKaminsky
ListViewwithRecyclerViewOpen for iteration 3/4