diff --git a/app/src/main/java/com/nmc/android/ui/PrivacySettingsInterface.kt b/app/src/main/java/com/nmc/android/ui/PrivacySettingsInterface.kt new file mode 100644 index 000000000000..860ffada08ab --- /dev/null +++ b/app/src/main/java/com/nmc/android/ui/PrivacySettingsInterface.kt @@ -0,0 +1,13 @@ +package com.nmc.android.ui + +import android.content.Context + +/** + * interface to open privacy settings activity from nmc/1921-settings branch + * for implementation look nmc/1878-privacy branch + * this class will have the declaration for it since it has the PrivacySettingsActivity.java in place + * since we don't have privacy settings functionality in this branch so to handle the redirection we have used interface + */ +interface PrivacySettingsInterface { + fun openPrivacySettingsActivity(context: Context) +} \ No newline at end of file diff --git a/app/src/main/java/com/nmc/android/ui/PrivacySettingsInterfaceImpl.kt b/app/src/main/java/com/nmc/android/ui/PrivacySettingsInterfaceImpl.kt new file mode 100644 index 000000000000..e087bc888e6f --- /dev/null +++ b/app/src/main/java/com/nmc/android/ui/PrivacySettingsInterfaceImpl.kt @@ -0,0 +1,14 @@ +package com.nmc.android.ui + +import android.content.Context + +/** + * interface impl to launch PrivacySettings Activity + * this class will have the implementation for it since it has the PrivacySettingsActivity in place + * calling of this method will be done from nmc/1921-settings + */ +class PrivacySettingsInterfaceImpl : PrivacySettingsInterface { + override fun openPrivacySettingsActivity(context: Context) { + PrivacySettingsActivity.openPrivacySettingsActivity(context, false) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java index b6801be56011..cc9bd9c69031 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java @@ -59,6 +59,8 @@ import com.nextcloud.client.preferences.AppPreferences; import com.nextcloud.client.preferences.AppPreferencesImpl; import com.nextcloud.client.preferences.DarkMode; +import com.nmc.android.ui.PrivacySettingsInterface; +import com.nmc.android.ui.PrivacySettingsInterfaceImpl; import com.owncloud.android.BuildConfig; import com.owncloud.android.MainApp; import com.owncloud.android.R; @@ -149,6 +151,16 @@ public class SettingsActivity extends PreferenceActivity @Inject ClientFactory clientFactory; @Inject ViewThemeUtils viewThemeUtils; + /** + * Things to note about both the branches. + * 1. nmc/1921-settings branch: + * --> interface won't be initialised + * --> calling of interface method will be done here + * 2. nmc/1878-privacy + * --> interface will be initialised + * --> calling of interface method won't be done here + */ + private PrivacySettingsInterface privacySettingsInterface; @SuppressWarnings("deprecation") @Override @@ -159,6 +171,9 @@ public void onCreate(Bundle savedInstanceState) { getDelegate().onCreate(savedInstanceState); addPreferencesFromResource(R.xml.preferences); + //NMC customization will be initialised in nmc/1878-privacy + privacySettingsInterface = new PrivacySettingsInterfaceImpl(); + setupActionBar(); // Register context menu for list of preferences.