Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.

Commit 9fe1d07

Browse files
committed
Merged release-0.4 into master
2 parents 6bb81f5 + acc27f2 commit 9fe1d07

37 files changed

+1499
-154
lines changed

app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ android {
1010
applicationId "com.davidmiguel.gobees"
1111
minSdkVersion 19
1212
targetSdkVersion 25
13-
versionCode 3
14-
versionName "v0.3"
13+
versionCode 4
14+
versionName "v0.4"
1515

1616
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1717
}
@@ -98,7 +98,7 @@ dependencies {
9898

9999
// Dependencies for Android unit tests
100100
androidTestCompile 'junit:junit:4.12'
101-
androidTestCompile 'org.mockito:mockito-core:2.2.26'
101+
androidTestCompile 'org.mockito:mockito-core:2.3.0'
102102

103103
// Espresso UI Testing
104104
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'

app/src/main/AndroidManifest.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,15 @@
4949
android:parentActivityName=".hive.HiveActivity"/>
5050
<activity
5151
android:name=".monitoring.MonitoringActivity"
52+
android:launchMode="singleTop"
5253
android:parentActivityName=".hive.HiveActivity"
53-
android:screenOrientation="landscape"/>
54+
android:screenOrientation="landscape"
55+
android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen"/>
5456
<activity
5557
android:name=".settings.SettingsActivity"
5658
android:parentActivityName=".apiaries.ApiariesActivity"/>
59+
60+
<service android:name=".monitoring.MonitoringService"/>
5761
</application>
5862

5963
</manifest>

app/src/main/java/com/davidmiguel/gobees/apiary/ApiaryActivity.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,14 @@ protected void onCreate(Bundle savedInstanceState) {
3737
actionBar.setDisplayShowHomeEnabled(true);
3838
}
3939

40+
// Get apiary id
41+
long apiaryId = getIntent().getLongExtra(ApiaryHivesFragment.ARGUMENT_APIARY_ID, NO_APIARY);
42+
if (apiaryId == NO_APIARY) {
43+
throw new IllegalArgumentException("No apiary id passed!");
44+
}
45+
4046
// Create hives fragment
41-
ApiaryHivesFragment apiaryHivesFragment = ApiaryHivesFragment.newInstance();
47+
ApiaryHivesFragment apiaryHivesFragment = ApiaryHivesFragment.newInstance(apiaryId);
4248

4349
// Create apiary info fragment
4450
ApiaryInfoFragment apiaryInfoFragment = ApiaryInfoFragment.newInstance();
@@ -54,12 +60,6 @@ protected void onCreate(Bundle savedInstanceState) {
5460
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
5561
tabLayout.setupWithViewPager(viewPager);
5662

57-
// Get apiary id
58-
long apiaryId = getIntent().getLongExtra(ApiaryHivesFragment.ARGUMENT_APIARY_ID, NO_APIARY);
59-
if (apiaryId == NO_APIARY) {
60-
throw new IllegalArgumentException("No apiary id passed!");
61-
}
62-
6363
// Init db
6464
goBeesRepository = Injection.provideApiariesRepository();
6565
goBeesRepository.openDb();

app/src/main/java/com/davidmiguel/gobees/apiary/ApiaryHivesFragment.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,14 @@ public class ApiaryHivesFragment extends Fragment
4848
private View noHivesView;
4949
private LinearLayout hivesView;
5050

51-
public ApiaryHivesFragment() {
52-
// Requires empty public constructor
51+
public static ApiaryHivesFragment newInstance(long apiaryId) {
52+
Bundle arguments = new Bundle();
53+
arguments.putLong(ARGUMENT_APIARY_ID, apiaryId);
54+
ApiaryHivesFragment fragment = new ApiaryHivesFragment();
55+
fragment.setArguments(arguments);
56+
return fragment;
5357
}
5458

55-
public static ApiaryHivesFragment newInstance() {
56-
return new ApiaryHivesFragment();
57-
}
58-
59-
6059
@Override
6160
public void onCreate(@Nullable Bundle savedInstanceState) {
6261
super.onCreate(savedInstanceState);
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package com.davidmiguel.gobees.camera;
2+
3+
/**
4+
* AndroidCamera contract.
5+
*/
6+
public interface AndroidCamera {
7+
8+
/**
9+
* Connects to the camera.
10+
*/
11+
void connect();
12+
13+
/**
14+
* Releases the camera.
15+
*/
16+
void release();
17+
18+
/**
19+
* Checks whether the camera is connected.
20+
*
21+
* @return camera status.
22+
*/
23+
boolean isConnected();
24+
25+
/**
26+
* Update the frame rate.
27+
*
28+
* @param delay time to wait before issue the first frame (in milliseconds).
29+
* @param period period between frames (in milliseconds).
30+
*/
31+
void updateFrameRate(long delay, long period);
32+
}

0 commit comments

Comments
 (0)