Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.nextcloud.client.di.ViewModelFactory
import com.nmc.android.utils.SearchViewThemeUtils.themeSearchView
import com.owncloud.android.R
import com.owncloud.android.databinding.LogsActivityBinding
import com.owncloud.android.ui.activity.ToolbarActivity
Expand Down Expand Up @@ -74,7 +75,8 @@ class LogsActivity : ToolbarActivity() {

(menu.findItem(R.id.action_search).actionView as SearchView).apply {
setOnQueryTextListener(searchBoxListener)
viewThemeUtils.androidx.themeToolbarSearchView(this)
//NMC customization
themeSearchView(this@LogsActivity, this)
}
return super.onCreateOptionsMenu(menu)
}
Expand Down
24 changes: 24 additions & 0 deletions app/src/main/java/com/nmc/android/utils/SearchViewThemeUtils.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.nmc.android.utils

import android.content.Context
import android.widget.ImageView
import androidx.appcompat.widget.AppCompatAutoCompleteTextView
import androidx.appcompat.widget.SearchView
import com.owncloud.android.R

object SearchViewThemeUtils {
fun themeSearchView(context: Context, searchView: SearchView) {
val fontColor = context.resources.getColor(R.color.fontAppbar, null)
val editText: AppCompatAutoCompleteTextView =
searchView.findViewById(androidx.appcompat.R.id.search_src_text)
editText.textSize = 16F
editText.setTextColor(fontColor)
editText.highlightColor = context.resources.getColor(R.color.et_highlight_color, null)
editText.setHintTextColor(context.resources.getColor(R.color.fontSecondaryAppbar, null))
val closeButton: ImageView = searchView.findViewById(androidx.appcompat.R.id.search_close_btn)
closeButton.setColorFilter(fontColor)
val searchButton: ImageView = searchView.findViewById(androidx.appcompat.R.id.search_button)
searchButton.setImageResource(R.drawable.ic_search)
searchButton.setColorFilter(fontColor)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ import com.nextcloud.utils.extensions.lastFragment
import com.nextcloud.utils.extensions.logFileSize
import com.nextcloud.utils.fileNameValidator.FileNameValidator.checkFolderPath
import com.nextcloud.utils.view.FastScrollUtils
import com.nmc.android.utils.SearchViewThemeUtils
import com.owncloud.android.MainApp
import com.owncloud.android.R
import com.owncloud.android.databinding.FilesBinding
Expand Down Expand Up @@ -867,7 +868,10 @@ class FileDisplayActivity :
searchView?.isIconified = false
}

searchView?.let { viewThemeUtils.androidx.themeToolbarSearchView(it) }
searchView?.let {
//NMC customization
SearchViewThemeUtils.themeSearchView(this, it)
}

// populate list of menu items to show/hide when drawer is opened/closed
mDrawerMenuItemstoShowHideList = ArrayList<MenuItem>(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import com.nextcloud.utils.extensions.FileExtensionsKt;
import com.nextcloud.utils.extensions.IntentExtensionsKt;
import com.nextcloud.utils.fileNameValidator.FileNameValidator;
import com.nmc.android.utils.SearchViewThemeUtils;
import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.databinding.ReceiveExternalFilesBinding;
Expand Down Expand Up @@ -1084,7 +1085,8 @@ public boolean onQueryTextChange(String newText) {
}
});

viewThemeUtils.androidx.themeToolbarSearchView(searchView);
//NMC customization
SearchViewThemeUtils.INSTANCE.themeSearchView(this, searchView);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

