Merge remote-tracking branch 'upstream/master' into profile

This commit is contained in:
Mark Anderson 2015-06-15 21:45:34 +01:00
commit 30bbef47a8
13 changed files with 51 additions and 14 deletions

View file

@ -149,6 +149,8 @@ class MUserSearch(mongo.Document):
except Exception, e:
print " ****> Error on search removal: %s" % e
# You only need to drop the index if there is data you want to clear.
# A new search server won't need this, as there isn't anything to drop.
if drop_index:
logging.info(" ---> ~FRRemoving stories search index...")
SearchStory.drop()

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.newsblur"
android:versionCode="95"
android:versionName="4.3.0b3" >
android:versionCode="97"
android:versionName="4.3.0b5" >
<uses-sdk
android:minSdkVersion="11"

View file

@ -62,6 +62,7 @@ public abstract class Reading extends NbActivity implements OnPageChangeListener
private static final String BUNDLE_POSITION = "position";
private static final String BUNDLE_STARTING_UNREAD = "starting_unread";
private static final String BUNDLE_SELECTED_FEED_VIEW = "selectedFeedView";
private static final String BUNDLE_IS_FULLSCREEN = "is_fullscreen";
private static final int OVERLAY_RANGE_TOP_DP = 40;
private static final int OVERLAY_RANGE_BOT_DP = 60;
@ -150,6 +151,14 @@ public abstract class Reading extends NbActivity implements OnPageChangeListener
defaultFeedView = (DefaultFeedView) getIntent().getSerializableExtra(EXTRA_DEFAULT_FEED_VIEW);
}
// were we fullscreen before rotation?
if ((savedInstanceBundle != null) && savedInstanceBundle.containsKey(BUNDLE_IS_FULLSCREEN)) {
boolean isFullscreen = savedInstanceBundle.getBoolean(BUNDLE_IS_FULLSCREEN, false);
if (isFullscreen) {
ViewUtils.hideSystemUI(getWindow().getDecorView());
}
}
// this value is expensive to compute but doesn't change during a single runtime
this.overlayRangeTopPx = (float) UIUtils.convertDPsToPixels(this, OVERLAY_RANGE_TOP_DP);
this.overlayRangeBotPx = (float) UIUtils.convertDPsToPixels(this, OVERLAY_RANGE_BOT_DP);
@ -166,6 +175,7 @@ public abstract class Reading extends NbActivity implements OnPageChangeListener
if (pager != null) {
outState.putInt(BUNDLE_POSITION, pager.getCurrentItem());
}
if (startingUnreadCount != 0) {
outState.putInt(BUNDLE_STARTING_UNREAD, startingUnreadCount);
}
@ -174,6 +184,10 @@ public abstract class Reading extends NbActivity implements OnPageChangeListener
if (item != null) {
outState.putSerializable(BUNDLE_SELECTED_FEED_VIEW, item.getSelectedFeedView());
}
if (ViewUtils.isSystemUIHidden(getWindow().getDecorView())) {
outState.putBoolean(BUNDLE_IS_FULLSCREEN, true);
}
}
@Override
@ -502,8 +516,8 @@ public abstract class Reading extends NbActivity implements OnPageChangeListener
enableOverlays();
// Ensure that we come out of immersive view if the activity no longer has focus
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && !hasFocus) {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
if (!hasFocus) {
ViewUtils.showSystemUI(getWindow().getDecorView());
}
}

View file

