Android界面工具庫

1.AndroidSlidingUpPanel
上拉抽屜控件

dependencies {
    repositories {
        mavenCentral()
    }
    compile 'com.sothree.slidinguppanel:library:3.4.0'
}

具體簡單使用

<com.sothree.slidinguppanel.SlidingUpPanelLayout
    xmlns:sothree="http://schemas.android.com/apk/res-auto"
    android:id="@+id/sliding_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="bottom"
    sothree:umanoPanelHeight="68dp"
    sothree:umanoShadowHeight="4dp">

    <TextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center"
        android:text="Main Content"
        android:textSize="16sp" />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center|top"
        android:text="The Awesome Sliding Up Panel"
        android:textSize="16sp" />
</com.sothree.slidinguppanel.SlidingUpPanelLayout>

2.FloatWindow
Andorid 任意界面懸浮窗,實現(xiàn)懸浮窗如此簡單
使用

allprojects {
        repositories {
            ...
            maven { url 'https://jitpack.io' }
        }
    }
dependencies {
            compile 'com.github.yhaolpz:FloatWindow:1.0.9'
    }
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
FloatWindow
              .with(getApplicationContext())
              .setView(view)
              .setWidth(100)                               //設(shè)置控件寬高
              .setHeight(Screen.width,0.2f)
              .setX(100)                                   //設(shè)置控件初始位置
              .setY(Screen.height,0.3f)
              .setDesktopShow(true)                        //桌面顯示
              .setViewStateListener(mViewStateListener)    //監(jiān)聽?wèi)腋】丶顟B(tài)改變
              .setPermissionListener(mPermissionListener)  //監(jiān)聽權(quán)限申請結(jié)果
              .build();
 //手動控制
        FloatWindow.get().show();
        FloatWindow.get().hide();

        //修改顯示位置
        FloatWindow.get().updateX(100);
        FloatWindow.get().updateY(100);

        //銷毀
        FloatWindow.destroy();

3.XPopup
功能強(qiáng)大,UI簡潔,交互優(yōu)雅的通用彈窗!可以替代Dialog,PopupWindow,PopupMenu,BottomSheet,DrawerLayout,Spinner等組件,自帶十幾種效果良好的動畫, 支持完全的UI和動畫自定義!(Powerful and Beautiful Popup,can absolutely replace Dialog,PopupWindow,PopupMenu,BottomSheet,DrawerLayout,Spinner. With built-in animators , very easy to custom popup view.)

implementation 'com.lxj:xpopup:1.8.6'
//for androidx.
implementation 'com.lxj:xpopup:1.8.6-x'
//版本號在26以及以上即可
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'

4.XRichText
一個Android富文本類庫,支持圖文混排,支持編輯和預(yù)覽,支持插入和刪除圖片

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

dependencies {
    implementation 'com.github.sendtion:XRichText:1.9.1'
}
如果出現(xiàn)support版本不一致問題,請排除XRichText中的support庫,或者升級自己的support庫為28.0.0版本。 Glide版本為4.9.0,依賴于28版本庫,如果你用的為低版本,同樣的處理方式。 使用方式:
implementation ('com.github.sendtion:XRichText:1.9.1') {
    exclude group: 'com.android.support'
    exclude group: 'com.github.bumptech.glide' //當(dāng)你的項目使用Glide4.0以下版本時建議添加此項
}
<com.sendtion.xrichtext.RichTextEditor
    android:id="@+id/et_new_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:rt_editor_text_line_space="6dp"
    app:rt_editor_image_height="500"
    app:rt_editor_image_bottom="10"
    app:rt_editor_text_init_hint="在這里輸入內(nèi)容"
    app:rt_editor_text_size="16sp"
    app:rt_editor_text_color="@color/grey_900"/>

5.FlowLayout
Android流式布局,支持單選、多選等,適合用于產(chǎn)品標(biāo)簽等

dependencies {
 compile 'com.hyman:flowlayout-lib:1.1.2'
}
<com.zhy.view.flowlayout.TagFlowLayout
        android:id="@+id/id_flowlayout"
        zhy:max_select="-1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:padding="20dp">
    </com.zhy.view.flowlayout.TagFlowLayout>

6.MagicIndicator
強(qiáng)大、可定制、易擴(kuò)展的 ViewPager 指示器框架。是ViewPagerIndicator、TabLayout、PagerSlidingTabStrip的最佳替代品。支持角標(biāo),更支持在非ViewPager場景下使用

repositories {
    ...
    maven {
        url "https://jitpack.io"
    }
}

dependencies {
    ...
    compile 'com.github.hackware1993:MagicIndicator:1.5.0'
}
 <net.lucode.hackware.magicindicator.MagicIndicator
        android:id="@+id/magic_indicator"
        android:layout_width="match_parent"
        android:layout_height="40dp" />

7.AndroidAutoSize
今日頭條屏幕適配方案終極版,一個極低成本的 Android 屏幕適配方案

implementation 'me.jessyan:autosize:1.1.2'
<manifest>
    <application>            
        <meta-data
            android:name="design_width_in_dp"
            android:value="360"/>
        <meta-data
            android:name="design_height_in_dp"
            android:value="640"/>           
     </application>           
</manifest>

8.BGASwipeBackLayout-Android
Android Activity 滑動返回。支持微信滑動返回樣式、橫屏滑動返回、全屏滑動返回
具體使用參考github

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容