diff --git a/app/build.gradle b/app/build.gradle index c3de83d8..4b194a2d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,7 +9,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.2' + classpath 'com.android.tools.build:gradle:3.5.3' } } apply plugin: 'com.android.application' @@ -43,7 +43,7 @@ dependencies { implementation 'com.simplecityapps:recyclerview-fastscroll:1.0.18' implementation 'com.github.StephenVinouze:MaterialNumberPicker:1.0.5' implementation 'com.github.chrisbanes:PhotoView:2.3.0' - implementation 'com.squareup.okhttp3:okhttp:4.2.0' + implementation 'com.squareup.okhttp3:okhttp:3.12.7' implementation 'com.squareup.picasso:picasso:2.71828' implementation 'com.wdullaer:materialdatetimepicker:4.2.3' implementation 'commons-net:commons-net:3.6' @@ -67,8 +67,8 @@ android { buildToolsVersion project.BUILD_TOOLS_VERSION defaultConfig { - versionCode 437 - versionName="1.5.437" + versionCode 438 + versionName="1.5.438" minSdkVersion 17 targetSdkVersion 29 multiDexEnabled true diff --git a/app/res/raw-de/changelog.md b/app/res/raw-de/changelog.md index a5fbdf72..3546967b 100644 --- a/app/res/raw-de/changelog.md +++ b/app/res/raw-de/changelog.md @@ -1,3 +1,7 @@ +## 1.5.438 +* FIX: Kompatibilität mit Android < 5.0 wiederhergestellt +* FIX: Absturz beim Streamen behoben + ## 1.5.437 * DEL: Auto-Theme-Wahl und mit ihr die Berechtigung für die grobe Position * DEL: Die Funktion "Spenden" wurde ersatzlos gestrichen (~75% einer Spende wurden durch Google/Steuern aufgefressen) diff --git a/app/res/raw/changelog.md b/app/res/raw/changelog.md index 391f629f..8e9573a7 100644 --- a/app/res/raw/changelog.md +++ b/app/res/raw/changelog.md @@ -1,3 +1,7 @@ +## 1.5.438 +* FIX: restore compatibility with Android < 5.0 +* FIX: crash when streaming + ## 1.5.437 * DEL: Auto-Theme selection and with that the coarse location permission have been dropped * DEL: Donations have been removed with no intention for any replacement (~70% of any donation got eaten up by google and local taxes) diff --git a/app/src/net/reichholf/dreamdroid/fragment/VideoOverlayFragment.java b/app/src/net/reichholf/dreamdroid/fragment/VideoOverlayFragment.java index 6afa14a9..4cac1460 100644 --- a/app/src/net/reichholf/dreamdroid/fragment/VideoOverlayFragment.java +++ b/app/src/net/reichholf/dreamdroid/fragment/VideoOverlayFragment.java @@ -16,13 +16,25 @@ import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; -import android.view.ViewTreeObserver; import android.view.Window; import android.view.WindowManager; import android.widget.SeekBar; import android.widget.TextView; import android.widget.Toast; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.widget.AppCompatImageButton; +import androidx.core.view.GestureDetectorCompat; +import androidx.fragment.app.DialogFragment; +import androidx.fragment.app.Fragment; +import androidx.leanback.widget.HorizontalGridView; +import androidx.loader.app.LoaderManager; +import androidx.loader.content.Loader; +import androidx.preference.PreferenceManager; +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + import net.reichholf.dreamdroid.DreamDroid; import net.reichholf.dreamdroid.R; import net.reichholf.dreamdroid.activities.VideoActivity; @@ -56,18 +68,6 @@ import java.util.ArrayList; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.appcompat.widget.AppCompatImageButton; -import androidx.core.view.GestureDetectorCompat; -import androidx.fragment.app.DialogFragment; -import androidx.fragment.app.Fragment; -import androidx.leanback.widget.HorizontalGridView; -import androidx.loader.app.LoaderManager; -import androidx.loader.content.Loader; -import androidx.preference.PreferenceManager; -import androidx.recyclerview.widget.GridLayoutManager; -import androidx.recyclerview.widget.RecyclerView; import butterknife.BindView; import butterknife.ButterKnife; @@ -170,6 +170,20 @@ public void onCreate(@Nullable Bundle savedInstanceState) { public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.video_player_overlay, container, false); ButterKnife.bind(this, view); + mButtonAudioTrack.setOnClickListener(v -> onSelectAudioTrack()); + mButtonInfo.setOnClickListener(v -> onInfo()); + mButtonList.setOnClickListener(v -> onList()); + mButtonSubtitleTrack.setOnClickListener(v -> onSelectSubtitleTrack()); + mButtonRewind.setOnTouchListener(new OnRepeatListener(v -> onRewind())); + mButtonPlay.setOnClickListener(v -> onPlay()); + mButtonForward.setOnTouchListener(new OnRepeatListener(v -> onForward())); + + return view; + } + + @Override + public void onActivityCreated(@Nullable Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); if (mServicesView != null) { if (DreamDroid.isTV(getContext())) { HorizontalGridView gridView = (HorizontalGridView) mServicesView; @@ -240,15 +254,6 @@ public boolean onSingleTapUp(MotionEvent e) { mGestureDector.onTouchEvent(event); return true; }); - mButtonAudioTrack.setOnClickListener(v -> onSelectAudioTrack()); - mButtonInfo.setOnClickListener(v -> onInfo()); - mButtonList.setOnClickListener(v -> onList()); - mButtonSubtitleTrack.setOnClickListener(v -> onSelectSubtitleTrack()); - mButtonRewind.setOnTouchListener(new OnRepeatListener(v -> onRewind())); - mButtonPlay.setOnClickListener(v -> onPlay()); - mButtonForward.setOnTouchListener(new OnRepeatListener(v -> onForward())); - - return view; } protected void onRewind() { @@ -548,6 +553,7 @@ private boolean isRecording() { private void updateViews() { View view = getView(); + TextView title = view.findViewById(R.id.title); title.setText(mTitle); @@ -598,7 +604,7 @@ private void updateViews() { mButtonInfo.setVisibility(View.GONE); } updateProgress(); - if (mServicesView != null) + if (mServicesView != null && mServicesView.getAdapter() != null) mServicesView.getAdapter().notifyDataSetChanged(); } diff --git a/app/src/net/reichholf/dreamdroid/fragment/dialogs/ChangelogDialog.java b/app/src/net/reichholf/dreamdroid/fragment/dialogs/ChangelogDialog.java index 66cf5b9f..31acf596 100644 --- a/app/src/net/reichholf/dreamdroid/fragment/dialogs/ChangelogDialog.java +++ b/app/src/net/reichholf/dreamdroid/fragment/dialogs/ChangelogDialog.java @@ -10,6 +10,7 @@ import org.apache.commons.io.IOUtils; +import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; @@ -41,7 +42,13 @@ public void onStart() { String changelog = ""; InputStream is = getResources().openRawResource(R.raw.changelog); try { - changelog = IOUtils.toString(is); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + byte[] buffer = new byte[1024]; + int length; + while ((length = is.read(buffer)) != -1) { + baos.write(buffer, 0, length); + } + changelog = baos.toString("UTF-8"); } catch (IOException e) { e.printStackTrace(); } diff --git a/build.gradle b/build.gradle index 4454e0e0..758802fc 100644 --- a/build.gradle +++ b/build.gradle @@ -4,6 +4,6 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.2' + classpath 'com.android.tools.build:gradle:3.5.3' } }