精华内容
下载资源
问答
  • 一,自定义Dialog样式 1,drawable 中准备一个Dialog背景样式bg_dialog.xml <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <...

    一,自定义Dialog样式

    • 1,drawable 中准备一个Dialog背景样式bg_dialog.xml
    <?xml version="1.0" encoding="utf-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android">
        <solid android:color="#ffffff" />
        <stroke
            android:width="0.8dp"
            android:color="#ffffff" />
        <!-- 圆角 -->
        <corners android:radius="6dp" />
    </shape>
    
    • 2,styles.xml中添加Dialog样式
     <style name="CustomDialog" parent="android:style/Theme.Dialog">
            <!--背景颜色及和透明程度-->
            <item name="android:windowBackground">@android:color/transparent</item>
            <!--是否去除标题 -->
            <item name="android:windowNoTitle">true</item>
            <!--是否去除边框-->
            <item name="android:windowFrame">@null</item>
            <!--是否浮现在activity之上-->
            <item name="android:windowIsFloating">true</item>
            <!--是否模糊-->
            <item name="android:backgroundDimEnabled">true</item>
        </style>
    
    • 3,在layout中新建common_dialog_layout.xml
    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical" android:layout_width="match_parent"
        android:layout_height="match_parent">
    
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:minWidth="260dp"
            android:layout_centerInParent="true"
            android:paddingTop="16dp"
            android:background="@drawable/bg_dialog"
            android:orientation="vertical">
            <TextView
                android:id="@+id/title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginLeft="16dp"
                android:layout_marginRight="16dp"
                android:layout_marginBottom="16dp"
                android:gravity="center"
                android:text="消息提示"
                android:visibility="visible"
                android:textColor="#333333"
                android:textSize="18sp" />
            <ImageView
                android:id="@+id/image"
                android:layout_gravity="center"
                android:maxHeight="150dp"
                android:maxWidth="150dp"
                android:layout_marginBottom="10dp"
                android:layout_marginLeft="16dp"
                android:layout_marginRight="16dp"
                android:visibility="visible"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />
            <TextView
                android:id="@+id/message"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center|left"
                android:layout_marginLeft="20dp"
                android:layout_marginRight="20dp"
                android:lineSpacingExtra="3dp"
                android:lineSpacingMultiplier="1.2"
                android:textSize="14dp"
                android:textColor="#999999"
                android:text="提示消息提示消息提示消息提示消息提示消息提示消息提示消息提示消息" />
    
            <View
                android:layout_width="match_parent"
                android:layout_height="1px"
                android:layout_marginTop="16dp"
                android:background="#E4E4E4" />
    
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">
    
                <Button
                    android:id="@+id/negtive"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="10dp"
                    android:paddingTop="16dp"
                    android:paddingBottom="16dp"
                    android:layout_weight="1"
                    android:background="@null"
                    android:gravity="center"
                    android:singleLine="true"
                    android:text="@string/Reject_and_Exit"
                    android:textColor="#999999"
                    android:textSize="16sp" />
    
                <View
                    android:id="@+id/column_line"
                    android:layout_width="1px"
                    android:layout_height="match_parent"
                    android:background="#E4E4E4" />
    
                <Button
                    android:id="@+id/positive"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="10dp"
                    android:layout_weight="1"
                    android:paddingTop="16dp"
                    android:paddingBottom="16dp"
                    android:background="@null"
                    android:gravity="center"
                    android:singleLine="true"
                    android:text="@string/To_add_permissions"
                    android:textColor="#02704B"
                    android:textSize="16sp" />
            </LinearLayout>
        </LinearLayout>
    </RelativeLayout>
    

    Dialog布局效果如下:
    在这里插入图片描述

    • 4 ,编写对应的java类CommonDialog.java
    package mlab.android.speedgame.ui;
    
    import android.app.Dialog;
    import android.content.Context;
    import android.os.Bundle;
    import android.text.TextUtils;
    import android.view.View;
    import android.widget.Button;
    import android.widget.ImageView;
    import android.widget.TextView;
    
    import mlab.android.speedgame.R;
    
    
    /**
     * description:自定义dialog
     */
    
    public class CommonDialog extends Dialog {
        /**
         * 显示的图片
         */
        private ImageView imageIv ;
    
        /**
         * 显示的标题
         */
        private TextView titleTv ;
    
        /**
         * 显示的消息
         */
        private TextView messageTv ;
    
        /**
         * 确认和取消按钮
         */
        private Button negtiveBn ,positiveBn;
    
        private Context context;
        /**
         * 按钮之间的分割线
         */
        private View columnLineView ;
        public CommonDialog(Context context) {
            super(context, R.style.CustomDialog);
            this.context = context;
        }
    
        /**
         * 都是内容数据
         */
        private String message;
        private String title;
        private String positive,negtive ;
        private int imageResId = -1 ;
    
        /**
         * 底部是否只有一个按钮
         */
        private boolean isSingle = false;
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.common_dialog_layout);
            //按空白处不能取消动画
            setCanceledOnTouchOutside(false);
            //初始化界面控件
            initView();
            //初始化界面数据
            refreshView();
            //初始化界面控件的事件
            initEvent();
        }
    
        /**
         * 初始化界面的确定和取消监听器
         */
        private void initEvent() {
            //设置确定按钮被点击后,向外界提供监听
            positiveBn.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    if ( onClickBottomListener!= null) {
                        onClickBottomListener.onPositiveClick();
                    }
                }
            });
            //设置取消按钮被点击后,向外界提供监听
            negtiveBn.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    if ( onClickBottomListener!= null) {
                        onClickBottomListener.onNegtiveClick();
                    }
                }
            });
        }
    
        /**
         * 初始化界面控件的显示数据
         */
        private void refreshView() {
            //如果用户自定了title和message
            if (!TextUtils.isEmpty(title)) {
                titleTv.setText(title);
                titleTv.setVisibility(View.VISIBLE);
            }else {
                titleTv.setVisibility(View.GONE);
            }
            if (!TextUtils.isEmpty(message)) {
                messageTv.setText(message);
            }
            //如果设置按钮的文字
            if (!TextUtils.isEmpty(positive)) {
                positiveBn.setText(positive);
            }else {
                positiveBn.setText(context.getResources().getString(R.string.To_add_permissions));
            }
            if (!TextUtils.isEmpty(negtive)) {
                negtiveBn.setText(negtive);
            }else {
                negtiveBn.setText(context.getResources().getString(R.string.Reject_and_Exit));
            }
    
            if (imageResId!=-1){
                imageIv.setImageResource(imageResId);
                imageIv.setVisibility(View.VISIBLE);
            }else {
                imageIv.setVisibility(View.GONE);
            }
            /**
             * 只显示一个按钮的时候隐藏取消按钮,回掉只执行确定的事件
             */
            if (isSingle){
                columnLineView.setVisibility(View.GONE);
                negtiveBn.setVisibility(View.GONE);
            }else {
                negtiveBn.setVisibility(View.VISIBLE);
                columnLineView.setVisibility(View.VISIBLE);
            }
        }
    
        @Override
        public void show() {
            super.show();
            refreshView();
        }
    
        /**
         * 初始化界面控件
         */
        private void initView() {
            negtiveBn = (Button) findViewById(R.id.negtive);
            positiveBn = (Button) findViewById(R.id.positive);
            titleTv = (TextView) findViewById(R.id.title);
            messageTv = (TextView) findViewById(R.id.message);
            imageIv = (ImageView) findViewById(R.id.image);
            columnLineView = findViewById(R.id.column_line);
        }
    
        /**
         * 设置确定取消按钮的回调
         */
        public OnClickBottomListener onClickBottomListener;
        public CommonDialog setOnClickBottomListener(OnClickBottomListener onClickBottomListener) {
            this.onClickBottomListener = onClickBottomListener;
            return this;
        }
        public interface OnClickBottomListener{
            /**
             * 点击确定按钮事件
             */
            public void onPositiveClick();
            /**
             * 点击取消按钮事件
             */
            public void onNegtiveClick();
        }
    
        public String getMessage() {
            return message;
        }
    
        public CommonDialog setMessage(String message) {
            this.message = message;
            return this ;
        }
    
        public String getTitle() {
            return title;
        }
    
        public CommonDialog setTitle(String title) {
            this.title = title;
            return this ;
        }
    
        public String getPositive() {
            return positive;
        }
    
        public CommonDialog setPositive(String positive) {
            this.positive = positive;
            return this ;
        }
    
        public String getNegtive() {
            return negtive;
        }
    
        public CommonDialog setNegtive(String negtive) {
            this.negtive = negtive;
            return this ;
        }
    
        public int getImageResId() {
            return imageResId;
        }
    
        public boolean isSingle() {
            return isSingle;
        }
    
        public CommonDialog setSingle(boolean single) {
            isSingle = single;
            return this ;
        }
    
        public CommonDialog setImageResId(int imageResId) {
            this.imageResId = imageResId;
            return this ;
        }
    
    }
    

    5,部分string.xml资源

    <string name="To_add_permissions">去添加 权限</string>
    <string name="Reject_and_Exit">拒绝则 退出</string>
    

    6,调用自定义Dialog

    CommonDialog dialog = new CommonDialog( mActivity);
                    dialog.setMessage(str)
                            .setTitle(mActivity.getApplication().getString(R.string.following_permissions))
                            .setSingle(false).setOnClickBottomListener(new CommonDialog.OnClickBottomListener() {
                        @RequiresApi(api = Build.VERSION_CODES.M)
                        @Override
                        public void onPositiveClick() {
                            dialog.dismiss();
                            mActivity.requestPermissions(permissions,requestCode);
                        }
    
                        @Override
                        public void onNegtiveClick() {
                            dialog.dismiss();
                            // 若拒绝了所需的权限请求,则退出应用
                            mActivity.finish();
                            System.exit(0);
                        }
                    }).show();
    

    二,权限动态申请

    • 1,针对照相机权限(CAMERA),定位权限(ACCESS_FINE_LOCATION)(ACCESS_COARSE_LOCATION),读手机信息权限(READ_PHONE_STATE),读写存储权限(READ_EXTERNAL_STORAGE)(WRITE_EXTERNAL_STORAGE),准备一个工具类PermissionUtils.java
    package mlab.android.speedgame.utils;
    
    import android.Manifest;
    import android.app.Activity;
    import android.app.AlertDialog;
    import android.content.DialogInterface;
    import android.content.pm.PackageManager;
    import android.os.Build;
    import android.util.Log;
    import android.widget.Toast;
    
    import androidx.annotation.NonNull;
    import androidx.annotation.RequiresApi;
    
    import java.util.ArrayList;
    import java.util.List;
    
    import mlab.android.speedgame.R;
    import mlab.android.speedgame.ui.CommonDialog;
    
    //申请权限的工具类
    public class PermissionUtils {
        private Activity mActivity;
        private int mReqCode;
        private CallBack mCallBack;
    
        //定义一个回调接口
        public static interface CallBack{
            //接受
            void grantAll(Activity mActivity);
            //拒绝
            void denied();
        }
    
        //定义一个构造函数
        public PermissionUtils(Activity activity) {
            this.mActivity = activity;
        }
    
        //定义请求权限的方法
        @RequiresApi(api = Build.VERSION_CODES.M)
        public void request(List<String> needPermissions, int reqCode, CallBack callBack){
    
            mReqCode=reqCode;
            mCallBack=callBack;
    
            //因为6.0之后才需要动态权限申请
            if (Build.VERSION.SDK_INT < 23){
                //6.0之前是默认获取全部权限
                callBack.grantAll(mActivity);
                return;
            }
    
            //判空,并抛出异常
            if (mActivity==null){
                throw  new IllegalArgumentException("activity is null.");
            }
    
    
            //将需要申请的权限,因为有些权限已经赋予
            List<String> reqPermission =new ArrayList<>();
            for (String permission:needPermissions){
                if (mActivity.checkSelfPermission(permission)!= PackageManager.PERMISSION_GRANTED){
                    reqPermission.add(permission);
                }
            }
    
            //如果没有要授予的权限,则直接返回
            if (reqPermission.isEmpty()){
                callBack.grantAll(mActivity);
                return;
            }
    
            //真正开始申请
            mActivity.requestPermissions(reqPermission.toArray(new String[]{}),reqCode);
    
        }
    
        //处理权限返回的回调
        public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
    
            if (requestCode==mReqCode){
                boolean grantAll = true;
                String str = "";//定位,获取手机信息,读写手机存储,后台弹出界面,显示悬浮窗
    
                //遍历每一个授权结果
                for (int i = 0; i < grantResults.length; i++) {
    
                    if (grantResults[i]!=PackageManager.PERMISSION_GRANTED){
                        grantAll=false;
                        if(("android.permission.ACCESS_COARSE_LOCATION".equals(permissions[i]) ||
                                "android.permission.ACCESS_FINE_LOCATION".equals(permissions[i])) &&
                                !str.contains(mActivity.getApplication().getString(R.string.Positioning_authority))){
                            str += mActivity.getApplication().getString(R.string.Positioning_authority) + " ";
                        }
                        if("android.permission.READ_PHONE_STATE".equals(permissions[i])){
                            str += mActivity.getApplication().getString(R.string.Access_to_mobile_phone_information) + " ";
                        }
                        if("android.permission.WRITE_EXTERNAL_STORAGE".equals(permissions[i])){
                            str += mActivity.getApplication().getString(R.string.Read_write_cell_phone_storage_permission) + " ";
                        }
                        if("android.permission.CAMERA".equals(permissions[i])){
                            str += mActivity.getApplication().getString(R.string.Camera_permission) + " ";
                        }
                    }
                    Log.d("xmmm",i + permissions[i]);
                }
                if(str != ""){
                    CommonDialog dialog = new CommonDialog( mActivity);
                    dialog.setMessage(str)
                            .setTitle(mActivity.getApplication().getString(R.string.following_permissions))
                            .setSingle(false).setOnClickBottomListener(new CommonDialog.OnClickBottomListener() {
                        @RequiresApi(api = Build.VERSION_CODES.M)
                        @Override
                        public void onPositiveClick() {
                            dialog.dismiss();
                            mActivity.requestPermissions(permissions,requestCode);
                        }
    
                        @Override
                        public void onNegtiveClick() {
                            dialog.dismiss();
                            // 若拒绝了所需的权限请求,则退出应用
                            mActivity.finish();
                            System.exit(0);
                        }
                    }).show();
                }
    
                if (grantAll){
                    mCallBack.grantAll(mActivity);
                }else {
                    mCallBack.denied();
                }
            }
        }
    }
    
    • 2,关于动态申请悬浮窗权限(SYSTEM_ALERT_WINDOW),准备一个工具类FloatTool.java
    package mlab.android.speedgame.utils;
    
    import android.app.Activity;
    import android.app.AlertDialog;
    import android.content.DialogInterface;
    import android.content.Intent;
    import android.net.Uri;
    import android.os.Build;
    import android.provider.Settings;
    
    import androidx.annotation.RequiresApi;
    
    import mlab.android.speedgame.R;
    import mlab.android.speedgame.ui.CommonDialog;
    /**
     * FloatTool.java:应用悬浮窗权限请求
     * AndroidMainifest.xml中添加: <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
     * 用法:
     * 1、请求悬浮窗权限:FloatTool.RequestOverlayPermission(this);
     * 2、处理悬浮窗权限请求结果:FloatTool.onActivityResult(requestCode, resultCode, data, this);
     */
    public class FloatTool
    {
        public static boolean CanShowFloat = false;
    
        private static final int REQUEST_OVERLAY = 5004;
    
        /** 动态请求悬浮窗权限 */
        public static void RequestOverlayPermission(Activity Instatnce)
        {
            if (Build.VERSION.SDK_INT >= 23)
            {
                if (!Settings.canDrawOverlays(Instatnce))
                {
                    String ACTION_MANAGE_OVERLAY_PERMISSION = "android.settings.action.MANAGE_OVERLAY_PERMISSION";
                    Intent intent = new Intent(ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:" + Instatnce.getPackageName()));
    
                    Instatnce.startActivityForResult(intent, REQUEST_OVERLAY);
                }
                else
                {
                    CanShowFloat = true;
                }
            }
        }
    
        /** 浮窗权限请求,Activity执行结果,回调函数 */
        @RequiresApi(api = Build.VERSION_CODES.M)
        public static void onActivityResult(int requestCode, int resultCode, Intent data, final Activity Instatnce)
        {
            // Toast.makeText(activity, "onActivityResult设置权限!", Toast.LENGTH_SHORT).show();
            if (requestCode == REQUEST_OVERLAY)		// 从应用权限设置界面返回
            {
                if(resultCode == Activity.RESULT_OK)
                {
                    CanShowFloat = true;		// 设置标识为可显示悬浮窗
                }
                else
                {
                    CanShowFloat = false;
    
                    if (!Settings.canDrawOverlays(Instatnce))	// 若当前未允许显示悬浮窗,则提示授权
                    {
                        CommonDialog dialog = new CommonDialog(Instatnce);
                        dialog.setMessage(Instatnce.getApplication().getString(R.string.Suspended_window))
                                .setTitle(Instatnce.getApplication().getString(R.string.Suspended_window_permission_not_authorized))
                                .setSingle(false).setOnClickBottomListener(new CommonDialog.OnClickBottomListener() {
                            @Override
                            public void onPositiveClick() {
                                dialog.dismiss();
                                FloatTool.RequestOverlayPermission(Instatnce);
                            }
    
                            @Override
                            public void onNegtiveClick() {
                                dialog.dismiss();
                                // 若拒绝了所需的权限请求,则退出应用
                                Instatnce.finish();
                                System.exit(0);
                            }
                        }).show();
                    }
                }
            }
        }
    }
    
    • 3,写一个Activity作为APP进入的首Activity进行权限申请SplashActivity
    package mlab.android.speedgame;
    
    import android.Manifest;
    import android.app.Activity;
    import android.app.AlertDialog;
    import android.content.DialogInterface;
    import android.content.Intent;
    import android.os.Build;
    
    import android.os.Bundle;
    import android.provider.Settings;
    import android.view.Window;
    import android.view.WindowManager;
    
    import androidx.annotation.NonNull;
    import androidx.annotation.RequiresApi;
    import androidx.core.app.ActivityCompat;
    
    import java.util.ArrayList;
    import java.util.List;
    
    import mlab.android.speedgame.ui.CommonDialog;
    import mlab.android.speedgame.utils.FloatTool;
    import mlab.android.speedgame.utils.PermissionUtils;
    
    public class SplashActivity extends Activity implements ActivityCompat.OnRequestPermissionsResultCallback{
    
        private static List<String> sNeedPermissions=new ArrayList<>();
    
        private PermissionUtils permissionUtils= null;
    
        //静态块中初始化所需要的权限
        static {
            sNeedPermissions.add(Manifest.permission.ACCESS_COARSE_LOCATION);
            sNeedPermissions.add(Manifest.permission.ACCESS_FINE_LOCATION);
            sNeedPermissions.add(Manifest.permission.ACCESS_NETWORK_STATE);
            sNeedPermissions.add(Manifest.permission.INTERNET);
            sNeedPermissions.add(Manifest.permission.READ_PHONE_STATE);
            sNeedPermissions.add(Manifest.permission.ACCESS_WIFI_STATE);
            sNeedPermissions.add(Manifest.permission.READ_EXTERNAL_STORAGE);
            sNeedPermissions.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
            sNeedPermissions.add(Manifest.permission.CAMERA);
            sNeedPermissions.add(Manifest.permission.CHANGE_WIFI_STATE);
            //sNeedPermissions.add(Manifest.permission.SYSTEM_ALERT_WINDOW);
            //sNeedPermissions.add(Manifest.permission.PACKAGE_USAGE_STATS);
            //sNeedPermissions.add(Manifest.permission.MODIFY_AUDIO_SETTINGS);
            //sNeedPermissions.add(Manifest.permission.BROADCAST_STICKY);
            //sNeedPermissions.add(Manifest.permission.CHANGE_WIFI_MULTICAST_STATE);
            //sNeedPermissions.add(Manifest.permission.GET_ACCOUNTS);
            //sNeedPermissions.add(Manifest.permission.REQUEST_INSTALL_PACKAGES);
            //sNeedPermissions.add(Manifest.permission.WRITE_SETTINGS);
            //sNeedPermissions.add(Manifest.permission.RECEIVE_BOOT_COMPLETED);
            //sNeedPermissions.add(Manifest.permission.WAKE_LOCK);
            //sNeedPermissions.add(Manifest.permission.KILL_BACKGROUND_PROCESSES);
            //sNeedPermissions.add(Manifest.permission.WRITE_SYNC_SETTINGS);
            //sNeedPermissions.add(Manifest.permission.WRITE_CONTACTS);
            //sNeedPermissions.add(Manifest.permission.CHANGE_CONFIGURATION);
            //sNeedPermissions.add(Manifest.permission.BATTERY_STATS);
            //sNeedPermissions.add(Manifest.permission.GET_PACKAGE_SIZE);
            //sNeedPermissions.add(Manifest.permission.BLUETOOTH);
            //sNeedPermissions.add(Manifest.permission.PACKAGE_USAGE_STATS);
            //sNeedPermissions.add(Manifest.permission.READ_CALL_LOG);
    
    
    
    
        }
    
        @RequiresApi(api = Build.VERSION_CODES.M)
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            /*set it to be no title*/
            requestWindowFeature(Window.FEATURE_NO_TITLE);
    
            /*set it to be full screen*/
            getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                    WindowManager.LayoutParams.FLAG_FULLSCREEN);
            setContentView(R.layout.a_permission);
            //FloatTool.RequestOverlayPermission(this);
            permissionUtils=new PermissionUtils(this);
    
            permissionUtils.request(sNeedPermissions, 100, new PermissionUtils.CallBack() {
                @Override
                public void grantAll(Activity mActivity) {
                    if(!Settings.canDrawOverlays(mActivity)){
                        CommonDialog dialog = new CommonDialog( mActivity);
                        dialog.setMessage(mActivity.getApplication().getString(R.string.Suspended_window))
                                .setTitle(mActivity.getApplication().getString(R.string.Suspended_window_permission_not_authorized))
                                .setSingle(false).setOnClickBottomListener(new CommonDialog.OnClickBottomListener() {
                            @Override
                            public void onPositiveClick() {
                                dialog.dismiss();
                                FloatTool.RequestOverlayPermission(mActivity);
                            }
    
                            @Override
                            public void onNegtiveClick() {
                                dialog.dismiss();
                                // 若拒绝了所需的权限请求,则退出应用
                                mActivity.finish();
                                System.exit(0);
                            }
                        }).show();
                    }else{
                        toMainActivity();
                        finish();
                    }
                }
    
                @Override
                public void denied() {
                    fileList();
                }
            });
        }
    
    
        public void toMainActivity(){
            //进入主Activity
            startActivity(new Intent(SplashActivity.this,MainActivity.class));
        }
    
        @Override
        public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
            super.onRequestPermissionsResult(requestCode, permissions, grantResults);
            permissionUtils.onRequestPermissionsResult(requestCode,permissions,grantResults);
        }
    
        /** Activity执行结果 */
        @RequiresApi(api = Build.VERSION_CODES.M)
        protected void onActivityResult(int requestCode, int resultCode, Intent data)
        {
            super.onActivityResult(requestCode, resultCode, data);
            FloatTool.onActivityResult(requestCode, resultCode, data, this);
            if(Settings.canDrawOverlays(this)){
                toMainActivity();
                finish();
            }
        }
    
    }
    
    • 4,补1:动态申请安装未知来源应用权限(REQUEST_INSTALL_PACKAGES),在MainActivity.java的onCreate()方法中添加以下代码
    //打开未知来源权限
            boolean haveInstallPermission;
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
                //先获取是否有安装未知来源应用的权限
                haveInstallPermission = getPackageManager().canRequestPackageInstalls();
                if (!haveInstallPermission) {//没有权限
                    CommonDialog dialog = new CommonDialog(this);
                    dialog.setMessage(this.getApplication().getString(R.string.install_permission))
                            .setTitle(this.getApplication().getString(R.string.following_permissions))
                            .setSingle(true).setOnClickBottomListener(new CommonDialog.OnClickBottomListener() {
                        @RequiresApi(api = Build.VERSION_CODES.M)
                        @Override
                        public void onPositiveClick() {
                            dialog.dismiss();
                            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
                                startInstallPermissionSettingActivity();
                            }
                        }
    
                        @Override
                        public void onNegtiveClick() {
                            dialog.dismiss();
                            // 若拒绝了所需的权限请求,则退出应用
                            //mActivity.finish();
                            System.exit(0);
                        }
                    }).show();
                }
            }
    
    • 4,补2:在MainActivity.java中添加方法startInstallPermissionSettingActivity()
    /**
         * 进入打开位置来源权限页面
         */
        @RequiresApi(api = Build.VERSION_CODES.O)
        private void startInstallPermissionSettingActivity() {
            Uri packageURI = Uri.parse("package:" + getPackageName());
            //注意这个是8.0新API
            Intent intent = new Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES, packageURI);
            startActivityForResult(intent, 10086);
        }
    
    • 5,部分String.xml 中文包资源
     <string name="To_add_permissions">去添加 权限</string>
        <string name="Reject_and_Exit">拒绝则 退出</string>
        <string name="Suspended_window_permission_not_authorized">两项权限未授权</string>
        <string name="Suspended_window">请打开后台弹出界面权限与显示悬浮窗权限</string>
        <string name="following_permissions">应用需以下权限,请务必进行授权,否则应用将无法开启</string>
        <string name="Positioning_authority">定位权限</string>
        <string name="Camera_permission">照相机权限</string>
        <string name="Access_to_mobile_phone_information">获取手机信息权限</string>
        <string name="Read_write_cell_phone_storage_permission">读写手机存储权限</string>
        <string name="install_permission">安装应用需要打开未知来源权限,请去设置中开启权限</string>
    
    展开全文
  • 之前有发个一个凡科的右侧悬浮窗,今天给加了一些图标样式,新增css判断窗口大小自动隐藏(手机端不会显示),这下比较齐全了。 可以自己自定义图标,在css更改图片链接即可(背景图标和鼠标hover浮动图标)。 ...

    之前有发个一个凡科的右侧悬浮窗,今天给加了一些图标样式,新增css判断窗口大小自动隐藏(手机端不会显示),这下比较齐全了。

    • 可以自己自定义图标,在css更改图片链接即可(背景图标和鼠标hover浮动图标)。
    • 如果要自己添加在css里写好就可以了。图标可以使用https://www.iconfont.cn

    预览:

    仿凡科网站右侧悬浮窗  在线客服简约图标大全快捷导航钻芒美化版-钻芒博客

    代码

    html

    <div class="wapnone fk_service">
    	<ul>
    		<li>
    			<div class="fk_service_consult_cont1" style="display: none;"> <span class="fk_service_triangle"></span> 在线咨询 </div>
    		</li>
    		<li class="fk_service_box fk_service_consult">
    			<div class="fk_service_consult_cont"> <span class="fk_service_triangle"></span>
    				<div class="fk_service_consult_cont_top"> <span class="fk_service_hint"> <span class="fk_service_icon"></span>
    						<span> 如遇问题,请联系站长 </span> </span> <span class="fk_service_button" onclick="window.open('https://wpa.qq.com/msgrd?v=3&uin=20838641&site=qq&menu=yes')">QQ联系</span>
    					<span class="fk_service_button" onclick="window.open('https://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&email=cpol@qq.com')">在线邮件</span>
    				</div> <span class="fk_service_phone"> QQ 请注明来意 :20838641 </span> <span class="fk_service_check_site"> <span class="fk_service_icon"></span>
    					<span onclick="window.open('http://tool.zmki.cn')">更多:极客导航</span> </span>
    			</div>
    		</li>
    		
    		<li class="fk_service_box fk_service_qr">
    			<div class="fk_service_qr_cont"> <span class="fk_service_triangle"></span>
    				<div class="fk_service_qrimg"> <span class="fk_service_qrimg_site"></span> 微信公众号 </div>
    				<div class="fk_service_qrtext"><span>奇思妙想 · 科技小新</span></div>
    			</div>
    		</li>
    		<!-- 不需要图标的注释或删除即可 -->
    		<li class="fk_service_box fk_service_ax" onclick="window.open('https://tool.zmki.cn/index.php/t.html')">
    			<div class="fk_service_ax_cont"> <span class="fk_service_triangle"></span> 提交收录,站长收到留言后即刻处理! </div>
    		</li>
    
    		<li class="fk_service_box fk_service_dh" onclick="window.open('https://tool.zmki.cn/index.php/t.html')">
    			<div class="fk_service_dh_cont"> <span class="fk_service_triangle"></span> 提交收录,站长收到留言后即刻处理! </div>
    		</li>
    
    		<li class="fk_service_box fk_service_jk" onclick="window.open('https://tool.zmki.cn/index.php/t.html')">
    			<div class="fk_service_jk_cont"> <span class="fk_service_triangle"></span> 提交收录,站长收到留言后即刻处理! </div>
    		</li>
    
    		<li class="fk_service_box fk_service_ws" onclick="window.open('https://tool.zmki.cn/index.php/t.html')">
    			<div class="fk_service_ws_cont"> <span class="fk_service_triangle"></span> 提交收录,站长收到留言后即刻处理! </div>
    		</li>
    
    		<li class="fk_service_box fk_service_sd" onclick="window.open('https://tool.zmki.cn/index.php/t.html')">
    			<div class="fk_service_sd_cont"> <span class="fk_service_triangle"></span> 提交收录,站长收到留言后即刻处理! </div>
    		</li>
    
    
    
    		<li class="fk_service_box fk_service_dz" onclick="window.open('https://tool.zmki.cn/index.php/t.html')">
    			<div class="fk_service_dz_cont"> <span class="fk_service_triangle"></span> 提交收录,站长收到留言后即刻处理! </div>
    		</li>
    		
    		<li class="fk_service_box fk_service_feedback" onclick="window.open('https://tool.zmki.cn/index.php/t.html')">
    			<div class="fk_service_feedback_cont"> <span class="fk_service_triangle"></span> 提交收录,站长收到留言后即刻处理! </div>
    		</li>
    		
    		<li class="fk_service_box fk_service_upward" onclick="FkService.fk_upWard();" style="display: block;">
    			<div class="fk_service_upward_cont"> <span class="fk_service_triangle"></span> <span> 返回顶部 </span> </div>
    		</li>
    	</ul>
    </div>
    
    

    Select Code

    Copy

     

    css

    <!-- <link rel="stylesheet" href="https://fe.faisys.com/fkService_1_0/css/fk_service.min.css?v=201908151449">
     -->
    
    
    <style>
    	.fk_service {
    		max-height: 232px;
    		position: fixed;
    		right: 10px;
    		top: 40%;
    		/* 垂直位置 */
    		font-family: "寰蒋闆呴粦";
    		font-size: 14px;
    		color: #243558;
    		z-index: 10000
    	}
    
    
    	.fk_service ul {
    		margin: 0;
    		padding: 0;
    		position: absolute;
    		right: 0
    	}
    
    	.fk_service li {
    		list-style-type: none
    	}
    
    	.fk_service li>div {
    		box-sizing: border-box;
    		box-shadow: 0 0 9px 0 rgba(0, 0, 0, 0.1)
    	}
    
    	.fk_service_box {
    		width: 40px;
    		height: 40px;
    		background: #fff;
    		margin-bottom: 10px;
    		border-radius: 4px;
    		box-sizing: border-box;
    		box-shadow: 0 0 9px 0 rgba(0, 0, 0, 0.1)
    	}
    
    	.fk_service_triangle {
    		top: 12px;
    		right: -11px;
    		position: absolute;
    		border-top: 7px solid transparent;
    		border-bottom: 7px solid transparent;
    		border-left: 11px solid #e1e6ec;
    		z-index: 1010
    	}
    
    	.fk_service_triangle:after {
    		content: "\20";
    		top: -6px;
    		right: 1px;
    		position: absolute;
    		border-top: 6px solid transparent;
    		border-bottom: 6px solid transparent;
    		border-left: 10px solid #fff;
    		z-index: 1000
    	}
    
    	.fk_service_triangle:before {
    		content: "\20";
    		width: 80px;
    		height: 45px;
    		top: -20px;
    		right: -52px;
    		position: absolute;
    		background: rgba(0, 0, 0, 0)
    	}
    
    	@keyframes fade-in {
    		0% {
    			opacity: .4;
    			right: 82px
    		}
    
    		100% {
    			opacity: 1;
    			right: 62px
    		}
    	}
    
    	.fk_service_consult {
    		background: url(https://a-oss.zmki.cn/2019/20190827-5d652476ab305.png) no-repeat -366px -16px #fff
    	}
    
    	.fk_service_consult:hover {
    		border: 0;
    		background: url(https://a-oss.zmki.cn/2019/20190827-5d652476ab305.png) no-repeat -410px -16px #4f7cfc
    	}
    
    	.fk_service_consult:hover .fk_service_consult_cont {
    		display: block;
    		opacity: 1;
    		transition: linear .2s;
    		animation-name: fade-in;
    		animation-duration: .3s;
    		animation-iteration-count: 1;
    		animation-delay: 0s
    	}
    
    	.fk_service_consult_cont {
    		width: 200px;
    		min-height: 210px;
    		max-height: 268px;
    		border-radius: 3px;
    		background: #fff;
    		right: 62px;
    		position: absolute;
    		text-align: center;
    		border: 1px solid #e1e6ec;
    		display: none;
    		opacity: 0
    	}
    
    	.fk_service_consult_cont1 {
    		width: 70px;
    		height: 40px;
    		line-height: 40px;
    		background: #fff;
    		border-radius: 5px;
    		right: 62px;
    		text-align: center;
    		position: absolute;
    		display: none;
    		border: 1px solid #e1e6ec
    	}
    
    	.fk_service_consult_cont1 .fk_service_triangle:before {
    		width: 0 !important
    	}
    
    	.fk_service_consult_cont>.fk_service_triangle:after {
    		border-left: 10px solid #f6f8fb !important
    	}
    
    	.fk_service_consult_cont span {
    		float: left
    	}
    
    	.fk_service_consult_cont_top {
    		width: 100%;
    		height: 157px;
    		background: #f6f8fb;
    		border-radius: 3px;
    		border-bottom: 1px solid #eef2f8
    	}
    
    	.fk_service_hint {
    		width: 100%;
    		height: 40px;
    		line-height: 40px;
    		font-size: 12px;
    		color: #9aa8c2;
    		text-align: center
    	}
    
    	.fk_service_hint>.fk_service_icon {
    		background: url(https://a-oss.zmki.cn/2019/20190827-5d652476ab305.png) no-repeat -460px -25px;
    		width: 15px;
    		height: 15px;
    		margin: 13px 2px 0 18px
    	}
    
    	.fk_service_button {
    		width: 160px;
    		height: 38px;
    		line-height: 38px;
    		background: #4f7cfc;
    		border-radius: 18px;
    		text-align: center;
    		color: #fff;
    		margin: 5px 0 10px 20px;
    		cursor: pointer
    	}
    
    	.fk_service_button:hover {
    		background: #618aff
    	}
    
    	.fk_service_phone {
    		width: 100%;
    		height: 53px;
    		line-height: 53px;
    		font-size: 14px;
    		text-align: center
    	}
    
    	.fk_service_check_site {
    		width: 100%;
    		height: 48px;
    		line-height: 48px;
    		color: #3b6bf4;
    		border-top: 1px solid #eaeef5;
    		cursor: pointer
    	}
    
    	.fk_service_check_site>.fk_service_icon {
    		background: url(https://a-oss.zmki.cn/2019/20190827-5d652476ab305.png) no-repeat -461px -75px;
    		width: 20px;
    		height: 20px;
    		margin: 15px 2px 0 45px
    	}
    
    	.fk_service_feedback {
    		background: url(https://a-oss.zmki.cn/2019/20190827-5d652476ab305.png) no-repeat -363px -64px #fff
    	}
    
    	.fk_service_feedback:hover {
    		border: 0;
    		background: url(https://a-oss.zmki.cn/2019/20190827-5d652476ab305.png) no-repeat -407px -64px #4f7cfc;
    		cursor: pointer
    	}
    
    	.fk_service_feedback:hover .fk_service_feedback_cont {
    		display: block;
    		opacity: 1;
    		transition: linear .2s;
    		animation-name: fade-in;
    		animation-duration: .3s;
    		animation-iteration-count: 1;
    		animation-delay: 0s
    	}
    
    	.fk_service_feedback_cont {
    		width: 264px;
    		height: 40px;
    		line-height: 40px;
    		background: #fff;
    		border-radius: 5px;
    		right: 62px;
    		text-align: center;
    		position: absolute;
    		display: none;
    		border: 1px solid #e1e6ec
    	}
    
    
    	.fk_service_qr {
    		background: url(https://a-oss.zmki.cn/2019/20190827-5d652476ab305.png) no-repeat -365px -113px #fff
    	}
    
    	.fk_service_qr:hover {
    		border: 0;
    		background: url(https://a-oss.zmki.cn/2019/20190827-5d652476ab305.png) no-repeat -409px -113px #4f7cfc
    	}
    
    	.fk_service_qr:hover .fk_service_qr_cont {
    		display: block;
    		opacity: 1;
    		transition: linear .2s;
    		animation-name: fade-in;
    		animation-duration: .3s;
    		animation-iteration-count: 1;
    		animation-delay: 0s
    	}
    
    	.fk_service_qr_cont {
    		width: 143px;
    		height: 202px;
    		border-radius: 3px;
    		background: #fff;
    		right: 62px;
    		position: absolute;
    		text-align: center;
    		border: 1px solid #e1e6ec;
    		background-color: #f6f8fb;
    		display: none;
    		opacity: 0
    	}
    
    	.fk_service_qr_cont>.fk_service_triangle:after {
    		border-left: 10px solid #f6f8fb !important
    	}
    
    	.fk_service_qr_cont>.fk_service_qrimg {
    		width: 100%;
    		height: 164px;
    		float: left
    	}
    
    	.fk_service_qrimg_site {
    		width: 119px;
    		height: 119px;
    		float: left;
    		margin: 12px 12px 5px 12px;
    		background: url(https://a-oss.zmki.cn/2019/20190827-5d652476ab305.png) no-repeat -41px -26px
    	}
    
    	.fk_service_qrimg_hd {
    		width: 119px;
    		height: 119px;
    		float: left;
    		margin: 12px 12px 5px 12px;
    		background: url(https://a-oss.zmki.cn/2019/20190827-5d652476ab305.png) no-repeat -198px -26px
    	}
    
    	.fk_service_qrimg_wxast {
    		width: 119px;
    		height: 119px;
    		float: left;
    		margin: 12px 12px 5px 12px;
    		background: url(../image/fk_service.png?v=201905151200) no-repeat -198px -328px
    	}
    
    	.fk_service_qrimg_flyer {
    		width: 119px;
    		height: 119px;
    		float: left;
    		margin: 12px 12px 5px 12px;
    		background: url(https://a-oss.zmki.cn/2019/20190827-5d652476ab305.png) no-repeat -41px -177px
    	}
    
    	.fk_service_qrimg_wxapp {
    		width: 119px;
    		height: 119px;
    		float: left;
    		margin: 12px 12px 5px 12px;
    		background: url(https://a-oss.zmki.cn/2019/20190827-5d652476ab305.png) no-repeat -198px -177px
    	}
    
    	.fk_service_qrimg_fkmall {
    		width: 119px;
    		height: 119px;
    		float: left;
    		margin: 12px 12px 5px 12px;
    		background: url(https://a-oss.zmki.cn/2019/20190827-5d652476ab305.png) no-repeat -41px -326px
    	}
    
    	.fk_service_qr_cont>.fk_service_qrtext {
    		width: 100%;
    		height: 35px;
    		font-size: 12px;
    		color: #7b89a6;
    		background-color: #fff;
    		float: left;
    		bottom: 0;
    		display: table
    	}
    
    	.fk_service_qr_cont>.fk_service_qrtext>span {
    		display: table-cell;
    		vertical-align: middle
    	}
    
    	.fk_service_upward {
    		display: none;
    		background: url(https://a-oss.zmki.cn/2019/20190827-5d652476ab305.png) no-repeat -363px -159px #fff
    	}
    
    	.fk_service_upward:hover {
    		border: 0;
    		background: url(https://a-oss.zmki.cn/2019/20190827-5d652476ab305.png) no-repeat -407px -159px #4f7cfc;
    		cursor: pointer
    	}
    
    	.fk_service_upward:hover .fk_service_upward_cont {
    		display: block;
    		opacity: 1;
    		transition: linear .2s;
    		animation-name: fade-in;
    		animation-duration: .3s;
    		animation-iteration-count: 1;
    		animation-delay: 0s
    	}
    
    	.fk_service_upward_cont {
    		width: 84px;
    		height: 40px;
    		line-height: 40px;
    		border-radius: 3px;
    		background: #fff;
    		right: 62px;
    		position: absolute;
    		text-align: center;
    		border: 1px solid #e1e6ec;
    		display: none;
    		opacity: 0
    	}
    
    	.fk_service_upward_cont span {
    		font-size: 14px
    	}
    	/* ----------------------------------------------------------------------- */
    	/* 新增图标->zmki 开始*/
    	.fk_service_jk {
    		/* 前景图标 */
    		background: url(https://a-oss.zmki.cn/2019/20191218-c9feba3074fcf.png) no-repeat center center #fff;
    		background-size: 40%40%;
    	}
    	
    	.fk_service_jk:hover {
    		border: 0;
    		/* 鼠标悬浮图标 */
    		background: url(https://a-oss.zmki.cn/2019/20191218-9e8acd5341cdc.png) no-repeat center center #4f7cfc;
    		background-size: 40%40%;
    		cursor: pointer
    	}
    	
    	.fk_service_jk:hover .fk_service_jk_cont {
    		display: block;
    		opacity: 1;
    		transition: linear .2s;
    		animation-name: fade-in;
    		animation-duration: .3s;
    		animation-iteration-count: 1;
    		animation-delay: 0s
    	}
    	
    	.fk_service_jk_cont {
    		width: 264px;
    		height: 40px;
    		line-height: 40px;
    		background: #fff;
    		border-radius: 5px;
    		right: 62px;
    		text-align: center;
    		position: absolute;
    		display: none;
    		border: 1px solid #e1e6ec
    	}
    	
    	/* 新增图标->zmki 结束*/
    	
    	/* 新增图标->zmki 开始*/
    	.fk_service_ws {
    		background: url(https://a-oss.zmki.cn/2019/20191218-61b4baac98ee7.png) no-repeat center center #fff;
    		background-size: 50%50%;
    	}
    	
    	.fk_service_ws:hover {
    		border: 0;
    		background: url(https://a-oss.zmki.cn/2019/20191218-8ded04c01bb3c.png) no-repeat center center #4f7cfc;
    		background-size: 50%50%;
    		cursor: pointer
    	}
    	
    	.fk_service_ws:hover .fk_service_ws_cont {
    		display: block;
    		opacity: 1;
    		transition: linear .2s;
    		animation-name: fade-in;
    		animation-duration: .3s;
    		animation-iteration-count: 1;
    		animation-delay: 0s
    	}
    	
    	.fk_service_ws_cont {
    		width: 264px;
    		height: 40px;
    		line-height: 40px;
    		background: #fff;
    		border-radius: 5px;
    		right: 62px;
    		text-align: center;
    		position: absolute;
    		display: none;
    		border: 1px solid #e1e6ec
    	}
    	
    	/* 新增图标->zmki 结束*/
    	
    	
    	/* 闪电 新增图标->zmki 开始*/
    	.fk_service_sd {
    		background: url(https://a-oss.zmki.cn/2019/20191218-94664bd399372.png) no-repeat center center #fff;
    		background-size: 50%50%;
    	}
    	
    	.fk_service_sd:hover {
    		border: 0;
    		background: url(https://a-oss.zmki.cn/2019/20191218-fab840acee28b.png) no-repeat center center #4f7cfc;
    		background-size: 50%50%;
    		cursor: pointer
    	}
    	
    	.fk_service_sd:hover .fk_service_sd_cont {
    		display: block;
    		opacity: 1;
    		transition: linear .2s;
    		animation-name: fade-in;
    		animation-duration: .3s;
    		animation-iteration-count: 1;
    		animation-delay: 0s
    	}
    	
    	.fk_service_sd_cont {
    		width: 264px;
    		height: 40px;
    		line-height: 40px;
    		background: #fff;
    		border-radius: 5px;
    		right: 62px;
    		text-align: center;
    		position: absolute;
    		display: none;
    		border: 1px solid #e1e6ec
    	}
    	
    	/*闪电 新增图标->zmki 结束*/
    	
    	/* 导航 新增图标->zmki 开始*/
    	.fk_service_dh {
    		background: url(https://a-oss.zmki.cn/2019/20191218-711bcdc875f32.png) no-repeat center center #fff;
    		background-size: 60%60%;
    	}
    	
    	.fk_service_dh:hover {
    		border: 0;
    		background: url(https://a-oss.zmki.cn/2019/20191218-8d9cf4c72a239.png) no-repeat center center #4f7cfc;
    		background-size: 60%60%;
    		cursor: pointer
    	}
    	
    	.fk_service_dh:hover .fk_service_dh_cont {
    		display: block;
    		opacity: 1;
    		transition: linear .2s;
    		animation-name: fade-in;
    		animation-duration: .3s;
    		animation-iteration-count: 1;
    		animation-delay: 0s
    	}
    	
    	.fk_service_dh_cont {
    		width: 264px;
    		height: 40px;
    		line-height: 40px;
    		background: #fff;
    		border-radius: 5px;
    		right: 62px;
    		text-align: center;
    		position: absolute;
    		display: none;
    		border: 1px solid #e1e6ec
    	}
    	
    	/*导航 新增图标->zmki 结束*/
    	
    	/* 爱心 新增图标->zmki 开始*/
    	.fk_service_ax {
    		background: url(https://a-oss.zmki.cn/2019/20191218-bf1792e790a39.png) no-repeat center center #fff;
    		background-size: 40%40%;
    	}
    	
    	.fk_service_ax:hover {
    		border: 0;
    		background: url(https://a-oss.zmki.cn/2019/20191218-f379809ce7aef.png) no-repeat center center #4f7cfc;
    		background-size: 40%40%;
    		cursor: pointer
    	}
    	
    	.fk_service_ax:hover .fk_service_ax_cont {
    		display: block;
    		opacity: 1;
    		transition: linear .2s;
    		animation-name: fade-in;
    		animation-duration: .3s;
    		animation-iteration-count: 1;
    		animation-delay: 0s
    	}
    	
    	.fk_service_ax_cont {
    		width: 264px;
    		height: 40px;
    		line-height: 40px;
    		background: #fff;
    		border-radius: 5px;
    		right: 62px;
    		text-align: center;
    		position: absolute;
    		display: none;
    		border: 1px solid #e1e6ec
    	}
    	
    	/*爱心 新增图标->zmki 结束*/
    	
    	/* 点赞 新增图标->zmki 开始*/
    	.fk_service_dz {
    		background: url(https://a-oss.zmki.cn/2019/20191218-3d077e8df0bf0.png) no-repeat center center #fff;
    		background-size: 50%50%;
    	}
    	
    	.fk_service_dz:hover {
    		border: 0;
    		background: url(https://a-oss.zmki.cn/2019/20191218-986a9393f3e9e.png) no-repeat center center #4f7cfc;
    		background-size: 50%50%;
    		cursor: pointer
    	}
    	
    	.fk_service_dz:hover .fk_service_dz_cont {
    		display: block;
    		opacity: 1;
    		transition: linear .2s;
    		animation-name: fade-in;
    		animation-duration: .3s;
    		animation-iteration-count: 1;
    		animation-delay: 0s
    	}
    	
    	.fk_service_dz_cont {
    		width: 264px;
    		height: 40px;
    		line-height: 40px;
    		background: #fff;
    		border-radius: 5px;
    		right: 62px;
    		text-align: center;
    		position: absolute;
    		display: none;
    		border: 1px solid #e1e6ec
    	}
    	
    	/*点赞 新增图标->zmki 结束*/
    
            /* 手机端自动隐藏 开始 */
    	@media screen and (max-width: 1221px) { .wapnone{display:none; }
    	}
    	/* 手机端自动隐藏 结束 */
    </style>
    

    本文转载自:钻芒博客

    原文链接:https://www.zmki.cn/5003.html

     

    展开全文
  • 软件预览图: 软件版本号:3.0 软件语言:简体中文 运行环境:安卓 官方网站:无 软件大小: 2.8MB 授权形式:免费软件 ...需要开启悬浮窗和后台运行,在线图库超多壁纸提供选择,也可以自定义手机图库图片。 ...

    软件预览图:在这里插入图片描述

    软件版本号:3.0

    软件语言:简体中文

    运行环境:安卓

    官方网站:无

    软件大小: 2.8MB

    授权形式:免费软件

    官方下载:https://yrb6.lanzoui.com/ibHCVj84o2h

    软件介绍: 全局壁纸美化3.0APP全面兼容所有安卓版本,一键全局美化手机,美化手机桌面、屏幕最佳之选,手机瞬间B格翻倍。需要开启悬浮窗和后台运行,在线图库超多壁纸提供选择,也可以自定义手机图库图片。

    展开全文
  • Auto.js.apk

    2019-10-29 10:17:43
    用于显示自定义悬浮窗。 files: 文件系统。文件创建、获取信息、读写。 http: HTTP。发送HTTP请求,例如GET, POST等。 images, colors: 图片和图色处理。截图,剪切图片,找图找色,读取保存图片等。 keys: 按键...
  • Auto.js打包插件.apk

    2019-10-29 10:16:46
    用于显示自定义悬浮窗。 files: 文件系统。文件创建、获取信息、读写。 http: HTTP。发送HTTP请求,例如GET, POST等。 images, colors: 图片和图色处理。截图,剪切图片,找图找色,读取保存图片等。 keys: 按键...
  • AutoJs以及打包插件.rar

    2019-08-30 18:01:53
    用于显示自定义悬浮窗。 files: 文件系统。文件创建、获取信息、读写。 http: HTTP。发送HTTP请求,例如GET, POST等。 images, colors: 图片和图色处理。截图,剪切图片,找图找色,读取保存图片等。 keys: 按键...
  • 实例120 自定义图片浏览标签 实例121 自定义文件下载的标签 实例122 自定义数据查询的标签 实例123 自定义生成随机数的标签 实例124 自定义生成系统菜单的标签 第5章 JavaBean技术 5.1 字符串处理 实例125 ...
  • 实例120 自定义图片浏览标签 实例121 自定义文件下载的标签 实例122 自定义数据查询的标签 实例123 自定义生成随机数的标签 实例124 自定义生成系统菜单的标签 第5章 JavaBean技术 5.1 字符串处理 实例125 ...
  • 2、模仿小米手机视觉差产品图片展示 3、淡入淡出式轮播图 4、点出左右按钮图片组切换轮播图 5、百页效果轮播图 6、模拟相册效果可点击放大左右切换 7、CSS3实现广告轮播器 8、实现电商网站放大镜效果 9、实现鼠标...
  • 二级界面可以自由拖动悬浮,支持最小化最大化关闭,响应双击自定义标题栏。 数据源支持模拟数据(默认)、数据库采集、串口通信(需定制)、网络通信(需定制)、网络请求等,可自由设定每个子界面的采集间隔即数据...
  • 5.2 另外其他需要的应用权限有 后台弹出界面 显示悬浮窗 修改系统配置(可选) 等 开发辅助 在线取色工具:图片base64取色 在线多点取色路径生成: 多点取色辅助工具 解锁功能扩展辅助:unit/获取锁屏界面控件...
  • 注意,在实际开发中,由于Android手机碎片化比较严重,分辨率太多了,建议灵活设置布局的宽高比为4:3或者16:9或者你认为合适的,可以用代码设置。 如果宽高比变形,则会有黑边 <org.yczbj.ycvideoplayerlib....
  • 能在应用后台弹出(需要申请悬浮窗权限,一行代码即可) 支持androidx 完美支持RTL布局 如果你想要时间选择器和城市选择器,可以使用XPopup扩展功能库XPopupExt: https://github.com/li-xiaojun/XPopupExt 设计...
  • 310、修复Android 11 QQ无法显示图片的问题 309、兼容Android 11运行Google Service 308、解决Android 11无法运行chromium 307、支持Hook @CriticalNative Method 306、修复JDK 13无法编译运行的问题 305、修复...

空空如也

空空如也

1 2
收藏数 26
精华内容 10
关键字:

手机自定义图片悬浮窗