FORUMS

EVLeaks Shows Off Possible BlackBerry Android Phone

It wasn’t too long ago that we received reports of BlackBerry planning to use … more

Mysterious GG1 Google Device Stops by FCC. Glass v2?

As the year progresses, we draw further away from Google’s annual I/O … more

Material and Material Dark Hit Samsung’s Theme Store

The latest version of Touchwiz, launched alongside the Galaxy S6 and S6 Edge, … more

Swappa’s New App Helps You Value Your Device

There comes a sad time in everyone’s life where you must part ways with your … more

[Library] ViewPager

192 posts
Thanks Meter: 76
 
By gade12, Senior Member on 28th December 2013, 10:44 PM
Post Reply Subscribe to Thread Email Thread
Hi guys.
I am going to try to explain the scene of this library.

HC/ICS and above are android versions that are in more than 75% of all android smartphones...
This can cause one scene, you want to develop an application to HC/ICS or above...
Your application need to use ViewPager, this is awesome feature and looks greats...But Android only support this through Support-v4 (actually r19)
And you think...why do i have to use "non native library" (Fragments, FragmentManager, FragmentTransiction...) import all from support-v4 if my application is for ics or above
This force, for example, SO to use fragments from support-v4 when SO have his implementation of Fragments...Cause redundant code, apks more heavy, maybe worse performance...

I will not enter in discussion about native bugs, android version of smartphones, performance, support of old devices...

I found a lot of comments of people asking for native Viewpgaer and answer is always same, not exits or create your own implementation...So i decided to create ViewPager only library...But why new one if ViewPager from support-v4 works great?

So i have created a library ViewPager from support-v4 code

For now it support from API 11 to API 19 I have deleted all code non related with ViewPager and viewpager before API 11. In API 11,HC 3.0, force close when trying to close fragments (some methods related with FragmentManager and FragmentTransaction are implemented in API 13 or above).

All this provide us a 126Kb of ViewPager library and remove support-v4 from our applications (if we only use ViewPager) that i want to share with all us. Now we have a 113Kb of library without supporting HC (See second post for more info)

If people like this and use it, i will remove support for HC (only 0.1% of Android devices), making more small library.(Done)

All credits are for Google and Android, i dont use this to make money. Code continue with same license.

The use of this library is the same as Support-V4

- Copy ViewPager.jar in libs folder and see that it dependency appear as "Android Private Library"
- import com.google.android.view.PagerAdapter; for class
- <com.google.android.view.ViewPager /> for xml

Other importants imports are:

import com.google.android.app.FragmentPagerAdapter;
import com.google.android.app.FragmentStatePagerAdapter;
import com.google.android.view.PagerAdapter;

Here is the complete tree (See second post for version without HC support):



Enjoy it and advise me with possible bug in differents versions. I have tested 3.0,4.0,4.0.3,4.2.2,4.3 (3.0 not work in version that dont support HC)
Attached Thumbnails
Click image for larger version

Name:	ViewPagerTree.jpg
Views:	1654
Size:	123.8 KB
ID:	2480122  
Attached Files
File Type: jar ViewPager.jar - [Click for QR Code] (126.3 KB, 94 views)
Last edited by gade12; 30th December 2013 at 05:11 PM.
The Following 4 Users Say Thank You to gade12 For This Useful Post: [ View ]
 
 
28th December 2013, 10:49 PM |#2  
gade12's Avatar
OP Senior Member
Flag Salamanca
Thanks Meter: 76
 
More
ViewPager Library without support HC

This jar is more small size and without bugs (Honeycomb dont support native FragmentManager and FragmentTransiction (or at least some functionalities) and it forceclose due to this)

To donwload this library get this attachment

Here is the complete tree:



It works from API 14 to API 19
Attached Thumbnails
Click image for larger version

Name:	viewpagernohc.jpg
Views:	1192
Size:	110.5 KB
ID:	2483786  
Attached Files
File Type: jar ViewPager.jar - [Click for QR Code] (113.4 KB, 36 views)
Last edited by gade12; 30th December 2013 at 05:19 PM.
The Following 3 Users Say Thank You to gade12 For This Useful Post: [ View ]
30th December 2013, 12:47 PM |#3  
EatHeat's Avatar
Recognized Developer
Flag Calcutta
Thanks Meter: 1,458
 
More
Nice, but source?
30th December 2013, 01:43 PM |#4  
gade12's Avatar
OP Senior Member
Flag Salamanca
Thanks Meter: 76
 
More
Quote:
Originally Posted by EatHeat

Nice, but source?

Source is support-v4 google code with some modifications by me.
But yes, i will create a github repository
31st December 2013, 06:22 PM |#5  
ssuukk's Avatar
Senior Member
Dirty, stinking and full of dog sh!t
Thanks Meter: 1,825
 
More
Sorry for slight offtopic, but maybe you can help me with creating "patched" Android Support Library. I had to correct one bug there, but was unable to repack it into usable and working support lib. If you know how to do it maybe you can PM me?
1st January 2014, 02:10 AM |#6  
gade12's Avatar
OP Senior Member
Flag Salamanca
Thanks Meter: 76
 
More
Quote:
Originally Posted by ssuukk

Sorry for slight offtopic, but maybe you can help me with creating "patched" Android Support Library. I had to correct one bug there, but was unable to repack it into usable and working support lib. If you know how to do it maybe you can PM me?

No problem, you have a PM
The Following User Says Thank You to gade12 For This Useful Post: [ View ]
Post Reply Subscribe to Thread

Tags
jar, library, viewpager
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes