diff --git a/drawable_resources/get_it_as_apk_backup.svg b/drawable_resources/get_it_as_apk_backup.svg new file mode 100644 index 000000000000..2abd229c6ee5 --- /dev/null +++ b/drawable_resources/get_it_as_apk_backup.svg @@ -0,0 +1,119 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + GET IT AS + APK-File + + + + + + diff --git a/drawable_resources/what_new_instant_upload.svg b/drawable_resources/whats_new_auto_upload.svg similarity index 99% rename from drawable_resources/what_new_instant_upload.svg rename to drawable_resources/whats_new_auto_upload.svg index 749ccd8320aa..d91364457fc6 100644 --- a/drawable_resources/what_new_instant_upload.svg +++ b/drawable_resources/whats_new_auto_upload.svg @@ -1,6 +1,6 @@ - + diff --git a/drawable_resources/whats_new_fingerprint.svg b/drawable_resources/whats_new_fingerprint.svg new file mode 100644 index 000000000000..b99ed3df6d89 --- /dev/null +++ b/drawable_resources/whats_new_fingerprint.svg @@ -0,0 +1,598 @@ + +image/svg+xml5 +1 +8 +0 + \ No newline at end of file diff --git a/drawable_resources/whats_new_notifications.svg b/drawable_resources/whats_new_notifications.svg new file mode 100644 index 000000000000..9c063d986906 --- /dev/null +++ b/drawable_resources/whats_new_notifications.svg @@ -0,0 +1,142 @@ + +image/svg+xml \ No newline at end of file diff --git a/drawable_resources/whats_new_search.svg b/drawable_resources/whats_new_search.svg new file mode 100644 index 000000000000..71277419777c --- /dev/null +++ b/drawable_resources/whats_new_search.svg @@ -0,0 +1,768 @@ + +image/svg+xml \ No newline at end of file diff --git a/drawable_resources/whats_new_theming.svg b/drawable_resources/whats_new_theming.svg new file mode 100644 index 000000000000..2b879187eabb --- /dev/null +++ b/drawable_resources/whats_new_theming.svg @@ -0,0 +1,1271 @@ + +image/svg+xml+ ++ ++ + \ No newline at end of file diff --git a/src/main/java/com/owncloud/android/MainApp.java b/src/main/java/com/owncloud/android/MainApp.java index a7a3f055815f..c34174fb2d17 100644 --- a/src/main/java/com/owncloud/android/MainApp.java +++ b/src/main/java/com/owncloud/android/MainApp.java @@ -219,6 +219,17 @@ public static int getVersionCode() { } } + // Non gradle build systems do not provide BuildConfig.VERSION_CODE + // so we must fallback to this method :( + public static String getVersionName() { + try { + String thisPackageName = getAppContext().getPackageName(); + return getAppContext().getPackageManager().getPackageInfo(thisPackageName, 0).versionName; + } catch (PackageManager.NameNotFoundException e) { + return ""; + } + } + // From AccountAuthenticator // public static final String AUTHORITY = "org.owncloud"; public static String getAuthority() { diff --git a/src/main/java/com/owncloud/android/features/FeatureList.java b/src/main/java/com/owncloud/android/features/FeatureList.java index 7ce36ffaa3d2..bc285ba46664 100644 --- a/src/main/java/com/owncloud/android/features/FeatureList.java +++ b/src/main/java/com/owncloud/android/features/FeatureList.java @@ -38,9 +38,11 @@ */ public class FeatureList { private static final boolean SHOW_ON_FIRST_RUN = true; + private static final boolean SHOW_ON_UPGRADE = false; - private static final String VERSION_1_0_0 = "1.0.0"; - private static final String BETA_VERSION_0 = "0"; + private static final int VERSION_1_0_0 = 10000099; + private static final int VERSION_2_0_0 = 20000099; + private static final int BETA_VERSION_0 = 0; static final private FeatureItem featuresList[] = { // Basic features showed on first install @@ -50,10 +52,20 @@ public class FeatureList { new FeatureItem(R.drawable.whats_new_accounts, R.string.welcome_feature_2_title, R.string.welcome_feature_2_text, VERSION_1_0_0, BETA_VERSION_0, SHOW_ON_FIRST_RUN), - new FeatureItem(R.drawable.what_new_instant_upload, + new FeatureItem(R.drawable.whats_new_auto_upload, R.string.welcome_feature_3_title, R.string.welcome_feature_3_text, VERSION_1_0_0, BETA_VERSION_0, SHOW_ON_FIRST_RUN), - // Features introduced in certain point in time + // 2.0.0 + new FeatureItem(R.drawable.whats_new_auto_upload, R.string.whats_new_auto_upload_title, + R.string.whats_new_auto_upload_content, VERSION_2_0_0, BETA_VERSION_0, SHOW_ON_UPGRADE, false), + new FeatureItem(R.drawable.whats_new_search, R.string.whats_new_search_title, + R.string.whats_new_search_content, VERSION_2_0_0, BETA_VERSION_0, SHOW_ON_UPGRADE, false), + new FeatureItem(R.drawable.whats_new_theming, R.string.whats_new_theming_title, + R.string.whats_new_theming_content, VERSION_2_0_0, BETA_VERSION_0, SHOW_ON_UPGRADE, false), + new FeatureItem(R.drawable.whats_new_notification, R.string.whats_new_notification_title, + R.string.whats_new_notification_content, VERSION_2_0_0, BETA_VERSION_0, SHOW_ON_UPGRADE, false), + new FeatureItem(R.drawable.whats_new_fingerprint, R.string.whats_new_fingerprint_title, + R.string.whats_new_fingerprint_content, VERSION_2_0_0, BETA_VERSION_0, SHOW_ON_UPGRADE, false) }; static public FeatureItem[] get() { @@ -64,7 +76,7 @@ static public FeatureItem[] getFiltered(final int lastSeenVersionCode, final boo List features = new LinkedList<>(); for (FeatureItem item : get()) { - final int itemVersionCode = isBeta ? item.getBetaVersionNumber() : item.getVersionNumber(); + final int itemVersionCode = isBeta ? item.getBetaVersionNumber() : item.getVersionCode(); if (isFirstRun && item.shouldShowOnFirstRun()) { features.add(item); } else if (!isFirstRun && !item.shouldShowOnFirstRun() && @@ -81,21 +93,29 @@ static public class FeatureItem implements Parcelable { private int image; private int titleText; private int contentText; - private int versionNumber; + private int versionCode; private int betaVersion; private boolean showOnInitialRun; + private boolean contentCentered; - public FeatureItem(int image, int titleText, int contentText, String version, String betaVersion) { - this(image, titleText, contentText, version, betaVersion, false); + public FeatureItem(int image, int titleText, int contentText, int version, int betaVersion) { + this(image, titleText, contentText, version, betaVersion, false, true); } - public FeatureItem(int image, int titleText, int contentText, String version, String betaVersion, boolean showOnInitialRun) { + public FeatureItem(int image, int titleText, int contentText, int version, int betaVersion, + boolean showOnInitialRun) { + this(image, titleText, contentText, version, betaVersion, showOnInitialRun, true); + } + + public FeatureItem(int image, int titleText, int contentText, int versionCode, int betaVersion, + boolean showOnInitialRun, boolean contentCentered) { this.image = image; this.titleText = titleText; this.contentText = contentText; - this.versionNumber = versionCodeFromString(version); - this.betaVersion = Integer.parseInt(betaVersion); + this.versionCode = versionCode; + this.betaVersion = betaVersion; this.showOnInitialRun = showOnInitialRun; + this.contentCentered = contentCentered; } public boolean shouldShowImage() { return image != DO_NOT_SHOW; } @@ -107,10 +127,16 @@ public FeatureItem(int image, int titleText, int contentText, String version, St public boolean shouldShowContentText() { return contentText != DO_NOT_SHOW; } public int getContentText() { return contentText; } - public int getVersionNumber() { return versionNumber; } + public int getVersionCode() { + return versionCode; + } public int getBetaVersionNumber() { return betaVersion; } public boolean shouldShowOnFirstRun() { return showOnInitialRun; } + public boolean shouldContentCentered() { + return contentCentered; + } + @Override public int describeContents() { return 0; @@ -121,18 +147,20 @@ public void writeToParcel(Parcel dest, int flags) { dest.writeInt(image); dest.writeInt(titleText); dest.writeInt(contentText); - dest.writeInt(versionNumber); + dest.writeInt(versionCode); dest.writeInt(betaVersion); dest.writeByte((byte) (showOnInitialRun ? 1 : 0)); + dest.writeByte((byte) (contentCentered ? 1 : 0)); } private FeatureItem(Parcel p) { image = p.readInt(); titleText = p.readInt(); contentText = p.readInt(); - versionNumber = p.readInt(); + versionCode = p.readInt(); betaVersion = p.readInt(); showOnInitialRun = p.readByte() == 1; + contentCentered = p.readByte() == 1; } public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { @@ -156,7 +184,7 @@ private static int versionCodeFromString(String version) { return 0; } return Integer.parseInt(v[0])*(int)(10e6) + - Integer.parseInt(v[1])*(int)(10e4) + + Integer.parseInt(v[1])*(int)(10e3) + Integer.parseInt(v[2])*100; } } diff --git a/src/main/java/com/owncloud/android/ui/activity/WhatsNewActivity.java b/src/main/java/com/owncloud/android/ui/activity/WhatsNewActivity.java index e632cfc454bc..fae5287ae224 100644 --- a/src/main/java/com/owncloud/android/ui/activity/WhatsNewActivity.java +++ b/src/main/java/com/owncloud/android/ui/activity/WhatsNewActivity.java @@ -1,23 +1,23 @@ /** - * Nextcloud Android client application + * Nextcloud Android client application * - * @author Bartosz Przybylski - * Copyright (C) 2015 Bartosz Przybylski - * Copyright (C) 2015 ownCloud Inc. - * Copyright (C) 2016 Nextcloud. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE - * License as published by the Free Software Foundation; either - * version 3 of the License, or any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU AFFERO GENERAL PUBLIC LICENSE for more details. - * - * You should have received a copy of the GNU Affero General Public - * License along with this program. If not, see . + * @author Bartosz Przybylski + * Copyright (C) 2015 Bartosz Przybylski + * Copyright (C) 2015 ownCloud Inc. + * Copyright (C) 2016 Nextcloud. + *

+ * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AFFERO GENERAL PUBLIC LICENSE for more details. + *

+ * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see . */ package com.owncloud.android.ui.activity; @@ -36,6 +36,7 @@ import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.view.ViewPager; +import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -77,7 +78,7 @@ protected void onCreate(Bundle savedInstanceState) { setContentView(R.layout.whats_new_activity); mProgress = (ProgressIndicator) findViewById(R.id.progressIndicator); - mPager = (ViewPager)findViewById(R.id.contentPanel); + mPager = (ViewPager) findViewById(R.id.contentPanel); final boolean isBeta = getResources().getBoolean(R.bool.is_beta); String[] urls = getResources().getStringArray(R.array.whatsnew_urls); @@ -109,8 +110,8 @@ protected void onCreate(Bundle savedInstanceState) { @Override public void onClick(View view) { if (mProgress.hasNextStep()) { - mPager.setCurrentItem(mPager.getCurrentItem()+1, true); - mProgress.animateToStep(mPager.getCurrentItem()+1); + mPager.setCurrentItem(mPager.getCurrentItem() + 1, true); + mProgress.animateToStep(mPager.getCurrentItem() + 1); } else { onFinish(); finish(); @@ -134,14 +135,14 @@ public void onClick(View view) { } }); - TextView tv = (TextView)findViewById(R.id.welcomeText); + TextView tv = (TextView) findViewById(R.id.welcomeText); if (showWebView) { tv.setText(R.string.app_name); } else if (isFirstRun()) { tv.setText(R.string.empty); } else { - tv.setText(R.string.whats_new_title); + tv.setText(String.format(getString(R.string.whats_new_title), MainApp.getVersionName())); } updateNextButtonIfNeeded(); @@ -205,8 +206,8 @@ static private boolean shouldShow(Context context) { return (isFirstRun() && context instanceof AccountAuthenticatorActivity) || ( !(isFirstRun() && (context instanceof FileDisplayActivity)) && - !(context instanceof PassCodeActivity) && - (FeatureList.getFiltered(getLastSeenVersionCode(), isFirstRun(), isBeta).length > 0) + !(context instanceof PassCodeActivity) && + (FeatureList.getFiltered(getLastSeenVersionCode(), isFirstRun(), isBeta).length > 0) ); } @@ -217,7 +218,7 @@ public void onPageScrolled(int position, float positionOffset, int positionOffse @Override public void onPageSelected(int position) { - mProgress.animateToStep(position+1); + mProgress.animateToStep(position + 1); updateNextButtonIfNeeded(); } @@ -284,7 +285,7 @@ private final class FeaturesViewAdapter extends FragmentPagerAdapter { private FeatureItem[] mFeatures; - public FeaturesViewAdapter(FragmentManager fm, FeatureItem[]features) { + public FeaturesViewAdapter(FragmentManager fm, FeatureItem[] features) { super(fm); mFeatures = features; } @@ -314,7 +315,7 @@ static public FeatureFragment newInstance(FeatureItem item) { @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); - mItem = getArguments() != null ? (FeatureItem)getArguments().getParcelable("feature") : null; + mItem = getArguments() != null ? (FeatureItem) getArguments().getParcelable("feature") : null; } @Nullable @@ -324,19 +325,23 @@ public View onCreateView(LayoutInflater inflater, @Nullable Bundle savedInstanceState) { View v = inflater.inflate(R.layout.whats_new_element, container, false); - ImageView iv = (ImageView)v.findViewById(R.id.whatsNewImage); + ImageView iv = (ImageView) v.findViewById(R.id.whatsNewImage); if (mItem.shouldShowImage()) { iv.setImageResource(mItem.getImage()); } - TextView tv2 = (TextView)v.findViewById(R.id.whatsNewTitle); + TextView tv2 = (TextView) v.findViewById(R.id.whatsNewTitle); if (mItem.shouldShowTitleText()) { tv2.setText(mItem.getTitleText()); } - tv2 = (TextView)v.findViewById(R.id.whatsNewText); + tv2 = (TextView) v.findViewById(R.id.whatsNewText); if (mItem.shouldShowContentText()) { tv2.setText(mItem.getContentText()); + + if (!mItem.shouldContentCentered()) { + tv2.setGravity(Gravity.START); + } } return v; diff --git a/src/main/res/drawable-hdpi/what_new_instant_upload.png b/src/main/res/drawable-hdpi/whats_new_auto_upload.png similarity index 100% rename from src/main/res/drawable-hdpi/what_new_instant_upload.png rename to src/main/res/drawable-hdpi/whats_new_auto_upload.png diff --git a/src/main/res/drawable-hdpi/whats_new_fingerprint.png b/src/main/res/drawable-hdpi/whats_new_fingerprint.png new file mode 100644 index 000000000000..3ad9f072eb3d Binary files /dev/null and b/src/main/res/drawable-hdpi/whats_new_fingerprint.png differ diff --git a/src/main/res/drawable-hdpi/whats_new_notification.png b/src/main/res/drawable-hdpi/whats_new_notification.png new file mode 100644 index 000000000000..50794105503b Binary files /dev/null and b/src/main/res/drawable-hdpi/whats_new_notification.png differ diff --git a/src/main/res/drawable-hdpi/whats_new_search.png b/src/main/res/drawable-hdpi/whats_new_search.png new file mode 100644 index 000000000000..43f81c160124 Binary files /dev/null and b/src/main/res/drawable-hdpi/whats_new_search.png differ diff --git a/src/main/res/drawable-hdpi/whats_new_theming.png b/src/main/res/drawable-hdpi/whats_new_theming.png new file mode 100644 index 000000000000..68ffda15bbab Binary files /dev/null and b/src/main/res/drawable-hdpi/whats_new_theming.png differ diff --git a/src/main/res/layout/whats_new_activity.xml b/src/main/res/layout/whats_new_activity.xml index 2136d3d3362f..16f49c867e8a 100644 --- a/src/main/res/layout/whats_new_activity.xml +++ b/src/main/res/layout/whats_new_activity.xml @@ -34,7 +34,8 @@ android:layout_marginStart="10dp" android:layout_marginTop="5dp" android:layout_weight="6" - android:gravity="center_vertical" + android:textStyle="bold" + android:gravity="center" android:text="@string/placeholder_sentence" android:textAppearance="?android:attr/textAppearanceLarge" android:textColor="@color/primary_button_text_color"/> diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 3ecc70128a00..2b983a0678e9 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -623,7 +623,7 @@ Unknown - What\'s new in Nextcloud + What\'s new in %1$s A safe home for all your data @@ -632,9 +632,21 @@ Multi account Connect to all your clouds - Instant upload + Auto upload Keep your photos safe + Enhanced auto upload + \u2022 for all android versions\n\u2022 less battery consumption\n\u2022 more reliable, but not instant\n\u2022 separation of images & videos + + Full server search + \u2022 Not only in current folder\n\u2022 Returns results from complete server\n\u2022 Directly open files/folders\n\u2022 Supported in NC12 and above + + Theming support + If enabled on server app will show\n\u2022 background image\n\u2022 server name\n\u2022 use color to distinguish accounts + + Notification support + Get notifications like\n\u2022 new remote share\n\u2022 comment mentions\n\u2022 admin announcements + Skip Please scan your finger @@ -690,4 +702,6 @@ Test server connection , Resharing is not allowed + Unlock with fingerprint + Use your fingerprint to unlock the app