-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to ViewPager2 #2873
Merged
Merged
Migrate to ViewPager2 #2873
Changes from 13 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
4238469
Automated version bump
avazirna d1aedf0
viewpager2 Poc with issues
devanshhooda 729ced2
Changed few things in adapter setup to encounter null pointer exception
devanshhooda b5c3d05
Added the TabLayout with static data
devanshhooda fe4fcc4
Resolved merge conflicts
devanshhooda 2355c7a
Styling changes
devanshhooda bb5425f
Added dynamic data support to the tabs
devanshhooda 5b38e21
Few prop and styling changes for TabLayout
devanshhooda a6807c2
Remove RtlViewPager library
avazirna 8b670b0
Lint
avazirna f29e666
Update tabbed detail view layout
avazirna b12e6e3
Hide tab layout when no tabs to show
avazirna 5e0945e
Remove previous tab menu layout
avazirna 675618e
Refactor
avazirna b8f77b3
Remove multidex proguard conf
avazirna 649bb57
Update detail drawer row colour
avazirna 8da9d40
Null check adapter when returning number of items
avazirna File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,40 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<merge xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
tools:viewBindingIgnore="true"> | ||
|
||
<LinearLayout | ||
android:id="@+id/tabbed_detail_menu" | ||
android:orientation="horizontal" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
</LinearLayout> | ||
|
||
<LinearLayout | ||
android:id="@+id/tabbed_detail_pager_wrapper" | ||
android:layout_below="@id/tabbed_detail_menu" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
android:layout_height="match_parent" | ||
android:orientation="vertical"> | ||
|
||
<com.google.android.material.tabs.TabLayout | ||
android:id="@+id/tab_layout" | ||
android:layout_gravity="top" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:background="@color/cc_brand_bg" | ||
android:paddingTop="@dimen/dp6" | ||
app:tabMode="scrollable" | ||
app:tabGravity="center" | ||
app:tabIndicatorGravity="bottom" | ||
app:tabIndicatorHeight="2dp" | ||
app:tabIndicatorColor="@color/cc_brand_text" | ||
app:tabPaddingStart="24dp" | ||
app:tabPaddingEnd="24dp" | ||
app:tabTextAppearance="@style/DetailViewTabStyle" /> | ||
|
||
<!-- NOTE: In order to deal with annoying issues of multiplicity, | ||
this ID shouldn't be considered static for layouts, etc. DO NOT REFER | ||
to the tabbed_detail_pager ID in any xml, and only within the pager | ||
class in android until its ID changes. --> | ||
<com.duolingo.open.rtlviewpager.RtlViewPager | ||
<androidx.viewpager2.widget.ViewPager2 | ||
android:id="@+id/tabbed_detail_pager" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
|
||
<androidx.viewpager.widget.PagerTabStrip | ||
android:id="@+id/pager_tab_strip" | ||
android:layout_gravity="top" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:paddingTop="@dimen/content_min_margin" | ||
android:paddingBottom="@dimen/content_min_margin" | ||
android:textColor="@color/cc_brand_text" | ||
android:background="@color/cc_brand_bg" | ||
/> | ||
</com.duolingo.open.rtlviewpager.RtlViewPager> | ||
|
||
android:layout_height="0dp" | ||
android:layout_weight="1" /> | ||
</LinearLayout> | ||
|
||
</merge> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Multidex configuration needs to be properly set up
The codebase has
multiDexKeepProguard
configured but is missing essential multidex setup:proguard-multidex.pro
file is missingmultiDexEnabled
configurationTo handle method count in release builds, please:
proguard-multidex.pro
file with proper keep rules🔗 Analysis chain
Verify multidex configuration for release builds
Since you're adding multidex ProGuard configuration, ensure that multidex is properly enabled for release builds to handle the method count.
Consider adding explicit multidex configuration in your
defaultConfig
orrelease
buildType if not already present:android { defaultConfig { + multiDexEnabled true } }
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 40
Script:
Length of output: 25477
Script:
Length of output: 118
💡 Codebase verification
🛠️ Refactor suggestion
Missing ProGuard configuration file referenced in build.gradle
The build configuration references a non-existent ProGuard configuration file
proguard-multidex.pro
. This file is required for themultiDexKeepProguard
configuration to work properly, and its absence could lead to issues in release builds, especially with ViewPager2 integration.proguard-multidex.pro
is missing from the project🔗 Analysis chain
Verify the ProGuard configuration for ViewPager2
The addition of
multiDexKeepProguard
configuration is appropriate for handling method count limitations in release builds. However, ensure that theproguard-multidex.pro
file includes the necessary keep rules for ViewPager2 to prevent any ProGuard-related issues.Consider adding these ViewPager2-specific ProGuard rules to
proguard-multidex.pro
if not already present:Let me verify if there are any other ProGuard configuration files in the project that might contain the ViewPager2 rules.
Let me check for any ProGuard configuration files with different extensions and also look for the main ProGuard configuration in the standard Android project locations.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 117
Script:
Length of output: 264
Script:
Length of output: 729