Skip to content
This repository has been archived by the owner on Jan 6, 2019. It is now read-only.

Commit

Permalink
Get "about" activity version number from the build
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarvperes committed Dec 8, 2015
1 parent 65c0f6d commit 3776405
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
2 changes: 2 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ android {
applicationId 'com.hayaisoftware.launcher'
minSdkVersion 15
targetSdkVersion 22
versionCode 3
versionName "1.0.2"
}
buildTypes {
release {
Expand Down
4 changes: 1 addition & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
package="com.hayaisoftware.launcher"
xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="3"
android:versionName="1.0.2" >
xmlns:android="http://schemas.android.com/apk/res/android">

<uses-sdk
android:minSdkVersion="15"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,24 @@
package com.hayaisoftware.launcher.activities;

import android.app.Activity;
import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;

import com.hayaisoftware.launcher.BuildConfig;
import com.hayaisoftware.launcher.R;
import com.hayaisoftware.launcher.StatusBarColorHelper;

public class AboutActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);

TextView aboutTextView=((TextView) findViewById(R.id.about_textview));
aboutTextView.setText(aboutTextView.getText().toString().replace("[APP_VERSION]",
BuildConfig.VERSION_NAME));
}


Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
android:scrollbars="vertical"
android:fillViewport="true">

<TextView android:layout_width="wrap_content" android:layout_height="wrap_content"
<TextView android:id="@+id/about_textview" android:layout_width="wrap_content" android:layout_height="wrap_content"
android:text="@string/about_content"/>

</ScrollView>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-pt/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<string name="action_about">Sobre</string>
<string name="action_system_settings">Ajustes do dispositivo</string>
<string name="activity_not_found">Atividade não encontrada.</string>
<string name="title_activity_about">Sobre</string><string name="about_content">Hayai Launcher 1.0.1
<string name="title_activity_about">Sobre</string><string name="about_content">Hayai Launcher [APP_VERSION]
\n
\nWebsite do projeto:
\nhttps://github.com/seizonsenryaku/HayaiLauncher
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<string name="action_system_settings">Device settings</string>
<string name="activity_not_found">Activity not found.</string>
<string name="action_about">About</string>
<string name="about_content">Hayai Launcher 1.0.1
<string name="about_content">Hayai Launcher [APP_VERSION]
\n
\nProject Website:
\nhttps://github.com/seizonsenryaku/HayaiLauncher
Expand Down

0 comments on commit 3776405

Please sign in to comment.