@ -63,6 +63,7 @@ public class SetupCommentSectionTask extends AsyncTask<Void, Void, Void> {
@Override
protected Void doInBackground(Void... arg0) {
if (context == null) return null;
comments = FeedUtils.dbHelper.getComments(story.id);
publicCommentViews = new ArrayList<View>();
@ -223,6 +224,7 @@ public class SetupCommentSectionTask extends AsyncTask<Void, Void, Void> {
}
protected void onPostExecute(Void result) {
if (context == null) return;
View view = viewHolder.get();
if (view == null) return; // fragment was dismissed before we rendered

View file

@ -165,10 +165,11 @@ public class PrefsUtils {
saveUserImage(context, profile.photoUrl);
}
public static UserDetails getUserDetails(final Context context) {
public static UserDetails getUserDetails(Context context) {
UserDetails user = new UserDetails();
final SharedPreferences preferences = context.getSharedPreferences(PrefConstants.PREFERENCES, 0);
if (context == null) return null;
SharedPreferences preferences = context.getSharedPreferences(PrefConstants.PREFERENCES, 0);
user.averageStoriesPerMonth = preferences.getInt(PrefConstants.USER_AVERAGE_STORIES_PER_MONTH, 0);
user.bio = preferences.getString(PrefConstants.USER_BIO, null);
user.feedAddress = preferences.getString(PrefConstants.USER_FEED_ADDRESS, null);

View file

@ -1,9 +1,10 @@
package com.newsblur.util;
import android.app.FragmentManager;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.app.FragmentManager;
import android.os.Build;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
@ -129,6 +130,7 @@ public class ViewUtils {
}
public static void showSystemUI(View view) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) return;
// Some layout/drawing artifacts as we don't use the FLAG_LAYOUT flags but otherwise the overlays wouldn't appear
// and the action bar would overlap the content
view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
@ -145,6 +147,7 @@ public class ViewUtils {
}
public static boolean isSystemUIHidden(View view) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) return false;
return (view.getSystemUiVisibility() & View.SYSTEM_UI_FLAG_IMMERSIVE) != 0;
}

View file

@ -30,10 +30,10 @@ echo "
/ '. .'
.' \.-'
/ '.
; \
; \
| '
' / \
; / NewsBlur \
' / \
; / NewsBlur \
| Y ;
; \ DB Server .
' t-' ;

3
fabfile.py vendored
View file

@ -181,7 +181,7 @@ def ec2():
def all():
do()
env.roles = ['app', 'dev', 'db', 'task', 'debug', 'node', 'push', 'work']
env.roles = ['app', 'db', 'task', 'debug', 'node', 'push', 'work']
# =============
# = Bootstrap =
@ -811,7 +811,6 @@ def setup_db_firewall():
# DigitalOcean
for ip in set(env.roledefs['app'] +
env.roledefs['db'] +
env.roledefs['dev'] +
env.roledefs['debug'] +
env.roledefs['task'] +
env.roledefs['work'] +

View file

@ -9248,6 +9248,14 @@ form.opml_import_form input {
margin: 0 6px 0 0;
background: transparent url('/media/img/mobile/nokia.png') no-repeat 0 0;
}
.NB-modal-goodies .NB-goodies-sailfish {
float: right;
width: 64px;
height: 28px;
margin: 0 6px 0 0;
background: transparent url('/media/img/mobile/sailfish.png') no-repeat 0 0;
background-size: auto 28px;
}
.NB-modal-goodies .NB-goodies-windows {
float: right;
width: 28px;

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View file

@ -154,7 +154,7 @@ _.extend(NEWSBLUR.ReaderAccount.prototype, {
]),
(NEWSBLUR.Globals.is_premium && $.make('div', { className: 'NB-preference NB-preference-premium-renew' }, [
$.make('div', { className: 'NB-preference-options' }, [
$.make('div', { className: 'NB-block' }, 'Your premium account will renew on:'),
$.make('div', { className: 'NB-block' }, 'Your premium account is paid until:'),
$.make('div', { className: 'NB-block' }, [
$.make('span', { className: 'NB-raquo' }, '&raquo;'),
' ',

View file

@ -71,7 +71,7 @@ _.extend(NEWSBLUR.ReaderFeedchooser.prototype, {
' for going premium!'
]),
$.make('h2', { className: 'NB-modal-subtitle' }, [
'Your premium account will renew on:',
'Your premium account is paid until:',
$.make('br'),
$.make('b', { style: 'display: block; margin: 8px 0' }, [
$.make('span', { className: 'NB-raquo' }, '&raquo;'),

View file

@ -111,6 +111,14 @@ _.extend(NEWSBLUR.ReaderGoodies.prototype, {
$.make('div', { className: 'NB-goodies-nokia' }),
$.make('div', { className: 'NB-goodies-title' }, 'Web Feeds')
]),
$.make('div', { className: 'NB-goodies-group NB-modal-submit' }, [
$.make('a', {
className: 'NB-goodies-mobile-link NB-modal-submit-button NB-modal-submit-green',
href: 'https://github.com/jrutila/harbour-newsblur'
}, 'View in Sailfish OS'),
$.make('div', { className: 'NB-goodies-sailfish' }),
$.make('div', { className: 'NB-goodies-title' }, 'Sailblur')
]),
$.make('fieldset', [
$.make('legend', 'Native Apps for NewsBlur')
]),