forked from organicmaps/organicmaps-tmp
Styles modifications according to the new AppCompat lib.
This commit is contained in:
parent
5d53be0956
commit
409cfc559a
28 changed files with 153 additions and 128 deletions
|
@ -56,7 +56,7 @@
|
|||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/MwmTheme.Main">
|
||||
android:theme="@style/MwmTheme">
|
||||
|
||||
<meta-data
|
||||
android:name="com.facebook.sdk.ApplicationId"
|
||||
|
@ -69,8 +69,7 @@
|
|||
<activity
|
||||
android:name="com.mapswithme.maps.DownloadResourcesActivity"
|
||||
android:configChanges="orientation|screenLayout|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/MwmTheme.NoActionBar">
|
||||
android:label="@string/app_name">
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
|
@ -168,8 +167,7 @@
|
|||
<activity
|
||||
android:name="com.mapswithme.maps.MWMActivity"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/MwmTheme.NoActionBar">
|
||||
android:launchMode="singleTask">
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
|
@ -182,7 +180,7 @@
|
|||
android:name=".search.SearchActivity"
|
||||
android:configChanges="orientation|screenLayout|screenSize"
|
||||
android:label="@string/search_map"
|
||||
android:theme="@style/MwmTheme.Main.Search"
|
||||
android:theme="@style/MwmTheme.Search"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize">
|
||||
</activity>
|
||||
|
||||
|
@ -202,7 +200,7 @@
|
|||
android:name="com.mapswithme.maps.bookmarks.ChooseBookmarkCategoryActivity"
|
||||
android:configChanges="orientation|screenLayout|screenSize"
|
||||
android:label="@string/bookmark_sets"
|
||||
android:theme="@style/MwmTheme.Main.Light"
|
||||
android:theme="@style/MwmTheme.Light"
|
||||
android:windowSoftInputMode="stateUnspecified|adjustResize">
|
||||
</activity>
|
||||
|
||||
|
|
|
@ -160,7 +160,7 @@
|
|||
android:label="@string/search_map"
|
||||
android:noHistory="true"
|
||||
android:screenOrientation="behind"
|
||||
android:theme="@style/MwmTheme.Main.Search"
|
||||
android:theme="@style/MwmTheme.Search"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize" >
|
||||
</activity>
|
||||
<activity
|
||||
|
|
|
@ -18,7 +18,7 @@ apply plugin: 'com.android.application'
|
|||
|
||||
dependencies {
|
||||
// android support libs
|
||||
compile libSupportV4, libSupportV7
|
||||
compile libSupportV4, libSupportV7, libSupportCardView, libSupportRecyclerView
|
||||
// google play services
|
||||
compile libGmsLocation, libGmsPlus, libGmsAnalytics
|
||||
// 3-party
|
||||
|
|
|
@ -8,6 +8,8 @@ propReleaseNdkFlags=V=1 NDK_DEBUG=0 PRODUCTION=1
|
|||
|
||||
libSupportV4=com.android.support:support-v4:22.+
|
||||
libSupportV7=com.android.support:appcompat-v7:22.+
|
||||
libSupportCardView=com.android.support:cardview-v7:22.+
|
||||
libSupportRecyclerView=com.android.support:recyclerview-v7:22.+
|
||||
libGmsLocation=com.google.android.gms:play-services-location:7.0.0
|
||||
libGmsPlus=com.google.android.gms:play-services-plus:7.0.0
|
||||
libGmsAnalytics=com.google.android.gms:play-services-analytics:7.0.0
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 570 B After Width: | Height: | Size: 427 B |
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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="match_parent"
|
||||
android:background="@android:color/transparent"
|
||||
|
@ -11,8 +10,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:gravity="center_vertical"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
||||
app:theme="@style/MwmWidget.Toolbar">
|
||||
android:theme="@style/MwmWidget.Toolbar">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv__update_all"
|
||||
|
@ -29,7 +27,7 @@
|
|||
</android.support.v7.widget.Toolbar>
|
||||
|
||||
<FrameLayout
|
||||
style="@style/MwmWidget.Shadow.Light"
|
||||
style="@style/MwmWidget.FrameLayout.Elevation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
android:layout_height="?attr/actionBarSize"/>
|
||||
|
||||
<FrameLayout
|
||||
style="@style/MwmWidget.Shadow.Light"
|
||||
style="@style/MwmWidget.FrameLayout.Elevation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
|
|
@ -7,12 +7,10 @@
|
|||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:layout_gravity="center_vertical"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
||||
app:theme="@style/MwmWidget.Toolbar"/>
|
||||
android:theme="@style/MwmWidget.Toolbar"/>
|
||||
|
||||
<LinearLayout
|
||||
style="@style/MwmWidget.Shadow.Light"
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<include
|
||||
android:id="@+id/pp__preview"
|
||||
|
@ -37,8 +36,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="@color/text_green"
|
||||
android:visibility="gone"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
||||
app:theme="@style/MwmWidget.Toolbar"/>
|
||||
android:theme="@style/MwmWidget.Toolbar"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</merge>
|
16
android/res/layout/activity_fragment_and_toolbar.xml
Normal file
16
android/res/layout/activity_fragment_and_toolbar.xml
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
layout="@layout/toolbar_default"/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fragment_container"
|
||||
style="@style/MwmWidget.FrameLayout.Elevation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</LinearLayout>
|
|
@ -14,7 +14,7 @@
|
|||
android:id="@+id/tv__update_all"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical|right"
|
||||
android:layout_gravity="right"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingRight="@dimen/margin_small"
|
||||
android:text="@string/downloader_update_all"
|
||||
|
@ -23,8 +23,16 @@
|
|||
android:textSize="18sp"/>
|
||||
</android.support.v7.widget.Toolbar>
|
||||
|
||||
<ListView
|
||||
android:id="@android:id/list"
|
||||
<FrameLayout
|
||||
style="@style/MwmWidget.FrameLayout.Elevation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ListView
|
||||
android:id="@android:id/list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -11,10 +11,17 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<ListView
|
||||
android:id="@android:id/list"
|
||||
<FrameLayout
|
||||
style="@style/MwmWidget.FrameLayout.Elevation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:scrollbarStyle="outsideOverlay"/>
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ListView
|
||||
android:id="@android:id/list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:scrollbarStyle="outsideOverlay"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
7
android/res/layout/toolbar_default.xml
Normal file
7
android/res/layout/toolbar_default.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:theme="@style/MwmWidget.Toolbar"/>
|
|
@ -1,4 +1,5 @@
|
|||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<item android:id="@+id/set_delete" android:title="@string/delete"></item>
|
||||
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:id="@+id/set_delete"
|
||||
android:title="@string/delete"/>
|
||||
</menu>
|
4
android/res/menu/menu_bookmarks.xml
Normal file
4
android/res/menu/menu_bookmarks.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
|
||||
</menu>
|
|
@ -11,7 +11,8 @@
|
|||
|
||||
<style name="MwmWidget.Toolbar" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
|
||||
<item name="displayOptions">showHome|homeAsUp|showTitle</item>
|
||||
<item name="android:background">@drawable/ic_bg_toolbar</item>
|
||||
<!-- FIXME -->
|
||||
<item name="background">@drawable/ic_bg_toolbar</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
|
@ -1,29 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="MwmTheme.Main" parent="MwmTheme">
|
||||
<item name="clickableBackground">?android:attr/selectableItemBackground</item>
|
||||
<item name="android:fontFamily" tools:targetApi="jelly_bean">@string/robotoRegular</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmTheme.NoActionBar" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
|
||||
<item name="clickableBackground">?android:attr/selectableItemBackground</item>
|
||||
<item name="android:fontFamily" tools:targetApi="jelly_bean">@string/robotoRegular</item>
|
||||
<item name="android:listViewStyle">@style/MwmWidget.ListView</item>
|
||||
<item name="android:textViewStyle">@style/MwmWidget.TextView</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmTheme.Main.Search" parent="MwmTheme">
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:windowBackground">@color/semitransparent_black</item>
|
||||
<item name="android:colorBackgroundCacheHint">@null</item>
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowAnimationStyle">@android:style/Animation</item>
|
||||
<item name="clickableBackground">?android:attr/selectableItemBackground</item>
|
||||
</style>
|
||||
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<style name="MwmWidget.ListView" parent="android:Widget.Holo.ListView">
|
||||
<item name="android:fadingEdge">none</item>
|
||||
|
|
|
@ -16,4 +16,6 @@
|
|||
<item name="android:background">@android:color/transparent</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmWidget.FrameLayout.Elevation"/>
|
||||
|
||||
</resources>
|
|
@ -13,8 +13,19 @@
|
|||
<color name="text_green_hint">#421F9952</color>
|
||||
|
||||
<!-- base colors -->
|
||||
<color name="base_green">#1F9952</color>
|
||||
|
||||
<!-- green tints -->
|
||||
<color name="base_green">#209952</color>
|
||||
<color name="base_green_darker">#188044</color>
|
||||
<color name="base_green_darkest">#146636</color>
|
||||
<color name="base_green_light">#24B460</color>
|
||||
<color name="base_green_lightest">#28CC6C</color>
|
||||
<!-- black tints -->
|
||||
<color name="base_black">#DE000000</color>
|
||||
<color name="base_black_divider">#8A000000</color>
|
||||
<!-- other colors -->
|
||||
<color name="base_blue">#000000</color>
|
||||
<color name="base_red">#000000</color>
|
||||
<color name="base_yellow">#000000</color>
|
||||
|
||||
<!-- TODO change all colors below, remove old ones-->
|
||||
<color name="semitransparent_white">#99FFFFFF</color>
|
||||
|
|
|
@ -1,39 +1,24 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<resources xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="MwmTheme" parent="Theme.AppCompat.Light">
|
||||
<style name="MwmTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="colorPrimary">@color/base_green</item>
|
||||
<!-- 'theme' attribute for actionbar -->
|
||||
<item name="theme">@style/MwmWidget.Toolbar</item>
|
||||
<item name="android:displayOptions">homeAsUp|showHome|showTitle</item>
|
||||
<item name="displayOptions">homeAsUp|showHome|showTitle</item>
|
||||
<item name="android:homeAsUpIndicator">@drawable/ic_back</item>
|
||||
<item name="homeAsUpIndicator">@drawable/ic_back</item>
|
||||
<item name="clickableBackground">?attr/selectableItemBackground</item>
|
||||
<item name="android:listViewStyle">@style/MwmWidget.ListView</item>
|
||||
<item name="android:textViewStyle">@style/MwmWidget.TextView</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmTheme.Main">
|
||||
<item name="clickableBackground">@drawable/default_selector</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmTheme.NoActionBar" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
|
||||
<item name="clickableBackground">@drawable/default_selector</item>
|
||||
<item name="android:listViewStyle">@style/MwmWidget.ListView</item>
|
||||
<item name="android:textViewStyle">@style/MwmWidget.TextView</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmTheme.Main.Search">
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:windowBackground">@color/semitransparent_black</item>
|
||||
<item name="android:windowBackground">@android:color/white</item>
|
||||
<item name="android:colorBackgroundCacheHint">@null</item>
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowAnimationStyle">@android:style/Animation</item>
|
||||
<item name="android:fontFamily" tools:targetApi="jelly_bean">@string/robotoRegular</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmTheme.Main.Light">
|
||||
<style name="MwmTheme.Search">
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:colorBackgroundCacheHint">@null</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmTheme.Light">
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowFrame">@null</item>
|
||||
<item name="android:windowTitleStyle">@style/TextAppearance.AppCompat.Title</item>
|
||||
|
@ -76,7 +61,7 @@
|
|||
</style>
|
||||
|
||||
<style name="MwmWidget.DividerMediumPadded">
|
||||
<item name="android:layout_height">1px</item> ho
|
||||
<item name="android:layout_height">1px</item>
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_marginRight">0dp</item>
|
||||
<item name="android:layout_marginLeft">0dp</item>
|
||||
|
@ -84,11 +69,10 @@
|
|||
</style>
|
||||
|
||||
<style name="MwmWidget.Toolbar" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
|
||||
<item name="android:background">@color/base_green</item>
|
||||
<item name="android:displayOptions">homeAsUp|showHome|showTitle</item>
|
||||
<item name="displayOptions">homeAsUp|showHome|showTitle</item>
|
||||
<item name="android:homeAsUpIndicator">@drawable/ic_back</item>
|
||||
<item name="homeAsUpIndicator">@drawable/ic_back</item>
|
||||
<item name="android:background">?colorPrimary</item>
|
||||
<item name="android:elevation">4dp</item>
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
<item name="android:displayOptions">homeAsUp|showTitle</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmWidget.ListView" parent="android:Widget.ListView">
|
||||
|
@ -112,6 +96,12 @@
|
|||
<item name="android:textSize">@dimen/place_page_title_big</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmWidget.FrameLayout"/>
|
||||
|
||||
<style name="MwmWidget.FrameLayout.Elevation">
|
||||
<item name="android:foreground">@drawable/bottom_shadow</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmWidget.Shadow">
|
||||
<item name="android:paddingLeft">4dp</item>
|
||||
<item name="android:paddingRight">4dp</item>
|
||||
|
|
|
@ -6,11 +6,8 @@ import android.support.v4.app.FragmentTransaction;
|
|||
|
||||
import com.mapswithme.maps.base.BaseMwmFragmentActivity;
|
||||
|
||||
|
||||
public class DownloadActivity extends BaseMwmFragmentActivity
|
||||
{
|
||||
private DownloadFragment mDownloadFragment;
|
||||
|
||||
public static final String EXTRA_OPEN_DOWNLOADED_LIST = "open_downloaded";
|
||||
|
||||
@Override
|
||||
|
@ -18,11 +15,9 @@ public class DownloadActivity extends BaseMwmFragmentActivity
|
|||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
getSupportActionBar().hide();
|
||||
|
||||
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
|
||||
mDownloadFragment = (DownloadFragment) Fragment.instantiate(this, DownloadFragment.class.getName(), getIntent().getExtras());
|
||||
transaction.replace(android.R.id.content, mDownloadFragment, "fragment");
|
||||
DownloadFragment downloadFragment = (DownloadFragment) Fragment.instantiate(this, DownloadFragment.class.getName(), getIntent().getExtras());
|
||||
transaction.replace(android.R.id.content, downloadFragment, "fragment");
|
||||
transaction.commit();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,12 +2,13 @@ package com.mapswithme.maps.base;
|
|||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.MenuItem;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
|
||||
import com.mapswithme.maps.MWMApplication;
|
||||
import com.mapswithme.maps.R;
|
||||
import com.mapswithme.util.Utils;
|
||||
import com.mapswithme.util.statistics.Statistics;
|
||||
|
||||
|
@ -25,9 +26,6 @@ public class BaseMwmFragmentActivity extends AppCompatActivity
|
|||
super.onCreate(arg0);
|
||||
|
||||
MWMApplication.get().initStats();
|
||||
final ActionBar bar = getSupportActionBar();
|
||||
if (bar != null)
|
||||
bar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -72,4 +70,14 @@ public class BaseMwmFragmentActivity extends AppCompatActivity
|
|||
super.onPause();
|
||||
org.alohalytics.Statistics.logEvent("$onPause", this.getClass().getSimpleName());
|
||||
}
|
||||
|
||||
protected Toolbar getToolbar()
|
||||
{
|
||||
return (Toolbar) findViewById(R.id.toolbar);
|
||||
}
|
||||
|
||||
protected void displayToolbarAsActionBar()
|
||||
{
|
||||
setSupportActionBar(getToolbar());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,9 +3,11 @@ package com.mapswithme.maps.bookmarks;
|
|||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
|
||||
import com.mapswithme.maps.R;
|
||||
import com.mapswithme.maps.base.BaseMwmFragmentActivity;
|
||||
import com.mapswithme.util.UiUtils;
|
||||
|
||||
public class BookmarkCategoriesActivity extends BaseMwmFragmentActivity
|
||||
{
|
||||
|
@ -14,11 +16,16 @@ public class BookmarkCategoriesActivity extends BaseMwmFragmentActivity
|
|||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setTitle(getString(R.string.bookmarks));
|
||||
setContentView(R.layout.activity_fragment_and_toolbar);
|
||||
final Toolbar toolbar = getToolbar();
|
||||
toolbar.setTitle(R.string.bookmarks);
|
||||
toolbar.inflateMenu(R.menu.bookmark_categories_context_menu);
|
||||
UiUtils.showHomeUpButton(toolbar);
|
||||
displayToolbarAsActionBar();
|
||||
|
||||
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
|
||||
Fragment fragment = Fragment.instantiate(this, BookmarkCategoriesFragment.class.getName(), getIntent().getExtras());
|
||||
transaction.replace(android.R.id.content, fragment, "fragment");
|
||||
transaction.replace(R.id.fragment_container, fragment, "fragment");
|
||||
transaction.commit();
|
||||
}
|
||||
}
|
|
@ -3,9 +3,11 @@ package com.mapswithme.maps.bookmarks;
|
|||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
|
||||
import com.mapswithme.maps.R;
|
||||
import com.mapswithme.maps.base.BaseMwmFragmentActivity;
|
||||
|
||||
import com.mapswithme.util.UiUtils;
|
||||
|
||||
public class BookmarkListActivity extends BaseMwmFragmentActivity
|
||||
{
|
||||
|
@ -14,9 +16,15 @@ public class BookmarkListActivity extends BaseMwmFragmentActivity
|
|||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.activity_fragment_and_toolbar);
|
||||
final Toolbar toolbar = getToolbar();
|
||||
toolbar.setTitle(R.string.bookmarks);
|
||||
UiUtils.showHomeUpButton(toolbar);
|
||||
displayToolbarAsActionBar();
|
||||
|
||||
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
|
||||
Fragment fragment = Fragment.instantiate(this, BookmarksListFragment.class.getName(), getIntent().getExtras());
|
||||
transaction.replace(android.R.id.content, fragment, "fragment");
|
||||
transaction.replace(R.id.fragment_container, fragment, "fragment");
|
||||
transaction.commit();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,10 +2,10 @@ package com.mapswithme.maps.bookmarks;
|
|||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v7.app.ActionBarActivity;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
|
@ -41,6 +41,7 @@ public class BookmarksListFragment extends BaseMwmListFragment
|
|||
private int mSelectedPosition;
|
||||
private BookmarkListAdapter mPinAdapter;
|
||||
private int mIndex;
|
||||
private ActionBar mActionBar;
|
||||
|
||||
// Menu routines
|
||||
static final int ID_SEND_BY_EMAIL = 0x01;
|
||||
|
@ -61,6 +62,8 @@ public class BookmarksListFragment extends BaseMwmListFragment
|
|||
createListAdapter();
|
||||
registerForContextMenu(getListView());
|
||||
setHasOptionsMenu(true);
|
||||
if (getActivity() instanceof AppCompatActivity)
|
||||
mActionBar = ((AppCompatActivity) getActivity()).getSupportActionBar();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -120,10 +123,10 @@ public class BookmarksListFragment extends BaseMwmListFragment
|
|||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count)
|
||||
{
|
||||
((ActionBarActivity) getActivity()).getSupportActionBar().setTitle(s.toString());
|
||||
|
||||
// Note! Do not set actual name here - saving process may be too long
|
||||
// see assignCategoryParams() instead.
|
||||
if (mActionBar != null)
|
||||
mActionBar.setTitle(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -265,14 +268,7 @@ public class BookmarksListFragment extends BaseMwmListFragment
|
|||
@Override
|
||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
|
||||
{
|
||||
final MenuItem menuItem = menu.add(Menu.NONE,
|
||||
ID_SEND_BY_EMAIL,
|
||||
ID_SEND_BY_EMAIL,
|
||||
R.string.share_by_email);
|
||||
|
||||
menuItem.setIcon(R.drawable.ic_share_bookmark);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
|
||||
menuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
||||
//
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -22,8 +22,6 @@ public class ChooseBookmarkCategoryActivity extends BaseMwmFragmentActivity
|
|||
{
|
||||
super.onCreate(arg0);
|
||||
|
||||
getSupportActionBar().hide();
|
||||
|
||||
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
|
||||
Fragment fragment = Fragment.instantiate(this, ChooseBookmarkCategoryFragment.class.getName(), getIntent().getExtras());
|
||||
transaction.replace(android.R.id.content, fragment, "fragment");
|
||||
|
|
|
@ -8,7 +8,6 @@ import android.support.v4.app.FragmentTransaction;
|
|||
|
||||
import com.mapswithme.maps.base.BaseMwmFragmentActivity;
|
||||
|
||||
|
||||
public class SearchActivity extends BaseMwmFragmentActivity
|
||||
{
|
||||
public static final String EXTRA_QUERY = "search_query";
|
||||
|
@ -18,8 +17,6 @@ public class SearchActivity extends BaseMwmFragmentActivity
|
|||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
getSupportActionBar().hide();
|
||||
|
||||
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
|
||||
Fragment fragment = Fragment.instantiate(this, SearchFragment.class.getName(), getIntent().getExtras());
|
||||
transaction.replace(android.R.id.content, fragment, "fragment");
|
||||
|
@ -39,5 +36,4 @@ public class SearchActivity extends BaseMwmFragmentActivity
|
|||
i.putExtra(EXTRA_QUERY, query);
|
||||
context.startActivity(i);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ public class StoragePathActivity extends BaseMwmFragmentActivity
|
|||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setTitle(getString(R.string.maps_storage));
|
||||
getToolbar().setTitle(R.string.maps_storage);
|
||||
|
||||
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
|
||||
Fragment fragment = Fragment.instantiate(this, StoragePathFragment.class.getName(), getIntent().getExtras());
|
||||
|
|
Loading…
Add table
Reference in a new issue