Browse Source

Rebase master

Signed-off-by: alperozturk <alper_ozturk@proton.me>
alperozturk 1 năm trước cách đây
mục cha
commit
1f31127df3

+ 0 - 26
app/src/main/java/com/nextcloud/ui/composeFragment/ComposeDestination.kt

@@ -1,26 +0,0 @@
-/*
- * Nextcloud Android client application
- *
- * @author Alper Ozturk
- * Copyright (C) 2024 Alper Ozturk
- * Copyright (C) 2024 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.nextcloud.ui.composeFragment
-
-enum class ComposeDestination {
-    AssistantScreen
-}

+ 0 - 115
app/src/main/java/com/nextcloud/ui/composeFragment/ComposeFragment.kt

@@ -1,115 +0,0 @@
-/*
- * Nextcloud Android client application
- *
- * @author Alper Ozturk
- * Copyright (C) 2024 Alper Ozturk
- * Copyright (C) 2024 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.nextcloud.ui.composeFragment
-
-import android.os.Bundle
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import androidx.compose.runtime.Composable
-import androidx.compose.runtime.LaunchedEffect
-import androidx.compose.runtime.getValue
-import androidx.compose.runtime.mutableStateOf
-import androidx.compose.runtime.remember
-import androidx.compose.runtime.setValue
-import androidx.compose.ui.platform.ViewCompositionStrategy
-import com.google.android.material.floatingactionbutton.FloatingActionButton
-import com.nextcloud.client.assistant.AssistantScreen
-import com.nextcloud.client.assistant.AssistantViewModel
-import com.nextcloud.common.NextcloudClient
-import com.nextcloud.utils.extensions.getSerializableArgument
-import com.owncloud.android.R
-import com.owncloud.android.databinding.FragmentComposeViewBinding
-import com.owncloud.android.lib.common.OwnCloudClientFactory
-import com.owncloud.android.lib.common.accounts.AccountUtils
-import com.owncloud.android.lib.common.utils.Log_OC
-import com.owncloud.android.ui.fragment.FileFragment
-import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.withContext
-
-class ComposeFragment : FileFragment() {
-
-    private var _binding: FragmentComposeViewBinding? = null
-
-    private val binding get() = _binding!!
-    private var destination: ComposeDestination? = null
-
-    companion object {
-        const val destinationKey = "destinationKey"
-    }
-
-    override fun onCreateView(
-        inflater: LayoutInflater,
-        container: ViewGroup?,
-        savedInstanceState: Bundle?
-    ): View {
-        _binding = FragmentComposeViewBinding.inflate(inflater, container, false)
-        destination = arguments.getSerializableArgument(destinationKey, ComposeDestination::class.java)
-
-        binding.composeView.apply {
-            setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed)
-
-            setContent {
-                Content(destination)
-            }
-        }
-
-        return binding.root
-    }
-
-    @Composable
-    private fun Content(destination: ComposeDestination?) {
-        val floatingActionButton: FloatingActionButton = requireActivity().findViewById(R.id.fab_main)
-        var nextcloudClient by remember { mutableStateOf<NextcloudClient?>(null) }
-
-        LaunchedEffect(Unit) {
-            nextcloudClient = getNextcloudClient()
-        }
-
-        return if (destination == ComposeDestination.AssistantScreen && nextcloudClient != null) {
-            AssistantScreen(
-                viewModel = AssistantViewModel(
-                    client = nextcloudClient!!
-                ),
-                floatingActionButton
-            )
-        } else {
-
-        }
-    }
-
-    private suspend fun getNextcloudClient(): NextcloudClient? {
-        return withContext(Dispatchers.IO) {
-            try {
-                OwnCloudClientFactory.createNextcloudClient(containerActivity.storageManager.user, requireContext())
-            } catch (e: AccountUtils.AccountNotFoundException) {
-                Log_OC.e(this, "Error caught at init of AssistantRepository", e)
-                null
-            }
-        }
-    }
-
-    override fun onDestroyView() {
-        super.onDestroyView()
-        _binding = null
-    }
-}

+ 0 - 3
app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java

@@ -248,9 +248,6 @@ public abstract class DrawerActivity extends ToolbarActivity
         if (getSupportActionBar() != null) {
             getSupportActionBar().setDisplayHomeAsUpEnabled(true);
         }
-
-        showSortListGroup(true);
-        hideSearchText(false);
     }
 
     /**

+ 0 - 8
app/src/main/java/com/owncloud/android/ui/activity/ToolbarActivity.java

@@ -155,14 +155,6 @@ public abstract class ToolbarActivity extends BaseActivity implements Injectable
         mSearchText.setText(getString(R.string.appbar_search_in, title));
     }
 
-    public void hideSearchText(boolean hide) {
-        if (hide) {
-            mSearchText.setVisibility(View.GONE);
-        } else {
-            mSearchText.setVisibility(View.VISIBLE);
-        }
-    }
-
     @SuppressLint("PrivateResource")
     private void showHomeSearchToolbar(boolean isShow) {
         viewThemeUtils.material.themeToolbar(mToolbar);