Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
505f8bf54b | |||
3c37c50843 | |||
448ff4d2b3 | |||
82810f06e1 | |||
d207b78065 |
2
.idea/compiler.xml
generated
2
.idea/compiler.xml
generated
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="11" />
|
||||
<bytecodeTargetLevel target="1.8" />
|
||||
</component>
|
||||
</project>
|
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@ -10,7 +10,7 @@
|
||||
</option>
|
||||
</component>
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
@ -2,9 +2,8 @@
|
||||
|
||||
# Ojo: the FLOSS RTSP Surveillance camera viewer for Android
|
||||
|
||||
[<img src="https://raw.githubusercontent.com/andOTP/andOTP/master/assets/badges/get-it-on-github.png" height="80">](https://github.com/penguin86/ojo/releases/latest)
|
||||
|
||||
F-droid build **coming soon!**
|
||||
[<img src="https://raw.githubusercontent.com/andOTP/andOTP/master/assets/badges/get-it-on-github.png" height="80">](https://github.com/penguin86/ojo/releases/latest)
|
||||
[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png" alt="Get it on F-Droid" height="80">](https://f-droid.org/it/packages/it.danieleverducci.ojo)
|
||||
|
||||
(Always prefer [F-Droid](https://f-droid.org) build, when possible).
|
||||
|
||||
|
@ -10,8 +10,8 @@ android {
|
||||
applicationId "it.danieleverducci.ojo"
|
||||
minSdkVersion 17
|
||||
targetSdkVersion 30
|
||||
versionCode 1
|
||||
versionName "0.0.1"
|
||||
versionCode 3
|
||||
versionName "0.0.3"
|
||||
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
|
||||
@ -39,7 +39,8 @@ dependencies {
|
||||
implementation 'com.google.android.material:material:1.4.0'
|
||||
implementation 'androidx.navigation:navigation-fragment:2.3.5'
|
||||
implementation 'androidx.navigation:navigation-ui:2.3.5'
|
||||
implementation 'org.videolan.android:libvlc-all:3.4.1'
|
||||
//implementation 'org.videolan.android:libvlc-all:3.4.1'
|
||||
implementation 'de.mrmaffen:libvlc-android:2.1.12@aar'
|
||||
testImplementation 'junit:junit:4.+'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||
|
18
app/release/output-metadata.json
Normal file
18
app/release/output-metadata.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": 2,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "it.danieleverducci.ojo",
|
||||
"variantName": "release",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"versionCode": 1,
|
||||
"versionName": "0.0.1",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
]
|
||||
}
|
@ -57,7 +57,7 @@ public class AddStreamFragment extends Fragment {
|
||||
|
||||
// Back to first fragment
|
||||
NavHostFragment.findNavController(AddStreamFragment.this)
|
||||
.navigate(R.id.action_SecondFragment_to_FirstFragment);
|
||||
.popBackStack();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ import android.widget.LinearLayout;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import org.videolan.libvlc.interfaces.IVLCVout;
|
||||
import org.videolan.libvlc.IVLCVout;
|
||||
import org.videolan.libvlc.LibVLC;
|
||||
import org.videolan.libvlc.Media;
|
||||
import org.videolan.libvlc.MediaPlayer;
|
||||
@ -52,14 +52,31 @@ public class SurveillanceFragment extends Fragment {
|
||||
|
||||
private FragmentSurveillanceBinding binding;
|
||||
private List<CameraView> cameraViews = new ArrayList<>();
|
||||
int viewMargin;
|
||||
private boolean fullscreenCameraView = false;
|
||||
private LinearLayout.LayoutParams cameraViewLayoutParams;
|
||||
private LinearLayout.LayoutParams rowLayoutParams;
|
||||
private LinearLayout.LayoutParams hiddenLayoutParams;
|
||||
|
||||
@Override
|
||||
public View onCreateView(
|
||||
LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState
|
||||
) {
|
||||
viewMargin = DpiUtils.DpToPixels(container.getContext(), 2);
|
||||
int viewMargin = DpiUtils.DpToPixels(container.getContext(), 2);
|
||||
cameraViewLayoutParams = new LinearLayout.LayoutParams(
|
||||
0,
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
1.0f
|
||||
);
|
||||
cameraViewLayoutParams.setMargins(viewMargin,viewMargin,viewMargin,viewMargin);
|
||||
|
||||
rowLayoutParams = new LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||
1.0f
|
||||
);
|
||||
|
||||
hiddenLayoutParams = new LinearLayout.LayoutParams(0, 0);
|
||||
|
||||
binding = FragmentSurveillanceBinding.inflate(inflater, container, false);
|
||||
return binding.getRoot();
|
||||
@ -114,29 +131,30 @@ public class SurveillanceFragment extends Fragment {
|
||||
for (int r = 0; r < elemsPerSide; r++) {
|
||||
// Create row and add to row container
|
||||
LinearLayout row = new LinearLayout(getContext());
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
0,
|
||||
1.0f
|
||||
);
|
||||
binding.gridRowContainer.addView(row, params);
|
||||
binding.gridRowContainer.addView(row, rowLayoutParams);
|
||||
// Add camera viewers to the row
|
||||
for (int c = 0; c < elemsPerSide; c++) {
|
||||
if ( camIdx < cc.size() ) {
|
||||
Camera cam = cc.get(camIdx);
|
||||
CameraView cv = addCameraView(cam, row);
|
||||
cv.startPlayback();
|
||||
cv.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// Toggle single/multi camera views
|
||||
fullscreenCameraView = !fullscreenCameraView;
|
||||
if (fullscreenCameraView) {
|
||||
hideAllCameraViewsButNot(v);
|
||||
} else {
|
||||
showAllCameras();
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Cameras are less than the maximum number of cells in grid: fill remaining cells with empty views
|
||||
View ev = new View(getContext());
|
||||
ev.setBackgroundColor(getResources().getColor(R.color.purple_700));
|
||||
LinearLayout.LayoutParams evParams = new LinearLayout.LayoutParams(
|
||||
0,
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
1.0f
|
||||
);
|
||||
evParams.setMargins(viewMargin,viewMargin,viewMargin,viewMargin);
|
||||
row.addView(ev, evParams);
|
||||
row.addView(ev, cameraViewLayoutParams);
|
||||
}
|
||||
camIdx++;
|
||||
}
|
||||
@ -156,22 +174,26 @@ public class SurveillanceFragment extends Fragment {
|
||||
protected void hideAllCameraViewsButNot(View cameraView) {
|
||||
for (int i = 0; i < binding.gridRowContainer.getChildCount(); i++) {
|
||||
LinearLayout row = (LinearLayout) binding.gridRowContainer.getChildAt(i);
|
||||
boolean emptyRow = true;
|
||||
for (int j = 0; j < row.getChildCount(); j++) {
|
||||
View cam = row.getChildAt(j);
|
||||
if (cameraView.getId() == cam.getId())
|
||||
cam.setVisibility(View.VISIBLE);
|
||||
if (cameraView == cam)
|
||||
emptyRow = false;
|
||||
else
|
||||
cam.setVisibility(View.GONE);
|
||||
cam.setLayoutParams(hiddenLayoutParams);
|
||||
}
|
||||
if (emptyRow)
|
||||
row.setLayoutParams(hiddenLayoutParams);
|
||||
}
|
||||
}
|
||||
|
||||
protected void showAllCameras() {
|
||||
for (int i = 0; i < binding.gridRowContainer.getChildCount(); i++) {
|
||||
LinearLayout row = (LinearLayout) binding.gridRowContainer.getChildAt(i);
|
||||
row.setLayoutParams(rowLayoutParams);
|
||||
for (int j = 0; j < row.getChildCount(); j++) {
|
||||
View cam = row.getChildAt(j);
|
||||
cam.setVisibility(View.VISIBLE);
|
||||
cam.setLayoutParams(cameraViewLayoutParams);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -183,13 +205,7 @@ public class SurveillanceFragment extends Fragment {
|
||||
);
|
||||
|
||||
// Add to layout
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||
0,
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
1.0f
|
||||
);
|
||||
params.setMargins(viewMargin,viewMargin,viewMargin,viewMargin);
|
||||
rowContainer.addView(cv.surfaceView, params);
|
||||
rowContainer.addView(cv.surfaceView, cameraViewLayoutParams);
|
||||
|
||||
cameraViews.add(cv);
|
||||
return cv;
|
||||
@ -223,7 +239,7 @@ public class SurveillanceFragment extends Fragment {
|
||||
surfaceView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
SurveillanceFragment.this.hideAllCameraViewsButNot(v);
|
||||
|
||||
}
|
||||
});
|
||||
SurfaceHolder holder = surfaceView.getHolder();
|
||||
@ -250,6 +266,10 @@ public class SurveillanceFragment extends Fragment {
|
||||
});
|
||||
}
|
||||
|
||||
public void setOnClickListener(View.OnClickListener listener) {
|
||||
surfaceView.setOnClickListener(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts the playback.
|
||||
*/
|
||||
|
1
fastlane/metadata/android/en-US/changelogs/3.txt
Normal file
1
fastlane/metadata/android/en-US/changelogs/3.txt
Normal file
@ -0,0 +1 @@
|
||||
Downgraded LibVLC library to fix black screen bug on certain devices
|
1
fastlane/metadata/android/it-IT/changelogs/3.txt
Normal file
1
fastlane/metadata/android/it-IT/changelogs/3.txt
Normal file
@ -0,0 +1 @@
|
||||
Downgrade della libreria libVLC per risolvere il bug della schermata nera in determinati dispositivi
|
Reference in New Issue
Block a user