瀏覽代碼

fixed headers and code duplication

AndyScherzinger 8 年之前
父節點
當前提交
ae40988c34

+ 19 - 1
res/drawable-anydpi-v21/arrow_right.xml

@@ -1,4 +1,22 @@
-<!-- drawable/arrow_right.xml -->
+<!--
+  Nextcloud Android client application
+
+  Copyright (C) 2016 Andy Scherzinger
+  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 <http://www.gnu.org/licenses/>.
+-->
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
     android:height="24dp"
     android:height="24dp"
     android:width="24dp"
     android:width="24dp"

+ 10 - 9
res/drawable/indicator_dot_not_selected.xml

@@ -1,22 +1,23 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
 <!--
 <!--
-  ownCloud Android client application
+  Nextcloud Android client application
 
 
   Copyright (C) 2015-2016 Bartosz Przybylski
   Copyright (C) 2015-2016 Bartosz Przybylski
   Copyright (C) 2015 ownCloud Inc.
   Copyright (C) 2015 ownCloud Inc.
-  Copyright (C) 2016 nextCloud
+  Copyright (C) 2016 Nextcloud.
 
 
-  This program is free software: you can redistribute it and/or modify
-  it under the terms of the GNU General Public License version 2,
-  as published by the Free Software Foundation.
+  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,
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-  GNU General Public License for more details.
+  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 General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+  You should have received a copy of the GNU Affero General Public
+  License along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->
 -->
 <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
 <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
     <item android:bottom="5dp" android:top="5dp" android:right="5dp" android:left="5dp">
     <item android:bottom="5dp" android:top="5dp" android:right="5dp" android:left="5dp">

+ 10 - 9
res/drawable/indicator_dot_selected.xml

@@ -1,22 +1,23 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
 <!--
 <!--
-  ownCloud Android client application
+  Nextcloud Android client application
 
 
   Copyright (C) 2015-2016 Bartosz Przybylski
   Copyright (C) 2015-2016 Bartosz Przybylski
   Copyright (C) 2015 ownCloud Inc.
   Copyright (C) 2015 ownCloud Inc.
-  Copyright (C) 2016 nextCloud
+  Copyright (C) 2016 Nextcloud.
 
 
-  This program is free software: you can redistribute it and/or modify
-  it under the terms of the GNU General Public License version 2,
-  as published by the Free Software Foundation.
+  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,
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-  GNU General Public License for more details.
+  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 General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+  You should have received a copy of the GNU Affero General Public
+  License along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->
 -->
 <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
 <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
     <item android:bottom="5dp" android:top="5dp" android:right="5dp" android:left="5dp">
     <item android:bottom="5dp" android:top="5dp" android:right="5dp" android:left="5dp">

+ 20 - 0
res/drawable/round_button.xml

@@ -1,4 +1,24 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
+<!--
+  Nextcloud Android client application
+
+  Copyright (C) 2016 Andy Scherzinger
+  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 <http://www.gnu.org/licenses/>.
+-->
 <shape xmlns:android="http://schemas.android.com/apk/res/android"
 <shape xmlns:android="http://schemas.android.com/apk/res/android"
     android:shape="oval">
     android:shape="oval">
     <solid android:color="@color/owncloud_blue_accent"/>
     <solid android:color="@color/owncloud_blue_accent"/>

+ 10 - 11
res/drawable/whats_new_progress_transition.xml

@@ -1,25 +1,24 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
 <!--
 <!--
-  ownCloud Android client application
+  Nextcloud Android client application
 
 
   Copyright (C) 2015 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 General Public License version 2,
-  as published by the Free Software Foundation.
+  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,
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-  GNU General Public License for more details.
+  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 General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+  You should have received a copy of the GNU Affero General Public
+  License along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->
 -->
-
 <transition xmlns:android="http://schemas.android.com/apk/res/android">
 <transition xmlns:android="http://schemas.android.com/apk/res/android">
