最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Android實現(xiàn)底部彈出按鈕菜單升級版

 更新時間:2017年10月09日 17:19:24   作者:JustingWang_1  
這篇文章主要為大家詳細介紹了Android實現(xiàn)底部彈出按鈕菜單的升級版,具有一定的參考價值,感興趣的小伙伴們可以參考一下

本文實例為大家分享了Android實現(xiàn)底部彈出按鈕菜單的具體代碼,在Android實現(xiàn)底部緩慢彈出菜單的升級,供大家參考,具體內(nèi)容如下

只貼出關(guān)鍵代碼

 case R.id.myself_share:
        //我的分享
        getShareMune();

getShareMune()

private void getShareMune() {

    final Dialog mdialog = new Dialog(getActivity(), R.style.photo_dialog);
    mdialog.setContentView(View.inflate(getActivity(), R.layout.layout_popwindow, null));
    // 彈出對話框
    Window window = mdialog.getWindow();
    WindowManager.LayoutParams lp = window.getAttributes();
    lp.gravity = Gravity.BOTTOM;
    lp.y = 20;
    window.setContentView(R.layout.layout_popwindow);
    final Button qq = (Button) window.findViewById(R.id.btn_QQ);
    final Button sina = (Button) window.findViewById(R.id.btn_sina);
    final Button firend = (Button) window.findViewById(R.id.btn_wechatfirend);
    final Button firend1 = (Button) window.findViewById(R.id.btn_wechatfirend1);
    final Button more = (Button) window.findViewById(R.id.btn_more);
    final Button back = (Button) window.findViewById(R.id.btn_cancel);

    //QQ
    qq.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
        showZiDingYi(QQ.NAME);
        mdialog.dismiss();
      }
    });
    //新浪
    sina.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
//        showZiDingYi(SinaWeibo.NAME);
        mdialog.dismiss();
      }
    });
    //微信好友
    firend.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
        showZiDingYi(Wechat.NAME);
        mdialog.dismiss();
      }
    });
    //微信朋友圈
    firend1.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
        showZiDingYi(WechatMoments.NAME);
        mdialog.dismiss();
      }
    });
    //更多
    more.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
        mdialog.dismiss();
      }
    });
    //取消
    back.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {

      }
    });
    mdialog.show();

  }

這里還有個Style

<style name="photo_dialog" parent="android:style/Theme.Dialog">
    <item name="android:windowAnimationStyle">@style/AnimBottom</item>
    <item name="android:windowFrame">@null</item>
    <!-- 邊框 -->
    <item name="android:windowIsFloating">true</item>
    <!-- 是否浮現(xiàn)在activity之上 -->
    <item name="android:windowIsTranslucent">true</item>
    <!-- 半透明 -->
    <item name="android:windowNoTitle">true</item>
    <!-- 無標題 -->
    <item name="android:windowBackground">@android:color/transparent</item>
    <!-- 背景透明 -->
    <item name="android:backgroundDimEnabled">true</item>
    <!-- 模糊 -->
  </style>


還有一個XML

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:gravity="center_horizontal"
  android:orientation="vertical">

  <LinearLayout
    android:id="@+id/pop_layout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <Button
      android:id="@+id/btn_QQ"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="@drawable/button_alter_top_radiu"
      android:padding="@dimen/standard_30px"
      android:text="分享到QQ"
      android:textColor="@color/black" />
    <View
      android:layout_width="match_parent"
      android:layout_height="0.5dp"
      android:background="@color/color_dialog_line" />
    <Button
      android:id="@+id/btn_sina"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="@drawable/linearlayout_border_no_radiu"
      android:padding="@dimen/standard_30px"
      android:text="分享到新浪"
      android:textColor="@color/black" />
    <View
      android:layout_width="match_parent"
      android:layout_height="0.5dp"
      android:background="@color/color_dialog_line" />
    <Button
      android:id="@+id/btn_wechatfirend"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="@drawable/linearlayout_border_no_radiu"
      android:padding="@dimen/standard_30px"
      android:text="分享到微信好友"
      android:textColor="@color/black" />
    <View
      android:layout_width="match_parent"
      android:layout_height="0.5dp"
      android:background="@color/color_dialog_line" />
    <Button
      android:id="@+id/btn_wechatfirend1"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="@drawable/linearlayout_border_no_radiu"
      android:padding="@dimen/standard_30px"
      android:text="分享到微信朋友圈"
      android:textColor="@color/black" />
    <View
      android:layout_width="match_parent"
      android:layout_height="0.5dp"
      android:background="@color/color_dialog_line" />

    <Button
      android:id="@+id/btn_more"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="@drawable/button_alter_bottom_radiu"
      android:padding="@dimen/standard_30px"
      android:text="分享到更多..."
      android:textColor="@color/black" />

    <Button
      android:layout_marginTop="@dimen/standard_20px"
      android:id="@+id/btn_cancel"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="@drawable/button_radius_white_lemonchiffon"
      android:padding="@dimen/standard_30px"
      android:text="取消"
      android:textColor="@color/black" />
  </LinearLayout>
