Skip to content

Commit 745f2cd

Browse files
author
Mersad Esalati
committed
add app version
1 parent 1e89af5 commit 745f2cd

File tree

6 files changed

+21
-43
lines changed

6 files changed

+21
-43
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dependencies {
2626
implementation 'com.android.support:appcompat-v7:27.1.1'
2727
implementation 'com.android.support:design:27.1.1'
2828
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
29-
//play services
29+
//Play Services
3030
implementation 'com.google.android.gms:play-services-gcm:15.0.1'
3131
implementation 'com.google.android.gms:play-services-location:15.0.1'
3232
//Neshan sdk library

app/src/main/java/org/neshan/sample/java/activity/MainActivity.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import android.view.Window;
2626
import android.view.WindowManager;
2727
import android.widget.Button;
28+
import android.widget.TextView;
2829
import android.widget.Toast;
2930

3031
import com.google.android.gms.location.FusedLocationProviderClient;
@@ -44,6 +45,7 @@
4445
import org.neshan.geometry.PolygonGeom;
4546
import org.neshan.graphics.ARGB;
4647
import org.neshan.layers.VectorElementLayer;
48+
import org.neshan.sample.BuildConfig;
4749
import org.neshan.sample.R;
4850
import org.neshan.sample.java.util.RecordKeeper;
4951
import org.neshan.services.NeshanMapStyle;
@@ -122,6 +124,10 @@ private void initLayoutReferences() {
122124
initToolbar();
123125
initMap();
124126
initLocation();
127+
128+
TextView appVersion = nav.getHeaderView(0).findViewById(R.id.app_version);
129+
appVersion.setText(String.format("نسخه %s", BuildConfig.VERSION_NAME));
130+
125131
initSideNavigation();
126132

127133
//on side navigation menu clicked

app/src/main/res/anim/theme_switch_fade_in.xml

Lines changed: 0 additions & 10 deletions
This file was deleted.

app/src/main/res/anim/theme_switch_fade_out.xml

Lines changed: 0 additions & 13 deletions
This file was deleted.

app/src/main/res/drawable/circle_white.xml

Lines changed: 0 additions & 7 deletions
This file was deleted.

app/src/main/res/layout/side_nav_header.xml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
xmlns:android="http://schemas.android.com/apk/res/android"
44
xmlns:app="http://schemas.android.com/apk/res-auto"
55
android:layout_width="match_parent"
6-
android:layout_height="140dp"
6+
android:layout_height="wrap_content"
7+
android:padding="4dp"
78
android:background="@drawable/gradient_bg">
89

910
<ImageView
1011
android:id="@+id/imageView"
1112
android:layout_width="56dp"
1213
android:layout_height="56dp"
1314
android:src="@drawable/ic_neshan_logo"
14-
app:layout_constraintBottom_toTopOf="@+id/guideline"
15+
android:layout_marginTop="16dp"
1516
app:layout_constraintEnd_toEndOf="parent"
1617
app:layout_constraintStart_toStartOf="parent"
17-
app:layout_constraintTop_toTopOf="parent"
18-
app:layout_constraintVertical_bias="1.0" />
18+
app:layout_constraintTop_toTopOf="parent" />
1919

2020
<TextView
2121
android:id="@+id/textView"
@@ -25,18 +25,20 @@
2525
android:textColor="@android:color/white"
2626
android:textStyle="bold"
2727
android:gravity="center"
28-
app:layout_constraintBottom_toBottomOf="parent"
28+
android:layout_marginTop="8dp"
2929
app:layout_constraintEnd_toEndOf="parent"
30-
app:layout_constraintHorizontal_bias="0.502"
3130
app:layout_constraintStart_toStartOf="parent"
32-
app:layout_constraintTop_toTopOf="@+id/guideline"
33-
app:layout_constraintVertical_bias="0.239" />
31+
app:layout_constraintTop_toBottomOf="@id/imageView" />
3432

35-
<android.support.constraint.Guideline
36-
android:id="@+id/guideline"
33+
<TextView
34+
android:id="@+id/app_version"
3735
android:layout_width="wrap_content"
3836
android:layout_height="wrap_content"
39-
android:orientation="horizontal"
40-
app:layout_constraintGuide_percent="0.5" />
37+
android:textColor="@android:color/white"
38+
android:gravity="center"
39+
android:layout_marginTop="4dp"
40+
app:layout_constraintTop_toBottomOf="@id/textView"
41+
app:layout_constraintEnd_toEndOf="parent"
42+
app:layout_constraintStart_toStartOf="parent"/>
4143

4244
</android.support.constraint.ConstraintLayout>

0 commit comments

Comments
 (0)