diff options
author | alexzatsepin <alexander.zatzepin@gmail.com> | 2016-09-08 20:56:31 +0300 |
---|---|---|
committer | alexzatsepin <alexander.zatzepin@gmail.com> | 2016-09-08 21:10:46 +0300 |
commit | 73429508ac8dd552292ca4a6f4fbafbb996d9306 (patch) | |
tree | d89025d3fe0b82d4cedd4308597a1e6489dcf3a0 | |
parent | d623fb49958551ebfd0960a60142a3e29ea74c2c (diff) |
Made the bottom panel layout with chart image, time/distance text view and bit 'Start' button (only for Phone as well)android-displaying-chart-image
Added the altitude chart image on the bottom panel for Phone UI only (not tablet)
-rw-r--r-- | android/3rd_party/BottomSheet/build.gradle | 3 | ||||
-rw-r--r-- | android/UnitTests/build.gradle | 2 | ||||
-rw-r--r-- | android/build.gradle | 3 | ||||
-rw-r--r-- | android/gradle/wrapper/gradle-wrapper.properties | 4 | ||||
-rw-r--r-- | android/res/layout/activity_map.xml | 9 | ||||
-rw-r--r-- | android/res/layout/menu_route_plan_line.xml | 34 | ||||
-rw-r--r-- | android/res/values/dimens.xml | 12 | ||||
-rw-r--r-- | android/src/com/mapswithme/maps/MwmActivity.java | 29 | ||||
-rw-r--r-- | android/src/com/mapswithme/maps/routing/RoutingController.java | 2 | ||||
-rw-r--r-- | android/src/com/mapswithme/maps/routing/RoutingPlanInplaceController.java | 13 |
10 files changed, 75 insertions, 36 deletions
diff --git a/android/3rd_party/BottomSheet/build.gradle b/android/3rd_party/BottomSheet/build.gradle index 70f45ba9ad..b58c47f884 100644 --- a/android/3rd_party/BottomSheet/build.gradle +++ b/android/3rd_party/BottomSheet/build.gradle @@ -4,7 +4,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:2.1.2' + classpath 'com.android.tools.build:gradle:2.1.3' } } @@ -24,4 +24,5 @@ android { defaultConfig { minSdkVersion propMinSdkVersion.toInteger() } + buildToolsVersion '24.0.2' }
\ No newline at end of file diff --git a/android/UnitTests/build.gradle b/android/UnitTests/build.gradle index cbd1b88ad0..76e83eef25 100644 --- a/android/UnitTests/build.gradle +++ b/android/UnitTests/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.1.2' + classpath 'com.android.tools.build:gradle:2.1.3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/android/build.gradle b/android/build.gradle index da77bd8387..038bded3c3 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -7,7 +7,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:2.1.2' + classpath 'com.android.tools.build:gradle:2.1.3' classpath 'io.fabric.tools:gradle:1.+' } } @@ -313,6 +313,7 @@ android { exclude 'lib/x86_64/libcrashlytics-envelope.so' exclude 'lib/x86_64/libcrashlytics.so' } + buildToolsVersion '24.0.2' } // Tasks needed to compile NDK part diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index c1e8f408dd..168d71e1c1 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Thu Apr 28 19:32:19 MSK 2016 +#Thu Sep 08 14:22:27 MSK 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip diff --git a/android/res/layout/activity_map.xml b/android/res/layout/activity_map.xml index dbd75800c1..695ce29aa4 100644 --- a/android/res/layout/activity_map.xml +++ b/android/res/layout/activity_map.xml @@ -10,15 +10,6 @@ android:layout_width="match_parent" android:layout_height="match_parent"/> - <ImageView - android:id="@+id/altitude_chart" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="140dp" - android:layout_marginBottom="@dimen/margin_base" - android:layout_gravity="center_horizontal" - android:src="@drawable/about_logo"/> - <include android:id="@+id/onmap_downloader" layout="@layout/onmap_downloader"/> diff --git a/android/res/layout/menu_route_plan_line.xml b/android/res/layout/menu_route_plan_line.xml index d7eee1df3f..50afd5ec4a 100644 --- a/android/res/layout/menu_route_plan_line.xml +++ b/android/res/layout/menu_route_plan_line.xml @@ -1,17 +1,35 @@ <?xml version="1.0" encoding="utf-8"?> -<FrameLayout +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" - android:layout_height="@dimen/menu_line_height" - android:layout_marginLeft="@dimen/menu_line_button_width_edge" - android:layout_marginRight="@dimen/menu_line_button_width_edge"> + android:layout_height="wrap_content" + android:paddingLeft="@dimen/altitude_chart_container_padding_left"> + + <LinearLayout + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:layout_marginBottom="@dimen/altitude_chart_margin_bottom" + android:layout_marginTop="@dimen/altitude_chart_margin_top" + android:orientation="vertical"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="@dimen/altitude_chart_time_distance_height" + android:layout_marginBottom="@dimen/altitude_chart_time_distance_margin_bottom" + android:text="33 мин 7.0 км" + android:textSize="16sp" /> + + <ImageView android:id="@+id/altitude_chart" + android:layout_width="@dimen/altitude_chart_image_width" + android:layout_height="@dimen/altitude_chart_image_height" /> + </LinearLayout> <Button android:id="@+id/start" - android:layout_width="180dp" - android:layout_height="wrap_content" + android:layout_width="@dimen/start_button_size" + android:layout_height="@dimen/start_button_size" android:layout_gravity="center" - android:layout_margin="@dimen/margin_quarter_plus" android:text="@string/p2p_start" style="@style/MwmWidget.Button.Accent" android:textAppearance="@style/MwmTextAppearance.Body1"/> -</FrameLayout>
\ No newline at end of file +</LinearLayout>
\ No newline at end of file diff --git a/android/res/values/dimens.xml b/android/res/values/dimens.xml index cc1778c80a..404e76750f 100644 --- a/android/res/values/dimens.xml +++ b/android/res/values/dimens.xml @@ -130,4 +130,16 @@ <dimen name="editor_margin_left_plus">72dp</dimen> <dimen name="editor_auth_btn_height">36dp</dimen> <dimen name="editor_margin_timetable_left">50dp</dimen> + + <!-- Phone bottom panel --> + <dimen name="altitude_chart_container_padding_left">16dp</dimen> + <dimen name="altitude_chart_margin_bottom">12dp</dimen> + <dimen name="altitude_chart_margin_top">14dp</dimen> + <dimen name="altitude_chart_time_distance_height">20dp</dimen> + <dimen name="altitude_chart_time_distance_text_size">16sp</dimen> + <dimen name="altitude_chart_time_distance_margin_bottom">10dp</dimen> + <dimen name="altitude_chart_image_height">40dp</dimen> + <dimen name="altitude_chart_image_width">232dp</dimen> + <dimen name="start_button_size">96dp</dimen> + </resources> diff --git a/android/src/com/mapswithme/maps/MwmActivity.java b/android/src/com/mapswithme/maps/MwmActivity.java index 016992d731..9e1c0adb65 100644 --- a/android/src/com/mapswithme/maps/MwmActivity.java +++ b/android/src/com/mapswithme/maps/MwmActivity.java @@ -3,7 +3,6 @@ package com.mapswithme.maps; import android.annotation.SuppressLint; import android.content.Context; import android.content.Intent; -import android.graphics.Bitmap; import android.location.Location; import android.os.Build; import android.os.Bundle; @@ -15,12 +14,10 @@ import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import android.support.v7.app.AlertDialog; import android.support.v7.widget.Toolbar; -import android.util.Log; import android.view.MotionEvent; import android.view.View; import android.view.View.OnClickListener; import android.view.WindowManager; -import android.widget.ImageView; import com.mapswithme.maps.Framework.MapObjectListener; import com.mapswithme.maps.activity.CustomNavigateUpListener; @@ -78,17 +75,20 @@ import com.mapswithme.util.ThemeUtils; import com.mapswithme.util.UiUtils; import com.mapswithme.util.Utils; import com.mapswithme.util.concurrency.UiThread; +import com.mapswithme.util.log.DebugLogger; +import com.mapswithme.util.log.Logger; import com.mapswithme.util.sharing.ShareOption; import com.mapswithme.util.sharing.SharingHelper; import com.mapswithme.util.statistics.AlohaHelper; import com.mapswithme.util.statistics.MytargetHelper; import com.mapswithme.util.statistics.Statistics; -import ru.mail.android.mytarget.nativeads.NativeAppwallAd; -import ru.mail.android.mytarget.nativeads.banners.NativeAppwallBanner; import java.io.Serializable; import java.util.Stack; +import ru.mail.android.mytarget.nativeads.NativeAppwallAd; +import ru.mail.android.mytarget.nativeads.banners.NativeAppwallBanner; + public class MwmActivity extends BaseMwmFragmentActivity implements MapObjectListener, View.OnTouchListener, @@ -150,6 +150,7 @@ public class MwmActivity extends BaseMwmFragmentActivity // The first launch of application ever - onboarding screen will be shown. private boolean mFirstStart; + private final Logger mLogger = new DebugLogger(MwmActivity.class.getSimpleName()); public interface LeftAnimationTrackListener { @@ -314,7 +315,6 @@ public class MwmActivity extends BaseMwmFragmentActivity return super.getThemeResourceId(theme); } - private ImageView altitudeChart; @SuppressLint("InlinedApi") @Override @@ -828,14 +828,6 @@ public class MwmActivity extends BaseMwmFragmentActivity if (MapFragment.nativeIsEngineCreated()) LocationHelper.INSTANCE.attach(this); - Log.i("RCHART", "MwmActivity.onStart()"); - altitudeChart = (ImageView) findViewById(R.id.altitude_chart); - Bitmap bm = Framework.nativeGenerateRouteAltitudeChart(800, 200, true); - if (bm != null) - { - Log.i("RCHART", "altitudeChart.setImageBitmap(bm); bm: " + bm.getWidth() + " " + bm.getHeight()); - altitudeChart.setImageBitmap(bm); - } } private void initShowcase() @@ -1338,6 +1330,15 @@ public class MwmActivity extends BaseMwmFragmentActivity } @Override + public void onRouteBuilt() { + mLogger.d("onRouteBuilt"); + if (!mIsFragmentContainer) + { + mRoutingPlanInplaceController.showRouteAltitudeChart(); + } + } + + @Override public void updateBuildProgress(int progress, @Framework.RouterType int router) { if (mIsFragmentContainer) diff --git a/android/src/com/mapswithme/maps/routing/RoutingController.java b/android/src/com/mapswithme/maps/routing/RoutingController.java index 7fb4d4443a..cddd74df95 100644 --- a/android/src/com/mapswithme/maps/routing/RoutingController.java +++ b/android/src/com/mapswithme/maps/routing/RoutingController.java @@ -63,6 +63,7 @@ public class RoutingController void showDownloader(boolean openDownloaded); void updateMenu(); void updatePoints(); + void onRouteBuilt(); /** * @param progress progress to be displayed. @@ -115,6 +116,7 @@ public class RoutingController mCachedRoutingInfo = Framework.nativeGetRouteFollowingInfo(); setBuildState(BuildState.BUILT); mLastBuildProgress = 100; + mContainer.onRouteBuilt(); } processRoutingEvent(); diff --git a/android/src/com/mapswithme/maps/routing/RoutingPlanInplaceController.java b/android/src/com/mapswithme/maps/routing/RoutingPlanInplaceController.java index 46d819ca5a..193b56ca50 100644 --- a/android/src/com/mapswithme/maps/routing/RoutingPlanInplaceController.java +++ b/android/src/com/mapswithme/maps/routing/RoutingPlanInplaceController.java @@ -1,10 +1,13 @@ package com.mapswithme.maps.routing; +import android.graphics.Bitmap; import android.os.Build; import android.os.Bundle; import android.view.View; import android.widget.Button; +import android.widget.ImageView; +import com.mapswithme.maps.Framework; import com.mapswithme.maps.MwmActivity; import com.mapswithme.maps.R; import com.mapswithme.maps.bookmarks.data.MapObject; @@ -87,4 +90,14 @@ public class RoutingPlanInplaceController extends RoutingPlanController if (state.containsKey(STATE_OPEN)) mSlotsRestoredState = state.getBoolean(STATE_OPEN); } + + public void showRouteAltitudeChart() + { + ImageView altitudeChart = (ImageView) mActivity.findViewById(R.id.altitude_chart); + Bitmap bm = Framework.nativeGenerateRouteAltitudeChart(altitudeChart.getWidth(), altitudeChart.getHeight(), true); + if (bm != null) + { + altitudeChart.setImageBitmap(bm); + } + } } |