</RelativeLayout>

上效果圖

以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • Android編程之簡單計時器實現(xiàn)方法

    Android編程之簡單計時器實現(xiàn)方法

    這篇文章主要介紹了Android編程之簡單計時器實現(xiàn)方法,涉及Android開發(fā)中ContextMenu及Chronometer的相關(guān)使用技巧,需要的朋友可以參考下
    2016-01-01
  • Android仿微信、qq點擊右上角加號彈出操作框

    Android仿微信、qq點擊右上角加號彈出操作框

    這篇文章主要為大家詳細介紹了Android仿微信、qq點擊右上角加號彈出操作框,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2018-04-04
  • Android編程設(shè)計模式之抽象工廠模式詳解

    Android編程設(shè)計模式之抽象工廠模式詳解

    這篇文章主要介紹了Android編程設(shè)計模式之抽象工廠模式,結(jié)合實例形式詳細分析了Android抽象工廠模式的概念、原理、使用方法及相關(guān)注意事項,需要的朋友可以參考下
    2017-12-12
  • ANDROID BottomNavigationBar底部導航欄的實現(xiàn)示例

    ANDROID BottomNavigationBar底部導航欄的實現(xiàn)示例

    本篇文章主要介紹了ANDROID BottomNavigationBar底部導航欄的實現(xiàn)示例,非常具有實用價值,需要的朋友可以參考下
    2017-10-10
  • 簡單實現(xiàn)Android計算器功能

    簡單實現(xiàn)Android計算器功能

    這篇文章主要為大家詳細介紹了自己動手實現(xiàn)的Android計算器功能,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2017-01-01
  • Android 開源項目側(cè)邊欄菜單(SlidingMenu)使用詳解

    Android 開源項目側(cè)邊欄菜單(SlidingMenu)使用詳解

    SlidingMenu的是一種比較新的設(shè)置界面或配置界面效果,在主界面左滑或者右滑出現(xiàn)設(shè)置界面,能方便的進行各種操作.目前有大量的應(yīng)用都在使用這一效果。如Evernote、Google+、Foursquare等,國內(nèi)的豌豆夾,人人,360手機助手等都使用SlidingMenu的界面方案。
    2016-05-05
  • Android實現(xiàn)系統(tǒng)日歷同步日程

    Android實現(xiàn)系統(tǒng)日歷同步日程

    這篇文章主要為大家詳細介紹了Android實現(xiàn)系統(tǒng)日歷同步日程,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2021-04-04
  • Android利用zxing快速集成二維碼掃描的實例教程

    Android利用zxing快速集成二維碼掃描的實例教程

    最近二維碼真是越來越火了,隨便電視上、網(wǎng)絡(luò)上、商場里,到處都是二維碼,所以下面這篇文章我們就來給大家介紹關(guān)于Android利用zxing快速集成二維碼掃描的相關(guān)資料,需要的朋友可以參考借鑒,下面隨著小編來一起看看吧。
    2017-09-09
  • Android的進度條控件描述

    Android的進度條控件描述

    這篇文章主要介紹了android的幾種進度條控件描述的相關(guān)資料,非常不錯,具有參考借鑒價值,需要的朋友可以參考下
    2017-01-01
  • Android自定義view實現(xiàn)拖動小球移動

    Android自定義view實現(xiàn)拖動小球移動

    這篇文章主要為大家詳細介紹了Android自定義view實現(xiàn)拖動小球移動,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2020-11-11

最新評論

绥阳县| 右玉县| 海林市| 防城港市| 大新县| 手机| 金秀| 奉新县| 嵩明县| 正安县| 曲松县| 扶绥县| 贵南县| 泽州县| 万山特区| 大埔区| 彭州市| 会昌县| 科技| 边坝县| 泰和县| 扶风县| 瑞金市| 裕民县| 加查县| 邹城市| 武穴市| 株洲市| 陆川县| 东山县| 那曲县| 凉山| 蒙山县| 东源县| 阿克陶县| 麻阳| 汤阴县| 吉林省| 巨野县| 济宁市| 林西县|