Skip to content
This repository has been archived by the owner on Apr 26, 2020. It is now read-only.

Commit

Permalink
Got it compiling again
Browse files Browse the repository at this point in the history
  • Loading branch information
DreierF committed Dec 8, 2014
1 parent e67931b commit 58a10fb
Show file tree
Hide file tree
Showing 10 changed files with 210 additions and 28 deletions.
Binary file modified app/app-release.apk
Binary file not shown.
6 changes: 4 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ android {
applicationId "de.dreier.mytargets"
minSdkVersion 14
targetSdkVersion 21
versionCode 15
versionName "1.9"
versionCode 16
versionName "1.9.1"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
Expand Down
171 changes: 171 additions & 0 deletions app/manifest-merger-release-report.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
-- Merging decision tree log ---
manifest
ADDED from AndroidManifest.xml:2:1
xmlns:tools
ADDED from AndroidManifest.xml:3:5
xmlns:android
ADDED from AndroidManifest.xml:2:11
package
ADDED from AndroidManifest.xml:4:5
INJECTED from AndroidManifest.xml:0:0
INJECTED from AndroidManifest.xml:0:0
android:versionName
INJECTED from AndroidManifest.xml:0:0
INJECTED from AndroidManifest.xml:0:0
android:versionCode
INJECTED from AndroidManifest.xml:0:0
INJECTED from AndroidManifest.xml:0:0
uses-feature#android.hardware.camera
ADDED from AndroidManifest.xml:6:5
android:required
ADDED from AndroidManifest.xml:8:9
android:name
ADDED from AndroidManifest.xml:7:9
uses-permission#android.permission.WRITE_EXTERNAL_STORAGE
ADDED from AndroidManifest.xml:10:5
android:name
ADDED from AndroidManifest.xml:10:22
application
ADDED from AndroidManifest.xml:12:5
MERGED from com.android.support:support-v4:21.0.2:16:5
MERGED from com.android.support:appcompat-v7:21.0.2:16:5
MERGED from com.android.support:support-v4:21.0.2:16:5
MERGED from com.melnykov:floatingactionbutton:1.0.7:12:5
MERGED from com.android.support:recyclerview-v7:21.0.0:17:5
MERGED from com.android.support:support-v4:21.0.2:16:5
MERGED from MyTargets.libraries:FloatLabel:unspecified:11:5
MERGED from com.android.support:support-v4:21.0.2:16:5
android:label
ADDED from AndroidManifest.xml:16:9
android:allowBackup
ADDED from AndroidManifest.xml:13:9
android:icon
ADDED from AndroidManifest.xml:15:9
android:theme
ADDED from AndroidManifest.xml:17:9
android:backupAgent
ADDED from AndroidManifest.xml:14:9
tools:ignore
ADDED from AndroidManifest.xml:18:9
meta-data#com.google.android.backup.api_key
ADDED from AndroidManifest.xml:20:9
android:name
ADDED from AndroidManifest.xml:21:13
android:value
ADDED from AndroidManifest.xml:22:13
activity#de.dreier.mytargets.activities.MainActivity
ADDED from AndroidManifest.xml:24:9
android:label
ADDED from AndroidManifest.xml:26:13
android:name
ADDED from AndroidManifest.xml:25:13
android:launchMode
ADDED from AndroidManifest.xml:27:13
intent-filter#android.intent.action.MAIN+android.intent.category.LAUNCHER
ADDED from AndroidManifest.xml:28:13
action#android.intent.action.MAIN
ADDED from AndroidManifest.xml:29:17
android:name
ADDED from AndroidManifest.xml:29:25
category#android.intent.category.LAUNCHER
ADDED from AndroidManifest.xml:31:17
android:name
ADDED from AndroidManifest.xml:31:27
activity#de.dreier.mytargets.activities.TrainingActivity
ADDED from AndroidManifest.xml:34:9
android:parentActivityName
ADDED from AndroidManifest.xml:37:13
android:name
ADDED from AndroidManifest.xml:35:13
android:launchMode
ADDED from AndroidManifest.xml:36:13
meta-data#android.support.PARENT_ACTIVITY
ADDED from AndroidManifest.xml:38:13
android:name
ADDED from AndroidManifest.xml:39:17
android:value
ADDED from AndroidManifest.xml:40:17
activity#de.dreier.mytargets.activities.RoundActivity
ADDED from AndroidManifest.xml:42:9
android:parentActivityName
ADDED from AndroidManifest.xml:45:13
android:name
ADDED from AndroidManifest.xml:43:13
android:launchMode
ADDED from AndroidManifest.xml:44:13
activity#de.dreier.mytargets.activities.PasseActivity
ADDED from AndroidManifest.xml:50:9
android:label
ADDED from AndroidManifest.xml:52:13
android:parentActivityName
ADDED from AndroidManifest.xml:54:13
android:name
ADDED from AndroidManifest.xml:51:13
android:launchMode
ADDED from AndroidManifest.xml:53:13
activity#de.dreier.mytargets.activities.NewRoundActivity
ADDED from AndroidManifest.xml:59:9
android:windowSoftInputMode
ADDED from AndroidManifest.xml:63:13
android:label
ADDED from AndroidManifest.xml:61:13
android:parentActivityName
ADDED from AndroidManifest.xml:62:13
android:name
ADDED from AndroidManifest.xml:60:13
activity#de.dreier.mytargets.activities.BowActivity
ADDED from AndroidManifest.xml:68:9
android:label
ADDED from AndroidManifest.xml:70:13
android:parentActivityName
ADDED from AndroidManifest.xml:72:13
android:name
ADDED from AndroidManifest.xml:69:13
android:launchMode
ADDED from AndroidManifest.xml:71:13
activity#de.dreier.mytargets.activities.EditBowActivity
ADDED from AndroidManifest.xml:77:9
android:label
ADDED from AndroidManifest.xml:79:13
android:theme
ADDED from AndroidManifest.xml:81:13
android:parentActivityName
ADDED from AndroidManifest.xml:80:13
android:name
ADDED from AndroidManifest.xml:78:13
activity#de.dreier.mytargets.activities.ScoreboardActivity
ADDED from AndroidManifest.xml:86:9
android:label
ADDED from AndroidManifest.xml:88:13
android:parentActivityName
ADDED from AndroidManifest.xml:89:13
android:name
ADDED from AndroidManifest.xml:87:13
activity#de.dreier.mytargets.activities.StatisticsActivity
ADDED from AndroidManifest.xml:94:9
android:label
ADDED from AndroidManifest.xml:96:13
android:name
ADDED from AndroidManifest.xml:95:13
uses-sdk
INJECTED from AndroidManifest.xml:0:0 reason: use-sdk injection requested
MERGED from com.android.support:support-v4:21.0.2:15:5
MERGED from com.android.support:appcompat-v7:21.0.2:15:5
MERGED from com.android.support:support-v4:21.0.2:15:5
MERGED from com.melnykov:floatingactionbutton:1.0.7:8:5
MERGED from com.android.support:recyclerview-v7:21.0.0:15:5
MERGED from com.android.support:support-v4:21.0.2:15:5
MERGED from MyTargets.libraries:FloatLabel:unspecified:7:5
MERGED from com.android.support:support-v4:21.0.2:15:5
android:targetSdkVersion
INJECTED from AndroidManifest.xml:0:0
INJECTED from AndroidManifest.xml:0:0
android:minSdkVersion
INJECTED from AndroidManifest.xml:0:0
INJECTED from AndroidManifest.xml:0:0
activity#android.support.v7.widget.TestActivity
ADDED from com.android.support:recyclerview-v7:21.0.0:18:9
android:label
ADDED from com.android.support:recyclerview-v7:21.0.0:18:19
android:name
ADDED from com.android.support:recyclerview-v7:21.0.0:18:60
3 changes: 3 additions & 0 deletions app/proguard-rules.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-dontobfuscate
-optimizationpasses 5
-keep class !android.support.v7.internal.view.menu.**,android.support.** {*;}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected void init(Intent intent, Bundle savedInstanceState) {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.round, menu);
MenuItem item = menu.findItem(R.id.menu_item_share);
MenuItem item = menu.findItem(R.id.action_share);
ShareActionProvider shareActionProvider = (ShareActionProvider) MenuItemCompat.getActionProvider(item);

// Construct share intent
Expand All @@ -60,6 +60,15 @@ public boolean onCreateOptionsMenu(Menu menu) {
return true;
}

@Override
public boolean onPrepareOptionsMenu(Menu menu) {
boolean hasPasses = adapter.getCount()>2;
menu.findItem(R.id.action_scoreboard).setVisible(hasPasses);
menu.findItem(R.id.action_share).setVisible(hasPasses);
menu.findItem(R.id.action_statistics).setVisible(hasPasses);
return super.onPrepareOptionsMenu(menu);
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
Expand Down Expand Up @@ -89,6 +98,7 @@ public void onResume() {
mRoundInfo = db.getRound(mRound);
adapter = new PasseAdapter(this, mTraining, mRound, mRoundInfo);
setListAdapter(adapter);
supportInvalidateOptionsMenu();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ private LinearSeries generateLinearRegression(LinearSeries data) {

LinearSeries series = new LinearSeries();
long x0 = data.getMinX();
long y0 = (long) (beta1 * x0 + beta0);
double y0 = beta1 * x0 + beta0;
long x1 = data.getMaxX();
long y1 = (long) (beta1 * x1 + beta0);
double y1 = beta1 * x1 + beta0;
series.addPoint(new LinearSeries.LinearPoint(x0, y0));
series.addPoint(new LinearSeries.LinearPoint(x1, y1));
return series;
Expand Down
16 changes: 8 additions & 8 deletions app/src/main/java/de/dreier/mytargets/models/LinearSeries.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public class LinearSeries {

private long mMinX = Long.MAX_VALUE;
private long mMaxX = Long.MIN_VALUE;
private long mMinY = Long.MAX_VALUE;
private long mMaxY = Long.MIN_VALUE;
private double mMinY = Long.MAX_VALUE;
private double mMaxY = Long.MIN_VALUE;

private PointF mLastPoint;

Expand Down Expand Up @@ -77,7 +77,7 @@ private void resetRange() {
mMaxY = Long.MIN_VALUE;
}

private void extendRange(long x, long y) {
private void extendRange(long x, double y) {
if (x < mMinX) mMinX = x;
if (x > mMaxX) mMaxX = x;
if (y < mMinY) mMinY = y;
Expand All @@ -99,19 +99,19 @@ public long getMaxX() {
return mMaxX;
}

public long getMinY() {
public double getMinY() {
return mMinY;
}

public long getMaxY() {
public double getMaxY() {
return mMaxY;
}

public static class LinearPoint implements Comparable<LinearPoint> {
private long mX;
private long mY;
private double mY;

public LinearPoint(long x, long y) {
public LinearPoint(long x, double y) {
mX = x;
mY = y;
}
Expand All @@ -120,7 +120,7 @@ public long getX() {
return mX;
}

public long getY() {
public double getY() {
return mY;
}

Expand Down
13 changes: 10 additions & 3 deletions app/src/main/java/de/dreier/mytargets/utils/TargetOpenHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

import android.content.ContentValues;
import android.content.Context;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.preference.PreferenceManager;

import java.io.ByteArrayOutputStream;
import java.io.File;
Expand Down Expand Up @@ -120,9 +122,11 @@ public class TargetOpenHelper extends SQLiteOpenHelper {
SHOOT_ZONE + " INTEGER," +
SHOOT_X + " REAL," +
SHOOT_Y + " REAL);";
private final Context mContext;

public TargetOpenHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
mContext = context;
}

@Override
Expand Down Expand Up @@ -166,6 +170,9 @@ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("UPDATE " + table + " SET distance=" + NewRoundActivity.distanceValues[i] + " WHERE distance=" + i);
}
}
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext);
int defaultDist = NewRoundActivity.distanceValues[prefs.getInt("distance", 0)];
prefs.edit().putInt("distance", defaultDist).apply();
}
onCreate(db);
}
Expand Down Expand Up @@ -271,10 +278,10 @@ public ArrayList<Passe> getRoundPasses(long round, int passe) {
String[] cols2 = {SHOOT_ZONE, SHOOT_X, SHOOT_Y};
String[] args1 = {"" + round};
Cursor res1 = db.query(TABLE_PASSE, cols1, PASSE_ROUND + "=?", args1, null, null, PASSE_ID + " ASC");
if(res1.moveToFirst()) {
if (res1.moveToFirst()) {
ArrayList<Passe> list = new ArrayList<>();
do {
if(res1.getPosition()!=passe-1) {
if (res1.getPosition() != passe - 1) {
String[] args2 = {"" + res1.getLong(0)}; // passe id
Cursor res = db.query(TABLE_SHOOT, cols2, SHOOT_PASSE + "=?", args2, null, null, SHOOT_ID + " ASC");
int count = res.getCount();
Expand All @@ -289,7 +296,7 @@ public ArrayList<Passe> getRoundPasses(long round, int passe) {
list.add(p);
res.close();
}
} while(res1.moveToNext());
} while (res1.moveToNext());

db.close();
return list;
Expand Down
11 changes: 0 additions & 11 deletions app/src/main/java/de/dreier/mytargets/views/ChartView.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
import android.util.DisplayMetrics;
import android.widget.RelativeLayout;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

import de.dreier.mytargets.models.LinearSeries;
import de.dreier.mytargets.models.RectD;
Expand Down Expand Up @@ -43,8 +41,6 @@ public class ChartView extends RelativeLayout {
private Rect mGridBounds = new Rect();
private final int mGridLineWidth;

private SimpleDateFormat dateFormatMonth;

private long mMinY = 0;
private long mMaxY = 15;

Expand Down Expand Up @@ -82,13 +78,6 @@ public ChartView(Context context, AttributeSet attrs, int defStyle) {
mTextPaint.setTextAlign(Paint.Align.CENTER);
mTextPaint.setAntiAlias(true);
mTextPaint.setTextSize(mLabelTextSize);

/*Calendar cal = (Calendar)QDateMgr.beg_hj[0].clone();
mMinX = cal.getTimeInMillis();
cal.add(Calendar.MONTH, 1);
mMaxX = cal.getTimeInMillis();*/

dateFormatMonth = new SimpleDateFormat("MMM",Locale.GERMANY);
}

/*
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/menu/round.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
android:title="@string/statistic"
app:showAsAction="ifRoom" />
<item
android:id="@+id/menu_item_share"
android:id="@+id/action_share"
android:title="@string/share"
app:actionProviderClass="android.support.v7.widget.ShareActionProvider"
app:showAsAction="ifRoom" />
Expand Down

0 comments on commit 58a10fb

Please sign in to comment.