Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions app/assets/locales/android_translatable_strings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -933,5 +933,4 @@ in.app.update.error.playstore=Updating CommCare requires an official PlayStore a
in.app.update.error.invalid.request=Couldn't install CommCare update due to internal failure. Please try later.
in.app.update.error.internal.error=Couldn't install CommCare update due to internal error in PlayStore. Please try later.

button.clear.title=Clear
media.missing.invalid.reference=Can't load media due to invalid reference: ${0}
button.clear.title=Clear
1 change: 0 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ dependencies {
implementation 'com.github.dimagi:zebra-print-android:v1.2'
implementation 'com.simprints:LibSimprints:1.0.12'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
Expand Down
205 changes: 0 additions & 205 deletions app/res/layout/media_layout.xml

This file was deleted.

38 changes: 38 additions & 0 deletions app/res/layout/missing_media_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@color/border_grey"
android:id="@+id/missing_media_view"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical"
android:padding="20dp">

<ImageView
android:id="@+id/download_media_icon"
android:layout_centerHorizontal="true"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:scaleType="center"
android:layout_marginTop="40dp"
android:src="@drawable/update_download_icon" />

<ProgressBar
style="?android:attr/progressBarStyle"
android:id="@+id/progress_bar"
android:layout_above="@id/missing_media_tv"
android:layout_centerHorizontal="true"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:layout_width="wrap_content"
android:visibility="gone" />

<TextView
android:gravity="center_horizontal"
android:id="@+id/missing_media_tv"
android:layout_below="@id/download_media_icon"
android:layout_centerHorizontal="true"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:layout_width="wrap_content" />

</RelativeLayout>
4 changes: 2 additions & 2 deletions app/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,6 @@
<!-- Map Info View -->
<dimen name="map_info_view_text_size">12sp</dimen>
<dimen name="map_info_view_text_padding">4dp</dimen>
<dimen name="dp40">40dp</dimen>


</resources>
6 changes: 3 additions & 3 deletions app/src/org/commcare/activities/FormEntryActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -873,8 +873,8 @@ private void saveInlineVideoState() {
if (uiController.questionsView != null) {
for (int i = 0; i < uiController.questionsView.getWidgets().size(); i++) {
QuestionWidget q = uiController.questionsView.getWidgets().get(i);
if (q.findViewById(R.id.inline_video_view) != null) {
VideoView inlineVideo = q.findViewById(R.id.inline_video_view);
if (q.findViewById(MediaLayout.INLINE_VIDEO_PANE_ID) != null) {
VideoView inlineVideo = q.findViewById(MediaLayout.INLINE_VIDEO_PANE_ID);
if (inlineVideo.isPlaying()) {
indexOfWidgetWithVideoPlaying = i;
positionOfVideoProgress = inlineVideo.getCurrentPosition();
Expand All @@ -888,7 +888,7 @@ private void saveInlineVideoState() {
private void restoreInlineVideoState() {
if (indexOfWidgetWithVideoPlaying != -1) {
QuestionWidget widgetWithVideoToResume = uiController.questionsView.getWidgets().get(indexOfWidgetWithVideoPlaying);
VideoView inlineVideo = widgetWithVideoToResume.findViewById(R.id.inline_video_view);
VideoView inlineVideo = widgetWithVideoToResume.findViewById(MediaLayout.INLINE_VIDEO_PANE_ID);
if (inlineVideo != null) {
inlineVideo.seekTo(positionOfVideoProgress);
inlineVideo.start();
Expand Down
33 changes: 14 additions & 19 deletions app/src/org/commcare/views/ResizingImageView.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.Pair;
import android.util.TypedValue;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.Toast;

import androidx.annotation.Nullable;

import org.commcare.dalvik.R;
import org.commcare.utils.FileUtil;
import org.javarosa.core.reference.InvalidReferenceException;
Expand All @@ -41,32 +39,29 @@ public class ResizingImageView extends ImageView {
private int mMaxWidth;
private int mMaxHeight;

private GestureDetector gestureDetector;
private ScaleGestureDetector scaleGestureDetector;
private final GestureDetector gestureDetector;
private final ScaleGestureDetector scaleGestureDetector;

private String imageURI;
private String bigImageURI;
private final String imageURI;
private final String bigImageURI;

private float scaleFactor = 1.0f;
private final static float scaleFactorThreshhold = 1.2f;

public ResizingImageView(Context context) {
super(context);
}

public ResizingImageView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
this(context, null, null);
}

public ResizingImageView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}

public void setImageURI(String imageURI, String bigImageURI) {
gestureDetector = new GestureDetector(getContext(), new GestureListener());
scaleGestureDetector = new ScaleGestureDetector(getContext(), new ScaleListener());
public ResizingImageView(Context context, String imageURI, String bigImageURI) {
super(context);
gestureDetector = new GestureDetector(context, new GestureListener());
scaleGestureDetector = new ScaleGestureDetector(context, new ScaleListener());
this.imageURI = imageURI;
this.bigImageURI = bigImageURI;
ViewGroup.MarginLayoutParams imageViewParams = new ViewGroup.MarginLayoutParams(
ViewGroup.MarginLayoutParams.WRAP_CONTENT,
ViewGroup.MarginLayoutParams.WRAP_CONTENT);
this.setLayoutParams(imageViewParams);
}

@Override
Expand Down
14 changes: 1 addition & 13 deletions app/src/org/commcare/views/media/CommCareVideoView.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package org.commcare.views.media;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.VideoView;

import java.util.Date;

/**
Expand All @@ -22,14 +20,6 @@ public CommCareVideoView(Context context) {
super(context);
}

public CommCareVideoView(Context context, AttributeSet attrs) {
super(context, attrs);
}

public CommCareVideoView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}

public void setListener(VideoDetachedListener listener) {
this.listener = listener;
}
Expand All @@ -49,9 +39,7 @@ public void start() {
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
if (listener != null) {
listener.onVideoDetached(duration);
}
listener.onVideoDetached(duration);
}

public interface VideoDetachedListener {
Expand Down
Loading