5 Star 0 Fork 0

tiamosu / BeemansCommon

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

common

allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
        maven { url 'https://jitpack.io' }
        maven { url 'https://repo1.maven.org/maven2/' }
    }
}
implementation 'com.gitee.tiamosu:BeemansCommon:1.7.4'

清单配置

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.beemans.common">

    <!-- 联网权限 -->
    <uses-permission android:name="android.permission.INTERNET" />

    <!-- 网络状态 -->
    <!-- 获取MAC地址,和设备标识⼀一起作为用户标识 -->
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <!-- 外部存储 -->
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission
        android:name="android.permission.WRITE_EXTERNAL_STORAGE"
        tools:ignore="ScopedStorage" />
    <uses-permission
        android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
        tools:ignore="ScopedStorage" />

    <!-- 手机权限,获取设备标识,标识⽤用户 -->
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />

    <queries>
        <!-- Android 11 软件包可见性适配 -->
        <package android:name="com.huawei.appmarket" />
        <package android:name="com.tencent.android.qqdownloader" />
        <package android:name="com.qihoo.appstore" />
        <package android:name="com.xiaomi.market" />
        <package android:name="com.baidu.appsearch" />

        <!-- 微信分享、支付 -->
        <package android:name="com.tencent.mm" />
        <!-- QQ分享、支付 -->
        <package android:name="com.tencent.mobileqq" />
        <!-- 支付宝支付 -->
        <package android:name="com.eg.android.AlipayGphone" />

        <!-- 调起其他页面意图:Intent.ACTION_VIEW -->
        <intent>
            <action android:name="android.intent.action.VIEW" />
        </intent>
    </queries>

    <application
        android:largeHeap="true"
        android:resizeableActivity="false"
        tools:ignore="UnusedAttribute">

        <!-- 适配全面屏 Android O vivo&oppo-->
        <meta-data
            android:name="android.max_aspect"
            android:value="2.4" />

        <!-- 适配刘海屏、水滴屏 Android O 小米 -->
        <meta-data
            android:name="notch.config"
            android:value="portrait|landscape" />

        <!-- 适配刘海屏、水滴屏 Android O 华为 -->
        <meta-data
            android:name="android.notch_support"
            android:value="true" />

        <meta-data
            android:name="com.beemans.common.app.GlobalConfiguration"
            android:value="ConfigModule" />

        <!-- 微信登录、分享所需 -->
        <activity
            android:name="${applicationId}.wxapi.WXEntryActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:exported="true"
            android:theme="@android:style/Theme.Translucent.NoTitleBar"
            tools:ignore="MissingClass"
            tools:node="replace" />
    </application>
</manifest>

全局样式

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- 应用主题样式 -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- 窗口背景颜色 -->
        <item name="android:windowBackground">@color/white</item>
        <!-- 应用的主要色调,ActionBar Toolbar 默认使用该颜色 -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <!-- 应用的主要暗色调,状态栏默认使用该颜色 -->
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <!-- 应用的强调色,CheckBox RadioButton Switch 等一般控件的选中效果默认采用该颜色 -->
        <item name="colorAccent">@color/colorAccent</item>
        <!-- ActionMode 覆盖 Actionbar 不被顶下来 -->
        <item name="windowActionModeOverlay">true</item>
        <item name="android:windowContentOverlay">@null</item>
        <!-- Activity 专场动画  -->
        <item name="android:windowAnimationStyle">@style/ActivityAnimationStyle</item>
    </style>

    <!-- 闪屏页主题样式 -->
    <style name="SplashTheme" parent="AppTheme">
        <item name="android:windowBackground">@drawable/shape_splash_theme_bg</item>
        <item name="android:windowFullscreen">true</item>
    </style>

    <!-- 弹框样式 -->
    <style name="CommonDialogStyle">
        <!-- 无边框 -->
        <item name="android:windowFrame">@null</item>
        <!-- 浮在 Activity 之上 -->
        <item name="android:windowIsFloating">true</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
        <!-- 半透明 -->
        <item name="android:windowIsTranslucent">true</item>
        <!-- 无标题 -->
        <item name="android:windowNoTitle">true</item>
        <!-- 背景透明 -->
        <item name="android:windowBackground">@color/transparent</item>
        <!-- 模糊 -->
        <item name="android:backgroundDimEnabled">true</item>
        <!-- Dialog进入及退出动画 -->
        <item name="android:windowAnimationStyle">@style/dialogScaleAnim</item>
        <!-- Base.Theme.AppCompat.Light.Dialog.Alert 特有的属性,用于指定默认宽度,这里需要禁用 -->
        <item name="android:windowMinWidthMajor">0dp</item>
        <item name="android:windowMinWidthMinor">0dp</item>
    </style>

    <!-- 缩放动画 -->
    <style name="dialogScaleAnim" parent="android:Animation">
        <item name="android:windowEnterAnimation">@anim/dialog_scale_in</item>
        <item name="android:windowExitAnimation">@anim/dialog_scale_out</item>
    </style>

    <!-- 顶部弹出动画 -->
    <style name="dialogTopAnim" parent="android:Animation">
        <item name="android:windowEnterAnimation">@anim/dialog_top_in</item>
        <item name="android:windowExitAnimation">@anim/dialog_top_out</item>
    </style>

    <!-- 底部弹出动画 -->
    <style name="dialogBottomAnim" parent="android:Animation">
        <item name="android:windowEnterAnimation">@anim/dialog_bottom_in</item>
        <item name="android:windowExitAnimation">@anim/dialog_bottom_out</item>
    </style>

    <!-- 左边弹出动画 -->
    <style name="dialogLeftAnim" parent="android:Animation">
        <item name="android:windowEnterAnimation">@anim/dialog_left_in</item>
        <item name="android:windowExitAnimation">@anim/dialog_left_out</item>
    </style>

    <!-- 右边弹出动画 -->
    <style name="dialogRightAnim" parent="android:Animation">
        <item name="android:windowEnterAnimation">@anim/dialog_right_in</item>
        <item name="android:windowExitAnimation">@anim/dialog_right_out</item>
    </style>

    <!-- 按压效果 -->
    <style name="itemSelector">
        <item name="android:background">?android:attr/selectableItemBackground</item>
        <item name="android:clickable">true</item>
        <item name="android:focusable">true</item>
    </style>

    <!-- ViewLine线条样式 -->
    <style name="commonLine">
        <item name="android:layout_width">0pt</item>
        <item name="android:layout_height">0.5pt</item>
        <item name="android:background">@color/color_f2f2f2</item>
    </style>

    <!-- TextView文本样式 -->
    <style name="commonText">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:gravity">center</item>
        <item name="android:textSize">16pt</item>
        <item name="android:textColor">@color/color_333333</item>
    </style>

    <!-- EditText输入样式 -->
    <style name="commonEdit">
        <item name="android:background">@null</item>
        <item name="android:gravity">center_vertical</item>
        <item name="android:maxLines">1</item>
        <item name="android:textSize">16pt</item>
        <item name="android:textColor">@color/color_333333</item>
        <item name="android:textColorHint">@color/color_999999</item>
    </style>
</resources>

第三方库

Comments ( 0 )

Sign in for post a comment

About

No description spread retract
Kotlin
Apache-2.0
Cancel

Releases (72)

All

Contributors

All

Activities

load more
can not load any more
1
https://gitee.com/tiamosu/BeemansCommon.git
git@gitee.com:tiamosu/BeemansCommon.git
tiamosu
BeemansCommon
BeemansCommon
master

Search

102255 3a0e046c 1850385 102255 7aaa926c 1850385