package com.wiz.ui.activity;
import com.wiz.ui.adapter.AdImageAdapter;
import com.wiz.ui.adapter.R;
import com.wiz.ui.view.PageControlView;
import android.content.Intent;
import android.content.res.Resources;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
import android.view.animation.AnimationUtils;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.Button;
import android.widget.Gallery;
import android.widget.LinearLayout;
import android.widget.TextView;
public class IndexActivity extends ParentActivity implements
View.OnClickListener {
private String[] adString;
private Gallery ad_image;
private TextView ad_text;
private LinearLayout bottom_left;
private LinearLayout bottom_right;
private LinearLayout center_layout;
Handler galleryHandler = new Handler() {
public void handleMessage(Message paramMessage) {
int i = 1 + ((Integer) paramMessage.obj).intValue();
if (i < 4) {
IndexActivity.this.ad_image.setSelection(i);
} else {
IndexActivity.this.ad_image.setSelection(0);
}
}
};
private boolean isFirstCreate = false;
private Button login_btn;
AdapterView.OnItemSelectedListener onItemSelectedListener = new AdapterView.OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> paramAdapterView,
View paramView, int paramInt, long paramLong) {
IndexActivity.this.page_control.generatePageControl(paramInt);
IndexActivity.this.ad_text
.setText(IndexActivity.this.adString[paramInt]);
IndexActivity.this.galleryHandler.removeMessages(0);
IndexActivity.this.galleryHandler.sendMessageDelayed(
IndexActivity.this.galleryHandler.obtainMessage(0,
Integer.valueOf(paramInt)), 2000L);
}
public void onNothingSelected(AdapterView<?> paramAdapterView) {
}
};
View.OnLongClickListener onLongClickListener = new View.OnLongClickListener() {
@Override
public boolean onLongClick(View paramView) {
int i = paramView.getId();
int j = 0;
Intent localIntent = null;
IndexActivity.this.startAnimal(i);
switch (i) {
case R.id.register:
j = 0;
break;
case R.id.hospital:
j = 1;
break;
case R.id.more:
j = 2;
break;
case R.id.myservice:
j = 3;
break;
}
localIntent = new Intent(IndexActivity.this, MainActivity.class);
localIntent.putExtra("intent_to_main_id", j);
IndexActivity.this.begin(localIntent);
return false;
}
};
private PageControlView page_control;
private LinearLayout top_left;
private LinearLayout top_right;
private void begin(Intent paramIntent) {
new AsyncTask<String, Void, String>() {
@Override
protected String doInBackground(String... params) {
try {
Thread.sleep(500L);
return null;
} catch (InterruptedException localInterruptedException) {
localInterruptedException.printStackTrace();
}
return null;
}
};
IndexActivity.this.startActivity(paramIntent);
}
public void onClick(View paramView) {
int i = paramView.getId();
int j = 0;
Intent localIntent = null;
IndexActivity.this.startAnimal(i);
switch (i) {
case R.id.register:
j = 0;
break;
case R.id.hospital:
j = 1;
break;
case R.id.more:
j = 2;
break;
case R.id.myservice:
j = 3;
break;
}
localIntent = new Intent(IndexActivity.this, MainActivity.class);
localIntent.putExtra("intent_to_main_id", j);
IndexActivity.this.begin(localIntent);
}
public void onCreate(Bundle paramBundle) {
super.onCreate(paramBundle);
this.isFirstCreate = true;
init(R.layout.p_index);
}
public boolean onKeyDown(int keyCode, KeyEvent paramKeyEvent) {
switch (keyCode) {
case KeyEvent.KEYCODE_BACK:
showConfirmDialog(R.string.logout_info);
break;
}
return false;
}
protected void onResume() {
super.onResume();
if (!this.isFirstCreate)
resumStartAnimal();
this.isFirstCreate = false;
}
public void resumStartAnimal() {
this.top_left.startAnimation(AnimationUtils.loadAnimation(this.context,
R.anim.anim_left_resume));
this.top_right.startAnimation(AnimationUtils.loadAnimation(
this.context, R.anim.anim_top_resume));
this.center_layout.startAnimation(AnimationUtils.loadAnimation(
this.context, R.anim.anim_center_resume));
this.bottom_left.startAnimation(AnimationUtils.loadAnimation(
this.context, R.anim.anim_bottom_resume));
this.bottom_right.startAnimation(AnimationUtils.loadAnimation(
this.context, R.anim.anim_right_resume));
this.top_left.setEnabled(true);
this.top_right.setEnabled(true);
this.center_layout.setEnabled(true);
this.bottom_left.setEnabled(true);
this.bottom_right.setEnabled(true);
}
protected void setupData() {
this.adString = getResources().getStringArray(R.array.ad_title);
}
protected void setupView() {
this.ad_image = (Gallery) findViewById(R.id.ad_image);
this.ad_text = (TextView) findViewById(R.id.ad_text);
this.page_control = (PageControlView) findViewById(R.id.pageControlView);
this.login_btn = (Button) findViewById(R.id.login_btn);
this.top_left = (LinearLayout) findViewById(R.id.top_left);
this.top_right = (LinearLayout) findViewById(R.id.top_right);
this.center_layout = (LinearLayout) findViewById(R.id.center);
this.bottom_left = (LinearLayout) findViewById(R.id.bottom_left);
this.bottom_right = (LinearLayout) findViewById(R.id.bottom_right);
this.top_left.setOnClickListener(this);
this.top_right.setOnClickListener(this);
this.center_layout.setOnClickListener(this);
this.bottom_left.setOnClickListener(this);
this.bottom_right.setOnClickListener(this);
this.top_left.setOnLongClickListener(this.onLongClickListener);
this.top_right.setOnLongClickListener(this.onLongClickListener);
this.center_layout.setOnLongClickListener(this.onLongClickListener);
this.bottom_left.setOnLongClickListener(this.onLongClickListener);
this.bottom_right.setOnLongClickListener(this.onLongClickListener);
AdImageAdapter localAdImageAdapter = new AdImageAdapter(this.context);
this.ad_image.setAdapter(localAdImageAdapter);
this.ad_image.setOnItemSelectedListener(this.onItemSelectedListener);
this.page_control.count = 4;
this.ad_image.setSelection(0);
this.login_btn.setOnClickListener(new View.OnClickListener() {
public void onClick(View paramView) {
// Intent localIntent = new Intent(IndexActivity.this,
// UserLoginActivity.class);
// localIntent.addFlags(67108864);
// IndexActivity.this.startActivity(localIntent);
}
});
}
public void startAnimal(int paramInt) {
this.top_left.setEnabled(false);
this.top_right.setEnabled(false);
this.center_layout.setEnabled(false);
this.bottom_left.setEnabled(false);
this.bottom_right.setEnabled(false);
switch (paramInt) {
case R.id.register:
this.top_left.startAnimation(AnimationUtils.loadAnimation(
this.context, R.anim.anim_center));
this.top_right.startAnimation(AnimationUtils.loadAnimation(
this.context, R.anim.anim_top));
this.center_layout.startAnimation(AnimationUtils.loadAnimation(
this.context, R.anim.anim_center));
this.bottom_left.startAnimation(AnimationUtils.loadAnimation(
this.context, R.anim.anim_bottom));
this.bottom_right.startAnimation(AnimationUtils.loadAnimation(
this.context, R.anim.anim_right));
break;
case R.id.hospital:
this.top_left.startAnimation(AnimationUtils.loadAnimation(
this.context, R.anim.anim_left));
this.top_right.startAnimation(AnimationUtils.loadAnimation(
this.context, R.anim.anim_cent
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Android 预约挂号软件部分源码 (150个子文件)
resources.ap_ 1.19MB
Booking.apk 1.21MB
proguard.cfg 1KB
ParentActivity.class 9KB
IndexActivity.class 7KB
DatabaseAdapter.class 4KB
Utils.class 3KB
DBUtils.class 3KB
MyApplication.class 3KB
MainActivity.class 2KB
DBUtils$DatabaseHelper.class 2KB
DatabaseImpl.class 2KB
IndexActivity$2.class 2KB
Rotate3dAnimation.class 2KB
ImageAdapter.class 2KB
PageControlView.class 2KB
AdImageAdapter.class 2KB
ParentActivity$DisplayNextView.class 1KB
DatabaseAdapter$DatabaseHelper.class 1KB
R$drawable.class 1KB
IndexActivity$3.class 1KB
ParentActivity$SwapViews.class 1KB
IndexActivity$4.class 1KB
MainActivity$1.class 1KB
R$id.class 1KB
IndexActivity$1.class 1KB
MyGallery.class 1KB
ParentActivity$6.class 969B
ParentActivity$2.class 966B
ParentActivity$5.class 915B
R$anim.class 912B
ParentActivity$3.class 908B
R$string.class 903B
ParentActivity$4.class 898B
R$array.class 843B
IndexActivity$5.class 764B
MyLogger.class 753B
ParentActivity$1.class 713B
R.class 673B
R$color.class 541B
R$layout.class 455B
IDatabase.class 357B
GlobalSetting.class 350B
R$attr.class 340B
.classpath 364B
classes.dex 38KB
IndexActivity.java 11KB
ParentActivity.java 10KB
R.java 6KB
DBUtils.java 5KB
DatabaseAdapter.java 4KB
MainActivity.java 4KB
MyApplication.java 3KB
Utils.java 3KB
Rotate3dAnimation.java 2KB
PageControlView.java 2KB
ImageAdapter.java 1KB
DatabaseImpl.java 1KB
AdImageAdapter.java 1KB
MyGallery.java 729B
IDatabase.java 392B
MyLogger.java 350B
GlobalSetting.java 104B
booking.key 1KB
ad_default.png 312KB
ad_default.png 312KB
ad_default_3.png 231KB
ad_default_3.png 231KB
ad_default_1.png 225KB
ad_default_1.png 225KB
ad_default_4.png 218KB
ad_default_4.png 218KB
ad_default_2.png 159KB
ad_default_2.png 159KB
豌豆荚截屏.png 93KB
index_top_image.png 6KB
index_top_image.png 6KB
search_image.png 3KB
search_image.png 3KB
menu_hospital.png 3KB
menu_hospital.png 3KB
hospital_image.png 3KB
hospital_image.png 3KB
ic_launcher.png 3KB
btn1_s.png 2KB
btn1_s.png 2KB
menu_search.png 2KB
menu_search.png 2KB
ic_launcher.png 2KB
menu_myservice.png 2KB
menu_myservice.png 2KB
edit_bg.9.png 2KB
menu_more.png 2KB
menu_more.png 2KB
menu_register.png 2KB
menu_register.png 2KB
menu_select.png 2KB
menu_select.png 2KB
myservice_image.png 2KB
myservice_image.png 2KB
共 150 条
- 1
- 2
Wizzercn
- 粉丝: 0
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- CVE-2019-0708漏洞检测与利用工具
- STM32单片机FPGA毕设电路原理论文报告利用c8051f020系列单片机实现智能仪器开发
- STM32单片机FPGA毕设电路原理论文报告利用8位单片机实现与Internet网络通信应用研究
- STM32单片机FPGA毕设电路原理论文报告利用80C196单片机测量三相异步电动机功率因数
- STM32单片机FPGA毕设电路原理论文报告力学传感器与单片机的接口设计
- p107-u07FLT2.wav
- STM32单片机FPGA毕设电路原理论文报告雷达幅频特性测试仪的智能化研究
- STM32单片机FPGA毕设电路原理论文报告可组网电子温湿度测量仪的设计与实现
- STM32单片机FPGA毕设电路原理论文报告可在单片机上实现的语音混沌保密通信方法
- STM32单片机FPGA毕设电路原理论文报告可实现的基于MCS51单片机的恒温控制系统的设计
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
前往页