The official Twitter client for Android has a nice toolbar when you click on a message that lets you retweet, reply, etc. How can I re-create a toolbar like that?
In Android applications, Toolbar is a kind of ViewGroup that can be placed in the XML layouts of an activity.
You can similarity assign to Main Menu-> View-> Toolbar and show toolbar again on Android studio IDE. Alternatively, after the main menu opened, click VIEW-> Toolbar tab. Save this answer. Show activity on this post.
What is the difference between the toolbar and the action bar? The most obvious difference between the two is the updated visual design of the toolbar. The toolbar no longer includes an icon on the left side and decreases some of the spacing between the action items on the right side.
For the LinearLayout approach, the code is simple, just add some weights and play around with what your looking for. This gives you a rough idea of the approach:
<EditText android:text="Example Layout"
android:layout_width="match_parent"
android:id="@+id/editText"
android:layout_height="wrap_content"
android:layout_weight="0.95"></EditText>
<LinearLayout
android:layout_width="fill_parent"
android:orientation="horizontal"
android:weightSum="1.0"
android:padding="1px"
android:layout_height="wrap_content"
android:layout_weight="0.05">
<ImageButton android:id="@+id/testButton1"
android:layout_weight="0.2"
android:background="@drawable/btn"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
<ImageButton android:id="@+id/testButton2"
android:layout_weight="0.2"
android:background="@drawable/btn"
android:layout_height="wrap_content"
android:layout_width="wrap_content" />
<ImageButton android:id="@+id/testButton3"
android:layout_weight="0.2"
android:background="@drawable/btn"
android:layout_height="wrap_content"
android:layout_width="wrap_content" />
<ImageButton android:id="@+id/testButton4"
android:layout_weight="0.2"
android:background="@drawable/btn"
android:layout_height="wrap_content"
android:layout_width="wrap_content" />
<ImageButton android:id="@+id/testButton5"
android:layout_weight="0.2"
android:background="@drawable/btn"
android:layout_height="wrap_content"
android:layout_width="wrap_content" />
</LinearLayout>
And results in something like this: http://i.stack.imgur.com/bShgb.png
You may also be happy with ActionBar as well, just watch the API requirements: http://developer.android.com/guide/topics/ui/actionbar.html
We call it QuickAction:
Find more about how to implement it here: http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With