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 @@ -18,6 +18,8 @@
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.os.Bundle;
import android.os.Environment;
import android.view.Menu;
Expand Down Expand Up @@ -209,10 +211,12 @@ public void onCreate(Bundle savedInstanceState) {
behaviours.add(getString(R.string.uploader_upload_files_behaviour_only_upload));
behaviours.add(getString(R.string.uploader_upload_files_behaviour_upload_and_delete_from_source));

ArrayAdapter<String> behaviourAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item,
//custom spinner item layout for NMC
ArrayAdapter<String> behaviourAdapter = new ArrayAdapter<>(this, R.layout.simple_spinner_item,
behaviours);
behaviourAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
binding.uploadFilesSpinnerBehaviour.setAdapter(behaviourAdapter);
binding.uploadFilesSpinnerBehaviour.getBackground().setColorFilter(getResources().getColor(R.color.primary, null), PorterDuff.Mode.SRC_IN);
binding.uploadFilesSpinnerBehaviour.setSelection(localBehaviour);

// setup the toolbar
Expand All @@ -233,6 +237,7 @@ public void onCreate(Bundle savedInstanceState) {

showToolbarSpinner();
mToolbarSpinner.setAdapter(mDirectories);
mToolbarSpinner.getBackground().setColorFilter(Color.TRANSPARENT, PorterDuff.Mode.SRC_IN);
mToolbarSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import android.view.View
import android.view.ViewGroup
import android.widget.ImageButton
import android.widget.PopupMenu
import androidx.appcompat.view.ContextThemeWrapper
import androidx.annotation.VisibleForTesting
import androidx.core.view.isVisible
import com.afollestad.sectionedrecyclerview.SectionedRecyclerViewAdapter
Expand Down Expand Up @@ -309,7 +310,9 @@ class SyncedFolderAdapter(
}

private fun onOverflowIconClicked(section: Int, item: SyncedFolderDisplayItem, view: View) {
val popup = PopupMenu(context, view).apply {
// NMC Customisation
val ctw = ContextThemeWrapper(context, R.style.CustomPopupTheme)
val popup = PopupMenu(ctw, view).apply {
inflate(R.menu.synced_folders_adapter)
setOnMenuItemClickListener { i: MenuItem -> optionsItemSelected(i, section, item) }
menu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
import java.util.Optional;

import androidx.annotation.NonNull;
import androidx.appcompat.view.ContextThemeWrapper;

/**
* This Adapter populates a ListView with following types of uploads: pending, active, completed. Filtering possible.
Expand Down Expand Up @@ -652,7 +653,9 @@ private void showItemConflictPopup(User user,
OCUpload item,
String status,
View view) {
PopupMenu popup = new PopupMenu(MainApp.getAppContext(), view);
//NMC Customisation
ContextThemeWrapper ctw = new ContextThemeWrapper(MainApp.getAppContext(), R.style.CustomPopupTheme);
PopupMenu popup = new PopupMenu(ctw, view);
popup.inflate(R.menu.upload_list_item_file_conflict);
popup.setOnMenuItemClickListener(i -> {
int itemId = i.getItemId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
Expand Down Expand Up @@ -290,7 +291,8 @@ public void onCreateOptionsMenu(Menu menu, @NonNull MenuInflater inflater) {
MenuItem menuItem = menu.findItem(R.id.action_three_dot_icon);

if (menuItem != null) {
viewThemeUtils.platform.colorMenuItemText(requireContext(), menuItem);
//NMC customization
menuItem.setIcon(viewThemeUtils.platform.colorDrawable(menuItem.getIcon(), ContextCompat.getColor(requireContext(), R.color.fontAppbar)));
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,8 @@ public boolean onCreateActionMode(ActionMode mode, Menu menu) {

final MenuItem item = menu.findItem(R.id.custom_menu_placeholder_item);
if (item.getIcon() != null) {
item.setIcon(viewThemeUtils.platform.colorDrawable(item.getIcon(), ContextCompat.getColor(requireContext(), R.color.white)));
// NMC customization
item.setIcon(viewThemeUtils.platform.colorDrawable(item.getIcon(), ContextCompat.getColor(requireContext(), R.color.fontAppbar)));
}

mActiveActionMode.invalidate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,11 @@ class PreviewImageFragment : FileFragment(), Injectable {
val item = menu.findItem(R.id.custom_menu_placeholder_item)

item.icon?.let {
// NMC customization
item.setIcon(
viewThemeUtils.platform.colorDrawable(
it,
ContextCompat.getColor(requireContext(), R.color.white)
ContextCompat.getColor(requireContext(), R.color.fontAppbar)
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import android.view.ViewGroup
import androidx.annotation.OptIn
import androidx.annotation.StringRes
import androidx.core.net.toUri
import androidx.core.content.ContextCompat
import androidx.core.view.MenuHost
import androidx.core.view.MenuProvider
import androidx.drawerlayout.widget.DrawerLayout
Expand Down Expand Up @@ -68,6 +69,7 @@ import com.owncloud.android.ui.dialog.ConfirmationDialogFragment
import com.owncloud.android.ui.dialog.RemoveFilesDialogFragment
import com.owncloud.android.ui.fragment.FileFragment
import com.owncloud.android.utils.MimeTypeUtil
import com.owncloud.android.utils.theme.ViewThemeUtils
import java.lang.ref.WeakReference
import java.util.concurrent.Executors
import javax.inject.Inject
Expand Down Expand Up @@ -115,6 +117,9 @@ class PreviewMediaFragment : FileFragment(), OnTouchListener, Injectable {
@Inject
lateinit var backgroundJobManager: BackgroundJobManager

@Inject
lateinit var viewThemeUtils: ViewThemeUtils

lateinit var binding: FragmentPreviewMediaBinding
private var emptyListView: ViewGroup? = null
private var exoPlayer: ExoPlayer? = null
Expand Down Expand Up @@ -306,6 +311,16 @@ class PreviewMediaFragment : FileFragment(), OnTouchListener, Injectable {
override fun onCreateMenu(menu: Menu, menuInflater: MenuInflater) {
menu.removeItem(R.id.action_search)
menuInflater.inflate(R.menu.custom_menu_placeholder, menu)
// NMC customization
val item = menu.findItem(R.id.custom_menu_placeholder_item)
item.icon?.let {
item.setIcon(
viewThemeUtils.platform.colorDrawable(
it,
ContextCompat.getColor(requireContext(), R.color.fontAppbar)
)
)
}
}

override fun onMenuItemSelected(menuItem: MenuItem): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import androidx.activity.OnBackPressedCallback
import androidx.annotation.IdRes
import androidx.annotation.VisibleForTesting
import androidx.core.content.ContextCompat
import androidx.appcompat.view.ContextThemeWrapper
import androidx.core.content.res.ResourcesCompat
import androidx.drawerlayout.widget.DrawerLayout
import androidx.recyclerview.widget.LinearLayoutManager
Expand Down Expand Up @@ -230,7 +231,9 @@ class TrashbinActivity :
}

override fun onOverflowIconClicked(file: TrashbinFile, view: View) {
val popup = PopupMenu(this, view)
// NMC Customization
val ctw = ContextThemeWrapper(this, R.style.CustomPopupTheme)
val popup = PopupMenu(ctw, view)
popup.inflate(R.menu.item_trashbin)
popup.setOnMenuItemClickListener {
onFileActionChosen(it.itemId, setOf(file))
Expand Down Expand Up @@ -561,11 +564,12 @@ class TrashbinActivity :
val inflater: MenuInflater = activity.menuInflater
inflater.inflate(R.menu.custom_menu_placeholder, menu)
val item = menu.findItem(R.id.custom_menu_placeholder_item)
// NMC Customization
item.icon?.let {
item.setIcon(
viewThemeUtils.platform.colorDrawable(
it,
ContextCompat.getColor(activity, R.color.white)
ContextCompat.getColor(activity, R.color.fontAppbar)
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ class FilesSpecificViewThemeUtils @Inject constructor(
.setThumbDrawable(getThumbDrawable(context))
.setPopupStyle {
PopupStyles.MD2.accept(it)
it.background = FastScrollPopupBackground(context, scheme.primary)
//NMC customisation
it.background = FastScrollPopupBackground(context, context.resources.getColor(R.color.primary, null))
}
}
}
Expand All @@ -115,7 +116,7 @@ class FilesSpecificViewThemeUtils @Inject constructor(
me.zhanghai.android.fastscroll.R.drawable.afs_md2_thumb,
null
)
return androidViewThemeUtils.tintPrimaryDrawable(context, thumbDrawable)!!
return androidViewThemeUtils.colorDrawable(thumbDrawable!!, context.resources.getColor(R.color.primary, null))
}

private fun getHomeAsUpIcon(isMenu: Boolean): Int {
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/bg_spinner.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<layer-list>
<item android:drawable="@drawable/ic_keyboard_arrow_down"
android:gravity="center_vertical|right" android:right="5dp" />
</layer-list>
</item>
</selector>
10 changes: 10 additions & 0 deletions app/src/main/res/layout/simple_spinner_item.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
style="?android:attr/spinnerItemStyle"
android:singleLine="true"
android:textColor="@color/primary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:textAlignment="inherit"/>
2 changes: 2 additions & 0 deletions app/src/main/res/layout/upload_files_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@
<Spinner
android:layout_width="match_parent"
android:layout_height="0dp"
style="@style/SpinnerTheme"
android:id="@+id/upload_files_spinner_behaviour"
android:paddingRight="40dp"
android:layout_weight="1"/>
</LinearLayout>

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>
Loading