浏览代码

package rename

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky 2 年之前
父节点
当前提交
73d87f164a

+ 2 - 2
app/src/versionDev/java/com/owncloud/android/app_review/InAppReviewHelperImpl.kt → app/src/generic/java/com/nextcloud/android/appReview/InAppReviewHelperImpl.kt

@@ -20,11 +20,11 @@
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
  */
 
-package com.owncloud.android.app_review
+package com.nextcloud.android.appReview
 
 import androidx.appcompat.app.AppCompatActivity
+import com.nextcloud.appReview.InAppReviewHelper
 import com.nextcloud.client.preferences.AppPreferences
-import com.nextcloud.app_review.InAppReviewHelper
 
 class InAppReviewHelperImpl(appPreferences: AppPreferences) :
     InAppReviewHelper {

+ 27 - 21
app/src/gplay/java/com/owncloud/android/app_review/InAppReviewHelperImpl.kt → app/src/gplay/java/com/nextcloud/android/appReview/InAppReviewHelperImpl.kt

@@ -4,22 +4,22 @@
  * @author Tobias Kaminsky
  * Copyright (C) 2023 Tobias Kaminsky
  * Copyright (C) 2023 Nextcloud GmbH
- *  
+ *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
  * (at your option) 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 <https://www.gnu.org/licenses/>.
  */
 
-package com.owncloud.android.app_review
+package com.nextcloud.android.appReview
 
 import androidx.appcompat.app.AppCompatActivity
 import com.google.android.gms.tasks.Task
@@ -28,14 +28,14 @@ import com.google.android.play.core.review.ReviewInfo
 import com.google.android.play.core.review.ReviewManager
 import com.google.android.play.core.review.ReviewManagerFactory
 import com.google.android.play.core.review.model.ReviewErrorCode
-import com.nextcloud.app_review.AppReviewShownModel
-import com.nextcloud.app_review.InAppReviewHelper
+import com.nextcloud.appReview.AppReviewShownModel
+import com.nextcloud.appReview.InAppReviewHelper
 import com.nextcloud.client.preferences.AppPreferences
 import com.nextcloud.utils.getFormattedStringDate
 import com.nextcloud.utils.isCurrentYear
 import com.owncloud.android.lib.common.utils.Log_OC
 
-//Reference: https://developer.android.com/guide/playcore/in-app-review
+// Reference: https://developer.android.com/guide/playcore/in-app-review
 /**
  * This class responsible to handle & manage in-app review related methods
  */
@@ -58,8 +58,12 @@ class InAppReviewHelperImpl(val appPreferences: AppPreferences) : InAppReviewHel
     }
 
     private fun resetReviewShownModel() {
-        val appReviewShownModel = AppReviewShownModel(System.currentTimeMillis().getFormattedStringDate(YEAR_FORMAT),
-            1, 0, null)
+        val appReviewShownModel = AppReviewShownModel(
+            System.currentTimeMillis().getFormattedStringDate(YEAR_FORMAT),
+            1,
+            0,
+            null
+        )
         appPreferences.setInAppReviewData(appReviewShownModel)
     }
 
