Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show changelog after update of app #1286

Merged
merged 4 commits into from
Oct 7, 2023
Merged
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
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
0.9.9.82
---------------------
- Note: Due to changes to the database schema the data will be cleared when upgrading
- Note: What a release! Thank you for the endless contributions from the community!
- Added - <a href="https://github.com/nextcloud/news-android/pull/1262">!1262 - Add shortcut to "Show only unread articles" in the toolbar (thanks to @mkanilsson)</a>
- Changed - <a href="https://github.com/nextcloud/news-android/pull/1186">!1186 - Material 3 Theme (thanks to @stefan-niedermann)</a>
- Added - <a href="https://github.com/nextcloud/news-android/pull/1264">!1264 - Add share to swipe option (thanks to @mkanilsson)</a>
- Added - <a href="https://github.com/nextcloud/news-android/pull/1266">!1266 - per-feed open-in settings ([#1221](https://github.com/nextcloud/news-android/issues/1221) / [#1058](https://github.com/nextcloud/news-android/issues/1058) / [#957](https://github.com/nextcloud/news-android/issues/957)) (thanks to @mkanilsson)</a>
- Added - <a href="https://github.com/nextcloud/news-android/pull/1265">!1265 - Allow searching both title and body at the same time (thanks to @mkanilsson)</a>
- Added - <a href="https://github.com/nextcloud/news-android/pull/1271">!1271 - Enable support for predictive back gestures (thanks to @KingOfDog)</a>
- Added - <a href="https://github.com/nextcloud/news-android/pull/1286">!1286 - Show changelog after update of app</a>
- Changed - <a href="https://github.com/nextcloud/news-android/pull/1256">!1256 - Fix starred items not obeying sort order (thanks to @mkanilsson)</a>
- Changed - <a href="https://github.com/nextcloud/news-android/pull/1186">!1186 - Material 3 Theme (thanks to @stefan-niedermann)</a>
- Changed - Dependency updates
- Fixed - <a href="https://github.com/nextcloud/news-android/pull/1257">!1257 - Seeking in podcast player doesn't work (thanks to @annasoin)</a>
- Fixed - <a href="https://github.com/nextcloud/news-android/pull/1255">!1255 - add line-height for h1 tags (thanks to @mkanilsson)</a>
- Fixed - <a href="https://github.com/nextcloud/news-android/pull/1257">!1257 - Seeking in podcast player doesn't work (thanks to @annasoin)</a>
- Fixed - <a href="https://github.com/nextcloud/news-android/pull/1272">!1272 - Fix weird formatting in articles (thanks to @mkanilsson)</a>
- Fixed - <a href="https://github.com/nextcloud/news-android/issues/1276">#1276 - active toggles lack color</a>

0.9.9.81
---------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ public class Constants {

public static final String USER_INFO_STRING = "USER_INFO";

public static final String PREVIOUS_VERSION_CODE = "PREVIOUS_VERSION_CODE";

protected static boolean isNextCloud(SharedPreferences prefs) {
int[] version = extractVersionNumberFromString(prefs.getString(Constants.NEWS_WEB_VERSION_NUMBER_STRING, ""));
if(version[0] == 0) {
if (version[0] == 0) {
// not initialized yet..
return true; // let's assume that it is nextcloud..
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ protected void onCreate(Bundle savedInstanceState) {
startLoginActivity();
}


Bundle args = new Bundle();
String userName = mPrefs.getString(SettingsActivity.EDT_USERNAME_STRING, null);
String url = mPrefs.getString(SettingsActivity.EDT_OWNCLOUDROOTPATH_STRING, null);
Expand Down Expand Up @@ -273,6 +272,8 @@ public void onDrawerOpened(View drawerView) {
if (savedInstanceState == null) { //When the app starts (no orientation change)
updateDetailFragment(SubscriptionExpandableListAdapter.SPECIAL_FOLDERS.ALL_UNREAD_ITEMS.getValue(), true, null, true);
}

showChangelogIfNecessary();
}

@Override
Expand Down Expand Up @@ -336,6 +337,17 @@ public void onConfigurationChanged(@NonNull Configuration newConfig) {
}
}

void showChangelogIfNecessary() {
// on first app start with new version - always show the changelog
int currentVersionCode = BuildConfig.VERSION_CODE;
int previousVersionCode = mPrefs.getInt(Constants.PREVIOUS_VERSION_CODE, 0);
if (currentVersionCode > previousVersionCode) {
DialogFragment dialog = new VersionInfoDialogFragment();
dialog.show(getSupportFragmentManager(), "VersionChangelogDialogFragment");
mPrefs.edit().putInt(Constants.PREVIOUS_VERSION_CODE, currentVersionCode).apply();
}
}

/**
* This method increases the "pull to open drawer" area by three.
* This method should be called only once!
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package de.luhmer.owncloudnewsreader;

import static de.luhmer.owncloudnewsreader.services.PodcastPlaybackService.CURRENT_PODCAST_MEDIA_TYPE;

import android.app.PictureInPictureParams;
import android.content.ComponentName;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.graphics.Point;
import android.os.Build;
import android.os.Bundle;
import android.os.RemoteException;
import android.support.v4.media.MediaBrowserCompat;
import android.support.v4.media.MediaMetadataCompat;
import android.support.v4.media.session.MediaControllerCompat;
Expand All @@ -29,8 +30,6 @@
import de.luhmer.owncloudnewsreader.services.PodcastPlaybackService;
import de.luhmer.owncloudnewsreader.services.podcast.PlaybackService;

import static de.luhmer.owncloudnewsreader.services.PodcastPlaybackService.CURRENT_PODCAST_MEDIA_TYPE;

public class PiPVideoPlaybackActivity extends AppCompatActivity {

private static final String TAG = PiPVideoPlaybackActivity.class.getCanonicalName();
Expand Down Expand Up @@ -172,6 +171,8 @@ public void onEvent(CollapsePodcastView event) {

@Override
public void onBackPressed() {
super.onBackPressed();

Log.d(TAG, "onBackPressed() called");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
enterPictureInPictureMode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import android.content.res.Resources;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.media.session.MediaControllerCompat;
import android.support.v4.media.session.PlaybackStateCompat;
import android.util.Log;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

import android.accounts.Account;
import android.accounts.AccountManager;
import android.app.DialogFragment;
import android.app.ProgressDialog;
import android.content.ContentResolver;
import android.content.Context;
Expand All @@ -45,6 +44,7 @@
import android.widget.Toast;

import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment;
import androidx.preference.CheckBoxPreference;
import androidx.preference.DialogPreference;
import androidx.preference.ListPreference;
Expand All @@ -54,6 +54,7 @@

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -126,10 +127,9 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
private static final Preference.OnPreferenceChangeListener sBindPreferenceSummaryToValueListener = (preference, value) -> {
String stringValue = value.toString();

if (preference instanceof ListPreference) {
if (preference instanceof ListPreference listPreference) {
// For list preferences, look up the correct display value in
// the preference's 'entries' list.
ListPreference listPreference = (ListPreference) preference;
int index = listPreference.findIndexOfValue(stringValue);

// Set the summary to reflect the new value.
Expand Down Expand Up @@ -158,8 +158,7 @@ else if(PREF_SYNC_SETTINGS.equals(preference.getKey())) {
};

private static final Preference.OnPreferenceChangeListener sBindPreferenceBooleanToValueListener = (preference, newValue) -> {
if(preference instanceof CheckBoxPreference) { //For legacy Android support
CheckBoxPreference cbPreference = ((CheckBoxPreference) preference);
if(preference instanceof CheckBoxPreference cbPreference) { //For legacy Android support
cbPreference.setChecked((Boolean) newValue);
} else {
TwoStatePreference twoStatePreference = ((TwoStatePreference) preference);
Expand Down Expand Up @@ -297,7 +296,7 @@ private void bindAboutPreferences(final PreferenceFragmentCompat prefFrag) {
Preference changelogPreference = prefFrag.findPreference(CB_VERSION);
changelogPreference.setOnPreferenceClickListener(preference -> {
DialogFragment dialog = new VersionInfoDialogFragment();
dialog.show(prefFrag.requireActivity().getFragmentManager(), "VersionChangelogDialogFragment");
dialog.show(prefFrag.requireActivity().getSupportFragmentManager(), "VersionChangelogDialogFragment");
return true;
});

Expand All @@ -317,10 +316,7 @@ private void bindPodcastPreferences(PreferenceFragmentCompat prefFrag)

public void checkForUnsycedChangesInDatabaseAndResetDatabase(final Context context) {
DatabaseConnectionOrm dbConn = new DatabaseConnectionOrm(context);
boolean resetDatabase = true;
if(dbConn.areThereAnyUnsavedChangesInDatabase()) {
resetDatabase = false;
}
boolean resetDatabase = !dbConn.areThereAnyUnsavedChangesInDatabase();

if(resetDatabase) {
new ResetDatabaseAsyncTask(context).execute();
Expand Down Expand Up @@ -379,11 +375,7 @@ private void openBugReport() {
}
}

try {
body = URLEncoder.encode(debugInfo,"UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
body = URLEncoder.encode(debugInfo, StandardCharsets.UTF_8);
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/nextcloud/news-android/issues/new?title=" + title + "&body=" + body));
startActivity(browserIntent);
}
Expand Down Expand Up @@ -453,8 +445,7 @@ protected void onPostExecute(Void result) {
pd.dismiss();
Toast.makeText(context, context.getString(R.string.cache_is_cleared), Toast.LENGTH_SHORT).show();

if(context instanceof SettingsActivity) {
SettingsActivity sa = (SettingsActivity) context;
if(context instanceof SettingsActivity sa) {
sa.resultIntent.putExtra(SettingsActivity.RI_CACHE_CLEARED, true);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

import android.app.Activity;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
Expand All @@ -34,10 +32,12 @@
import android.widget.ProgressBar;
import android.widget.TextView;

import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment;

import java.io.IOException;
import java.util.Formatter;

import androidx.appcompat.app.AlertDialog;
import de.luhmer.owncloudnewsreader.async_tasks.DownloadChangelogTask;
import de.luhmer.owncloudnewsreader.view.ChangeLogFileListView;

Expand Down