forked from organicmaps/organicmaps
[android] Added Discovery activity skeleton
This commit is contained in:
parent
82377de891
commit
2dc84e195d
8 changed files with 176 additions and 2 deletions
|
@ -362,7 +362,6 @@
|
|||
android:value="com.mapswithme.maps.MwmActivity"/>
|
||||
</activity>
|
||||
|
||||
<!-- ugc -->
|
||||
<activity
|
||||
android:name=".ugc.UGCEditorActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
|
@ -373,6 +372,15 @@
|
|||
android:value="com.mapswithme.maps.MwmActivity"/>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".discovery.DiscoveryActivity"
|
||||
android:parentActivityName=".MwmActivity">
|
||||
<!-- The meta-data element is needed for versions lower than 4.1 -->
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="com.mapswithme.maps.MwmActivity"/>
|
||||
</activity>
|
||||
|
||||
<!-- facebook -->
|
||||
<activity
|
||||
android:name="com.facebook.FacebookActivity"
|
||||
|
|
101
android/res/layout/fragment_discovery.xml
Normal file
101
android/res/layout/fragment_discovery.xml
Normal file
|
@ -0,0 +1,101 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v4.widget.NestedScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/MwmWidget.ToolbarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:theme="@style/MwmWidget.ToolbarTheme"/>
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/height_block_base"
|
||||
android:paddingLeft="@dimen/margin_base"
|
||||
android:paddingRight="@dimen/margin_base">
|
||||
<TextView
|
||||
android:id="@+id/thingsToDoTitle"
|
||||
android:textAppearance="@style/MwmTextAppearance.Discovery.Subtitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_marginRight="@dimen/margin_half"
|
||||
android:layout_marginEnd="@dimen/margin_half"
|
||||
android:layout_toLeftOf="@+id/viatorLogo"
|
||||
android:layout_toStartOf="@+id/viatorLogo"
|
||||
android:text="@string/discover_button_subtitle1"/>
|
||||
<ImageView
|
||||
android:id="@id/viatorLogo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/margin_half"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:src="?viatorLogo"
|
||||
android:background="?clickableBackground"/>
|
||||
</RelativeLayout>
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/thingsToDo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/margin_base_plus"
|
||||
tools:listitem="@layout/item_viator_product"/>
|
||||
<TextView
|
||||
android:id="@+id/attractionsTitle"
|
||||
android:text="@string/discover_button_subtitle2"
|
||||
android:textAppearance="@style/MwmTextAppearance.Discovery.Subtitle"
|
||||
android:layout_marginLeft="@dimen/margin_base"
|
||||
android:layout_marginStart="@dimen/margin_base"
|
||||
android:layout_marginRight="@dimen/margin_base"
|
||||
android:layout_marginEnd="@dimen/margin_base"
|
||||
android:layout_gravity="start"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/attractions"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/margin_base_plus"/>
|
||||
<TextView
|
||||
android:id="@+id/eatAndDrinkTitle"
|
||||
android:text="@string/discover_button_subtitle3"
|
||||
android:textAppearance="@style/MwmTextAppearance.Discovery.Subtitle"
|
||||
android:layout_marginLeft="@dimen/margin_base"
|
||||
android:layout_marginStart="@dimen/margin_base"
|
||||
android:layout_marginRight="@dimen/margin_base"
|
||||
android:layout_marginEnd="@dimen/margin_base"
|
||||
android:layout_gravity="start"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/food"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/margin_base_plus"/>
|
||||
<TextView
|
||||
android:id="@+id/localGuidesTitle"
|
||||
android:text="@string/discover_button_subtitle4"
|
||||
android:textAppearance="@style/MwmTextAppearance.Discovery.Subtitle"
|
||||
android:layout_marginLeft="@dimen/margin_base"
|
||||
android:layout_marginStart="@dimen/margin_base"
|
||||
android:layout_marginRight="@dimen/margin_base"
|
||||
android:layout_marginEnd="@dimen/margin_base"
|
||||
android:layout_gravity="start"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/localGuides"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
</android.support.v4.widget.NestedScrollView>
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
android:layout_weight="1"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/discover"
|
||||
android:id="@+id/discovery"
|
||||
style="@style/MwmTheme.Menu.Line.Button"
|
||||
android:src="@drawable/ic_menu_discovery"
|
||||
android:tag="@string/tag_menu_collapse"/>
|
||||
|
|
|
@ -191,4 +191,11 @@
|
|||
<style name="MwmTextAppearance.Tab" parent="MwmTextAppearance.Body4">
|
||||
<item name="android:textAllCaps">true</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmTextAppearance.Discovery.Subtitle" parent="MwmTextAppearance.Body3">
|
||||
<item name="android:fontFamily" tools:targetApi="jelly_bean">@string/robotoMedium</item>
|
||||
<item name="android:textAllCaps">true</item>
|
||||
<item name="android:ellipsize">end</item>
|
||||
<item name="android:maxLines">2</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
|
@ -43,6 +43,7 @@ import com.mapswithme.maps.bookmarks.BookmarkCategoriesActivity;
|
|||
import com.mapswithme.maps.bookmarks.data.BookmarkManager;
|
||||
import com.mapswithme.maps.bookmarks.data.FeatureId;
|
||||
import com.mapswithme.maps.bookmarks.data.MapObject;
|
||||
import com.mapswithme.maps.discovery.DiscoveryActivity;
|
||||
import com.mapswithme.maps.downloader.DownloaderActivity;
|
||||
import com.mapswithme.maps.downloader.DownloaderFragment;
|
||||
import com.mapswithme.maps.downloader.MapManager;
|
||||
|
@ -845,6 +846,10 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
null /* endPoint */, false /* canUseMyPositionAsStart */);
|
||||
break;
|
||||
|
||||
case DISCOVERY:
|
||||
DiscoveryActivity.start(MwmActivity.this);
|
||||
break;
|
||||
|
||||
case BOOKMARKS:
|
||||
closeMenu(Statistics.EventName.TOOLBAR_BOOKMARKS, AlohaHelper.TOOLBAR_BOOKMARKS, new Runnable()
|
||||
{
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
package com.mapswithme.maps.discovery;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.Fragment;
|
||||
|
||||
import com.mapswithme.maps.base.BaseMwmFragmentActivity;
|
||||
|
||||
public class DiscoveryActivity extends BaseMwmFragmentActivity
|
||||
{
|
||||
public static void start(@NonNull Activity activity)
|
||||
{
|
||||
final Intent i = new Intent(activity, DiscoveryActivity.class);
|
||||
activity.startActivity(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<? extends Fragment> getFragmentClass()
|
||||
{
|
||||
return DiscoveryFragment.class;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package com.mapswithme.maps.discovery;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.mapswithme.maps.R;
|
||||
import com.mapswithme.maps.base.BaseMwmToolbarFragment;
|
||||
|
||||
public class DiscoveryFragment extends BaseMwmToolbarFragment
|
||||
{
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
|
||||
{
|
||||
return inflater.inflate(R.layout.fragment_discovery, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState)
|
||||
{
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
mToolbarController.setTitle(R.string.discover_button_title);
|
||||
}
|
||||
}
|
|
@ -126,6 +126,7 @@ public class MainMenu extends BaseMenu
|
|||
ADD_PLACE(R.id.add_place),
|
||||
SEARCH(R.id.search),
|
||||
P2P(R.id.p2p),
|
||||
DISCOVERY(R.id.discovery),
|
||||
BOOKMARKS(R.id.bookmarks),
|
||||
SHARE(R.id.share),
|
||||
DOWNLOADER(R.id.download_maps),
|
||||
|
@ -217,6 +218,7 @@ public class MainMenu extends BaseMenu
|
|||
mapItem(Item.ADD_PLACE);
|
||||
mapItem(Item.SEARCH);
|
||||
mapItem(Item.P2P);
|
||||
mapItem(Item.DISCOVERY);
|
||||
mapItem(Item.BOOKMARKS);
|
||||
mapItem(Item.SHARE);
|
||||
mapItem(Item.DOWNLOADER);
|
||||
|
|
Loading…
Add table
Reference in a new issue