-
     <item android:drawable="@drawable/indicator_dot_not_selected" />
     <item android:drawable="@drawable/indicator_dot_not_selected" />
     <item android:drawable="@drawable/indicator_dot_selected" />
     <item android:drawable="@drawable/indicator_dot_selected" />
 </transition>
 </transition>

+ 20 - 0
res/layout/whats_new_activity.xml

@@ -1,4 +1,24 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
+<!--
+  Nextcloud Android client application
+
+  Copyright (C) 2015-2016 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 <http://www.gnu.org/licenses/>.
+-->
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
               android:layout_width="match_parent"
               android:layout_width="match_parent"
               android:layout_height="match_parent"
               android:layout_height="match_parent"

+ 20 - 0
res/layout/whats_new_element.xml

@@ -1,4 +1,24 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
+<!--
+  Nextcloud Android client application
+
+  Copyright (C) 2015-2016 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 <http://www.gnu.org/licenses/>.
+-->
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
               android:orientation="vertical"
               android:orientation="vertical"
               android:layout_width="match_parent"
               android:layout_width="match_parent"

+ 25 - 18
src/com/owncloud/android/features/FeatureList.java

@@ -1,22 +1,23 @@
 /**
 /**
- *   ownCloud Android client application
+ *   Nextcloud Android client application
  *
  *
  *   @author Bartosz Przybylski
  *   @author Bartosz Przybylski
  *   Copyright (C) 2015 Bartosz Przybylski
  *   Copyright (C) 2015 Bartosz Przybylski
  *   Copyright (C) 2015 ownCloud Inc.
  *   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 General Public License version 2,
- *   as published by the Free Software Foundation.
+ *   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,
  *   This program is distributed in the hope that it will be useful,
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *   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 <http://www.gnu.org/licenses/>.
  */
  */
 
 
 package com.owncloud.android.features;
 package com.owncloud.android.features;
