android8.0官方下载 怎么实现微博列表

Android实现微博菜单弹出效果
转载 &更新时间:日 16:08:23 & 作者:gqdy365
这篇文章主要为大家详细介绍了Android实现微博菜单弹出效果,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
先上Android仿微博菜单弹出效果图,这个截图不是很流畅,大家可以下载apk试一下。
说一下实现思路:
1、截取当前窗口,对图片做高斯模糊处理,将处理后的图片做popupwindow的背景图片;
2、创建popupwindow,完成布局,这儿要注意:View的移动范围是由parent的大小决定的,就是只能在parent的范围内移动;
3、给买个View添加进入动画,每个比前一个延期50ms播放动画,关闭窗口时相反;
4、为View的动画添加回弹插值器;
MoreWindow.java窗口
package com.jerome.
import android.animation.A
import android.animation.Animator.AnimatorL
import android.animation.ObjectA
import android.animation.ValueA
import android.app.A
import android.graphics.B
import android.graphics.C
import android.graphics.P
import android.graphics.R
import android.graphics.drawable.BitmapD
import android.os.H
import android.util.DisplayM
import android.util.L
import android.view.G
import android.view.LayoutI
import android.view.V
import android.view.View.OnClickL
import android.view.ViewG
import android.view.animation.A
import android.view.animation.Animation.AnimationL
import android.view.animation.AnimationS
import android.view.animation.TranslateA
import android.widget.ImageV
import android.widget.PopupW
import android.widget.RelativeL
import android.widget.RelativeLayout.LayoutP
public class MoreWindow extends PopupWindow implements OnClickListener{
private String TAG = MoreWindow.class.getSimpleName();
Activity mC
private int mW
private int mH
private int statusBarH
private Bitmap mBitmap=
private Bitmap overlay =
private Handler mHandler = new Handler();
public MoreWindow(Activity context) {
mContext =
public void init() {
Rect frame = new Rect();
mContext.getWindow().getDecorView().getWindowVisibleDisplayFrame(frame);
statusBarHeight = frame.
DisplayMetrics metrics = new DisplayMetrics();
mContext.getWindowManager().getDefaultDisplay()
.getMetrics(metrics);
mWidth = metrics.widthP
mHeight = metrics.heightP
setWidth(mWidth);
setHeight(mHeight);
private Bitmap blur() {
if (null != overlay) {
long startMs = System.currentTimeMillis();
View view = mContext.getWindow().getDecorView();
view.setDrawingCacheEnabled(true);
view.buildDrawingCache(true);
mBitmap = view.getDrawingCache();
float scaleFactor = 8;//图片缩放比例;
float radius = 10;//模糊程度
int width = mBitmap.getWidth();
int height = mBitmap.getHeight();
overlay = Bitmap.createBitmap((int) (width / scaleFactor),(int) (height / scaleFactor),Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(overlay);
canvas.scale(1 / scaleFactor, 1 / scaleFactor);
Paint paint = new Paint();
paint.setFlags(Paint.FILTER_BITMAP_FLAG);
canvas.drawBitmap(mBitmap, 0, 0, paint);
overlay = FastBlur.doBlur(overlay, (int) radius, true);
Log.i(TAG, "blur time is:"+(System.currentTimeMillis() - startMs));
private Animation showAnimation1(final View view,int fromY ,int toY) {
AnimationSet set = new AnimationSet(true);
TranslateAnimation go = new TranslateAnimation(0, 0, fromY, toY);
go.setDuration(300);
TranslateAnimation go1 = new TranslateAnimation(0, 0, -10, 2);
go1.setDuration(100);
go1.setStartOffset(250);
set.addAnimation(go1);
set.addAnimation(go);
set.setAnimationListener(new AnimationListener() {
public void onAnimationEnd(Animation animation) {
public void onAnimationRepeat(Animation animation) {
public void onAnimationStart(Animation animation) {
public void showMoreWindow(View anchor,int bottomMargin) {
final RelativeLayout layout = (RelativeLayout)LayoutInflater.from(mContext).inflate(R.layout.center_music_more_window, null);
setContentView(layout);
ImageView close= (ImageView)layout.findViewById(R.id.center_music_window_close);
android.widget.RelativeLayout.LayoutParams params =new android.widget.RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
params.bottomMargin = bottomM
params.addRule(RelativeLayout.BELOW, R.id.more_window_auto);
params.addRule(RelativeLayout.RIGHT_OF, R.id.more_window_collect);
params.topMargin = 200;
params.leftMargin = 18;
close.setLayoutParams(params);
close.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
if (isShowing()) {
closeAnimation(layout);
showAnimation(layout);
setBackgroundDrawable(new BitmapDrawable(mContext.getResources(), blur()));
setOutsideTouchable(true);
setFocusable(true);
showAtLocation(anchor, Gravity.BOTTOM, 0, statusBarHeight);
private void showAnimation(ViewGroup layout){
for(int i=0;i&layout.getChildCount();i++){
final View child = layout.getChildAt(i);
if(child.getId() == R.id.center_music_window_close){
child.setOnClickListener(this);
child.setVisibility(View.INVISIBLE);
mHandler.postDelayed(new Runnable() {
public void run() {
child.setVisibility(View.VISIBLE);
ValueAnimator fadeAnim = ObjectAnimator.ofFloat(child, "translationY", 600, 0);
fadeAnim.setDuration(300);
KickBackAnimator kickAnimator = new KickBackAnimator();
kickAnimator.setDuration(150);
fadeAnim.setEvaluator(kickAnimator);
fadeAnim.start();
}, i * 50);
private void closeAnimation(ViewGroup layout){
for(int i=0;i&layout.getChildCount();i++){
final View child = layout.getChildAt(i);
if(child.getId() == R.id.center_music_window_close){
child.setOnClickListener(this);
mHandler.postDelayed(new Runnable() {
public void run() {
child.setVisibility(View.VISIBLE);
ValueAnimator fadeAnim = ObjectAnimator.ofFloat(child, "translationY", 0, 600);
fadeAnim.setDuration(200);
KickBackAnimator kickAnimator = new KickBackAnimator();
kickAnimator.setDuration(100);
fadeAnim.setEvaluator(kickAnimator);
fadeAnim.start();
fadeAnim.addListener(new AnimatorListener() {
public void onAnimationStart(Animator animation) {
// TODO Auto-generated method stub
public void onAnimationRepeat(Animator animation) {
// TODO Auto-generated method stub
public void onAnimationEnd(Animator animation) {
child.setVisibility(View.INVISIBLE);
public void onAnimationCancel(Animator animation) {
// TODO Auto-generated method stub
}, (layout.getChildCount()-i-1) * 30);
if(child.getId() == R.id.more_window_local){
mHandler.postDelayed(new Runnable() {
public void run() {
dismiss();
}, (layout.getChildCount()-i) * 30 + 80);
public void onClick(View v) {
switch (v.getId()) {
case R.id.more_window_local:
case R.id.more_window_online:
case R.id.more_window_delete:
case R.id.more_window_collect:
case R.id.more_window_auto:
case R.id.more_window_external:
public void destroy() {
if (null != overlay) {
overlay.recycle();
System.gc();
if (null != mBitmap) {
mBitmap.recycle();
System.gc();
&KickBackAnimator.Java回弹效果:
package com.jerome.
import android.animation.TypeE
public class KickBackAnimator implements TypeEvaluator&Float& {
private final float s = 1.70158f;
float mDuration = 0f;
public void setDuration(float duration) {
mDuration =
public Float evaluate(float fraction, Float startValue, Float endValue) {
float t = mDuration *
float b = startValue.floatValue();
float c = endValue.floatValue() - startValue.floatValue();
float d = mD
float result = calculate(t, b, c, d);
public Float calculate(float t, float b, float c, float d) {
return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) +
代码见github:
请大家star一下,我后面会持续更新;
下面是apk下载地址:
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。
您可能感兴趣的文章:
大家感兴趣的内容
12345678910
最近更新的内容
常用在线小工具&>&Android实现页面底部仿新浪微博导航栏菜单源码
Android实现页面底部仿新浪微博导航栏菜单源码
上传大小:1009KB
Android实现页面底部仿新浪微博导航栏菜单源码
综合评分:4
{%username%}回复{%com_username%}{%time%}\
/*点击出现回复框*/
$(".respond_btn").on("click", function (e) {
$(this).parents(".rightLi").children(".respond_box").show();
e.stopPropagation();
$(".cancel_res").on("click", function (e) {
$(this).parents(".res_b").siblings(".res_area").val("");
$(this).parents(".respond_box").hide();
e.stopPropagation();
/*删除评论*/
$(".del_comment_c").on("click", function (e) {
var id = $(e.target).attr("id");
$.getJSON('/index.php/comment/do_invalid/' + id,
function (data) {
if (data.succ == 1) {
$(e.target).parents(".conLi").remove();
alert(data.msg);
$(".res_btn").click(function (e) {
var parentWrap = $(this).parents(".respond_box"),
q = parentWrap.find(".form1").serializeArray(),
resStr = $.trim(parentWrap.find(".res_area_r").val());
console.log(q);
//var res_area_r = $.trim($(".res_area_r").val());
if (resStr == '') {
$(".res_text").css({color: "red"});
$.post("/index.php/comment/do_comment_reply/", q,
function (data) {
if (data.succ == 1) {
var $target,
evt = e || window.
$target = $(evt.target || evt.srcElement);
var $dd = $target.parents('dd');
var $wrapReply = $dd.find('.respond_box');
console.log($wrapReply);
//var mess = $(".res_area_r").val();
var mess = resS
var str = str.replace(/{%header%}/g, data.header)
.replace(/{%href%}/g, 'http://' + window.location.host + '/user/' + data.username)
.replace(/{%username%}/g, data.username)
.replace(/{%com_username%}/g, data.com_username)
.replace(/{%time%}/g, data.time)
.replace(/{%id%}/g, data.id)
.replace(/{%mess%}/g, mess);
$dd.after(str);
$(".respond_box").hide();
$(".res_area_r").val("");
$(".res_area").val("");
$wrapReply.hide();
alert(data.msg);
}, "json");
/*删除回复*/
$(".rightLi").on("click", '.del_comment_r', function (e) {
var id = $(e.target).attr("id");
$.getJSON('/index.php/comment/do_comment_del/' + id,
function (data) {
if (data.succ == 1) {
$(e.target).parent().parent().parent().parent().parent().remove();
$(e.target).parents('.res_list').remove()
alert(data.msg);
//填充回复
function KeyP(v) {
var parentWrap = $(v).parents(".respond_box");
parentWrap.find(".res_area_r").val($.trim(parentWrap.find(".res_area").val()));
评论共有14条
谢谢分享,学习中!
不是我想要的 不是新浪微博客户端
以为是as的但是是eclipse的,希望以后需要的人可以看到
VIP会员动态
热门资源标签
CSDN下载频道资源及相关规则调整公告V11.10
下载频道用户反馈专区
下载频道积分规则调整V1710.18
spring mvc+mybatis+mysql+maven+bootstrap 整合实现增删查改简单实例.zip
资源所需积分/C币
当前拥有积分
当前拥有C币
输入下载码
为了良好体验,不建议使用迅雷下载
Android实现页面底部仿新浪微博导航栏菜单源码
会员到期时间:
剩余下载个数:
剩余积分:0
为了良好体验,不建议使用迅雷下载
积分不足!
资源所需积分/C币
当前拥有积分
您可以选择
程序员的必选
绿色安全资源
资源所需积分/C币
当前拥有积分
当前拥有C币
为了良好体验,不建议使用迅雷下载
资源所需积分/C币
当前拥有积分
当前拥有C币
为了良好体验,不建议使用迅雷下载
资源所需积分/C币
当前拥有积分
当前拥有C币
您的积分不足,将扣除 10 C币
为了良好体验,不建议使用迅雷下载
无法举报自己的资源
你当前的下载分为234。
你还不是VIP会员
开通VIP会员权限,免积分下载
你下载资源过于频繁,请输入验证码
您因违反CSDN下载频道规则而被锁定帐户,如有疑问,请联络:!
若举报审核通过,可返还被扣除的积分
被举报人:
请选择类型
资源无法下载 ( 404页面、下载失败、资源本身问题)
资源无法使用 (文件损坏、内容缺失、题文不符)
侵犯版权资源 (侵犯公司或个人版权)
虚假资源 (恶意欺诈、刷分资源)
含色情、危害国家安全内容
含广告、木马病毒资源
*投诉人姓名:
*投诉人联系方式:
*版权证明:
*详细原因:
Android实现页面底部仿新浪微博导航栏菜单源码淘宝上基于ANDROID手机微博的设计与实现_开题报告_百度文库
您的浏览器Javascript被禁用,需开启后体验完整功能,
享专业文档下载特权
&赠共享文档下载特权
&100W篇文档免费专享
&每天抽奖多种福利
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
淘宝上基于ANDROID手机微博的设计与实现_开题报告
阅读已结束,下载本文需要
定制HR最喜欢的简历
下载文档到电脑,同时保存到云知识,更方便管理
加入VIP
还剩6页未读,
定制HR最喜欢的简历
你可能喜欢-------------
新增文件夹...
新增文件夹
(多个标签用逗号分隔)
基于Android系统的新浪微博客户端的设计与实现.doc
   本系统基于Android移动开发平台,使用Java语言开发,使系统具有良好的平台移植性和可扩展性。新浪微博Android SDK为第三方微博应用提供了文档易用的微博API调用服务,使第三方微博客户端无需了解复杂的验证和API调用过程,就可以实现分享文字或者多媒体信息到新浪微博。&br&
   本系统包括四个模块:应用程序登录模块,主界面显示模块,微博浏览模块,用户模块。在登录模块,用户可以
   本系统基于Android移动开发平台,使用Java语言开发,使系统具有良好的平台移植性和可扩展性。新浪微博Android SDK为第三方微博应用提供了文档易用的微博API调用服务,使第三方微博客户端无需了解复杂的验证和API调用过程,就可以实现分享文字或者多媒体信息到新浪微博。&br&
   本系统包括四个模块:应用程序登录模块,主界面显示模块,微博浏览模块,用户模块。在登录模块,用户可以使用授权配置和用户注册并且登录系统。主界面显示模块中,用户可以发表新的微博和通过昵称搜索好友。微博浏览模块,进入浏览微博的详细页面,用户可以评论微博和转发微博。用户模块,可查看该用户的详细信息包括该用户的关注列表,话题列表,粉丝列表,和该用户所发表过的全部微博。&&
下载本文档需要登录,并付出相应积分()。
文件大小:836.19 KB
所需积分:& 10
相关资讯  — 
相关讨论话题  — 
浏览:0次&& 下载:1次
上传时间: 21:10:00
同类热门文档
0次浏览 &21次下载
0次浏览 &54次下载
0次浏览 &43次下载
0次浏览 &21次下载
0次浏览 &13次下载
0次浏览 &8次下载
相关经验 -
& 9人评&57页
& 4人评&35页
& 32人评&50页
& 7人评&66页
& 2人评&53页
OPEN-OPEN, all rights reserved.扫一扫体验手机阅读
android textview 如何实现像新浪微博@用户的点击事件
<span type="1" blog_id="1423207" userid='
27篇文章,10W+人气,0粉丝}

我要回帖

更多关于 android系统下载安装 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信