日本不卡不码高清免费观看,久久国产精品久久w女人spa,黄色aa久久,三上悠亚国产精品一区二区三区

您的位置:首頁技術(shù)文章
文章詳情頁

Android仿新浪微博發(fā)送菜單界面的實現(xiàn)

瀏覽:250日期:2022-06-05 18:52:11
效果圖

Android仿新浪微博發(fā)送菜單界面的實現(xiàn)

接下來就是一波貼代碼的過程

自定義Dialog

public class SinaSendView extends Dialog { private ImageButton ib_dialog_sina_close; private LinearLayout ll_dialog_sina_write; private LinearLayout ll_dialog_sina_time; private LinearLayout ll_dialog_sina_map; private LinearLayout ll_dialog_sina_menu; private ImageView iv_dialog_sina_bg,iv_dialog_sina_des; private Context mContext; private Boolean hideDes; private Bitmap screenShot; private Bitmap bitmap; private ByteArrayOutputStream baos; private byte[] bytes; public SinaSendView(Context context) { super(context); this.mContext = context; } public SinaSendView(Context context, int themeResId,Boolean hideDes) { super(context, themeResId); this.mContext = context; this.hideDes = hideDes; } protected SinaSendView(Context context, boolean cancelable, OnCancelListener cancelListener) { super(context, cancelable, cancelListener); this.mContext = context; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.layout_sina_send_dialog); ib_dialog_sina_close = (ImageButton) findViewById(R.id.ib_dialog_sina_close); ll_dialog_sina_write = (LinearLayout) findViewById(R.id.ll_dialog_sina_write); ll_dialog_sina_time = (LinearLayout) findViewById(R.id.ll_dialog_sina_time); ll_dialog_sina_map = (LinearLayout) findViewById(R.id.ll_dialog_sina_map); ll_dialog_sina_menu = (LinearLayout) findViewById(R.id.ll_dialog_sina_menu); iv_dialog_sina_bg = (ImageView) findViewById(R.id.iv_dialog_sina_bg); iv_dialog_sina_des = (ImageView) findViewById(R.id.iv_dialog_sina_des); initView(); } private void initView() { setBrulBg(); ll_dialog_sina_menu.setVisibility(View.VISIBLE); ll_dialog_sina_menu.setAnimation(AnimationUtil.moveToViewLocationFromTop()); ib_dialog_sina_close.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) {ll_dialog_sina_menu.setAnimation(AnimationUtil.moveToViewBottom());ll_dialog_sina_menu.setVisibility(View.GONE);dismiss(); } }); if(hideDes){ iv_dialog_sina_des.setVisibility(View.GONE); } } /** * 設(shè)置模糊背景 */ private void setBrulBg(){ screenShot = CommonUtils.getInstance().getScreenShot((Activity) mContext); bitmap = CommonUtils.getInstance().zoomImg(screenShot, 0.2f); baos = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.JPEG, 1, baos); bytes = baos.toByteArray(); Glide.with(mContext).load(bytes).asBitmap().transform(new BlurTransformation(CommonUtils.getInstance().getContext(), 25)).into(iv_dialog_sina_bg); } public void setClick(final SinaSendDialog mSinaSendDialog){ this.show(); ll_dialog_sina_write.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) {mSinaSendDialog.onNormalClick();dismiss(); } }); ll_dialog_sina_map.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) {mSinaSendDialog.onMapClick();dismiss(); } }); ll_dialog_sina_time.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) {mSinaSendDialog.onTimeClick();dismiss(); } }); } @Override public void dismiss() { super.dismiss(); if(screenShot != null && !screenShot.isRecycled()){ screenShot.recycle(); screenShot = null; } if(bitmap != null && !bitmap.isRecycled()){ bitmap.recycle(); bitmap = null; } try { baos.close(); } catch (IOException e) { e.printStackTrace(); } bytes = null; System.gc(); }}布局文件

