Large header/toolbar above tabs - android

I've followed this tutorial exactly to get myself a toolbar and tabs:
https://guides.codepath.com/android/Google-Play-Style-Tabs-using-TabLayout
However, I now want to change the toolbar so it looks more like this (taken from Google's guidelines):
http://i.imgur.com/qQrhGeL.png
I want to be able to add more text (and possibly an image) into the toolbar/header. How can I modify the code in the tutorial to do this?

You can use CollapsingToolbar and import another view to add more text or etc. You can find an example from here:
https://github.com/chrisbanes/cheesesquare/blob/master/app/src/main/res/layout/activity_detail.xml#L32
You make constant while scolling, do not use behavior attribute:
app:layout_behavior="#string/appbar_scrolling_view_behavior

Related

Material Design TextInputLayout With An Attached Dropdown?

Is there a Material component that will easily let me set the left of a TextInputEditText to be a dropdown like this image below? If not, I can create something, but wanted to see if anyone knew more about Material components before I start doing too much custom work. Looks custom to me, though.
With material component, Google has removed spinner from its UI Elements.
Preferred way to do it is TextInputLayout along with AutoCompleteTextView just like Ashu has mentioned in the comment section.
Here is a more thorough article, which can help you in implementing AutoCompleteTextView.
https://blog.usejournal.com/there-is-no-material-design-spinner-for-android-3261b7c77da8
So far, both answers say to use AutoCompleteTextView. However, that doesn't answer my question. As you can see in the image I posted with the question, only the left side is a drop down. The right side is just a normal text input that isn't affected by the drop down.
However, I think it is safe to assume there isn't a component that will do this for me easily and that it would indeed be custom work to make these two components appear to be one single component.

Sliding TabLayout Always in Center

Hello first of all i'm a newbie for the libraries stuff.
I found a Demo Project on Github here but it contains more than i need
I want this like Slider
Image
I have optimized it but its not working. So someone here, please take a look and guide me
Or any other stuff by which i can make that like layout?
Need to use padding for SlidingTabStrip. TabLayout has only app:tabContatentStart property, but you need to set both sides for this behavior.
Look here: https://stackoverflow.com/a/36886331/651770

Android multistep welcome screen (tutorial for using the app)

How to implement those popular welcome guides, where you have:
3-5 slides (with those little dots indicating the process), in the end button with something like "got it" (take me to the app & never show again).
Here is example (Walkthroughs with Twine):
https://ux.stackexchange.com/questions/50723/android-multi-step-wizard-examples
A simple ViewPager and multiple contained View's or Fragments will help you achieve this. For the indicator you can use ViewPagerIndicator.
you can simply use ViewPager here is a good library will help you to implement that:
https://github.com/JakeWharton/ViewPagerIndicator
or you can use a horizontal GridViews and set its column to 1 or using tabs and here is a library for horizontal gridView :
https://github.com/jess-anders/two-way-gridview

How to show multiple TextView 'inline' layout in Android?

For e.g. I want to show tags to some article (just like we have tags attached with each question on StackOverflow), I would like to show them like this:
Where the tags can be of variable length and they should span across multiple lines if they can't fit in the given width. I tried out LinearLayout and RelativeLayout but they don't seem to be able handle such 'auto' arrangement scenario. What layout or methodology should I use to achieve this effect?
This requirement is known as FlowLayout and I found couple of solutions as open source libraries to achieve this effect:
ApmeM/android-flowlayout
blazsolar/FlowLayout

set two titles?

I can setTitle("My Title"), but what I'm looking to do is set two titles... one on the left side and one on the right. How might I do that?
I currently have 2 textviews, aligned parent left and right... the textappearance is changed. But I'm hoping to get that into the titlebar using code so I don't have to use some background to simulate the titlebar.
You can define a custom view layout and tell the system to use it with:
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.text_title);
You can make your title view a RelativeLayout with two children positioned as you like. This should be done in onCreate() before calling setContentView(). See this thread for more discussion of using a custom view.
I don't think you can...I think Android only allows one title...but what you could do is
setTitle("My Title left My title right");
It's more than a little bit of a hack but it might work.
Full disclosure: haven't tried it.
Look at this tutorial for skinning / theming your titlebar
If you look at the Bluetooth Chat example on the Android Resources page, here, you'll see that it has exactly that sort of format. Details on how to access it are included there. It contains an XML edit and a few other simple modifications in your initialization code.
I'm playing around with some files right now to try and create this dual title bar.
It looks like this post would be helpful: my_own_titlebar_backbutton_like_on_the_iphone.
The comment written on this post at Thu Jan 29, 2009 5:55 pm contains the sample files, title1.zip, a second source file, title2.zip is a few comments below that one as well.

Categories

Resources