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

Commit

Permalink
Added android wear support
Browse files Browse the repository at this point in the history
Fixed bugs with 3er Spot
  • Loading branch information
DreierF committed Nov 14, 2014
1 parent aa10eaa commit ebe41ef
Show file tree
Hide file tree
Showing 49 changed files with 795 additions and 694 deletions.
Binary file modified app/app-release.apk
Binary file not shown.
3 changes: 2 additions & 1 deletion app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,13 @@
</content>
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="recyclerview-v7-21.0.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-21.0.0" level="project" />
<orderEntry type="library" exported="" name="floatingactionbutton-1.0.7" level="project" />
<orderEntry type="library" exported="" name="support-v4-21.0.0" level="project" />
<orderEntry type="library" exported="" name="library-2.4.0" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-21.0.0" level="project" />
<orderEntry type="module" module-name="FloatLabel" exported="" />
<orderEntry type="module" module-name="FloatingActionButton" exported="" />
</component>
</module>

6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "de.dreier.mytargets"
minSdkVersion 14
targetSdkVersion 21
versionCode 7
versionName "1.6"
versionCode 8
versionName "1.7"
}
buildTypes {
release {
Expand All @@ -22,6 +22,6 @@ android {
dependencies {
compile 'com.android.support:support-v4:21.0.0'
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.melnykov:floatingactionbutton:1.0.7'
compile project(":libraries:FloatLabel")
compile project(":libraries:FloatingActionButton")
}
Binary file added app/src/main/art/bogenschiessen.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
382 changes: 382 additions & 0 deletions app/src/main/art/ic_my_location_24px.ai

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions app/src/main/art/ic_my_location_24px.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions app/src/main/art/ic_no_watch_24px.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 36 additions & 4 deletions app/src/main/java/de/dreier/mytargets/NewRoundActivity.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package de.dreier.mytargets;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
Expand All @@ -18,13 +20,14 @@ public class NewRoundActivity extends ActionBarActivity implements View.OnClickL
private long mTraining = -1, mRound = -1;

private Spinner distance;
private RadioButton outdoor, indoor;
private RadioButton indoor;
private Spinner bow, target;
public static String[] distances = {"10m", "15m", "18m", "20m", "25m", "30m", "40m", "50m", "60m", "70m", "90m"};
public static int[] distanceValues = {10, 15, 18, 20, 25, 30, 40, 50, 60, 70, 90};
private RadioButton ppp3;
private Button addBow;
private boolean mCalledFromPasse = false;
private int mBowType = -1;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -50,7 +53,7 @@ protected void onCreate(Bundle savedInstanceState) {

distance = (Spinner) findViewById(R.id.distance);
distance.setAdapter(adapter);
outdoor = (RadioButton) findViewById(R.id.outdoor);
RadioButton outdoor = (RadioButton) findViewById(R.id.outdoor);
indoor = (RadioButton) findViewById(R.id.indoor);
ppp3 = (RadioButton) findViewById(R.id.ppp3);
RadioButton ppp6 = (RadioButton) findViewById(R.id.ppp6);
Expand Down Expand Up @@ -116,16 +119,45 @@ protected void onResume() {
}

@Override
public void onClick(View view) {
public void onClick(final View view) {
int tar = target.getSelectedItemPosition();

if (bow.getAdapter().getCount() == 0 && mBowType == -1 && tar == 4) {
new AlertDialog.Builder(this).setTitle(R.string.title_compound)
.setMessage(R.string.msg_compound_type)
.setPositiveButton(R.string.compound_bow, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mBowType = 1;
NewRoundActivity.this.onClick(view);
}
})
.setNegativeButton(R.string.other_bow, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mBowType = 0;
NewRoundActivity.this.onClick(view);
}
})
.show();
return;
}

TargetOpenHelper db = new TargetOpenHelper(this);
if (mTraining == -1) {
mTraining = db.newTraining();
}
long b = bow.getSelectedItemId();
if (bow.getAdapter().getCount() == 0) {
if (tar == 4) {
b = mBowType == 1 ? -2 : -1;
} else {
b = -1;
}
}
int dist = distance.getSelectedItemPosition();
String unit = "m";
int p = ppp3.isChecked() ? 3 : 6;
int tar = target.getSelectedItemPosition();
boolean in = indoor.isChecked();
long round = db.newRound(mTraining, mRound, dist, unit, in, p, tar, b);
db.close();
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/java/de/dreier/mytargets/NowListActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import android.widget.ListAdapter;
import android.widget.ListView;

import com.melnykov.fab.FloatingActionButton;

/**
* Shows all rounds of one settings_only day
*/
Expand Down Expand Up @@ -105,6 +107,9 @@ public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
return false;
}
});

FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.attachToListView(mListView);
}

protected void onEdit(long id) {}
Expand Down
Loading

0 comments on commit ebe41ef

Please sign in to comment.