- 浏览: 909488 次
- 性别:
- 来自: 湖北—》上海
最新评论
-
miketwais:
janyee2012 写道楼主在不,请问下面这句配置在disc ...
cas实现单点登录,登出(java和php客户端) -
f5528710:
IOS 利用UIScrollview实现滑动筛选 -
卡卡欧克:
php 客户端 不能和 java 客户端 同时登录 怎么办
cas实现单点登录,登出(java和php客户端) -
duanyutian:
大神 我加0 或者\n都没有用 和mina的通信有没有注意点 ...
ios socket AsyncSocket使用 -
周聪龙:
楼主,我按照你的那个配置之后,怎么反而不能登录了,我以前只是简 ...
cas 3.4登录成功返回用户更多信息
效果类似网易新闻的新闻栏目切换时背景滑动效果
实现代码如下:
package com.example.viewpager;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.TranslateAnimation;
import android.widget.ImageView;
import android.widget.TextView;
public class Scroll extends Activity {
final int SUM = 6;
TextView[] mTVs;
ImageView[] mBGs;
int mPreClickID = 0;
int mCurClickID = 0;
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initView();
}
public void initView(){
mTVs = new TextView[SUM];
mTVs[0] = (TextView) this.findViewById(R.id.text_btn1);
mTVs[1] = (TextView) this.findViewById(R.id.text_btn2);
mTVs[2] = (TextView) this.findViewById(R.id.text_btn3);
mTVs[3] = (TextView) this.findViewById(R.id.text_btn4);
mTVs[4] = (TextView) this.findViewById(R.id.text_btn5);
mTVs[5] = (TextView) this.findViewById(R.id.text_btn6);
mBGs = new ImageView[SUM];
mBGs[0] = (ImageView) this.findViewById(R.id.img_btn1);
mBGs[1] = (ImageView) this.findViewById(R.id.img_btn2);
mBGs[2]= (ImageView) this.findViewById(R.id.img_btn3);
mBGs[3]= (ImageView) this.findViewById(R.id.img_btn4);
mBGs[4]= (ImageView) this.findViewById(R.id.img_btn5);
mBGs[5]= (ImageView) this.findViewById(R.id.img_btn6);
for(int i = 0; i < SUM; i++){
mTVs[i].setOnClickListener(clickListener);
}
mTVs[0].setEnabled(false);
mPreClickID = 0;
}
private void updataCurView(int curClickID){
if(0 <= curClickID && SUM > curClickID){
mTVs[mPreClickID].setEnabled(true);
mTVs[curClickID].setEnabled(false);
mBGs[mPreClickID].setVisibility(View.INVISIBLE);
mBGs[curClickID].setVisibility(View.VISIBLE);
mPreClickID = curClickID;
}
}
private void startSlip(View v){
Animation a = new TranslateAnimation(0.0f, v.getLeft()-mTVs[mPreClickID].getLeft(), 0.0f, 0.0f);
a.setDuration(300);
a.setFillAfter(false);
a.setFillBefore(false);
for(int i = 0; i < SUM; i++)
{
if(mTVs[i] == v){
mCurClickID = i;
break;
}
}
a.setAnimationListener(new AnimationListener(){
public void onAnimationStart(Animation animation){
// TODO Auto-generated method stub
}
public void onAnimationEnd(Animation animation){
// TODO Auto-generated method stub
updataCurView(mCurClickID);
}
public void onAnimationRepeat(Animation animation){
// TODO Auto-generated method stub
}
});
mBGs[mPreClickID].startAnimation(a);
}
private View.OnClickListener clickListener = new View.OnClickListener(){
public void onClick(final View v){
startSlip(v);
}
};
}
布局文件的代码如下:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:umadsdk="http://schemas.android.com/apk/res/com.LoveBus"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/news_top_bg">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/two_green_bg"
android:id="@+id/img_btn1"/>
<TextView
android:id="@+id/text_btn1"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:padding="2dp"
android:textSize="6pt"
android:layout_marginLeft="-32dp"
android:layout_marginTop="-1dp"
android:text="头条"
android:gravity="center"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/two_green_bg"
android:id="@+id/img_btn2"
android:visibility="invisible"/>
<TextView
android:id="@+id/text_btn2"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_marginLeft="-32dp"
android:padding="2dp"
android:textSize="6pt"
android:gravity="center"
android:text="政策" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/two_green_b1g"
android:id="@+id/img_btn3"
android:visibility="invisible"/>
<TextView
android:id="@+id/text_btn3"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_marginLeft="-55dp"
android:padding="2dp"
android:textSize="6pt"
android:gravity="center"
android:text="地产金融" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/two_green_b1g"
android:id="@+id/img_btn4"
android:visibility="invisible"/>
<TextView
android:id="@+id/text_btn4"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_marginLeft="-55dp"
android:padding="2dp"
android:textSize="6pt"
android:gravity="center"
android:text="房企动态" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/two_green_b1g"
android:id="@+id/img_btn5"
android:visibility="invisible"
/>
<TextView
android:id="@+id/text_btn5"
android:layout_width="wrap_content"
android:layout_marginLeft="-55dp"
android:layout_height="40dp"
android:padding="2dp"
android:textSize="6pt"
android:gravity="center"
android:text="基金动态" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/two_green_b1g"
android:id="@+id/img_btn6"
android:visibility="invisible"/>
<TextView
android:id="@+id/text_btn6"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_marginLeft="-55dp"
android:padding="2dp"
android:textSize="6pt"
android:gravity="center"
android:text="保险信托"/>
</LinearLayout>
</LinearLayout>
发表评论
-
Gradle多渠道apk打包自动重命名
2018-01-20 21:22 1380使用友盟多渠道发布apk,使用gradle自动打apk是十 ... -
android5以上webview无法同步cookie的问题
2017-07-24 15:30 2194最近在做android webView中加载h5游戏,发现部 ... -
eclipse 中使用ARR
2016-08-09 17:51 2669最近需要在公司应用上集成阿里反馈功能,然而阿里sdk只提供a ... -
fragment中嵌套使用viewpager不显示的解决方案
2015-11-17 11:08 8736private void InitViewPager(Vi ... -
android actionbar 学习
2014-01-15 15:34 37581.Action Bar 介绍 我们能在应用中看见的a ... -
android 开源框架xUtils
2014-01-13 11:46 31096git地址:https://github.com/wyouf ... -
不使用ActionBarSherlock 兼容2.x的actionbar
2014-01-13 11:35 1784当需要在 android 7或更高的版本使用 ActionB ... -
ListView 含有多个Item布局时,convertView的缓存与重用
2013-12-26 12:03 3736最近有需求需要在listView中载入不同的listIte ... -
android 图片加载和缓存开源项目 Picasso
2013-12-13 10:54 26575Picasso – Android系统的图片下载和缓存类 ... -
Android、iPhone和Java三个平台一致的加密方法
2013-11-25 22:52 3824先前一直在做安卓,最近要开发iPhone客户端,这其中遇到的 ... -
android导入已有的外部数据库db
2013-10-14 17:16 9505我们平时见到的android数据库操作一般都是在程序开始时创 ... -
Android 连接Wifi和创建Wifi热点
2013-09-26 21:47 12784上代码: MainActivity.java ... -
android 获取签名信息
2013-08-27 16:30 2883/** * 获取签值信息 * @author allen ... -
android ndk的使用 jni
2013-08-25 14:53 1826最近android项目中底层加密方法需要用 ... -
Android 布局优化 java.lang.StackOverflowError
2013-05-28 19:41 2938最近做的一 ... -
android 广播的使用
2013-04-23 20:09 1101在Activity中,注册广播的一个Demo。 总共分3步 ... -
android 实现圆角listview
2012-09-24 11:26 3085无论是网站,还是APP,人们都爱看一些新颖的视图效果。直 ... -
Apndroid Push Notification实现安卓推送
2012-08-16 13:11 4883Apndroid Push Notificati ... -
android 调用拨打电话和发送短信的功能
2012-08-14 09:47 19361、拨打电话 Intent intent=new In ... -
android通过ViewFlipper实现左右滑动效果
2012-02-14 15:43 107791)View切换的控件—V ...
相关推荐
自定义控件实现横向滑动背景图视差效果
Android 实现小红书登陆页面背景图无限滚动效果,有需要的可以看下
http://blog.csdn.net/xu_fu/article/details/23131241示例代码,实现类似yahoo天气滑动背景模糊的效果
android 自定义ScrollView实现背景图片伸缩,android阻尼效果背景图片伸缩仿2015QQ空间,已经修改完bug,里面包含2个项目,2种阻尼,大家可以参考学习,鄙人也是刚刚接触
Android代码,自定义ViewPager,设置ViewPager的背景图片,当ViewPager切换页面时,背景图片自动滚动,根据计算,当ViewPager切换到最后一个页面时,背景也同时滑动到最后,如果背景图片宽度较小,ViewPager每次切换...
这个项目模仿天天动听实现了右侧导航功能,使用viewpager+fragment技术,实现了抽屉效果,实现了更改程序背景图片功能。
1. Android仿饿了么地图滑动特效Demo,比较简单,不涉及kotlin代码。 2. CoordinatorLayout + AppBarLayout + NestedScrollView 组合使用实现地图背景,滑动悬停华丽效果。
RecyclerView实现Item滑动加载进入动画效果,详情链接地址http://blog.csdn.net/u012341052?viewmode=contents
仿百度手机助手android端推荐界面实现上滑actionbar颜色变化及背景颜色变化继承了slibingTab与Viewpager.rar,太多无法一一验证是否可用,程序如果跑不起来需要自调,部分代码功能进行参考学习。
ViewFlow,一个滑动效果库.rar 乐动力的酷黑旋转引导动画.rar 仿淘宝购买商品,主页后缩.rar 多个按钮左右相互挤压效果demo.zip 幸运大转盘源码.rar 摇色子效果.rar 水果忍者点击屏幕效果.rar 翻翻乐--抢答--转盘.rar...
仿招行手机银行APP8.1首页下拉效果...下拉震动出现二楼效果、上滑改变Title背景透明度效果,通过自定义ScrollView监听onTouchEvent下拉震动出现二楼效果,通过监听ScrollView滚动事件实现上滑改变Title背景透明度效果。
本文实例为大家分享了android实现滑动解锁的具体代码,供大家参考,具体内容如下 效果图 需要用到的画笔, 整体灰色的背景, 滑块, 滑动之后绿色背景, 字体 mSliPaint = new Paint(); mSliPaint.setColor...
ToggleView自定义开关控件表征上没有跟Android原生的控件有什么相似的地方,而且在滑动的效果上也没有沿袭Android原生的地方,所以我们的自定义ToggleView选择继承View 同样的自定义控件需要复写三个构造方法 //...
利用CoordinatorLayout仿抖音个人中心 下拉越界回弹 图片放大,viewPager嵌套效果。效果基本一致,并且稳定。
废话不多说,先看下实现后的效果: 实现思路 看到上边 gif 图的效果,主要列举一下实现过程过程中遇到的难点。 如何使键盘弹出时候不遮挡底部登录布局; 当键盘弹出的时候如何不压缩背景图片或者背景延伸至「屏幕...
Android自定义View实现等级滑动条的实例 实现效果图: 思路: 首先绘制直线,然后等分直线绘制点; 绘制点的时候把X值存到集合中。 然后绘制背景图片,以及图片上的数字。 点击事件down的时候,换小图片为...
序 昨晚经历了美股本月的第三次熔断 ,有史...实现类似的效果 ,主要是使用三个控件相结合 CoordinatorLayout 、AppbarLayout 、NestedScrollView 。 AppbarLayout 是一种支持响应滚动手势的 app bar 布局 , Collapsi
在Android中是通过Gallery来实现拖动效果的。 通过Gallery可以实现各种各样的效果,此篇文章只是简要谈谈他的用法,至于后续的一些效果 有机会的时候做一个整理。 首先看看其简单实现吧!本次实例是通过选取图片...
前言 首次通过右滑来返回到上一个页面的操作是在 IOS7...Android系统里有很多滑动相关的API和类,比如ViewDragHelper就是一个很好的滑动助手类。首先设置Window的背景为透明,再通过ViewDragHelper对Activity上DecorVi