@@ -36,21 +37,29 @@ import java.util.regex.Pattern;
  * @author Bartosz Przybylski
  * @author Bartosz Przybylski
  */
  */
 public class FeatureList {
 public class FeatureList {
-
     static final private boolean SHOW_ON_FIRST_RUN = true;
     static final private boolean SHOW_ON_FIRST_RUN = true;
     static final private boolean SHOW_ON_UPGRADE = false;
     static final private boolean SHOW_ON_UPGRADE = false;
 
 
+    private static final String VERSION_1_0_0 = "1.0.0";
+    private static final String BETA_VERSION_0 = "0";
 
 
     static final private FeatureItem featuresList[] = {
     static final private FeatureItem featuresList[] = {
             // Basic features showed on first install
             // Basic features showed on first install
-            new FeatureItem(R.drawable.what_new_instant_upload, R.string.welcome_feature_1_title, R.string.welcome_feature_1_text, "1.0.0", "0", SHOW_ON_FIRST_RUN),
-            new FeatureItem(R.drawable.whats_new_files, R.string.welcome_feature_2_title,  R.string.welcome_feature_2_text, "1.0.0", "0", SHOW_ON_FIRST_RUN),
-            new FeatureItem(R.drawable.whats_new_share, R.string.welcome_feature_3_title,  R.string.welcome_feature_3_text, "1.0.0", "0" ,SHOW_ON_FIRST_RUN),
-            new FeatureItem(R.drawable.whats_new_accounts, R.string.welcome_feature_4_title,  R.string.welcome_feature_4_text, "1.0.0", "0", SHOW_ON_FIRST_RUN),
+            new FeatureItem(R.drawable.what_new_instant_upload,
+                    R.string.welcome_feature_1_title, R.string.welcome_feature_1_text,
+                    VERSION_1_0_0, BETA_VERSION_0, SHOW_ON_FIRST_RUN),
+            new FeatureItem(R.drawable.whats_new_files,
+                    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.whats_new_share,
+                    R.string.welcome_feature_3_title, R.string.welcome_feature_3_text,
+                    VERSION_1_0_0, BETA_VERSION_0, SHOW_ON_FIRST_RUN),
+            new FeatureItem(R.drawable.whats_new_accounts,
+                    R.string.welcome_feature_4_title, R.string.welcome_feature_4_text,
+                    VERSION_1_0_0, BETA_VERSION_0, SHOW_ON_FIRST_RUN),
             // Features introduced in certain point in time
             // Features introduced in certain point in time
     };
     };
 
 
-
     static public FeatureItem[] get() {
     static public FeatureItem[] get() {
         return featuresList;
         return featuresList;
     }
     }
@@ -147,13 +156,11 @@ public class FeatureList {
     static int versionCodeFromString(String version) {
     static int versionCodeFromString(String version) {
         String v[] = version.split(Pattern.quote("."));
         String v[] = version.split(Pattern.quote("."));
         if (v.length != 3) {
         if (v.length != 3) {
-            Log_OC.wtf("FeatureList", "Version string is incorrect " + version);
+            Log_OC.e("FeatureList", "Version string is incorrect " + version);
             return 0;
             return 0;
         }
         }
-        int result = Integer.parseInt(v[0])*(int)(10e6) +
+        return Integer.parseInt(v[0])*(int)(10e6) +
                 Integer.parseInt(v[1])*(int)(10e4) +
                 Integer.parseInt(v[1])*(int)(10e4) +
                 Integer.parseInt(v[2])*100;
                 Integer.parseInt(v[2])*100;
-
-        return result;
     }
     }
 }
 }

+ 12 - 11
src/com/owncloud/android/ui/activity/WhatsNewActivity.java

@@ -1,22 +1,23 @@
 /**
 /**
- *   ownCloud Android client application
+ *   Nextcloud Android client application
  *
  *
- *   Copyright (C) 2015-2016 Bartosz Przybylski
+ *   @author Bartosz Przybylski
+ *   Copyright (C) 2015 Bartosz Przybylski
  *   Copyright (C) 2015 ownCloud Inc.
  *   Copyright (C) 2015 ownCloud Inc.
- *   Copyright (C) 2016 nextCloud
+ *   Copyright (C) 2016 Nextcloud.
  *
  *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
+ *   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,
  *   This program is distributed in the hope that it will be useful,
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *   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 <http://www.gnu.org/licenses/>.
  */
  */
 
 
 package com.owncloud.android.ui.activity;
 package com.owncloud.android.ui.activity;
@@ -50,7 +51,7 @@ import com.owncloud.android.features.FeatureList.FeatureItem;
 import com.owncloud.android.ui.whatsnew.ProgressIndicator;
 import com.owncloud.android.ui.whatsnew.ProgressIndicator;
 
 
 /**
 /**
- * @author Bartosz Przybylski
+ * Activity displaying general feature after a fresh install and new features after an update.
  */
  */
 public class WhatsNewActivity extends FragmentActivity implements ViewPager.OnPageChangeListener {
 public class WhatsNewActivity extends FragmentActivity implements ViewPager.OnPageChangeListener {
 
 

+ 10 - 9
src/com/owncloud/android/ui/whatsnew/ProgressIndicator.java

@@ -1,22 +1,23 @@
 /**
 /**
- *   ownCloud Android client application
+ *   Nextcloud Android client application
  *
  *
  *   @author Bartosz Przybylski
  *   @author Bartosz Przybylski
  *   Copyright (C) 2015 Bartosz Przybylski
  *   Copyright (C) 2015 Bartosz Przybylski
  *   Copyright (C) 2015 ownCloud Inc.
  *   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 General Public License version 2,
- *   as published by the Free Software Foundation.
+ *   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,
  *   This program is distributed in the hope that it will be useful,
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *   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 <http://www.gnu.org/licenses/>.
  */
  */
 
 
 package com.owncloud.android.ui.whatsnew;
 package com.owncloud.android.ui.whatsnew;
@@ -33,7 +34,7 @@ import android.widget.LinearLayout;
 import com.owncloud.android.R;
 import com.owncloud.android.R;
 
 
 /**
 /**
- * @author Bartosz Przybylski
+ * Progress indicator visualizing the actual progress with dots.
  */
  */
 public class ProgressIndicator extends FrameLayout {
 public class ProgressIndicator extends FrameLayout {