mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 23:28:42 +03:00
Fix icon tinting for fake placeholder menu iteFix icon tinting for fake placeholder menu itemm
Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
This commit is contained in:
parent
0cc2e6875d
commit
36f918da7e
4 changed files with 9 additions and 5 deletions
|
@ -130,6 +130,7 @@ import androidx.annotation.StringRes;
|
|||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
import androidx.drawerlayout.widget.DrawerLayout;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
@ -709,9 +710,10 @@ public class OCFileListFragment extends ExtendedListFragment implements
|
|||
mIsActionModeNew = true;
|
||||
|
||||
// fake menu to be able to use bottom sheet instead
|
||||
// TODO android:iconTint does not work below API 26. Color icon with viewThemeUtils
|
||||
MenuInflater inflater = getActivity().getMenuInflater();
|
||||
inflater.inflate(R.menu.custom_menu_placeholder, menu);
|
||||
final MenuItem item = menu.findItem(R.id.custom_menu_placeholder_item);
|
||||
item.setIcon(viewThemeUtils.platform.colorDrawable(item.getIcon(), ContextCompat.getColor(requireContext(), R.color.white)));
|
||||
mode.invalidate();
|
||||
|
||||
//set actionMode color
|
||||
|
|
|
@ -67,6 +67,7 @@ import com.owncloud.android.utils.BitmapUtils;
|
|||
import com.owncloud.android.utils.DisplayUtils;
|
||||
import com.owncloud.android.utils.MimeType;
|
||||
import com.owncloud.android.utils.MimeTypeUtil;
|
||||
import com.owncloud.android.utils.theme.ViewThemeUtils;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
|
@ -81,6 +82,7 @@ import javax.inject.Inject;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
|
@ -124,6 +126,8 @@ public class PreviewImageFragment extends FileFragment implements Injectable {
|
|||
@Inject ConnectivityService connectivityService;
|
||||
@Inject UserAccountManager accountManager;
|
||||
@Inject BackgroundJobManager backgroundJobManager;
|
||||
@Inject ViewThemeUtils viewThemeUtils;
|
||||
|
||||
private PreviewImageFragmentBinding binding;
|
||||
|
||||
/**
|
||||
|
@ -344,6 +348,8 @@ public class PreviewImageFragment extends FileFragment implements Injectable {
|
|||
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
|
||||
super.onCreateOptionsMenu(menu, inflater);
|
||||
inflater.inflate(R.menu.custom_menu_placeholder, menu);
|
||||
final MenuItem item = menu.findItem(R.id.custom_menu_placeholder_item);
|
||||
item.setIcon(viewThemeUtils.platform.colorDrawable(item.getIcon(), ContextCompat.getColor(requireContext(), R.color.white)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -67,7 +67,6 @@
|
|||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<!-- TODO maybe convert to listview instead -->
|
||||
<LinearLayout
|
||||
android:id="@+id/file_actions_list"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -22,12 +22,9 @@
|
|||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<!-- This is a "fake" menu so that we can implement custom actions on menu click, while still behaving and looking like a traditional menu item -->
|
||||
<!-- TODO only color white in actionmode and always-black bars (previewimagefragment), use viewthemeutils for that-->
|
||||
<item
|
||||
android:id="@+id/custom_menu_placeholder_item"
|
||||
android:icon="@drawable/ic_dots_vertical"
|
||||
android:iconTint="@color/white"
|
||||
android:title="@string/overflow_menu"
|
||||
app:showAsAction="always" />
|
||||
|
||||
</menu>
|
||||
|
|
Loading…
Reference in a new issue