How to change textview dynamically in the slide menu? - java

Is it possible to add textview to slide menu and change it dynamicly?

If you talk about the NavigationDrawer, it is just a ListView so It is easy to change one of the items dynamically.
See Creating a Navigation Drawer and How to refresh ListView.

Related

Android. How to show 2 items in recycler view and then add one item on every button click

I want to show 2 items by default and add items in recycler view when we click button in main activity. Those item contains edittext so I have to get the data from edittext in my main activity.
Basically you have to create two different ViewType/Layouts to implement this.
Sharing related links below..
https://www.geeksforgeeks.org/how-to-create-recyclerview-with-multiple-viewtype-in-android/
How to create RecyclerView with multiple view types
For adding items to Recycler view when you click in a button you should add the item in the list and notify adapter that new item added at the end of the recyclerview using notifyItemInserted()
and for the other question for getting the edittext value from the adapter to the activity you can create a callback interface that implemented in the activity and pass the reference to the adapter and fire it from adapter when Edittext value is changed

Android Dev: Navigation View vs App Bar

I'm new to Android development. I get that a NavigationView is an AppBar (i think). What makes these two different? I want to create a custom "appbar/toolbar" with a centered logo and menu/settings button in the top right corner (instead of the standard left) which reveals a drawer.
I was going to ditch the built in appbar/toolbar all together and just create my own somehow and include button overlay which displays a drawer.
What would you do? Navigation view, app bar, or custom toolbar from scratch? I don't know what the standard is or what is acceptable. What is the difference between a navigationview and appbar. Thank you.
edit: I'm slowing realizing that an appbar is one feature within a navigation view, among others like a drawer layout, menu items etc... i think.
1. NavigationView
By using NavigationView, we can bind the menu directly with NavigationView. This is the benefit of the NavigationView. No need to create ListView and adapter with navigation drawer. By default we can get selector of item click. With menu we can change the color of icon of selected menu.
For more details :
1.https://developer.android.com/reference/android/support/design/widget/NavigationView.html
http://www.technotalkative.com/part-4-playing-with-navigationview/
2. AppBar
Appbar is for toolbar with scrolling effect. We can easily give the material design effect.
For more details :
1.https://developer.android.com/reference/android/support/design/widget/AppBarLayout.html

Showing pagerSlidingTabStrip on the layout without viewPagerAdapter on Android 5.0+

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

Android - Submenu items in BottomBar?

I'm trying to add a submenu to the Android BottomBar, similar to this except the submenu should show after clicking a BottomBar icon.
I was able to get the BottomBar working, just looking for a simple submenu example. I basically want the user to click "Color" on the BottomBar and have a list of colors appear. After selecting, an ImageView tint will change based on selection.
I ended up abandoning BottomBar and using a row of plain Buttons with ListViews for pop-up menus. Much more control and better suited for my scenario.

ImageView Onclick Animation

Below is a picture of my app, I am currently using a modified version of this app to show my expandable content. Now my problem is with my ImageView, I currently have 3 layouts, one for the main dialog (with listview), one for the listview title & arrow and one for the item details (item row once expanded). I want to add animation to the ImageView so when you click the image or title textview, the list will expand and animate the change. How can I do this? I cannot get the onClick to work because it doesn't know there are 2 imageviews, it seens only one...
I will assume that your ImageView is this arrow inside your ListView element (because you didn't write it clearly enough).
You probably shouldnt try to attach onClickListener to your ImageView at all (nor to your ListView element title). The good way of implementing what you want you achieve would be to use ListView's onItemClickListener to detect clicks performed on specific items inside your listview, and then expanding appropriate expandable content.

Categories

Resources