import com.nextcloud.client.account.User;
import com.nextcloud.client.core.Clock;
import com.nmc.android.utils.SearchViewThemeUtils;
import com.nextcloud.client.di.Injectable;
import com.nextcloud.client.jobs.upload.FileUploadHelper;
import com.nextcloud.client.jobs.upload.FileUploadWorker;
Expand Down Expand Up @@ -296,8 +297,10 @@ public boolean onCreateOptionsMenu(Menu menu) {

final MenuItem item = menu.findItem(R.id.action_search);
mSearchView = (SearchView) MenuItemCompat.getActionView(item);
viewThemeUtils.androidx.themeToolbarSearchView(mSearchView);
viewThemeUtils.platform.tintTextDrawable(this, menu.findItem(R.id.action_choose_storage_path).getIcon());
//NMC customization
SearchViewThemeUtils.INSTANCE.themeSearchView(this, mSearchView);
viewThemeUtils.platform.colorDrawable(menu.findItem(R.id.action_choose_storage_path).getIcon(),
getResources().getColor(R.color.fontAppbar, null));

mSearchView.setOnSearchClickListener(v -> mToolbarSpinner.setVisibility(View.GONE));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ class UnifiedSearchHeaderViewHolder(

fun bind(section: UnifiedSearchSection) {
binding.title.text = section.name
viewThemeUtils.platform.colorPrimaryTextViewElement(binding.title)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class UnifiedSearchItemViewHolder(

val defaultDrawable = MimeTypeUtil.getFileTypeIcon(mimetype, entry.title, context, viewThemeUtils)
val drawable: Drawable = ResourcesCompat.getDrawable(context.resources, iconId, null) ?: defaultDrawable
return viewThemeUtils.platform.tintDrawable(context, drawable, ColorRole.PRIMARY)
// NMC Customization: No tinting required
return drawable
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import com.nextcloud.client.preferences.AppPreferences
import com.nextcloud.client.preferences.AppPreferencesImpl
import com.nextcloud.utils.extensions.getTypedActivity
import com.nextcloud.utils.extensions.handleBackButtonEvent
import com.nmc.android.utils.SearchViewThemeUtils
import com.owncloud.android.MainApp
import com.owncloud.android.R
import com.owncloud.android.databinding.ListFragmentBinding
Expand Down Expand Up @@ -167,7 +168,8 @@ open class ExtendedListFragment :
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
val item = menu.findItem(R.id.action_search)
searchView = item.actionView as SearchView?
viewThemeUtils.androidx.themeToolbarSearchView(searchView!!)
// NMC customization
SearchViewThemeUtils.themeSearchView(requireActivity(), searchView!!)
closeButton = searchView?.findViewById(androidx.appcompat.R.id.search_close_btn)
searchView?.setOnQueryTextListener(this)
searchView?.setOnCloseListener(this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import com.nextcloud.client.di.Injectable
import com.nextcloud.client.di.ViewModelFactory
import com.nextcloud.client.network.ClientFactory
import com.nextcloud.utils.extensions.typedActivity
import com.nmc.android.utils.SearchViewThemeUtils.themeSearchView
import com.owncloud.android.R
import com.owncloud.android.databinding.ListFragmentBinding
import com.owncloud.android.datamodel.FileDataStorageManager
Expand Down Expand Up @@ -180,7 +181,8 @@ class UnifiedSearchFragment :
// Required to align with TextView width.
// Because this fragment is opened with TextView onClick on the previous screen
maxWidth = Integer.MAX_VALUE
viewThemeUtils.androidx.themeToolbarSearchView(this)
// NMC Customization
themeSearchView(requireActivity(), this)
setQuery(vm.query.value, false)
setOnQueryTextListener(this@UnifiedSearchFragment)
isIconified = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.nextcloud.ui.fileactions.FileActionsBottomSheet;
import com.nextcloud.utils.extensions.BundleExtensionsKt;
import com.nextcloud.utils.extensions.FileExtensionsKt;
import com.nmc.android.utils.SearchViewThemeUtils;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.lib.common.utils.Log_OC;
Expand Down Expand Up @@ -248,7 +249,8 @@ public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflat
menuItem.setVisible(true);
searchView = (SearchView) MenuItemCompat.getActionView(menuItem);
searchView.setMaxWidth(Integer.MAX_VALUE);
viewThemeUtils.androidx.themeToolbarSearchView(searchView);
//NMC customization
SearchViewThemeUtils.INSTANCE.themeSearchView(requireActivity(), searchView);

if (searchOpen) {
searchView.setIconified(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import android.view.ViewGroup;

import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.nmc.android.utils.SearchViewThemeUtils;
import com.nextcloud.android.lib.richWorkspace.RichWorkspaceDirectEditingRemoteOperation;
import com.nextcloud.utils.extensions.FileExtensionsKt;
import com.owncloud.android.R;
Expand Down Expand Up @@ -112,7 +113,8 @@ public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflat
searchView = (SearchView) MenuItemCompat.getActionView(menuItem);
searchView.setOnQueryTextListener(this);
searchView.setMaxWidth(Integer.MAX_VALUE);
viewThemeUtils.androidx.themeToolbarSearchView(searchView);
//NMC customization
SearchViewThemeUtils.INSTANCE.themeSearchView(requireActivity(), searchView);

if (searchOpen) {
searchView.setIconified(false);
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/unified_search_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
android:visibility="gone"
android:background="@color/transparent"
app:srcCompat="@drawable/ic_dots_vertical"
app:tint="@color/standard_grey"
app:tint="@color/list_icon_color"
android:layout_gravity="center"
android:layout_width="50dp"
android:layout_height="50dp"
Expand Down
65 changes: 65 additions & 0 deletions app/src/main/res/values-night/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,69 @@
<color name="fontAppbar">@android:color/white</color>

<color name="actionbar_color">#101418</color>

<!-- NMC Colors -->
<color name="icon_color">#FFFFFF</color>
<color name="sort_text_color">@color/grey_30</color>
<color name="list_icon_color">@color/grey_30</color>
<color name="warning_icon_color">#CCCCCC</color>
<color name="divider_color">@color/grey_70</color>
<color name="spinner_bg_color">@color/grey_80</color>
<color name="refresh_layout_bg_color">#2D2D2D</color>
<color name="primary_button_disabled_color">@color/grey_70</color>
<color name="toolbar_divider_color">@color/grey_70</color>

<!-- Snackbar Colors -->
<color name="snackbar_bg_color">@color/grey_80</color>
<color name="snackbar_txt_color">@color/grey_0</color>

<!-- Alert Dialog Colors -->
<color name="alert_bg_color">@color/grey_80</color>
<color name="alert_txt_color">@color/grey_0</color>

<!-- NavigationView colors -->
<color name="nav_selected_bg_color">@color/grey_60</color>
<color name="nav_txt_unselected_color">@color/grey_0</color>
<color name="nav_txt_selected_color">@color/grey_0</color>
<color name="nav_icon_unselected_color">@color/grey_30</color>
<color name="nav_icon_selected_color">#FFFFFF</color>
<color name="nav_divider_color">@color/grey_30</color>
<color name="nav_bg_color">@color/grey_80</color>
<color name="drawer_quota_txt_color">#FFFFFF</color>

<!-- Bottom Sheet Colors -->
<color name="bottom_sheet_bg_color">@color/grey_80</color>
<color name="bottom_sheet_icon_color">@color/grey_30</color>
<color name="bottom_sheet_txt_color">@color/grey_0</color>

<!-- Popup Menu Colors -->
<color name="popup_menu_bg">@color/grey_80</color>
<color name="popup_menu_txt_color">@color/grey_0</color>
<color name="overflow_bg_color">@color/grey_80</color>

<!-- Switch Compat Colors -->
<color name="switch_thumb_disabled">@color/grey_70</color>
<color name="switch_track_disabled">@color/grey_60</color>

<!-- Checkbox Colors -->
<color name="checkbox_checked_disabled">@color/grey_70</color>
<color name="checkbox_unchecked_disabled">@color/grey_70</color>

<!-- Share Colors -->
<color name="share_title_txt_color">#FFFFFF</color>
<color name="share_subtitle_txt_color">@color/grey_30</color>
<color name="share_info_txt_color">@color/grey_0</color>
<color name="share_search_border_color">@color/grey_0</color>
<color name="share_btn_txt_color">@color/grey_0</color>
<color name="share_list_item_txt_color">@color/grey_0</color>
<color name="share_disabled_txt_color">@color/grey_60</color>
<color name="share_txt_color">@color/grey_0</color>
<color name="share_et_divider">#FFFFFF</color>
<color name="share_blue_color">#7d94f9</color>

<!-- Scan Colors -->
<color name="scan_doc_bg_color">#121212</color>
<color name="scan_text_color">@color/grey_0</color>
<color name="scan_edit_bottom_color">@color/grey_80</color>
<color name="scan_count_bg_color">@color/grey_80</color>
</resources>
90 changes: 90 additions & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,94 @@
<color name="fontSecondaryAppbar">#A5A5A5</color>

<color name="actionbar_color">#F7F9FF</color>

<!-- NMC Colors -->
<color name="icon_color">#191919</color>
<color name="sort_text_color">@color/primary</color>
<color name="list_icon_color">#191919</color>
<color name="warning_icon_color">#191919</color>
<color name="divider_color">@color/grey_30</color>
<color name="spinner_bg_color">@android:color/white</color>
<color name="refresh_layout_bg_color">#FFFFFF</color>
<color name="primary_button_disabled_color">@color/grey_0</color>
<color name="toolbar_divider_color">#CCCCCC</color>
<color name="et_highlight_color">#77c4ff</color>
<color name="white_trans_70">#B3FFFFFF</color>
<color name="progress_bar_background">@color/grey_10</color>

<!-- Grey Colors -->
<color name="dark_grey">#101010</color>
<color name="grey_0">#F2F2F2</color>
<color name="grey_10">#E5E5E5</color>
<color name="grey_30">#B2B2B2</color>
<color name="grey_60">#666666</color>
<color name="grey_70">#4C4C4C</color>
<color name="grey_80">#333333</color>

<!-- Snackbar Colors -->
<color name="snackbar_bg_color">@color/design_snackbar_background_color</color>
<color name="snackbar_txt_color">@color/white</color>

<!-- Alert Dialog Colors -->
<color name="alert_bg_color">#FFFFFF</color>
<color name="alert_txt_color">#191919</color>

<!-- NavigationView colors -->
<color name="nav_selected_bg_color">@color/grey_0</color>
<color name="nav_txt_unselected_color">#191919</color>
<color name="nav_txt_selected_color">@color/primary</color>
<color name="nav_icon_unselected_color">#191919</color>
<color name="nav_icon_selected_color">@color/primary</color>
<color name="nav_divider_color">@color/grey_30</color>
<color name="nav_bg_color">@color/white</color>
<color name="drawer_quota_txt_color">#191919</color>

<!-- Bottom Sheet Colors -->
<color name="bottom_sheet_bg_color">#FFFFFF</color>
<color name="bottom_sheet_icon_color">#191919</color>
<color name="bottom_sheet_txt_color">#191919</color>

<!-- Popup Menu Colors -->
<color name="popup_menu_bg">#FFFFFF</color>
<color name="popup_menu_txt_color">#191919</color>
<color name="overflow_bg_color">#FFFFFF</color>

<!-- Switch Compat Colors -->
<color name="switch_thumb_checked_enabled">@color/primary</color>
<color name="switch_track_checked_enabled">#F399C7</color>
<color name="switch_thumb_unchecked_enabled">#FFFFFF</color>
<color name="switch_track_unchecked_enabled">@color/grey_30</color>
<color name="switch_thumb_disabled">@color/grey_10</color>
<color name="switch_track_disabled">@color/grey_0</color>

<!-- Checkbox Colors -->
<color name="checkbox_checked_enabled">@color/primary</color>
<color name="checkbox_unchecked_enabled">@color/grey_30</color>
<color name="checkbox_checked_disabled">@color/grey_30</color>
<color name="checkbox_unchecked_disabled">#CCCCCC</color>

<!-- Share Colors -->
<color name="share_title_txt_color">#191919</color>
<color name="share_subtitle_txt_color">@color/grey_30</color>
<color name="share_info_txt_color">#191919</color>
<color name="share_search_border_color">#191919</color>
<color name="share_btn_txt_color">#191919</color>
<color name="share_list_item_txt_color">#191919</color>
<color name="share_disabled_txt_color">@color/grey_30</color>
<color name="share_txt_color">#191919</color>
<color name="share_et_divider">#000000</color>
<color name="share_warning_txt_color">#191919</color>
<color name="sharing_warning_bg_color">#F6E5EB</color>
<color name="sharing_warning_border_color">#C16F81</color>
<color name="share_color">#0D39DF</color>
<color name="shared_with_me_color">#0099ff</color>
<color name="share_blue_color">#2238df</color>

<!-- Scan Colors -->
<color name="scan_doc_bg_color">@color/grey_0</color>
<color name="scan_text_color">#191919</color>
<color name="scan_edit_bottom_color">@color/grey_0</color>
<color name="scan_count_bg_color">@color/grey_30</color>
<color name="neptune">#77b6bb</color>
<color name="neptune_50">#5077b6bb</color>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
<!-- Close button icon -->
<item name="closeIcon">@drawable/ic_close</item>
<!-- Search button icon -->
<item name="searchIcon">@drawable/ic_search_grey</item>
<item name="searchIcon">@drawable/ic_search</item>
<!-- Layout for query suggestion rows // unused for now, staying with the standard layout -->
<!--<item name="suggestionRowLayout">...</item>-->
</style>
Expand Down