<?xml version='1.0' encoding='utf-8'?><FrameLayout xmlns:android='http://schemas.android.com/apk/res/android' android:layout_width='match_parent' android:layout_height='match_parent' > <ImageView android: android:layout_width='match_parent' android:layout_height='match_parent' android:scaleType='fitXY' /> <ImageButton android: android:layout_width='15dp' android:layout_height='15dp' android:src='http://www.b3g6.com/bcjs/@drawable/dialog_sina_send_close' android:background='@null' android:layout_gravity='bottom|center_horizontal' android:layout_marginBottom='17dp' /> <ImageView android:layout_width='match_parent' android:layout_height='0.5dp' android:background='@color/line_gray' android:layout_gravity='bottom' android:layout_marginBottom='50dp' /> <LinearLayout android: android:layout_width='wrap_content' android:layout_height='wrap_content' android:layout_gravity='bottom|center_horizontal' android:layout_marginBottom='120dp' android:orientation='horizontal' android:visibility='gone' > <LinearLayout android: android:layout_width='wrap_content' android:layout_height='wrap_content' android:orientation='vertical' android:gravity='center_horizontal' > <ImageViewandroid:layout_width='75dp'android:layout_height='75dp'android:src='http://www.b3g6.com/bcjs/@drawable/dialog_sina_send_write'/> <TextViewandroid:layout_width='wrap_content'android:layout_height='wrap_content'android:textSize='13sp'android:textColor='@color/text_gray'android:text='一般內(nèi)容'android:layout_marginTop='8dp'/> </LinearLayout> <LinearLayout android: android:layout_width='wrap_content' android:layout_height='wrap_content' android:orientation='vertical' android:gravity='center_horizontal' android:layout_marginLeft='35dp' android:layout_marginRight='35dp' > <ImageViewandroid:layout_width='75dp'android:layout_height='75dp'android:src='http://www.b3g6.com/bcjs/@drawable/dialog_sina_send_time'/> <TextViewandroid:layout_width='wrap_content'android:layout_height='wrap_content'android:textSize='13sp'android:textColor='@color/text_gray'android:text='時間膠囊'android:layout_marginTop='8dp'/> </LinearLayout> <LinearLayout android: android:layout_width='wrap_content' android:layout_height='wrap_content' android:orientation='vertical' android:gravity='center_horizontal' > <ImageViewandroid:layout_width='75dp'android:layout_height='75dp'android:src='http://www.b3g6.com/bcjs/@drawable/dialog_sina_send_map'/> <TextViewandroid:layout_width='wrap_content'android:layout_height='wrap_content'android:textSize='13sp'android:textColor='@color/text_gray'android:text='地點膠囊'android:layout_marginTop='8dp'/> </LinearLayout> </LinearLayout> <ImageView android: android:layout_width='wrap_content' android:layout_height='wrap_content' android:src='http://www.b3g6.com/bcjs/@drawable/dialog_sina_send_des' android:layout_gravity='center_horizontal' android:layout_marginTop='70dp' /></FrameLayout>Style

<style name='SinaSendDialog'> <item name='android:windowFullscreen'>true</item> <item name='android:windowNoTitle'>true</item> <item name='android:windowBackground'>@android:color/transparent</item></style>工具方法

