我无法在 MIUI 11 redmi note 6 pro mobile 中开始活动,出现以下错误:
com.android.server.am.ExtraActivityManagerService: MIUILOG- 权限被拒绝活动
我找到了一些解决方案,例如打开“后台启动”权限。我在 MIUI 11 上找不到这样的东西。从字面上看,我不知道这个问题。提前致谢。
我已经使用bottomsheetdialogfragment 实现了bottomsheet。但默认它具有调光效果(稀松布)。如何删除或将调光效果(稀松布)更改为不可见,以便我可以清楚地看到其他 UI 元素。
这是我使用的布局。
fragment_bottom_sheet_queue.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/res_bottom_sheet_shape"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dp">
<ImageView
android:id="@+id/close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="10dp"
android:layout_marginTop="8dp"
android:background="?selectableItemBackgroundBorderless"
android:contentDescription="@string/image_description"
android:padding="10dp"
android:src="@drawable/ic_close" />
<TextView
android:id="@+id/txt_queue"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_gravity="center"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:fontFamily="@font/quicksand_medium"
android:gravity="center"
android:text="@string/queue"
android:textColor="@color/dark_white"
android:textSize="18sp" />
<ImageView
android:id="@+id/option"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_gravity="center_vertical"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:background="?selectableItemBackgroundBorderless"
android:contentDescription="@string/image_description"
android:padding="10dp"
android:src="@drawable/ic_menu" />
<ImageView
android:id="@+id/tickoption"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_gravity="center_vertical"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:visibility="gone"
android:background="?selectableItemBackgroundBorderless"
android:contentDescription="@string/image_description"
android:padding="10dp"
android:src="@drawable/ic_done_grey_24dp" />
</RelativeLayout>
<View
android:id="@+id/view"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="6dp"
android:background="@color/light_grey" …
Run Code Online (Sandbox Code Playgroud) android android-layout android-bottomsheetdialog bottomsheetdialogfragment
我有一个具有锐利矩形背景的菜单。我已经尝试了很多,但无法将其更改为圆形背景。 弹出菜单.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#1F2026"
android:orientation="horizontal"
>
<TextView
android:id="@+id/details"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:fontFamily="@font/quicksand_regular"
android:text="@string/add_to_favourite"
android:textColor="@color/icon_color_dark" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
上面给出的是我的弹出菜单 xml。
public static void showAlbumPopupOptions(final Activity activity, ImageView listMore,
final Song song, String songId, int playingState) {
final boolean isLogged = AppController.getBooleanPreference(Constants.LOGGED_IN, false);
String[] listItems;
listItems = activity.getResources().getStringArray(R.array.popup_menu_add_album);
ArrayAdapter<String> mPopupAdapter = new ArrayAdapter<>(activity, R.layout.popup_menu, R
.id.details, listItems);
final ListPopupWindow albumPopup = new ListPopupWindow(activity);
albumPopup.setContentWidth(Utils.measureContentWidth(mPopupAdapter, activity));
albumPopup.setAdapter(mPopupAdapter);
albumPopup.setHeight(ListPopupWindow.WRAP_CONTENT);
albumPopup.setAnchorView(listMore);
albumPopup.setModal(true);
albumPopup.setDropDownGravity(Gravity.END);
final LoadingProgressDialog loadingProgressDialog = new LoadingProgressDialog(activity, R
.style
.DialogThemeProgress, false); …
Run Code Online (Sandbox Code Playgroud) android popupmenu android-styles android-popupwindow material-components-android