Scrolling in ActionBar title-android - android

How can I create an Actionbar title with scrolling where clicking on a particular title item moves to the corresponding page?
You can see this functionality in Google Drive app in android mobile phones:

You could create a custom actionBar with a textView for the title that has:
android:scrollHorizontally="true"
That should get the desired effect.

I have created a library called Veni Divi that provides you with a custom action bar title that behaves like the one from Google Drive app.
In case someone needs this functionality, the source is available on GitHub.
You may see a demo app on Google Play.

Related

Alternative for missing app bar in Android TV

I just notice that my Android app, when I run it on
Android TV with leanback intent, that it doesn't
show a sandwich button for the menu items.
This is missing, and everthing else like the title:
What is the suggested alternative? Is it possible
to listen to a button on the remote control and
make the menu items visible?
Incase you are looking for tab based navigation, The Leanback templates provide side navigation in the browse experience, which works well for many apps. If you need tab navigation (typically displayed horizontally across the top of the app), you can instead use Leanback Tabs.
Add the library to your project:
implementation "androidx.leanback:leanback-tab:$version"
Sample code
val leanbackTabLayout = findViewById<LeanbackTabLayout>(R.id.tab_layout)
val leanbackViewPager = findViewById<LeanbackViewPager>(R.id.view_pager)
leanbackViewPager.setAdapter(adapter)
leanbackTabLayout.setupWithViewPager(leanbackViewPager)
Then implement tabs using LeanbackTabLayout and LeanbackViewPager by following the existing ViewPager guide. Note that LeanbackViewPager is based on ViewPager, not ViewPager2.
Note that only themes that are derived from Theme.AppCompat are supported.

How to get the Google Now searchbar into my app?

Google has just implemented their searchbar from Google Now into the play store application as you can see in the gif below.
How can I implement this actionbar searchbar into my own app?
I'd like to have the
style
hamburger animation
acess from toolbar button
microphone button
ripple effect on lollipop devices
What I already have is
the layout for a list item
the "old" searchview inside the actionbar
Any ideas? thanks in advance
I created this library to do this, the only thing it does not do is the ripples, but I expect you could implement them quite easily with other resources:
https://github.com/Quinny898/PersistentSearch
Here's a gif of its use:
for that you need to use material search bar.
Below is link for github.
Please download code.
https://github.com/ManuelPeinado/GlassActionBar
https://github.com/ManuelPeinado/GlassActionBar/tree/master/samples-stock
And modify this code as you want.
it will help.

Sliding Layout in Android

I want to put settings in left side of screen.
There will be switcher, listviews and textviews.
In result I need like this example:
Is it possible and how I can start with?
You can use Sliding Menu Library to give such effect...
You can get the code from here.
You can also refer this link.
It's possible, and you can implement it using the Navigation Drawer which comes with android support library.
You must check out the Ribbon Menu
1) What's the Purpose
Ease of Access: Allow easy access to a menu that slides in and out
Ease of Implementation: Update the same screen using minimal amount of code
Independency: Does not require support libraries such as ActionBarSherlock
Customization: Easy to change colors and menus
2)What's New
Changed the sliding animation to match Facebook and Google+ apps
Added standard ActionBar (you can chose to use ActionBarSherlock)
Used menuitem to open the Menu
Added ability to update ListView on main Activity
Added 2 ListViews to the Menu, similiar to Facebook and Google+ apps
Added a AutoCompleteTextView and a Button as well to show examples of implemenation
Added method to allow users to hit the 'back button' to hide the menu when it is open
Allows users to interact with background(main ListView) and the menu at the same time unlike the Facebook and Google+ apps!
OR
You can also try out with Sliding Menu
You have to add one library file slider.jar into your project and follow this example for the same :
http://www.oodlestechnologies.com/blogs/Facebook-Style-Slide-Menu-In-Android

In Android, how can I display an overflow like menu when button is clicked?

I am working on an android app and I want to make a button display a certain menu when clicked. For example, the google play music app has a overflow icon next to each icon, and when clicked, you are presented with a list of choices. How can i accomplish something liks that? http://i.stack.imgur.com/TZ3fU.png
Android Developer Guide has a tutorial:
http://developer.android.com/guide/topics/ui/menus.html#FloatingContextMenu
Also, given the situation, you might want this:
http://developer.android.com/guide/topics/ui/menus.html#PopupMenu
You can also use the Spinner widget. In case you are using Sherlock, you can use
If you want it backported you can use the v7 version of popupmenu
https://developer.android.com/reference/android/support/v7/widget/PopupMenu.html

Android Actionbar

I have a pretty simple question about the Android ActionBar... is this intended to be present in the app, to use as a sort of header, or is it only intended to show when the user hits the setting button on the device?
I'm trying to implement a menu that is always present in the app, like a logo for branding, and some other actions, like a search icon and perhaps a map icon to see the map functionality. Any suggestions? Also see this post here
The ActionBar is always displayed. Check out the Android Developer Site for more information on the ActionBar UI patterns and usage.
You can use the excellent ActionBarSherlock library to provide an ActionBar on 2.x devices.
The ActionBar sounds perfect for the branding/icons you want. You would use your logo as the icon, and then have Action Items for Search and Map functionality.
Have you put your android:targetSdkVersion to 11 or more ? ActionBar is available only for Honeycomb and ICS :)

Categories

Resources