From e7a6728aea008cab5befa5980382370c32974ce5 Mon Sep 17 00:00:00 2001 From: 张钢 <floatgang@163.com> Date: 星期三, 11 九月 2024 14:51:07 +0800 Subject: [PATCH] 修改了百年心愿模块的排版和显示不正确的问题 --- app_base/src/main/java/com/android/app_base/base/adapter/BaseVp2FragmentAdapter.java | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/app_base/src/main/java/com/android/app_base/base/adapter/BaseVp2FragmentAdapter.java b/app_base/src/main/java/com/android/app_base/base/adapter/BaseVp2FragmentAdapter.java index 4fcc559..99ac083 100644 --- a/app_base/src/main/java/com/android/app_base/base/adapter/BaseVp2FragmentAdapter.java +++ b/app_base/src/main/java/com/android/app_base/base/adapter/BaseVp2FragmentAdapter.java @@ -171,6 +171,21 @@ } /** + * 鑾峰彇鏌愪釜 Fragment 鐨勭储寮曪紙娌℃湁灏辫繑鍥� -1锛� + */ + public int getFragmentIndex(String clazz) { + if (clazz == null) { + return -1; + } + for (int i = 0; i < mFragmentList.size(); i++) { + if (clazz.equals(mFragmentList.get(i).getClass().getName())) { + return i; + } + } + return -1; + } + + /** * 鏍规嵁 绱㈠紩 鑾峰彇鏌愪釜 Fragment */ public F getFragment(int index) { -- Gitblit v1.9.1