Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
PR review #2
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo committed Oct 23, 2019
1 parent 4fb9a4c commit 915dea2
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ public BookmarkAdapter(@Nullable BookmarkItemCallback clickCallback, Context aCo
setHasStableIds(false);
}

public void setNarrow(boolean isNarrow, int first, int last) {
public void setNarrow(boolean isNarrow) {
if (mIsNarrowLayout != isNarrow) {
mIsNarrowLayout = isNarrow;
notifyItemRangeChanged(first, last);
notifyDataSetChanged();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ public HistoryAdapter(@Nullable HistoryItemCallback clickCallback, Context aCont
setHasStableIds(true);
}

public void setNarrow(boolean isNarrow, int first, int last) {
public void setNarrow(boolean isNarrow) {
if (mIsNarrowLayout != isNarrow) {
mIsNarrowLayout = isNarrow;
notifyItemRangeChanged(first, last);
notifyDataSetChanged();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,9 @@ private void updateLayout() {
post(() -> {
double width = Math.ceil(getWidth()/getContext().getResources().getDisplayMetrics().density);
boolean isNarrow = width < SettingsStore.WINDOW_WIDTH_DEFAULT;

if (isNarrow != mBinding.getIsNarrow()) {
int firstVisibleItem = ((LinearLayoutManager) mBinding.bookmarksList.getLayoutManager()).findFirstVisibleItemPosition();
int lastVisibleItem = ((LinearLayoutManager) mBinding.bookmarksList.getLayoutManager()).findLastVisibleItemPosition();
mBookmarkAdapter.setNarrow(isNarrow, firstVisibleItem, lastVisibleItem);
mBookmarkAdapter.setNarrow(isNarrow);

mBinding.setIsNarrow(isNarrow);
mBinding.executePendingBindings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,7 @@ private void updateLayout() {
boolean isNarrow = width < SettingsStore.WINDOW_WIDTH_DEFAULT;

if (isNarrow != mBinding.getIsNarrow()) {
int firstVisibleItem = ((LinearLayoutManager) mBinding.historyList.getLayoutManager()).findFirstVisibleItemPosition();
int lastVisibleItem = ((LinearLayoutManager) mBinding.historyList.getLayoutManager()).findLastVisibleItemPosition();
mHistoryAdapter.setNarrow(width < SettingsStore.WINDOW_WIDTH_DEFAULT, firstVisibleItem, lastVisibleItem);
mHistoryAdapter.setNarrow(isNarrow);

mBinding.setIsNarrow(isNarrow);
mBinding.executePendingBindings();
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@

<!-- This string is used to in the Library panels to the left of the sync button to indicate
that the content has never been synced yet. -->
<string name="fxa_account_last_no_synced">No synced yet</string>
<string name="fxa_account_last_no_synced">Not synced yet</string>

<!-- This string is used to in the Library panels to the left of the sync button to indicate
that the syncing is off. -->
Expand Down

0 comments on commit 915dea2

Please sign in to comment.