Răsfoiți Sursa

make bullet list toggable,
update e2e & text

Signed-off-by: tobiaskaminsky <tobias@kaminsky.me>

tobiaskaminsky 7 ani în urmă
părinte
comite
79d1349942

Fișier diff suprimat deoarece este prea mare
+ 86 - 0
drawable_resources/whats_new_end_to_end_encryption.svg


+ 17 - 7
src/main/java/com/owncloud/android/features/FeatureList.java

@@ -54,13 +54,15 @@ public class FeatureList {
                     R.string.welcome_feature_3_title, R.string.welcome_feature_3_text,
                     VERSION_1_0_0, BETA_VERSION_0, SHOW_ON_FIRST_RUN),
             // 3.0.0
-            new FeatureItem(R.drawable.whats_new_files, R.string.whats_new_end_to_end_encryption_title,
+            new FeatureItem(R.drawable.whats_new_end_to_end_encryption, R.string.whats_new_end_to_end_encryption_title,
                     R.string.whats_new_end_to_end_encryption_content, VERSION_3_0_0, BETA_VERSION_0,
-                    SHOW_ON_UPGRADE, false),
+                    SHOW_ON_UPGRADE, false, false),
             new FeatureItem(R.drawable.whats_new_resized_images, R.string.whats_new_resized_images_title,
-                    R.string.whats_new_resized_images_content, VERSION_3_0_0, BETA_VERSION_0, SHOW_ON_UPGRADE, false),
+                    R.string.whats_new_resized_images_content, VERSION_3_0_0, BETA_VERSION_0, SHOW_ON_UPGRADE,
+                    false, false),
             new FeatureItem(R.drawable.whats_new_ipv6, R.string.whats_new_ipv6_title,
-                    R.string.whats_new_ipv6_content, VERSION_3_0_0, BETA_VERSION_0, SHOW_ON_UPGRADE, false),
+                    R.string.whats_new_ipv6_content, VERSION_3_0_0,
+                    BETA_VERSION_0, SHOW_ON_UPGRADE, false, false),
     };
 
     static public FeatureItem[] get() {
@@ -92,18 +94,19 @@ public class FeatureList {
         private int betaVersion;
         private boolean showOnInitialRun;
         private boolean contentCentered;
+        private boolean bulletList;
 
         public FeatureItem(int image, int titleText, int contentText, int version, int betaVersion) {
-            this(image, titleText, contentText, version, betaVersion, false, true);
+            this(image, titleText, contentText, version, betaVersion, false, true, true);
         }
 
         public FeatureItem(int image, int titleText, int contentText, int version, int betaVersion,
                            boolean showOnInitialRun) {
-            this(image, titleText, contentText, version, betaVersion, showOnInitialRun, true);
+            this(image, titleText, contentText, version, betaVersion, showOnInitialRun, true, true);
         }
 
         public FeatureItem(int image, int titleText, int contentText, int versionCode, int betaVersion,
-                           boolean showOnInitialRun, boolean contentCentered) {
+                           boolean showOnInitialRun, boolean contentCentered, boolean bulletList) {
             this.image = image;
             this.titleText = titleText;
             this.contentText = contentText;
@@ -111,6 +114,7 @@ public class FeatureList {
             this.betaVersion = betaVersion;
             this.showOnInitialRun = showOnInitialRun;
             this.contentCentered = contentCentered;
+            this.bulletList = bulletList;
         }
 
         public boolean shouldShowImage() { return image != DO_NOT_SHOW; }
@@ -132,6 +136,10 @@ public class FeatureList {
             return contentCentered;
         }
 
+        public boolean shouldShowBulletPointList() {
+            return bulletList;
+        }
+
         @Override
         public int describeContents() {
             return 0;
@@ -146,6 +154,7 @@ public class FeatureList {
             dest.writeInt(betaVersion);
             dest.writeByte((byte) (showOnInitialRun ? 1 : 0));
             dest.writeByte((byte) (contentCentered ? 1 : 0));
+            dest.writeByte((byte) (bulletList ? 1 : 0));
         }
 
         private FeatureItem(Parcel p) {
@@ -156,6 +165,7 @@ public class FeatureList {
             betaVersion = p.readInt();
             showOnInitialRun = p.readByte() == 1;
             contentCentered = p.readByte() == 1;
+            bulletList = p.readByte() == 1;
         }
         public static final Parcelable.Creator CREATOR =
                 new Parcelable.Creator() {

+ 47 - 23
src/main/java/com/owncloud/android/ui/activity/WhatsNewActivity.java

@@ -352,30 +352,19 @@ public class WhatsNewActivity extends FragmentActivity implements ViewPager.OnPa
             if (mItem.shouldShowContentText()) {
                 LinearLayout linearLayout = v.findViewById(R.id.whatsNewTextLayout);
 
-                int standardMargin = getResources().getDimensionPixelSize(R.dimen.standard_margin);
-                int doubleMargin = getResources().getDimensionPixelSize(R.dimen.standard_double_margin);
-                int zeroMargin = getResources().getDimensionPixelSize(R.dimen.zero);
-
-                String[] texts = getText(mItem.getContentText()).toString().split("\n");
-
-                for (String text : texts) {
-                    TextView textView = new TextView(getContext());
-                    LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
-                            ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
-                    layoutParams.setMargins(doubleMargin, standardMargin, doubleMargin, zeroMargin);
-                    textView.setTextAppearance(getContext(), R.style.NextcloudTextAppearanceMedium);
-                    textView.setLayoutParams(layoutParams);
-                    BulletSpan bulletSpan = new BulletSpan(standardMargin, fontColor);
-                    SpannableString spannableString = new SpannableString(text);
-                    spannableString.setSpan(bulletSpan, 0, spannableString.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
-                    textView.setText(spannableString);
-                    textView.setTextColor(fontColor);
-
-                    if (!mItem.shouldContentCentered()) {
-                        textView.setGravity(Gravity.START);
-                    } else {
-                        textView.setGravity(Gravity.CENTER_HORIZONTAL);
+
+                if (mItem.shouldShowBulletPointList()) {
+                    String[] texts = getText(mItem.getContentText()).toString().split("\n");
+
+                    for (String text : texts) {
+                        TextView textView = generateTextView(text, getContext(),
+                                mItem.shouldContentCentered(), fontColor, true);
+
+                        linearLayout.addView(textView);
                     }
+                } else {
+                    TextView textView = generateTextView(getText(mItem.getContentText()).toString(),
+                            getContext(), mItem.shouldContentCentered(), fontColor, false);
 
                     linearLayout.addView(textView);
                 }
@@ -384,4 +373,39 @@ public class WhatsNewActivity extends FragmentActivity implements ViewPager.OnPa
             return v;
         }
     }
+
+    private static TextView generateTextView(String text, Context context,
+                                             boolean shouldContentCentered, int fontColor,
+                                             boolean showBulletPoints) {
+        int standardMargin = context.getResources().getDimensionPixelSize(R.dimen.standard_margin);
+        int doubleMargin = context.getResources()
+                .getDimensionPixelSize(R.dimen.standard_double_margin);
+        int zeroMargin = context.getResources().getDimensionPixelSize(R.dimen.zero);
+
+        TextView textView = new TextView(context);
+        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
+                ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+        layoutParams.setMargins(doubleMargin, standardMargin, doubleMargin, zeroMargin);
+        textView.setTextAppearance(context, R.style.NextcloudTextAppearanceMedium);
+        textView.setLayoutParams(layoutParams);
+
+        if (showBulletPoints) {
+            BulletSpan bulletSpan = new BulletSpan(standardMargin, fontColor);
+            SpannableString spannableString = new SpannableString(text);
+            spannableString.setSpan(bulletSpan, 0, spannableString.length(),
+                    Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
+            textView.setText(spannableString);
+        } else {
+            textView.setText(text);
+        }
+        textView.setTextColor(fontColor);
+
+        if (!shouldContentCentered) {
+            textView.setGravity(Gravity.START);
+        } else {
+            textView.setGravity(Gravity.CENTER_HORIZONTAL);
+        }
+
+        return textView;
+    }
 }

BIN
src/main/res/drawable-hdpi/whats_new_end_to_end_encryption.png


+ 3 - 3
src/main/res/values/strings.xml

@@ -602,11 +602,11 @@
     <string name="welcome_feature_3_text">Keep your photos safe</string>
 
     <string name="whats_new_end_to_end_encryption_title">End to end encryption</string>
-    <string name="whats_new_end_to_end_encryption_content">Easily add new devices using a 12 words passphrase\nSetup directly from any client\nAny number of folders can be end-to-end encrypted</string>
+    <string name="whats_new_end_to_end_encryption_content">Choose which folders to encrypt, set up from any client. Easily add new devices using a 12 word passphrase.</string>
     <string name="whats_new_resized_images_title">Screen adapted images</string>
-    <string name="whats_new_resized_images_content">on preview show only screen adapted image\nvery  small, but still usable for sending/sharing\ndownload whole file on zooming possible</string>
+    <string name="whats_new_resized_images_content">Smaller version is shown by default, as it saves data and works nicely for sending &amp; sharing. You can download the whole file on zooming.</string>
     <string name="whats_new_ipv6_title">IPv6 support</string>
-    <string name="whats_new_ipv6_content">support for IPv6\nsupports IPv6/v4 at the same time</string>
+    <string name="whats_new_ipv6_content">Now works nicely with servers supporting IPv6, while supporting IPv4 at the same time.</string>
 
     <string name="whats_new_skip">Skip</string>
 

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff