From 745f2cd6ff96dffd7b5c9fbdcf67498fa2893287 Mon Sep 17 00:00:00 2001 From: Mersad Esalati Date: Sun, 29 Jul 2018 09:42:40 +0330 Subject: [PATCH] add app version --- app/build.gradle | 2 +- .../sample/java/activity/MainActivity.java | 6 +++++ .../main/res/anim/theme_switch_fade_in.xml | 10 ------- .../main/res/anim/theme_switch_fade_out.xml | 13 ---------- app/src/main/res/drawable/circle_white.xml | 7 ----- app/src/main/res/layout/side_nav_header.xml | 26 ++++++++++--------- 6 files changed, 21 insertions(+), 43 deletions(-) delete mode 100644 app/src/main/res/anim/theme_switch_fade_in.xml delete mode 100644 app/src/main/res/anim/theme_switch_fade_out.xml delete mode 100644 app/src/main/res/drawable/circle_white.xml diff --git a/app/build.gradle b/app/build.gradle index a54c309..cd16021 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -26,7 +26,7 @@ dependencies { implementation 'com.android.support:appcompat-v7:27.1.1' implementation 'com.android.support:design:27.1.1' implementation 'com.android.support.constraint:constraint-layout:1.1.2' - //play services + //Play Services implementation 'com.google.android.gms:play-services-gcm:15.0.1' implementation 'com.google.android.gms:play-services-location:15.0.1' //Neshan sdk library diff --git a/app/src/main/java/org/neshan/sample/java/activity/MainActivity.java b/app/src/main/java/org/neshan/sample/java/activity/MainActivity.java index 8dc9504..9fd5cbb 100644 --- a/app/src/main/java/org/neshan/sample/java/activity/MainActivity.java +++ b/app/src/main/java/org/neshan/sample/java/activity/MainActivity.java @@ -25,6 +25,7 @@ import android.view.Window; import android.view.WindowManager; import android.widget.Button; +import android.widget.TextView; import android.widget.Toast; import com.google.android.gms.location.FusedLocationProviderClient; @@ -44,6 +45,7 @@ import org.neshan.geometry.PolygonGeom; import org.neshan.graphics.ARGB; import org.neshan.layers.VectorElementLayer; +import org.neshan.sample.BuildConfig; import org.neshan.sample.R; import org.neshan.sample.java.util.RecordKeeper; import org.neshan.services.NeshanMapStyle; @@ -122,6 +124,10 @@ private void initLayoutReferences() { initToolbar(); initMap(); initLocation(); + + TextView appVersion = nav.getHeaderView(0).findViewById(R.id.app_version); + appVersion.setText(String.format("نسخه %s", BuildConfig.VERSION_NAME)); + initSideNavigation(); //on side navigation menu clicked diff --git a/app/src/main/res/anim/theme_switch_fade_in.xml b/app/src/main/res/anim/theme_switch_fade_in.xml deleted file mode 100644 index bb7bed8..0000000 --- a/app/src/main/res/anim/theme_switch_fade_in.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/anim/theme_switch_fade_out.xml b/app/src/main/res/anim/theme_switch_fade_out.xml deleted file mode 100644 index 53dcc63..0000000 --- a/app/src/main/res/anim/theme_switch_fade_out.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - diff --git a/app/src/main/res/drawable/circle_white.xml b/app/src/main/res/drawable/circle_white.xml deleted file mode 100644 index 781b453..0000000 --- a/app/src/main/res/drawable/circle_white.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/side_nav_header.xml b/app/src/main/res/layout/side_nav_header.xml index e9d0784..2bce6bf 100644 --- a/app/src/main/res/layout/side_nav_header.xml +++ b/app/src/main/res/layout/side_nav_header.xml @@ -3,7 +3,8 @@ 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="140dp" + android:layout_height="wrap_content" + android:padding="4dp" android:background="@drawable/gradient_bg"> + app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toBottomOf="@id/imageView" /> - + android:textColor="@android:color/white" + android:gravity="center" + android:layout_marginTop="4dp" + app:layout_constraintTop_toBottomOf="@id/textView" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent"/> \ No newline at end of file