/** * 從控件的頂部移動到控件所在位置 * * @return */ public static TranslateAnimation moveToViewLocationFromTop() { TranslateAnimation mHiddenAction = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f,Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,-1.0f, Animation.RELATIVE_TO_SELF, 0.0f); mHiddenAction.setDuration(500); return mHiddenAction; } /** * 截取當(dāng)前屏幕 * @param activity * @return */ public Bitmap getScreenShot(Activity activity) { // 獲取windows中最頂層的view View view = activity.getWindow().getDecorView(); view.buildDrawingCache(); // 獲取狀態(tài)欄高度 Rect rect = new Rect(); view.getWindowVisibleDisplayFrame(rect); int statusBarHeights = rect.top; Display display = activity.getWindowManager().getDefaultDisplay(); // 獲取屏幕寬和高 int widths = display.getWidth(); int heights = display.getHeight(); // 允許當(dāng)前窗口保存緩存信息 view.setDrawingCacheEnabled(true); // 去掉狀態(tài)欄 Bitmap bmp = Bitmap.createBitmap(view.getDrawingCache(), 0,0, widths, heights); // 銷毀緩存信息 view.destroyDrawingCache(); return bmp; } /** * 改變bitmap寬高 * @param bm * @param f * @return */ public Bitmap zoomImg(Bitmap bm,float f){ int width = bm.getWidth(); int height = bm.getHeight(); float scaleWidth = f; float scaleHeight = f; Matrix matrix = new Matrix(); matrix.postScale(scaleWidth, scaleHeight); Bitmap newbm = Bitmap.createBitmap(bm, 0, 0, width, height, matrix, true); return newbm; }接口

public interface SinaSendDialog { void onNormalClick(); void onTimeClick(); void onMapClick();}

基本講一下邏輯,背景采用截屏高斯模糊處理,這里一定要降圖片質(zhì)量,不然會慢,按鈕采用一個動畫從上向下劃出,雖然不是特別完美,但是多少有個樣子。

源碼地址:

https://github.com/bertsir/SinaSendView

到這里就結(jié)束啦.

以上就是Android仿新浪微博發(fā)送菜單界面的實現(xiàn)的詳細(xì)內(nèi)容,更多關(guān)于Android 發(fā)送菜單界面的實現(xiàn)的資料請關(guān)注好吧啦網(wǎng)其它相關(guān)文章!

標(biāo)簽: 微博
相關(guān)文章:
日本不卡不码高清免费观看,久久国产精品久久w女人spa,黄色aa久久,三上悠亚国产精品一区二区三区
www.51av欧美视频| 亚洲精品成人一区| 国产精品蜜月aⅴ在线| 日韩综合一区二区三区| 中文一区一区三区免费在线观| 久久视频一区| 999精品在线| 精品免费视频| 日韩精品欧美大片| 国产激情精品一区二区三区| 日韩一区精品| 欧美欧美黄在线二区| 国产精品网在线观看| 日韩不卡免费高清视频| 日韩精品一级中文字幕精品视频免费观看 | 国精品产品一区| 亚洲最新无码中文字幕久久| 老牛影视精品| 欧美a级一区| 青青草91视频| 国产高清日韩| 91日韩在线| 欧美日韩视频| 亚洲乱码久久| 国产日韩一区二区三区在线| 日韩精品免费一区二区夜夜嗨 | 国产suv精品一区| 日韩激情一区| 欧美一级专区| 久久免费影院| 欧美亚洲激情| 日韩精品免费观看视频| 精品精品99| 日韩精品一区二区三区中文| 久久三级视频| 一区二区三区四区日本视频| 日韩1区2区日韩1区2区| 美女精品一区| 在线一区免费观看| 激情婷婷久久| 日韩高清成人| 日韩大片在线播放| 日韩av中文字幕一区二区三区| 中文在线不卡| 婷婷精品进入| 日韩在线观看不卡| 亚洲最新无码中文字幕久久| 精品久久久久中文字幕小说| 国产精品videossex久久发布| 97精品资源在线观看| 日韩av在线播放中文字幕| 久久亚洲不卡| 老牛国产精品一区的观看方式| 黄色在线一区| 亚洲欧美激情诱惑| 综合激情网站| 日韩精品1区2区3区| 日av在线不卡| 日韩一区二区三区精品视频第3页| 视频一区二区欧美| 欧美日韩一区二区三区在线电影| 欧美日本久久| 成人一区而且| 成人羞羞视频在线看网址| 五月激情久久| 在线亚洲成人| 国产一区 二区| 三上亚洲一区二区| 激情综合亚洲| 午夜性色一区二区三区免费视频| 久久精品99国产精品日本| 精品中国亚洲| 91一区二区三区四区| 午夜欧美精品久久久久久久| 亚洲香蕉久久| 免费亚洲婷婷| 1024精品一区二区三区| 亚洲精品第一| 国产精品sm| 精品中文一区| 欧美日韩亚洲一区三区| 久久久久国产| 青草av.久久免费一区| 激情黄产视频在线免费观看| 日韩中文字幕av电影| 国产一区国产二区国产三区| 欧美日韩国产在线一区| 亚洲香蕉久久| 老牛影视精品| 欧美久久久网站| 日韩精品中文字幕吗一区二区 | 久久天堂成人| 欧美日韩18| 午夜精品免费| 精品中文字幕一区二区三区四区| 首页国产欧美久久| 日韩免费av| 欧美交a欧美精品喷水| 影音先锋久久| 日韩中文在线播放| 91亚洲精品在看在线观看高清| 亚洲91久久| 精品国产精品国产偷麻豆| 综合激情网...| 亚洲视频综合| 九色porny丨国产首页在线| 国产亚洲一区| 日韩国产在线不卡视频| 久久精品国产www456c0m| 精品国产欧美日韩| 国产剧情一区二区在线观看| 亚洲色图综合| 久久国产精品久久久久久电车| 婷婷丁香综合| 欧美精品一区二区久久| 久久精品一区二区三区中文字幕| 日本精品另类| 蜜桃传媒麻豆第一区在线观看| 亚洲国内欧美| 亚洲小说欧美另类婷婷| 三上悠亚国产精品一区二区三区| 97精品国产| 成人va天堂| 日韩视频一区| 美国三级日本三级久久99| 亚洲人成高清| 日韩激情网站| 精品国产亚洲一区二区三区在线 | 日韩在线麻豆| 日韩二区三区四区| 久久福利在线| 极品av在线| 亚洲欧美高清| 日本不卡中文字幕| 国产一区二区三区四区二区| 欧美久久天堂| 美女国产精品| 国产精品久久久久9999高清| 成人日韩在线| 久久午夜影视| 狂野欧美性猛交xxxx| 四季av一区二区凹凸精品| 九色porny丨国产首页在线| 六月婷婷一区| 国产精品黄色片| 亚洲国产专区校园欧美| 久久高清免费观看| 麻豆久久一区二区| 99久久久国产精品美女| 日韩和欧美一区二区| 伊伊综合在线| 欧美视频一区| 五月天久久久| 国产精品乱战久久久| 欧美综合另类| 久久精品999| 亚洲v在线看| 久久国产精品毛片| 精品久久久亚洲| 激情婷婷久久| 国产精品羞羞答答在线观看| 免费高潮视频95在线观看网站| 午夜在线精品偷拍| 日韩在线免费| 精品成人18| 国产亚洲久久| 午夜一区在线| 在线一区电影| 欧美成a人国产精品高清乱码在线观看片在线观看久 | 国产精品任我爽爆在线播放| 日韩亚洲精品在线| 国产精品亚洲一区二区三区在线观看| 日韩一区二区三区四区五区| 黄色亚洲精品| 激情婷婷亚洲| 久久五月天小说| 三级小说欧洲区亚洲区| 国产伦久视频在线观看| 久久精品一区| 久久超级碰碰| 欧美极品中文字幕| 国产精品tv| 国产一区二区三区日韩精品| 国产精品黄色片| 中文字幕日本一区| 喷白浆一区二区| 日韩中文字幕麻豆| 亚洲一二三区视频| 亚洲免费观看高清完整版在线观| 久久亚洲国产| 中日韩男男gay无套| 鲁大师成人一区二区三区 | 欧美日韩国产观看视频| 久久毛片亚洲| 久久精品一区二区不卡| 九九久久电影| 亚洲乱码视频| 亚洲精品无播放器在线播放| 日韩精品免费一区二区夜夜嗨| 国产三级一区|