Add registerFilesAppType

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2024-08-05 14:21:56 +02:00 committed by Alper Öztürk
parent d532060a57
commit 9410241045
2 changed files with 27 additions and 0 deletions

View file

@ -15,11 +15,15 @@ import static androidx.preference.PreferenceManager.getDefaultSharedPreferences;
import android.app.Application;
import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import android.webkit.WebView;
import androidx.appcompat.app.AppCompatDelegate;
import com.nextcloud.android.sso.FilesAppTypeRegistry;
import com.nextcloud.android.sso.model.FilesAppType;
import it.niedermann.owncloud.notes.branding.BrandingUtil;
import it.niedermann.owncloud.notes.preferences.DarkModeSetting;
@ -46,6 +50,18 @@ public class NotesApplication extends Application {
if (BuildConfig.DEBUG) {
WebView.setWebContentsDebuggingEnabled(true);
}
registerFilesAppType();
}
private void registerFilesAppType() {
String packageId = getResources().getString(R.string.package_id);
String accountType = getResources().getString(R.string.account_type);
if (TextUtils.isEmpty(packageId) || TextUtils.isEmpty(accountType)) {
return;
}
FilesAppTypeRegistry.getInstance().init(new FilesAppType(packageId, accountType, FilesAppType.Type.PROD));
}
public static BrandingUtil brandingUtil() {

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Nextcloud - Android Client
~
~ SPDX-FileCopyrightText: 2024 Alper Ozturk <alper.ozturk@nextcloud.com>
~ SPDX-License-Identifier: AGPL-3.0-or-later
-->
<resources>
<string name="package_id" translatable="false"></string>
<string name="account_type" translatable="false"></string>
</resources>