i am developing an arabic android application and i have the compatibility package referenced
i have a ViewPager that displays my content but i want to start scrolling the pager view from the right
making the starting page on the far right of the pages.
I don`t think it is easy to do, maybe using java reflection
Another and easier solution is to use your last page like your first page. So at the start you just call:
YourViewPager.setCurrentItem(YourViewPagerSize);
Related
I want to open multiple tabs within one webview. I can manage to load one url at a time. I am understanding that i have to customized my webview to do so. Is it possible, like as my below picture ?
Any suggestion , tutorial or guideline is appreciated.
Tabs are simply not part of WebView, you need to develop such features around it yourself.
E.g. you could use a TabLayout to implement the tabs, and update the state of the WebView according to the selected tab. You can easily find tutorials all over the place detailing tabs.
In android, i want to move from current to previous activity by left to right swipe as in iOS. I want to be able to even hold while swiping such as both activities are visible at the same time.
I want to introduce transition/animation effect just like in Telegram app. So please help how can i do it.
Tutorials or example code will work for me.
Thanks in advance!
You better use the Swipe animation with multiple Fragments inside one Activity: Creating Swipe Views with Tabs
take a look at this tutorial : HOW TO IMPLEMENT HORIZONTAL VIEW SWIPING WITH TABS
If you're already using Google's NavComponent library, you should try a library that I wrote:
https://github.com/massivemadness/Fragula
It's fully integrated with NavComponent, which means the navigation API stays the same, you only need to make some changes in NavGraph and NavHost container.
Here's the result:
I am using a Viewpager for using user profiles. I have few requirements for Viewpager.
I want it to be locked in one direction. i.e. I want user should be able to swipe left only to load new fragments. Once he has moved to next fragment, he shouldn't be able to go back to previous fragment. I saw so many answers but could not infer a apt answer.
How to disable ViewPager from swiping in one direction User says he was unable to get the required result.
I want to use some good animation for fragment page change transition effect rather than simple sliding. I saw JazzyViewPager - https://github.com/jfeinstein10/JazzyViewPager but was unable to understand how to incorporate in my existing project.
In case, it is possible I was thinking of using a pan for some 3D horizontal rolling (Not a priority though).
First Problem's solution See Here and
Another Link
Second you can add Transition effect to fragment what you expect
step by step explanation give here
and also see This
I have existed code for two activities(ActivityA and ActivityB).
Now I need to have a another activity, which will act as my first and only screen of my application. This activity will be having two tabs on its header part and I need to display each of my Activity when user press on each tab.
I have done some search on this and found TabAcivity will be suitable choice, but it is deprecated now.
I saw many posts which are suggesting Fragments. But I dont want to change my existing code. Can any one suggest me easy method to incorporate this.
you can use Android Tab Layout with Swipeable Views
here i give Link in this link step by step information given. so i think you can get batter idea from that.
Tab Layout with Swipeable Views
you can also download code from this site and also see video in given sit
I'd like to make a view in my Android app that flips between multiple views on a swipe/fling. I'd like it to behave more or less like the Android Launcher behaves when flipping between views. In particular,
It should flip views on swipe.
Generally a swipe will flip between one view and the next. It should not fling across all of the views.
If you swipe slowly, you should see the views dragging as you're swiping, eg. the way the Launcher does it.
I tried using a ViewFlipper with a GestureOverlayView as per Romain Guy's blog post here, but there's no indicator to the user as they're swiping. This makes discoverability difficult, which is presumably why Launcher does it the way they do.
I tried using a Gallery object, but when I swipe from left to right, there's a certain amount of momentum that flings the users through all the views rather than just taking them to the next view.
Is there a good way to accomplish what I'm trying to do?
I know this is an old question but ViewPager is created for this exact same purpose. ViewPager is part of android compatibility package and more can be found at http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html
Take a look at HorizontalPager. It's actually based on RealViewSwitcher, which in turn is based on the Android homescreen's code, and supports snap-to paging with drag feedback, as well as nested vertically-scrolling subviews. Gesture support for fast swipes isn't all it should be, but this may get you part of the way there (and I'd welcome contributions back).
EDIT: As of 2012 you're much better off using Google's ViewPager - it's in the compat library.
Check out SwipeView within this project https://github.com/fry15/uk.co.jasonfry.android.tools It does exactly what you want it to do and is super simple to implement.
#CommonsGuy extended ViewFlipper to do it.
https://github.com/commonsguy/cwac-viewswiper
Ihaven't used this one yet so im not sure if it moves with your finger like the launcher if not your going to have to make an OnTochListener to do it for you in me.ACTION_MOVE you will update the view to change its position. I'll post some sample code when I get home if you don't get another answer.