Showing pagerSlidingTabStrip on the layout without viewPagerAdapter on Android 5.0+ - java

I would like to develop an android app's UI looks like the Uber's but booking rooms.
I want to implement the function about showing the option's description, from users who are clicking the PagerSlidingTabStrip items which shown on the bottom. The fragment page will be shown when the user click the fragment tab (PagerSlidingTabStrip), also the chosen option will be selected.
I feel puzzled and confused when I am implementing this function, and concern the pagerSlidingTabStrip can trigger events by setOnClickListner or not. Also I don't willing to show the fragment page on the main page once users logged on the page by default.
Thank you.

Its better if you use TabLayout instead of PagerSlidingTabStrip
That will help you to get click of the Tab selected as well as reselected and on that click event you can hide and show your Bottom Views which holding fragments

Related

adding items from recyclerview into activity's textView

in the beginning i want to apologize for my bad english but im currently working on an application, i have 2 firebase tables (propertys and tennants) sorted by the logged user (doesn't even matter for my problem). So i have 2 possibilities in the navigation drawer, i can add and view propertys, view is enabled in the recyclerview, adding is done by fab button, both RV and fab are in an fragment, same goes with tennants. I can click on each of items and view all the details about them in an activity, so what i want is when i click on an property item and it opens activity where my property details are, i have a button that should add tennats to that specific property and list them in that activity (property details). You guys got any solution? I tried onClick of that button to open tennants recyclerview and select multiple items and then onBackPressed to try to save them but i simply cannot get it working, then i tried with alertCustomDialog where it should list all the tennants (part that iam not able to do) and with checkboxes select tenants that i want to, please if anyone can help or has some clue how to do this, please HELP! :=)

What is the best way to create pages(about/my home/references tabs) as in the image below?

I just started learning Android programming. I've created a page and I want to create "About/My Home/References" tabs in the image below.
The "About/My Home/References" tabs (you can see them in the link below) all act like a button. When I click the "About" tab, I can see the things about the users. When I click the "My Home" tab, I can see the some text about my home. The third tab also does the same thing.
Image link: https://imgyukle.com/i/4LgQH
My question is how can I do this in Android Studio? I've added three button but it doesn't look like that. Any idea?
You can use TabLayout with TabItems widgets. Visit, for example, https://material.io/develop/android/components/tab-layout/ for short overview and https://www.codingdemos.com/android-tablayout-example-viewpager/ as step-by-step manual.
For that layout, you want to use Fragments and a ViewPager with a TabLayout.
Your main Activity would contain 3 Fragments, AboutFragment, HomeFragment and ReferencesFragment.
This would allow you to build each layout separately. The ViewPager would contain the Fragment, and lets you swipe between them. The TabLayout contains your buttons, to tell the ViewPager which to show.

How do I create simple two page Android swipe app in Android Studio

I want to create a tabbed activity or empty activity in Android Studio, but I need to be able to swipe to a page 2.
All I would like is for the app to say the standard "Hello World" on the 1st screen, and then you can swipe to the next page that says "Hello World Page 2", Just those 2 screens with no title bar on any of the screens - that's it.
I've tried creating a tabbed activity and was able to create both pages and swipe works, but it creates a button in the lower right corner and a title bar with settings button up top that I couldn't figure out how to delete.
I tried an empty activity but couldn't figure out how to add another page. If anyone could provide me the code or a sample project I could edit that would be amazing as I've lost several days in frustration over this.
You can use ViewPager component. When you will use it you would to use TabLayout, but if you want to hide it you just simply can edit its visibility.
You Can try this Example.
https://www.sitepoint.com/using-viewpager-to-create-a-sliding-screen-ui-in-android/
Simply replace the image with TextView.
To hide the actionbar user getSupportActionBar().hide()

Navigation Drawer app behaivour when open fragments

Im working with a Android app that uses Navigation Drawer. This app use the template provided with Eclipse ADT (when you select the navigation drawer template).
I dont understand the behaivour of the navigation drawer very well.
My main requeriment is make a "search" option, I have on the Navigation Drawer a EditText to get the query string from the user. I want that I press search button and open my SearchFragment getting the search query.
I know that I can make this:
Bundle args = new Bundle();
args.putString("searchQuery",searchQuery);
fragment.setArguments(args);
And this for getting:
getArguments().getString("searchQuery");
But I have the next:
MainActivity
NavigationDrawerFragment
SearchFragment
OtherFragments.. (I think this arent relevant in the question)
I dont understand where I can make this steps.
More data:
I have in the navigation drawer class the EditText with the setOnEditorActionListener for the search press.
Any info that I can add I will be add. Sorry my english
Thanks for the help
Navigation drawer is basically a component that show 2 pane in the way that one is the main pane (usually fragment) that is used to show content and the other one is usually a listview that is just used to choose which fragment to show in main pane
so if you want to switch between 2 different layouts you have to create 2 different fragments and then you can add or replace these fragments based on listview's selected item.
You may refer to below link for complete code
http://developer.android.com/training/implementing-navigation/nav-drawer.html
Hope it helps!

Android activity navigation

I'm developing an app, where there is the main activity, it display some content (texts, images, etc), and a translucent menu on top of it. In this menu, I got link to other "screens" (implemented as Activities), on clicking it, I get correctly to the new activity, but the "activity changing animation" of the device blinks and then get me to the new activity.
I would like to make the navigation experience to be seamless on navigate through the screens, keeping my menu always on top of it. Today, this menu is implemented as a custom view (extending a Linear layout), also this menu will be expandable and collapsible, so the way it is I have to store the menu state through the activities.
PS: The way I've thought was to keep always two running activities, one for the current screen and another one for the menu, keep the menu on top, and just change the activity behind it. But could not find a way to do this...
PPS: Developing for Android 2.1
Anyone got an idea?
You should take a look at Fragments, or try to keep all functionality in one activity, changing only the content view.

Categories

Resources