Skip to content

Instantly share code, notes, and snippets.

@xanderblinov
Created November 28, 2016 11:38
Show Gist options
  • Save xanderblinov/93abf13f50090da982ed3c4df1c2c8b5 to your computer and use it in GitHub Desktop.
Save xanderblinov/93abf13f50090da982ed3c4df1c2c8b5 to your computer and use it in GitHub Desktop.
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() }
}
<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>
<?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