Created
November 28, 2016 11:38
-
-
Save xanderblinov/c02621eede764d1371b118efbd0603bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_address_search_manual) | |
val address = intent.getSerializableExtra(KEY_BUNDLE_ADDRESS) as Address? | |
getPresenter().init(address, intent.getBooleanExtra(KEY_BUNDLE_WAITING_FOR_RESULT, false)) | |
initViews() | |
} | |
private fun initViews() { | |
// Toolbar | |
view_toolbar_text_view_title.text = getString(R.string.activity_address_search_manual_title) | |
view_toolbar_button_menu.state = MaterialMenuDrawable.IconState.ARROW | |
view_toolbar_button_menu.setOnClickListener { onBackPressed() } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style name="CustomToolbar"> | |
<item name="android:layout_width">match_parent</item> | |
<item name="android:layout_height">?attr/actionBarSize</item> | |
<item name="android:contentInsetStart">0dp</item> | |
<item name="contentInsetStart">0dp</item> | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.design.widget.AppBarLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:background="@color/green"> | |
<android.support.v7.widget.Toolbar | |
android:id="@+id/view_toolbar" | |
style="@style/CustomToolbar"> | |
<com.redmadrobot.material_menu.MaterialMenuView | |
android:id="@+id/view_toolbar_button_menu" | |
style="@style/BackButton" | |
android:background="?selectableItemBackgroundBorderless" | |
app:mm_color="@color/white" /> | |
<com.redmadrobot.core.ui.view.fontview.FontTextView | |
android:id="@+id/view_toolbar_text_view_title" | |
style="@style/A3" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:lines="1" | |
android:ellipsize="end" | |
android:layout_gravity="center_vertical" | |
android:layout_margin="@dimen/default_margin_half" | |
android:text="@string/app_name" | |
android:textColor="@color/white" /> | |
</android.support.v7.widget.Toolbar> | |
</android.support.design.widget.AppBarLayout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
toolbar с https://github.com/balysv/material-menu