Skip to content

Commit

Permalink
Add registerFilesAppType
Browse files Browse the repository at this point in the history
Signed-off-by: alperozturk <[email protected]>
  • Loading branch information
alperozturk96 authored and tobiasKaminsky committed Dec 13, 2024
1 parent 943dbc4 commit 6719d0c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@

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;

Expand All @@ -46,6 +50,18 @@ public void onCreate() {
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() {
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/res/values/setup.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Nextcloud - Android Client
~
~ SPDX-FileCopyrightText: 2024 Alper Ozturk <[email protected]>
~ SPDX-License-Identifier: AGPL-3.0-or-later
-->

<resources>
<string name="package_id" translatable="false"></string>
<string name="account_type" translatable="false"></string>
</resources>

0 comments on commit 6719d0c

Please sign in to comment.