blob: 6c5a9d96bf804f4e7da7a83f14efc1d3d5da25f9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
package com.mapswithme.maps.base;
import android.os.Bundle;
import androidx.annotation.CallSuper;
import androidx.appcompat.widget.Toolbar;
import com.mapswithme.maps.R;
import com.mapswithme.util.UiUtils;
public abstract class BaseMwmExtraTitleActivity extends BaseMwmFragmentActivity
{
protected static final String EXTRA_TITLE = "activity_title";
@Override
@CallSuper
protected void onSafeCreate(Bundle savedInstanceState)
{
super.onSafeCreate(savedInstanceState);
String title = "";
Bundle bundle = getIntent().getExtras();
if (bundle != null)
{
title = bundle.getString(EXTRA_TITLE);
}
Toolbar toolbar = getToolbar();
UiUtils.extendViewWithStatusBar(toolbar);
toolbar.setTitle(title);
UiUtils.showHomeUpButton(toolbar);
displayToolbarAsActionBar();
}
@Override
protected int getContentLayoutResId()
{
return R.layout.activity_fragment_and_toolbar;
}
@Override
protected int getFragmentContentResId()
{
return R.id.fragment_container;
}
}
|