1
0
Fork 0
mirror of https://github.com/MatomoCamp/matomocamp-companion-android.git synced 2024-09-19 16:13:46 +02:00

Moved all build config values to build.gradle

This commit is contained in:
Christophe Beyls 2015-12-25 16:50:27 +01:00
parent d5b0b833dd
commit f31af2f492
3 changed files with 12 additions and 20 deletions

View file

@ -8,6 +8,8 @@ android {
applicationId "be.digitalia.fosdem" applicationId "be.digitalia.fosdem"
minSdkVersion 7 minSdkVersion 7
targetSdkVersion 21 targetSdkVersion 21
versionCode 700131
versionName "1.3.1"
} }
buildTypes { buildTypes {
@ -18,9 +20,13 @@ android {
} }
} }
ext {
supportLibraryVersion = '21.0.3'
}
dependencies { dependencies {
compile 'com.android.support:appcompat-v7:21.0.+' compile "com.android.support:appcompat-v7:$supportLibraryVersion"
compile 'com.android.support:cardview-v7:21.0.+' compile "com.android.support:cardview-v7:$supportLibraryVersion"
// Version 1.2.3 has a bug and crashes when detecting 2-finger gestures. Use 1.2.2 instead. // Version 1.2.3 has a bug and crashes when detecting 2-finger gestures. Use 1.2.2 instead.
compile 'com.github.chrisbanes.photoview:library:1.2.2' compile 'com.github.chrisbanes.photoview:library:1.2.2'
} }

View file

@ -2,13 +2,7 @@
<manifest <manifest
package="be.digitalia.fosdem" package="be.digitalia.fosdem"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto" android:installLocation="auto">
android:versionCode="700131"
android:versionName="1.3.1">
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="21"/>
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.NFC"/> <uses-permission android:name="android.permission.NFC"/>

View file

@ -10,7 +10,6 @@ import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.TypedArray; import android.content.res.TypedArray;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.PorterDuff; import android.graphics.PorterDuff;
@ -52,6 +51,7 @@ import java.text.DateFormat;
import java.util.Date; import java.util.Date;
import java.util.Locale; import java.util.Locale;
import be.digitalia.fosdem.BuildConfig;
import be.digitalia.fosdem.R; import be.digitalia.fosdem.R;
import be.digitalia.fosdem.api.FosdemApi; import be.digitalia.fosdem.api.FosdemApi;
import be.digitalia.fosdem.db.DatabaseManager; import be.digitalia.fosdem.db.DatabaseManager;
@ -547,16 +547,8 @@ public class MainActivity extends ActionBarActivity {
@NonNull @NonNull
@Override @Override
public Dialog onCreateDialog(Bundle savedInstanceState) { public Dialog onCreateDialog(Bundle savedInstanceState) {
Context context = getActivity(); String title = String.format("%1$s %2$s", getString(R.string.app_name), BuildConfig.VERSION_NAME);
String title; return new AlertDialog.Builder(getActivity())
try {
String versionName = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;
title = String.format("%1$s %2$s", getString(R.string.app_name), versionName);
} catch (NameNotFoundException e) {
title = getString(R.string.app_name);
}
return new AlertDialog.Builder(context)
.setTitle(title) .setTitle(title)
.setIcon(R.mipmap.ic_launcher) .setIcon(R.mipmap.ic_launcher)
.setMessage(getResources().getText(R.string.about_text)) .setMessage(getResources().getText(R.string.about_text))