diff --git a/WordPress/src/main/java/org/wordpress/android/ui/prefs/BlogPreferencesActivity.java b/WordPress/src/main/java/org/wordpress/android/ui/prefs/BlogPreferencesActivity.java
index 7e283a3ad823..46a57ba697a5 100644
--- a/WordPress/src/main/java/org/wordpress/android/ui/prefs/BlogPreferencesActivity.java
+++ b/WordPress/src/main/java/org/wordpress/android/ui/prefs/BlogPreferencesActivity.java
@@ -214,8 +214,6 @@ public void onEventMainThread(ConnectionChangeReceiver.ConnectionChangeEvent eve
(SiteSettingsFragment) fragmentManager.findFragmentByTag(KEY_SETTINGS_FRAGMENT);
if (siteSettingsFragment != null) {
- siteSettingsFragment.allowEditing(event.isConnected());
-
if (!event.isConnected()) {
ToastUtils.showToast(this, getString(R.string.site_settings_disconnected_toast));
}
diff --git a/WordPress/src/main/java/org/wordpress/android/ui/prefs/RelatedPostsDialog.java b/WordPress/src/main/java/org/wordpress/android/ui/prefs/RelatedPostsDialog.java
index 6cfb2aaad905..446545bde4b9 100644
--- a/WordPress/src/main/java/org/wordpress/android/ui/prefs/RelatedPostsDialog.java
+++ b/WordPress/src/main/java/org/wordpress/android/ui/prefs/RelatedPostsDialog.java
@@ -76,9 +76,6 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
mPreviewImages.add((ImageView) v.findViewById(R.id.related_post_image2));
mPreviewImages.add((ImageView) v.findViewById(R.id.related_post_image3));
- WPPrefUtils.layoutAsSubhead(mShowHeader);
- WPPrefUtils.layoutAsSubhead(mShowImages);
-
Bundle args = getArguments();
if (args != null) {
mShowRelatedPosts.setChecked(args.getBoolean(SHOW_RELATED_POSTS_KEY));
diff --git a/WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsFragment.java b/WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsFragment.java
index d5284d2795af..f6306a18bd76 100644
--- a/WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsFragment.java
+++ b/WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsFragment.java
@@ -155,6 +155,10 @@ public class SiteSettingsFragment extends PreferenceFragment
private Preference mModerationHoldPref;
private Preference mBlacklistPref;
+ // This Device settings
+ private DetailListPreference mImageWidthPref;
+ private WPSwitchPreference mUploadAndLinkPref;
+
// Delete site option (NOTE: only for WP.org)
private Preference mDeleteSitePref;
@@ -207,9 +211,9 @@ public void onResume() {
public void run() {
// initialize settings with locally cached values, fetch remote on first pass
mSiteSettings.init(true);
- // stop future calls from fetching remote settings
}
}, FETCH_DELAY);
+ // stop future calls from fetching remote settings
mShouldFetch = false;
}
}
@@ -428,6 +432,13 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
setDetailListPreferenceValue(mFormatPref,
newValue.toString(),
mSiteSettings.getDefaultPostFormatDisplay());
+ } else if (preference == mImageWidthPref) {
+ mBlog.setMaxImageWidth(newValue.toString());
+ setDetailListPreferenceValue(mImageWidthPref,
+ mBlog.getMaxImageWidth(),
+ mBlog.getMaxImageWidth());
+ } else if (preference == mUploadAndLinkPref) {
+ mBlog.setFullSizeImage(Boolean.valueOf(newValue.toString()));
} else {
return false;
}
@@ -498,22 +509,13 @@ public void onCredentialsValidated(Exception error) {
}
}
- public void allowEditing(boolean allow) {
- // Address won't be editable until the app supports domain name changes
- if (mAddressPref != null) mAddressPref.setEnabled(false);
- if (mTitlePref != null) mTitlePref.setEnabled(allow);
- if (mTaglinePref != null) mTaglinePref.setEnabled(allow);
- if (mPrivacyPref != null) mPrivacyPref.setEnabled(allow);
- if (mLanguagePref != null) mLanguagePref.setEnabled(allow);
- }
-
private void setupPreferenceList(ListView prefList, Resources res) {
if (prefList == null || res == null) return;
// customize list dividers
- prefList.setDividerHeight(1);
//noinspection deprecation
- prefList.setDivider(getResources().getDrawable(R.drawable.preferences_divider));
+ prefList.setDivider(res.getDrawable(R.drawable.preferences_divider));
+ prefList.setDividerHeight(res.getDimensionPixelSize(R.dimen.site_settings_divider_height));
// handle long clicks on preferences to display hints
prefList.setOnItemLongClickListener(this);
// required to customize (Calypso) preference views
@@ -555,6 +557,8 @@ private void initPreferences() {
mMultipleLinksPref = getClickPref(R.string.pref_key_site_multiple_links);
mModerationHoldPref = getClickPref(R.string.pref_key_site_moderation_hold);
mBlacklistPref = getClickPref(R.string.pref_key_site_blacklist);
+ mImageWidthPref = (DetailListPreference) getChangePref(R.string.pref_key_site_image_width);
+ mUploadAndLinkPref = (WPSwitchPreference) getChangePref(R.string.pref_key_site_upload_and_link_image);
mDeleteSitePref = getClickPref(R.string.pref_key_site_delete_site);
// .com sites hide the Account category, self-hosted sites hide the Related Posts preference
@@ -633,6 +637,9 @@ private void setPreferencesFromSiteSettings() {
setDetailListPreferenceValue(mPrivacyPref,
String.valueOf(mSiteSettings.getPrivacy()),
mSiteSettings.getPrivacyDescription());
+ setDetailListPreferenceValue(mImageWidthPref,
+ mBlog.getMaxImageWidth(),
+ mBlog.getMaxImageWidth());
setCategories();
setPostFormats();
setAllowComments(mSiteSettings.getAllowComments());
@@ -652,6 +659,7 @@ private void setPreferencesFromSiteSettings() {
.getQuantityString(R.plurals.site_settings_multiple_links_summary,
mSiteSettings.getMultipleLinks(),
mSiteSettings.getMultipleLinks()));
+ mUploadAndLinkPref.setChecked(mBlog.isFullSizeImage());
mIdentityRequiredPreference.setChecked(mSiteSettings.getIdentityRequired());
mUserAccountRequiredPref.setChecked(mSiteSettings.getUserAccountRequired());
mThreadingPref.setValue(String.valueOf(mSiteSettings.getThreadingLevels()));
diff --git a/WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsInterface.java b/WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsInterface.java
index 6d2aa3158696..943779a41924 100644
--- a/WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsInterface.java
+++ b/WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsInterface.java
@@ -669,27 +669,16 @@ public SiteSettingsInterface init(boolean fetchRemote) {
* If there is a change in verification status the listener is notified.
*/
protected void credentialsVerified(boolean valid) {
- if (valid) {
- if (!mSettings.hasVerifiedCredentials) {
- notifyCredentialsVerifiedOnUiThread(null);
- }
- mRemoteSettings.hasVerifiedCredentials = mSettings.hasVerifiedCredentials = true;
- } else {
- if (mSettings.hasVerifiedCredentials) {
- notifyCredentialsVerifiedOnUiThread(new AuthenticationError());
- }
- mRemoteSettings.hasVerifiedCredentials = mSettings.hasVerifiedCredentials = false;
- }
+ Exception e = valid ? null : new AuthenticationError();
+ if (mSettings.hasVerifiedCredentials != valid) notifyCredentialsVerifiedOnUiThread(e);
+ mRemoteSettings.hasVerifiedCredentials = mSettings.hasVerifiedCredentials = valid;
}
/**
* Helper method to create an XML-RPC interface for the current blog.
*/
protected XMLRPCClientInterface instantiateInterface() {
- if (mBlog == null) {
- return null;
- }
-
+ if (mBlog == null) return null;
return XMLRPCFactory.instantiate(mBlog.getUri(), mBlog.getHttpuser(), mBlog.getHttppassword());
}
diff --git a/WordPress/src/main/res/color/number_picker_title.xml b/WordPress/src/main/res/color/calypso_title_text.xml
similarity index 100%
rename from WordPress/src/main/res/color/number_picker_title.xml
rename to WordPress/src/main/res/color/calypso_title_text.xml
diff --git a/WordPress/src/main/res/layout/blog_preferences.xml b/WordPress/src/main/res/layout/blog_preferences.xml
index 47b8ffa5f03b..5a1266a91536 100644
--- a/WordPress/src/main/res/layout/blog_preferences.xml
+++ b/WordPress/src/main/res/layout/blog_preferences.xml
@@ -93,7 +93,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
-
-
@@ -45,7 +45,7 @@
android:layout_marginBottom="8dp"
android:duplicateParentState="true"
android:textSize="@dimen/text_sz_large"
- android:textColor="@color/number_picker_title"
+ android:textColor="@color/calypso_title_text"
app:fontFamily="openSans"
app:fontVariation="normal" />
diff --git a/WordPress/src/main/res/layout/related_posts_dialog.xml b/WordPress/src/main/res/layout/related_posts_dialog.xml
index bdd5e8e3e8e9..dab3fa2ddf06 100644
--- a/WordPress/src/main/res/layout/related_posts_dialog.xml
+++ b/WordPress/src/main/res/layout/related_posts_dialog.xml
@@ -42,22 +42,22 @@
app:fontFamily="openSans"
app:fontVariation="normal" />
-
-
Select categories
Tags (separate tags with commas)
Content (tap to add text and media)
- Default image width
+ Default Image Width
Password
Blogs
Account details
@@ -441,6 +441,9 @@
wp_pref_site_location
wp_pref_site_default_category
wp_pref_site_default_format
+ wp_pref_site_default_this_device
+ wp_pref_site_default_image_width
+ wp_pref_site_upload_and_link_image
wp_pref_site_discussion
wp_pref_site_allow_comments
wp_pref_site_allow_comments_nested
@@ -491,6 +494,7 @@
@string/discussion
Defaults for New Posts
@string/comments
+ This Device
Site Title
@@ -503,6 +507,8 @@
Enable Location
Default Category
Default Format
+ @string/max_thumbnail_px_width
+ @string/upload_full_size_image
@string/related_posts
@string/more
Allow Comments
@@ -574,6 +580,29 @@
- @string/site_settings_privacy_hidden_summary
- @string/site_settings_privacy_private_summary
+
+ - Original Size
+ - 100
+ - 200
+ - 300
+ - 400
+ - 500
+ - 600
+ - 700
+ - 800
+ - 900
+ - 1000
+ - 1100
+ - 1200
+ - 1300
+ - 1400
+ - 1500
+ - 1600
+ - 1700
+ - 1800
+ - 1900
+ - 2000
+
@@ -602,6 +631,29 @@
- 0
- -1
+
+ - Original Size
+ - 100
+ - 200
+ - 300
+ - 400
+ - 500
+ - 600
+ - 700
+ - 800
+ - 900
+ - 1000
+ - 1100
+ - 1200
+ - 1300
+ - 1400
+ - 1500
+ - 1600
+ - 1700
+ - 1800
+ - 1900
+ - 2000
+
In a few words, explain what this site is about
@@ -614,6 +666,8 @@
Automatically add location data to your posts
Sets new post category
Sets new post format
+ Resizes images in posts to this width
+ Enable to always upload the fullsize image
Show or hide related posts in reader
View all available Discussion settings
View and change your sites discussion settings
diff --git a/WordPress/src/main/res/xml/site_settings.xml b/WordPress/src/main/res/xml/site_settings.xml
index 05ded3f54bb4..9af89df83589 100644
--- a/WordPress/src/main/res/xml/site_settings.xml
+++ b/WordPress/src/main/res/xml/site_settings.xml
@@ -89,12 +89,6 @@
android:key="@string/pref_key_site_writing"
android:title="@string/site_settings_writing_header">
-
-
+
+
+
+
+
+
+
+
+
+