@@ -68,9 +72,9 @@ class InAppReviewHelperImpl(val appPreferences: AppPreferences) : InAppReviewHel
         val currentTimeMills = System.currentTimeMillis()
 
         appReviewShownModel?.let {
-            if (it.appRestartCount >= MIN_APP_RESTARTS_REQ
-                && currentTimeMills.isCurrentYear(it.firstShowYear)
-                && it.reviewShownCount < MAX_DISPLAY_PER_YEAR
+            if (it.appRestartCount >= MIN_APP_RESTARTS_REQ &&
+                currentTimeMills.isCurrentYear(it.firstShowYear) &&
+                it.reviewShownCount < MAX_DISPLAY_PER_YEAR
             ) {
                 doAppReview(activity)
             } else {
@@ -98,23 +102,25 @@ class InAppReviewHelperImpl(val appPreferences: AppPreferences) : InAppReviewHel
         }
     }
 
-    private fun launchAppReviewFlow(manager: ReviewManager,
+    private fun launchAppReviewFlow(
+        manager: ReviewManager,
         activity: AppCompatActivity,
-        reviewInfo: ReviewInfo) {
+        reviewInfo: ReviewInfo
+    ) {
         val flow = manager.launchReviewFlow(activity, reviewInfo)
         flow.addOnCompleteListener { _ ->
             // The flow has finished. The API does not indicate whether the user
             // reviewed or not, or even whether the review dialog was shown. Thus, no
             // matter the result, we continue our app flow.
             // Scenarios in which the flow won't shown:
-            //1. Showing dialog to frequently
-            //2. If quota is reached can be checked in official documentation
-            //3. Flow won't be shown if user has already reviewed the app. User has to delete the review from play store to show the review dialog again
-            //Link for more info: https://stackoverflow.com/a/63342266
+            // 1. Showing dialog to frequently
+            // 2. If quota is reached can be checked in official documentation
+            // 3. Flow won't be shown if user has already reviewed the app. User has to delete the review from play store to show the review dialog again
+            // Link for more info: https://stackoverflow.com/a/63342266
             Log_OC.d(TAG, "App Review flow is completed")
         }
 
-        //on successful showing review dialog increment the count and capture the date
+        // on successful showing review dialog increment the count and capture the date
         val appReviewShownModel = appPreferences.inAppReviewData
         appReviewShownModel?.let {
             it.appRestartCount = 0
@@ -128,7 +134,7 @@ class InAppReviewHelperImpl(val appPreferences: AppPreferences) : InAppReviewHel
         private val TAG = InAppReviewHelperImpl::class.java.simpleName
         const val YEAR_FORMAT = "yyyy"
         const val DATE_TIME_FORMAT = "dd-MM-yyyy HH:mm:ss"
-        const val MIN_APP_RESTARTS_REQ = 10 //minimum app restarts required to ask the review
-        const val MAX_DISPLAY_PER_YEAR = 15 //maximum times to ask review in a year
+        const val MIN_APP_RESTARTS_REQ = 10 // minimum app restarts required to ask the review
+        const val MAX_DISPLAY_PER_YEAR = 15 // maximum times to ask review in a year
     }
 }

+ 5 - 5
app/src/generic/java/com/owncloud/android/app_review/InAppReviewHelperImpl.kt → app/src/huawei/java/com/nextcloud/android/appReview/InAppReviewHelperImpl.kt

@@ -4,26 +4,26 @@
  * @author Tobias Kaminsky
  * Copyright (C) 2023 Tobias Kaminsky
  * Copyright (C) 2023 Nextcloud GmbH
- *  
+ *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
  * (at your option) 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 <https://www.gnu.org/licenses/>.
  */
 
-package com.owncloud.android.app_review
+package com.nextcloud.android.appReview
 
 import androidx.appcompat.app.AppCompatActivity
+import com.nextcloud.appReview.InAppReviewHelper
 import com.nextcloud.client.preferences.AppPreferences
-import com.nextcloud.app_review.InAppReviewHelper
 
 class InAppReviewHelperImpl(appPreferences: AppPreferences) :
     InAppReviewHelper {

+ 1 - 1
app/src/main/java/com/nextcloud/app_review/AppReviewShownModel.kt → app/src/main/java/com/nextcloud/appReview/AppReviewShownModel.kt

@@ -20,7 +20,7 @@
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
  */
 
-package com.nextcloud.app_review
+package com.nextcloud.appReview
 
 data class AppReviewShownModel(
     var firstShowYear: String?,

+ 3 - 2
app/src/main/java/com/nextcloud/app_review/InAppReviewHelper.kt → app/src/main/java/com/nextcloud/appReview/InAppReviewHelper.kt

@@ -20,7 +20,7 @@
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
  */
 
-package com.nextcloud.app_review
+package com.nextcloud.appReview
 
 import androidx.appcompat.app.AppCompatActivity
 
@@ -30,7 +30,8 @@ interface InAppReviewHelper {
      * method to be called from Application onCreate() method to work properly
      * since we have to capture the app restarts Application is the best place to do that
      * this method will do the following:
-     * 1. Reset the @see AppReviewModel with the current year (yyyy) if the app is launched first time or if the year has changed.
+     * 1. Reset the @see AppReviewModel with the current year (yyyy),
+     * if the app is launched first time or if the year has changed.
      * 2. If the year is same then it will only increment the appRestartCount
      */
     fun resetAndIncrementAppRestartCounter()

+ 2 - 3
app/src/main/java/com/nextcloud/app_review/InAppReviewModule.kt → app/src/main/java/com/nextcloud/appReview/InAppReviewModule.kt

@@ -20,11 +20,10 @@
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
  */
 
-package com.nextcloud.app_review
+package com.nextcloud.appReview
 
+import com.nextcloud.android.appReview.InAppReviewHelperImpl
 import com.nextcloud.client.preferences.AppPreferences
-import com.owncloud.android.app_review.InAppReviewHelperImpl
-// import com.owncloud.android.app_review.InAppReviewHelperImpl
 import dagger.Module
 import dagger.Provides
 import javax.inject.Singleton

+ 1 - 1
app/src/main/java/com/nextcloud/client/di/AppComponent.java

@@ -22,7 +22,7 @@ package com.nextcloud.client.di;
 
 import android.app.Application;
 
-import com.nextcloud.app_review.InAppReviewModule;
+import com.nextcloud.appReview.InAppReviewModule;
 import com.nextcloud.client.appinfo.AppInfoModule;
 import com.nextcloud.client.database.DatabaseModule;
 import com.nextcloud.client.device.DeviceModule;

+ 1 - 1
app/src/main/java/com/nextcloud/client/preferences/AppPreferences.java

@@ -20,7 +20,7 @@
 
 package com.nextcloud.client.preferences;
 
-import com.nextcloud.app_review.AppReviewShownModel;
+import com.nextcloud.appReview.AppReviewShownModel;
 import com.owncloud.android.datamodel.OCFile;
 import com.owncloud.android.utils.FileSortOrder;
 

+ 1 - 1
app/src/main/java/com/nextcloud/client/preferences/AppPreferencesImpl.java

@@ -26,7 +26,7 @@ import android.content.Context;
 import android.content.SharedPreferences;
 
 import com.google.gson.Gson;
-import com.nextcloud.app_review.AppReviewShownModel;
+import com.nextcloud.appReview.AppReviewShownModel;
 import com.nextcloud.client.account.User;
 import com.nextcloud.client.account.UserAccountManager;
 import com.nextcloud.client.account.UserAccountManagerImpl;

+ 4 - 2
app/src/main/java/com/nextcloud/utils/Extensions.kt

@@ -45,7 +45,7 @@ fun TextView.makeLinks(vararg links: Pair<String, View.OnClickListener>) {
                 textPaint.color = textPaint.linkColor
                 // toggle below value to enable/disable
                 // the underline shown below the clickable text
-                //textPaint.isUnderlineText = true
+                // textPaint.isUnderlineText = true
             }
 
             override fun onClick(view: View) {
@@ -56,7 +56,9 @@ fun TextView.makeLinks(vararg links: Pair<String, View.OnClickListener>) {
         }
         startIndexOfLink = this.text.toString().indexOf(link.first, startIndexOfLink + 1)
         spannableString.setSpan(
-            clickableSpan, startIndexOfLink, startIndexOfLink + link.first.length,
+            clickableSpan,
+            startIndexOfLink,
+            startIndexOfLink + link.first.length,
             Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
         )
     }

+ 1 - 1
app/src/main/java/com/owncloud/android/MainApp.java

@@ -40,7 +40,7 @@ import android.os.StrictMode;
 import android.text.TextUtils;
 import android.view.WindowManager;
 
-import com.nextcloud.app_review.InAppReviewHelper;
+import com.nextcloud.appReview.InAppReviewHelper;
 import com.nextcloud.client.account.User;
 import com.nextcloud.client.account.UserAccountManager;
 import com.nextcloud.client.appinfo.AppInfo;

+ 1 - 1
app/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java

@@ -57,7 +57,7 @@ import android.view.WindowManager;
 
 import com.google.android.material.appbar.AppBarLayout;
 import com.google.android.material.snackbar.Snackbar;
-import com.nextcloud.app_review.InAppReviewHelper;
+import com.nextcloud.appReview.InAppReviewHelper;
 import com.nextcloud.client.account.User;
 import com.nextcloud.client.appinfo.AppInfo;
 import com.nextcloud.client.core.AsyncRunner;

+ 2 - 5
app/src/main/java/com/owncloud/android/ui/asynctasks/GallerySearchTask.java

@@ -34,20 +34,16 @@ import com.owncloud.android.lib.resources.files.model.RemoteFile;
 import com.owncloud.android.lib.resources.status.OCCapability;
 import com.owncloud.android.operations.RefreshFolderOperation;
 import com.owncloud.android.ui.fragment.GalleryFragment;
-import com.owncloud.android.ui.fragment.SearchType;
 import com.owncloud.android.utils.FileStorageUtils;
 
 import java.lang.ref.WeakReference;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.Date;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 
-import androidx.lifecycle.Lifecycle;
-
 public class GallerySearchTask extends AsyncTask<Void, Void, GallerySearchTask.Result> {
 
     private final User user;
@@ -220,4 +216,5 @@ public class GallerySearchTask extends AsyncTask<Void, Void, GallerySearchTask.R
             this.lastTimestamp = lastTimestamp;
         }
     }
-}
+}
+

+ 2 - 2
app/src/qa/java/com/owncloud/android/app_review/InAppReviewHelperImpl.kt → app/src/qa/java/com/nextcloud/android/appReview/InAppReviewHelperImpl.kt

@@ -20,10 +20,10 @@
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
  */
 
-package com.owncloud.android.app_review
+package com.nextcloud.android.appReview
 
 import androidx.appcompat.app.AppCompatActivity
-import com.nextcloud.app_review.InAppReviewHelper
+import com.nextcloud.appReview.InAppReviewHelper
 import com.nextcloud.client.preferences.AppPreferences
 
 class InAppReviewHelperImpl(appPreferences: AppPreferences) :

+ 0 - 0
app/src/test/java/com/nextcloud/android/utils/ExtensionTest.kt → app/src/test/java/com/nextcloud/android/utils/ExtensionsTest.kt


+ 6 - 5
app/src/huawei/java/com/owncloud/android/app_review/InAppReviewHelperImpl.kt → app/src/versionDev/java/com/nextcloud/android/appReview/InAppReviewHelperImpl.kt

@@ -1,28 +1,29 @@
 /*
+ *
  * Nextcloud Android client application
  *
  * @author Tobias Kaminsky
  * Copyright (C) 2023 Tobias Kaminsky
  * Copyright (C) 2023 Nextcloud GmbH
- *  
+ *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
  * (at your option) 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 <https://www.gnu.org/licenses/>.
  */
 
-package com.owncloud.android.app_review
+package com.nextcloud.android.appReview
 
 import androidx.appcompat.app.AppCompatActivity
-import com.nextcloud.app_review.InAppReviewHelper
+import com.nextcloud.appReview.InAppReviewHelper
 import com.nextcloud.client.preferences.AppPreferences
 
 class InAppReviewHelperImpl(appPreferences: AppPreferences) :