Pull Screen not indicator with Swipe Refresh Layout Android - android

I am implementing swipe refresh layout to my fragment. It works perfectly, but I want to pull the screen as animation not the indicator itself. I also want not to show the default indicator because I have my own custom progress bar.
Any help will be appriciated.

use this to hide the progress indicator
if (swipeLayout.isRefreshing()) {
swipeLayout.setRefreshing(false);
}
and for animating the activity, you can use transitions in android. Follow this link to get some cool transitions and just implement it to the root element of your activity.

Related

Android web view with controls, refresh button and progress bar

How to create functionality for the following requirements in android webView?
Next Button - Should be disabled when there is no page to load next.
Previous button - Should be disabled when there is no previous page.
Progress bar (Horizontal) - Display the progress when loading a page. (Should be aligned to top or bottom and with control keys.)
Refresh button
Any other nice to have elements or controls - Share the URL of the current page etc..
There is no component available to meet your requirement, you have to create your own, with the help of recyclerView and ViewPager2, List which contains your URLs, I have described using the diagram. User recyclerView to display a progress bar, and ViewPager2 will use to display the fragment, and the fragment contains the webView.

Slide menu display same for all pages Android

I am trying to make an App on android. I have made the slide in menu bar like the one shown in the the picture below. The blue bar. Now what I want is that my every screen should show the same menu options. Not those with the back button. How do I do that? Should I make one header and call that in every class? Right now I have an Activity and everything else is a fragment.
I can post my code here as well.
make a Parent Activity and make this acion bar in it.inherit your all activities from this parent activity and just remove setContentView(R.layout.layoutname) from your child activity.
this works in your scenario when you are using fragments so you don't need the layout for activity. so your fragment container would be your parent activity..

Move the Floating Action Button along with the swiped tab

Let me brief about my idea and what I'm aiming to achieve,
Idea is to have a swipe tab with three tabs in it and each tab screen being represented by a seperate Fragment class. I did this using the "it.neokree:MaterialTabs:0.11" library and everything is working well.
Then I created a floating action button (FAB) using the "com.oguzdev:CircularFloatingActionMenu:1.0.2" library.
Now what I'm trying to achieve is to fix this FAB to the fragment in the center tab and when I swipe the screen to go the previous or the next tab the FAB should slide out along with the tab fragment its in and should slide back in along with the center tab screen when I swipe back to it.
I have worked on it till now and now I'm able hide the view in other fragments and show it again in the center fragment by overriding the setUserVisibleHint() method in each fragment class like this.
#Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if (isVisibleToUser) {
View tempView = getActivity().findViewById(R.id.myFAB);
tempView.setVisibility(View.INVISIBLE);
}
}
But the problem is I want the FAB to slide out and in along with the center tab just like other views in the tab's fragment class does, but my FAB is simply vanishing and reappearring.
In a way I want the FAB to be exclusive to the center tab and should be fixed to it.
I also tried defining the FAB inside the center Fragment class but it doesn't seem to make any difference. Any Advice and suggestion will be very helpful. Thanks in advance
This library adds it's view to the 'android.R.id.content' ViewGroup. That's why it doesn't matter, where you define it.
Animating such view may be difficult, but should be possible. You have translate the FAB while swiping the pager manually.
By the way, Google recommends to hide the FAB, not swipe:
For tabbed screens, the floating action button should not exit the
screen in the same direction as the screen exits. Doing so creates
visual noise. It would also cause a nonfunctional floating action
button to appear on screen. Furthermore, it incorrectly implies that
the floating action button is at the same the z-level as the content,
rather than at the level of the primary UI elements at the root
level.
See: http://www.google.com/design/spec/components/buttons-floating-action-button.html#buttons-floating-action-button-behavior
If you want to show the FloatingActionButton only in the middle/single tab, then you can add the FAB in the Fragment instead of adding it in Activity in which all the Fragments are added.

How do i add swipe functionality to a button?

I want to show a button in a view.. If I swipe it left/right, I want to be able to get the next button.. How can I do it?
Each button represents an option of a menu..
Swiping should only work on the button.
The ViewPager class allows you to implement horizontal swiping through menu items. It can be set up to work on just on a small area of your Activity. You would use a fragment containing just a button in your case.
Take a look at this post on the Android Developers Blog for an example.

Swiping in order to call another Activity in Android

I want to make something like transitions between ViewControllers in iOS 7 but in Android, is it possible?
Explanation: please look at image below, I have main Activity which has ViewPager inside, so we can swipe between Fragments. I want to call another Activity (or Fragment) from each Fragment (blue on image) swiping to bottom or to top but this action should be done smoothly like in ViewPager.
You can intercept swipe up and down gestures and set items in viewpager accordingly. Please read this guide on how to intercept swipes in various directions.

Categories

Resources