package com.example.lgs.testandnroid;
import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewTreeObserver;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.aierjun.moveview.view.MaxView;
import com.aierjun.moveview.view.MoveLinearLayout;
/**
* Created by lgs on 2017/6/2.
*/
public class ObtainPageActivity extends Activity {
ImageView imageViewDDD;
ImageView obtains_showdefalut;
ImageView tv_NoShOW_Img;
LinearLayout show_lt;
MoveLinearLayout tv_NoShOW_LL;
TextView imageView3;
private MaxView maxViewBg;
TextView tv_NoShOw_Centent,tv_NoShOw_Name_Title;
int left,top;
private ViewTreeObserver mObserver;
private Intent mIntent;
private int x,y;
private WindowManager mWm;
private int mWidth;
private int mHeight;
private RelativeLayout mContainer;
private AnimatorSet mAnimatorSet;
private ObjectAnimator mBackgroundColor;
private ObjectAnimator mA;
private ObjectAnimator mB;
private ObjectAnimator mC;
private ObjectAnimator mD1;
private ObjectAnimator mE;
private ObjectAnimator mRotationYs1;
private ObjectAnimator mRotationYs2;
private ObjectAnimator mTranslationX;
private ObjectAnimator mAnimator2;
private ObjectAnimator mAnimator3;
private ObjectAnimator mAnimator4;
private ObjectAnimator mAnimator5;
private int[] mScrrentt;
private int mImg_width;
private int mImg_height;
private float mCuurentX;
private float mCuurentY;
private String mSelectCard;
private TextView mTv_service_title;
private TextView tv_Service_name;
private float density;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_obtainpage);
mIntent = getIntent();
if(mIntent==null){
this.finish();
}
left= mIntent.getIntExtra("lelf",0);//x
top= mIntent.getIntExtra("top",0);//y
mSelectCard = mIntent.getStringExtra("selectCard");
if(mSelectCard==null){
this.finish();
}
mContainer = (RelativeLayout) findViewById(R.id.container);
tv_NoShOW_Img = (ImageView) findViewById(R.id.tv_NoShOW_Img);
imageViewDDD = (ImageView) findViewById(R.id.imageViewDDD);
obtains_showdefalut = (ImageView) findViewById(R.id.obtains_showdefalut);
mTv_service_title = (TextView) findViewById(R.id.tv_service_title);
tv_Service_name = (TextView) findViewById(R.id.tv_service_name);
imageView3 = (TextView) findViewById(R.id.imageView3);
tv_NoShOw_Centent = (TextView) findViewById(R.id.tv_NoShOW_Centent);
tv_NoShOw_Name_Title = (TextView) findViewById(R.id.tv_NoShOW_Name_Title);
show_lt = (LinearLayout) findViewById(R.id.show_lt);
tv_NoShOW_LL = (MoveLinearLayout) findViewById(R.id.tv_NoShOW_LL);
maxViewBg= (MaxView) findViewById(R.id.ac_maxbg);
maxViewBg.setVisibility(TextUtils.equals("0",mSelectCard)?View.GONE:View.VISIBLE);
mWm = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
mWidth = mWm.getDefaultDisplay().getWidth();
mHeight = mWm.getDefaultDisplay().getHeight();
mHeight = mHeight +getStatusBarHeight();
density=getResources().getDisplayMetrics().density;
mBackgroundColor = ObjectAnimator.ofInt(mContainer, "backgroundColor", 0x44000000, 0x44000000);
findViewById(R.id.imageView2).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
resertAnimator(true);
}
});
imageView3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
maxViewBg.disMiss();
resertAnimator(false);
}
});
mObserver = tv_NoShOW_LL.getViewTreeObserver();
mObserver.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
tv_NoShOW_LL.ccc(left,top);
}
});
tv_NoShOW_LL.postDelayed(new Runnable() {
@Override
public void run() {
findViewById(R.id.imageView2).performClick();
}
},800);
}
public void resertAnimator(boolean is) {
ValueAnimator.AnimatorUpdateListener D = new ValueAnimator.AnimatorUpdateListener() {
private ObjectAnimator mRotationYs;
boolean is = true;
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
long playTime = valueAnimator.getCurrentPlayTime();
if (playTime > 500 && is) {
is = false;
mRotationYs = ObjectAnimator.ofFloat(tv_NoShOW_Img, "rotationY", 0f, 180f);
mRotationYs1 = ObjectAnimator.ofFloat(tv_NoShOw_Centent, "rotationY", 0f, 180f);
mRotationYs2 = ObjectAnimator.ofFloat(tv_NoShOw_Name_Title, "rotationY", 0f, 180f);
mRotationYs.setDuration(10);
mRotationYs1.setDuration(10);
mRotationYs2.setDuration(10);
mRotationYs.start();
mRotationYs1.start();
mRotationYs2.start();
obtains_showdefalut.setVisibility(View.GONE);
if(TextUtils.equals("0",mSelectCard)){
tv_NoShOw_Centent.setText("加油哦!");
tv_NoShOW_Img.setVisibility(View.GONE);
imageViewDDD.setVisibility(View.GONE);
tv_NoShOw_Name_Title.setText("谢谢参与");
tv_NoShOw_Name_Title.setVisibility(View.VISIBLE);
}else{
tv_NoShOw_Name_Title.setVisibility(View.GONE);
tv_NoShOw_Centent.setText("沙棘果"+mSelectCard+"个");
imageViewDDD.setVisibility(View.VISIBLE);
tv_NoShOW_Img.setVisibility(View.VISIBLE);
tv_NoShOW_Img.setImageResource(R.mipmap.shajiguo);
}
}
}
};
if(is){
mScrrentt = new int[2];
tv_NoShOW_LL.getLocationOnScreen(mScrrentt);
x = mScrrentt[0];
y = mScrrentt[1];
mImg_width = tv_NoShOW_LL.getWidth() / 2;
mImg_height = tv_NoShOW_LL.getHeight() / 2;
mCuurentX = mWidth / 2 - x - mImg_width;
mCuurentY = mHeight / 2 - y - mImg_height;
mTranslationX = ObjectAnimator.ofFloat(tv_NoShOW_LL, "translationX", 0.0f, mCuurentX);
mAnimator2 = ObjectAnimator.ofFloat(tv_NoShOW_LL, "translationY", 0.0f, mCuurentY);
mAnimator3 = ObjectAnimator.ofFloat(tv_NoShOW_LL, "rotationY", 0f, 180f);
mAnimator4 = ObjectAnimator.ofFloat(tv_NoShOW_LL, "scaleX", 1f, 1.5f);
mAnimator5 = ObjectAnimator.ofFloat(tv_NoShOW_LL, "scaleY", 1f, 1.5f);
mAnimatorSet = new AnimatorSet();
mAnimatorS
没有合适的资源?快使用搜索试试~ 我知道了~
android 模仿京东签到
共106个文件
xml:55个
png:17个
java:11个
3星 · 超过75%的资源 需积分: 13 29 下载量 195 浏览量
2017-06-19
10:19:42
上传
评论 1
收藏 547KB RAR 举报
温馨提示
博客地址:http://blog.csdn.net/qq_18877377/article/details/73433512
资源推荐
资源详情
资源评论
收起资源包目录
android 模仿京东签到 (106个子文件)
gradlew.bat 2KB
fileSnapshots.bin 10.17MB
localClassSetAnalysis.bin 892KB
fileHashes.bin 580KB
taskArtifacts.bin 217KB
localJarClasspathSnapshot.bin 22KB
.gitignore 127B
.gitignore 8B
build.gradle 1KB
build.gradle 521B
settings.gradle 16B
gradlew 5KB
app.iml 11KB
TestAndnroid.iml 889B
gradle-wrapper.jar 52KB
ObtainPageActivity.java 14KB
MaxView.java 10KB
ObtainListAdapter.java 6KB
ObtainShowCard.java 5KB
MoveImageView.java 3KB
MoveLinearLayout.java 1001B
MainActivity.java 882B
ExampleInstrumentedTest.java 786B
ExampleUnitTest.java 422B
ViewValue.java 264B
ObtainList.java 148B
defaulthead.jpg 13KB
localClassSetAnalysis.lock 17B
localJarClasspathSnapshot.lock 17B
taskArtifacts.lock 17B
shajiguo3x.png 16KB
ic_launcher_round.png 14KB
ic_launcher.png 10KB
ic_launcher_round.png 10KB
ic_launcher.png 8KB
ic_launcher_round.png 6KB
ic_launcher.png 5KB
ic_launcher_round.png 4KB
shajiguo.png 4KB
ic_launcher.png 3KB
ic_launcher_round.png 2KB
ic_launcher.png 2KB
lihua_a4.png 2KB
lihua_a2.png 2KB
lihua_a3.png 2KB
lihua_a1.png 2KB
meitu_1.png 847B
proguard-rules.pro 986B
gradle.properties 747B
local.properties 506B
gradle-wrapper.properties 236B
workspace.xml 195KB
activity_obtainpage.xml 6KB
misc.xml 6KB
adapter_obtain_list.xml 3KB
ccccc.xml 3KB
styles.xml 2KB
activity_obtainnoshowcard.xml 2KB
AndroidManifest.xml 1KB
compiler.xml 686B
exposed_instrumentation_api_publish_0_5.xml 675B
espresso_idling_resource_2_2_2.xml 657B
animated_vector_drawable_25_3_1.xml 646B
support_vector_drawable_25_3_1.xml 643B
support_media_compat_25_3_1.xml 634B
support_core_utils_25_3_1.xml 628B
gradle.xml 626B
activity_main.xml 625B
espresso_core_2_2_2.xml 624B
support_fragment_25_3_1.xml 622B
recyclerview_v7_25_1_0.xml 619B
support_core_ui_25_3_1.xml 619B
support_compat_25_3_1.xml 616B
appcompat_v7_25_3_1.xml 610B
butterknife_8_0_1.xml 600B
butterknife_annotations_8_0_1.xml 591B
runner_0_5.xml 588B
support_annotations_25_3_1.xml 585B
rules_0_5.xml 585B
runConfigurations.xml 564B
hamcrest_core_1_3.xml 526B
drawable_shape.xml 523B
javax_inject_1.xml 511B
junit_4_12.xml 477B
anima_dialog.xml 419B
constraint_layout_1_0_2.xml 410B
support_v4_25_3_1.xml 404B
bg_obtain_line.xml 397B
constraint_layout_solver_1_0_2.xml 382B
modules.xml 361B
javax_annotation_api_1_2.xml 358B
hamcrest_integration_1_3.xml 354B
push_bottom_out.xml 354B
hamcrest_library_1_3.xml 342B
javawriter_2_1_1.xml 330B
jsr305_2_0_1.xml 330B
rounded_corners_bg.xml 327B
colors.xml 315B
put_in.xml 313B
drawable_shape1.xml 311B
共 106 条
- 1
- 2
资源评论
- u0100740542017-12-12你这效果好像和你演示的不一样啊
一条黑犬
- 粉丝: 0
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功