Skip to content

Commit

Permalink
add app version
Browse files Browse the repository at this point in the history
  • Loading branch information
Mersad Esalati committed Jul 29, 2018
1 parent 1e89af5 commit 745f2cd
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 43 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand Down
10 changes: 0 additions & 10 deletions app/src/main/res/anim/theme_switch_fade_in.xml

This file was deleted.

13 changes: 0 additions & 13 deletions app/src/main/res/anim/theme_switch_fade_out.xml

This file was deleted.

7 changes: 0 additions & 7 deletions app/src/main/res/drawable/circle_white.xml

This file was deleted.

26 changes: 14 additions & 12 deletions app/src/main/res/layout/side_nav_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
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">

<ImageView
android:id="@+id/imageView"
android:layout_width="56dp"
android:layout_height="56dp"
android:src="@drawable/ic_neshan_logo"
app:layout_constraintBottom_toTopOf="@+id/guideline"
android:layout_marginTop="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1.0" />
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/textView"
Expand All @@ -25,18 +25,20 @@
android:textColor="@android:color/white"
android:textStyle="bold"
android:gravity="center"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.502"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/guideline"
app:layout_constraintVertical_bias="0.239" />
app:layout_constraintTop_toBottomOf="@id/imageView" />

<android.support.constraint.Guideline
android:id="@+id/guideline"
<TextView
android:id="@+id/app_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.5" />
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"/>

</android.support.constraint.ConstraintLayout>

0 comments on commit 745f2cd

Please sign in to comment.