Commit e7237fe9 authored by Christian Schabesberger's avatar Christian Schabesberger

move on to version 1.259

parents 8c0c2063 79ca3c89
Pipeline #43983603 skipped with stage
......@@ -5,15 +5,17 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
allprojects {
repositories {
maven { url 'https://jitpack.io' }
jcenter()
google()
maven { url 'https://clojars.org/repo' }
maven { url "http://dl.bintray.com/populov/maven" }
maven { url "http://jzaccone.github.io/SlidingMenu-aar" }
maven { url "https://jitpack.io" }
maven {url "https://clojars.org/repo/"}
jcenter()
}
}
<<<<<<< HEAD
#Fri Feb 23 12:52:38 CET 2018
=======
#Thu Mar 08 12:50:31 MSK 2018
>>>>>>> 2b71e821ec9ddddeb1328334577dd04fa8609fb0
#Thu Sep 27 07:58:25 MSK 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "org.fox.tttrss"
......@@ -47,30 +47,28 @@ android {
}
dependencies {
compile project(':taskerlocaleapi')
compile 'com.squareup.okhttp3:okhttp:3.9.1'
compile('com.github.bumptech.glide:okhttp3-integration:1.5.0') {
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation('com.github.bumptech.glide:okhttp3-integration:1.5.0') {
exclude group: 'glide-parent'
}
compile 'org.jsoup:jsoup:1.10.2'
compile 'com.bogdwellers:pinchtozoom:0.1'
compile 'com.github.bumptech.glide:glide:3.8.0'
compile 'jp.wasabeef:glide-transformations:2.0.2'
compile 'com.android.support:recyclerview-v7:27.1.0'
compile 'com.android.support:cardview-v7:27.1.0'
compile 'com.android.support:support-v4:27.1.0'
compile 'com.android.support:appcompat-v7:27.1.0'
compile 'com.android.support:customtabs:27.1.0'
compile 'com.android.support:design:27.1.0'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.shamanland:fab:0.0.8'
compile 'ch.acra:acra:4.9.2'
compile 'com.ToxicBakery.viewpager.transforms:view-pager-transforms:1.2.32@aar'
compile 'me.relex:circleindicator:1.2.2@aar'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
compile 'frankiesardo:icepick:3.2.0'
provided 'frankiesardo:icepick-processor:3.2.0'
implementation 'org.jsoup:jsoup:1.10.2'
implementation 'com.bogdwellers:pinchtozoom:0.1'
implementation 'com.github.bumptech.glide:glide:3.8.0'
implementation 'jp.wasabeef:glide-transformations:2.0.2'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:customtabs:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.shamanland:fab:0.0.8'
implementation 'com.ToxicBakery.viewpager.transforms:view-pager-transforms:1.2.32@aar'
implementation 'me.relex:circleindicator:1.2.2@aar'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
implementation 'frankiesardo:icepick:3.2.0'
compileOnly 'frankiesardo:icepick-processor:3.2.0'
annotationProcessor 'frankiesardo:icepick-processor:3.2.0'
compile 'com.github.livefront:bridge:v1.1.1'
implementation 'com.github.livefront:bridge:v1.1.1'
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fox.ttrss"
android:versionCode="483"
android:versionName="1.249">
android:versionCode="493"
android:versionName="1.259">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
......@@ -17,7 +17,7 @@
android:backupAgent=".util.PrefsBackupAgent"
android:fullBackupOnly="true"
android:hardwareAccelerated="true"
android:icon="@drawable/ic_launcher"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config" >
......@@ -26,6 +26,8 @@
<meta-data android:name="org.fox.ttrss.glide.OkHttpProgressGlideModule"
android:value="GlideModule" />
<meta-data android:name="android.max_aspect" android:value="2.1" />
<activity
android:name=".LaunchActivity"
android:label="@string/app_name"
......@@ -35,6 +37,9 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
</activity>
<activity
android:name=".OnlineActivity"
......@@ -46,6 +51,7 @@
</activity>
<activity
android:name=".MasterActivity"
android:exported="true"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
......@@ -67,13 +73,6 @@
android:name=".LogcatActivity"
android:label="@string/logcat_title" >
</activity>
<activity
android:name=".tasker.TaskerSettingsActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="com.twofortyfouram.locale.intent.action.EDIT_SETTING" />
</intent-filter>
</activity>
<activity
android:name=".offline.OfflineActivity"
android:label="@string/app_name" >
......@@ -221,13 +220,6 @@
</intent-filter>
</receiver>
<receiver android:name=".tasker.TaskerReceiver" >
<intent-filter>
<action android:name="com.twofortyfouram.locale.intent.action.QUERY_CONDITION" />
<action android:name="com.twofortyfouram.locale.intent.action.FIRE_SETTING" />
</intent-filter>
</receiver>
<receiver android:name=".widget.SmallWidgetProvider" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
......
......@@ -7,18 +7,11 @@ import android.support.annotation.Nullable;
import com.livefront.bridge.Bridge;
import com.livefront.bridge.SavedStateHandler;
import org.acra.ACRA;
import org.acra.ReportingInteractionMode;
import org.acra.annotation.ReportsCrashes;
import org.fox.ttrss.types.Article;
import org.fox.ttrss.types.ArticleList;
import icepick.Icepick;
@ReportsCrashes(mode = ReportingInteractionMode.SILENT,
excludeMatchingSharedPreferencesKeys = {"password"},
resDialogText = R.string.crash_dialog_text,
formUri = "https://tt-rss.org/acra/submit/")
public class Application extends android.app.Application {
private static Application m_singleton;
......@@ -36,10 +29,6 @@ public class Application extends android.app.Application {
public final void onCreate() {
super.onCreate();
if (!BuildConfig.DEBUG) {
ACRA.init(this);
}
Bridge.initialize(getApplicationContext(), new SavedStateHandler() {
@Override
public void saveInstanceState(@NonNull Object target, @NonNull Bundle state) {
......
......@@ -469,7 +469,8 @@ public class ArticleFragment extends StateSavedFragment {
ws.setMediaPlaybackRequiresUserGesture(false);
}
if (CommonActivity.THEME_DARK.equals(m_prefs.getString("theme", CommonActivity.THEME_DEFAULT))) {
String theme = m_prefs.getString("theme", CommonActivity.THEME_DEFAULT);
if (CommonActivity.THEME_DARK.equals(theme) || CommonActivity.THEME_AMBER.equals(theme)) {
m_web.setBackgroundColor(Color.BLACK);
}
......
......@@ -338,6 +338,7 @@ public class ArticlePager extends StateSavedFragment {
put("include_header", "true");
}
put("resize", String.valueOf(m_activity.getScreenWidth()));
}
};
......
......@@ -17,6 +17,7 @@ import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.BitmapFactory;
import android.graphics.Point;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
......@@ -67,7 +68,7 @@ public class CommonActivity extends AppCompatActivity implements SharedPreferenc
public final static String THEME_DARK = "THEME_DARK";
public final static String THEME_LIGHT = "THEME_LIGHT";
//public final static String THEME_SEPIA = "THEME_SEPIA";
//public final static String THEME_AMBER = "THEME_AMBER";
public final static String THEME_AMBER = "THEME_AMBER";
public final static String THEME_DEFAULT = CommonActivity.THEME_LIGHT;
public final static String NOTIFICATION_CHANNEL_NORMAL = "channel_normal";
......@@ -315,7 +316,9 @@ public class CommonActivity extends AppCompatActivity implements SharedPreferenc
String theme = prefs.getString("theme", CommonActivity.THEME_DEFAULT);
if (theme.equals(THEME_DARK)) {
setTheme(R.style.DarkTheme);
setTheme(R.style.DarkTheme);
} else if (theme.equals(THEME_AMBER)) {
setTheme(R.style.AmberTheme);
} else {
setTheme(R.style.LightTheme);
}
......@@ -387,6 +390,7 @@ public class CommonActivity extends AppCompatActivity implements SharedPreferenc
builder.setExitAnimations(this, R.anim.slide_in_left, R.anim.slide_out_right);
builder.setToolbarColor(tvBackground.data);
builder.setShowTitle(true);
Intent shareIntent = getShareIntent(uri.toString(), null);
......@@ -576,5 +580,13 @@ public class CommonActivity extends AppCompatActivity implements SharedPreferenc
public static void requestWidgetUpdate(Context context) {
JobIntentService.enqueueWork(context.getApplicationContext(), WidgetUpdateService.class, 0, new Intent());
}
public int getScreenWidth() {
Display display = getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
return size.x;
}
}
......@@ -8,6 +8,7 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.LoaderManager;
......@@ -99,9 +100,9 @@ public class FeedCategoriesFragment extends BaseFeedlistFragment implements OnIt
// virtual cats implemented in getCategories since api level 1
if (apiLevel == 0) {
m_cats.add(new FeedCategory(-1, "Special", 0));
m_cats.add(new FeedCategory(-2, "Labels", 0));
m_cats.add(new FeedCategory(0, "Uncategorized", 0));
m_cats.add(new FeedCategory(-1, getString(R.string.cat_special), 0));
m_cats.add(new FeedCategory(-2, getString(R.string.cat_labels), 0));
m_cats.add(new FeedCategory(0, getString(R.string.cat_uncategorized), 0));
specialCatFound = true;
}
......@@ -117,7 +118,7 @@ public class FeedCategoriesFragment extends BaseFeedlistFragment implements OnIt
sortCats();
if (!specialCatFound) {
m_cats.add(0, new FeedCategory(-1, "Special", 0));
m_cats.add(0, new FeedCategory(-1, getString(R.string.cat_special), 0));
}
m_adapter.notifyDataSetChanged();
......@@ -304,6 +305,10 @@ public class FeedCategoriesFragment extends BaseFeedlistFragment implements OnIt
if (cat != null)
menu.setHeaderTitle(cat.title);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
menu.findItem(R.id.create_shortcut).setVisible(false);
}
super.onCreateContextMenu(menu, v, menuInfo);
}
......
......@@ -9,6 +9,7 @@ import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.graphics.Typeface;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.LoaderManager;
......@@ -115,6 +116,31 @@ public class FeedsFragment extends BaseFeedlistFragment implements OnItemClickLi
m_feeds.add(f);
catUnread += f.unread;
}
// localize special feed names
// TODO: join with shortcut title lookup by id?
if (m_activeCategory != null && m_activeCategory.id == -1) {
switch (f.id) {
case -1:
f.title = getString(R.string.feed_starred_articles);
break;
case -2:
f.title = getString(R.string.feed_published_articles);
break;
case -3:
f.title = getString(R.string.fresh_articles);
break;
case -4:
f.title = getString(R.string.feed_all_articles);
break;
case -6:
f.title = getString(R.string.feed_recently_read);
break;
case 0:
f.title = getString(R.string.feed_archived_articles);
break;
}
}
}
sortFeeds();
......@@ -206,8 +232,8 @@ public class FeedsFragment extends BaseFeedlistFragment implements OnItemClickLi
@Override
public int compare(Feed a, Feed b) {
Log.d(TAG, "A:" + a.title + " " + a.is_cat + " " + a.order_id);
Log.d(TAG, "B:" + b.title + " " + b.is_cat + " " + b.order_id);
//Log.d(TAG, "A:" + a.title + " " + a.is_cat + " " + a.order_id);
//Log.d(TAG, "B:" + b.title + " " + b.is_cat + " " + b.order_id);
if (a.id >= 0 && b.id >= 0)
if (a.is_cat && b.is_cat)
......@@ -348,6 +374,10 @@ public class FeedsFragment extends BaseFeedlistFragment implements OnItemClickLi
menu.findItem(R.id.unsubscribe_feed).setVisible(false);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
menu.findItem(R.id.create_shortcut).setVisible(false);
}
super.onCreateContextMenu(menu, v, menuInfo);
}
......@@ -520,13 +550,16 @@ public class FeedsFragment extends BaseFeedlistFragment implements OnItemClickLi
m_activity.getTheme().resolveAttribute(R.attr.ic_star, tv, true);
icon.setImageResource(tv.resourceId);
} else if (feed.id == -2 && !feed.is_cat) {
m_activity.getTheme().resolveAttribute(R.attr.ic_checkbox_marked, tv, true);
m_activity.getTheme().resolveAttribute(R.attr.ic_rss_box, tv, true);
icon.setImageResource(tv.resourceId);
} else if (feed.id == -3 && !feed.is_cat) {
m_activity.getTheme().resolveAttribute(R.attr.ic_coffee, tv, true);
m_activity.getTheme().resolveAttribute(R.attr.ic_fresh, tv, true);
icon.setImageResource(tv.resourceId);
} else if (feed.id == -4 && !feed.is_cat) {
m_activity.getTheme().resolveAttribute(R.attr.ic_folder_outline, tv, true);
m_activity.getTheme().resolveAttribute(R.attr.ic_inbox, tv, true);
icon.setImageResource(tv.resourceId);
} else if (feed.id == -6 && !feed.is_cat) {
m_activity.getTheme().resolveAttribute(R.attr.ic_restore, tv, true);
icon.setImageResource(tv.resourceId);
} else if (feed.is_cat) {
m_activity.getTheme().resolveAttribute(R.attr.ic_folder_outline, tv, true);
......
......@@ -123,7 +123,7 @@ public class GalleryActivity extends CommonActivity {
.asBitmap()
.skipMemoryCache(false)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.dontTransform()
//.dontTransform()
.into(HeadlinesFragment.FLAVOR_IMG_MIN_SIZE, HeadlinesFragment.FLAVOR_IMG_MIN_SIZE)
.get();
......
package org.fox.ttrss;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
......@@ -589,7 +590,7 @@ public class HeadlinesFragment extends StateSavedFragment {
final String sessionId = m_activity.getSessionId();
final boolean isCat = m_feed.is_cat;
HeadlinesRequest req = new HeadlinesRequest(getActivity().getApplicationContext(), m_activity, m_feed, m_articles) {
@SuppressLint("StaticFieldLeak") HeadlinesRequest req = new HeadlinesRequest(getActivity().getApplicationContext(), m_activity, m_feed, m_articles) {
@Override
protected void onProgressUpdate(Integer... progress) {
m_activity.setProgress(Math.round((((float) progress[0] / (float) progress[1]) * 10000)));
......@@ -714,6 +715,7 @@ public class HeadlinesFragment extends StateSavedFragment {
put("include_nested", "true");
put("has_sandbox", "true");
put("order_by", m_activity.getSortMode());
put("resize", String.valueOf(m_activity.getScreenWidth()));
if (isCat) put("is_cat", "true");
......@@ -939,7 +941,7 @@ public class HeadlinesFragment extends StateSavedFragment {
if (article.id == Article.TYPE_AMR_FOOTER && m_prefs.getBoolean("headlines_mark_read_scroll", false)) {
WindowManager wm = (WindowManager) m_activity.getSystemService(Context.WINDOW_SERVICE);
Display display = wm.getDefaultDisplay();
int screenHeight = display.getHeight();
int screenHeight = (int)(display.getHeight() * 1.5);
holder.view.setLayoutParams(new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT, screenHeight));
}
......@@ -1240,7 +1242,7 @@ public class HeadlinesFragment extends StateSavedFragment {
Glide.with(HeadlinesFragment.this)
.load(article.flavorImageUri)
.dontTransform()
//.dontTransform()
.diskCacheStrategy(DiskCacheStrategy.ALL)
.skipMemoryCache(false)
.listener(new RequestListener<String, GlideDrawable>() {
......@@ -1639,7 +1641,7 @@ public class HeadlinesFragment extends StateSavedFragment {
//Log.d(TAG, "XYR: " + pxToDp(w) + " " + pxToDp(h) + " " + r);
if (forceDown || h < m_minimumHeightToEmbed || r >= 1.2) {
if (forceDown || h < m_minimumHeightToEmbed || r >= 1) {
lp.addRule(RelativeLayout.BELOW, R.id.headline_header);
......
......@@ -126,6 +126,21 @@ public class MasterActivity extends OnlineActivity implements HeadlinesEventList
int feedId = i.getIntExtra("feed_id", 0);
boolean isCat = i.getBooleanExtra("feed_is_cat", false);
String feedTitle = i.getStringExtra("feed_title");
// app shortcuts are not allowed to pass string extras
if (feedTitle == null) {
switch (feedId) {
case -1:
feedTitle = getString(R.string.feed_starred_articles);
break;
case -3:
feedTitle = getString(R.string.fresh_articles);
break;
case -4:
feedTitle = getString(R.string.feed_all_articles);
break;
}
}
Feed tmpFeed = new Feed(feedId, feedTitle, isCat);
......@@ -159,11 +174,11 @@ public class MasterActivity extends OnlineActivity implements HeadlinesEventList
ft.replace(R.id.feeds_fragment, new FeedsFragment(), FRAG_FEEDS);
}
if (m_prefs.getBoolean("open_fresh_on_startup", true)) {
if (!shortcutMode && m_prefs.getBoolean("open_fresh_on_startup", true)) {