mirror of
https://github.com/Tencent/QMUI_Android.git
synced 2026-10-17 04:31:16 +08:00
章节购买折叠
This commit is contained in:
@@ -13,7 +13,7 @@ object Dep {
|
||||
|
||||
object QMUI {
|
||||
const val group = "com.qmuiteam"
|
||||
const val qmuiVer = "2.1.0.29"
|
||||
const val qmuiVer = "2.1.1.34"
|
||||
const val archVer = "2.1.0.4"
|
||||
const val typeVer = "0.1.0.8"
|
||||
|
||||
|
||||
@@ -573,6 +573,29 @@ public abstract class QMUIStickySectionAdapter<
|
||||
}
|
||||
}
|
||||
|
||||
public void toggleFoldForChapterBuy(int position) {
|
||||
QMUISection<H, T> section = getSection(position);
|
||||
if (section == null) {
|
||||
return;
|
||||
}
|
||||
if (mViewCallback != null && !section.isFold()) {
|
||||
for (int i = 0; i < mSectionIndex.size(); i++) {
|
||||
int itemIndex = getItemIndex(i);
|
||||
if (itemIndex == ITEM_INDEX_SECTION_HEADER && getSection(i) == section && mViewCallback.doGetStickyHeaderPosition() == position) {
|
||||
mViewCallback.scrollToPosition(i, true, true);
|
||||
RecyclerView recyclerView = mViewCallback.getRecyclerView();
|
||||
section.setFold(!section.isFold());
|
||||
lock(section);
|
||||
diff(false, true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
section.setFold(!section.isFold());
|
||||
lock(section);
|
||||
diff(false, true);
|
||||
}
|
||||
|
||||
|
||||
public int getRelativeStickyPosition(int position) {
|
||||
while (getItemViewType(position) != ITEM_TYPE_SECTION_HEADER) {
|
||||
@@ -741,6 +764,8 @@ public abstract class QMUIStickySectionAdapter<
|
||||
RecyclerView.ViewHolder findViewHolderForAdapterPosition(int position);
|
||||
|
||||
void requestChildFocus(View view);
|
||||
int doGetStickyHeaderPosition();
|
||||
RecyclerView getRecyclerView();
|
||||
}
|
||||
|
||||
public interface PositionFinder<H extends QMUISection.Model<H>, T extends QMUISection.Model<T>> {
|
||||
|
||||
@@ -267,6 +267,11 @@ public class QMUIStickySectionLayout extends QMUIFrameLayout implements QMUIStic
|
||||
mRecyclerView.requestChildFocus(view, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int doGetStickyHeaderPosition() {
|
||||
return getStickyHeaderPosition();
|
||||
}
|
||||
|
||||
public interface StickySectionWrapViewConfig {
|
||||
void config(QMUIFrameLayout stickySectionWrapView);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user