首先是JiaoyuzixunActivity.java代码部分:
package com.gaoxiaotong.ctone.jiaoyuzixun;import java.util.ArrayList;import java.util.HashMap;import java.util.Iterator;import java.util.List;import java.util.Map;import org.json.JSONArray;import org.json.JSONObject;import com.gaoxiaotong.ctone.entity.Jiaoyuzixun_ViewPage_Adapter;import com.gaoxiaotong.ctone.entity.jianzhizhaopinAdapter;import com.gaoxiaotong.ctone.jianzhizhaopin.JianzhizhaopinActivity;import com.gaoxiaotong.info.Webserinfo;import com.gaoxiaotongctone.MainActivity;import com.gaoxiaotongctone.R;import android.app.Activity;import android.app.ProgressDialog;import android.content.Intent;import android.os.AsyncTask;import android.os.Bundle;import android.os.Parcelable;import android.support.v4.view.PagerAdapter;import android.support.v4.view.ViewPager;import android.support.v4.view.ViewPager.OnPageChangeListener;import android.util.Log;import android.view.KeyEvent;import android.view.View;import android.view.ViewGroup.LayoutParams;import android.view.animation.AnimationSet;import android.view.animation.TranslateAnimation;import android.widget.AdapterViewFlipper;import android.widget.HorizontalScrollView;import android.widget.ImageView;import android.widget.LinearLayout;import android.widget.ListView;import android.widget.ProgressBar;import android.widget.RadioButton;import android.widget.RadioGroup;import android.widget.TextView;import android.widget.RadioGroup.OnCheckedChangeListener;/** * HorizontalScrollView和ViewPager联动效果 上面为HorizontalScrollView,下面为ViewPager **/public class JiaoyuzixunActivity extends Activity implements OnCheckedChangeListener { private ProgressDialog dialog; private ProgressBar progressBar; private HashMap hMap; private int pageIndex; private boolean load_pagesize; private int thePage; /** * 设置布局显示属性 */ private LayoutParams mLayoutParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); /** * 设置布局显示目标最大化属性 */ private LayoutParams FFlayoutParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT); private LinearLayout loadingLayout; private TextView texview_back; private RadioGroup mRadioGroup; private RadioButton mRadioButton1; private RadioButton mRadioButton2; private RadioButton mRadioButton3; private RadioButton mRadioButton4; private RadioButton mRadioButton5; private RadioButton mRadioButton6; private ImageView mImageView; private float mCurrentCheckedRadioLeft;// 当前被选中的RadioButton距离左侧的距离 private HorizontalScrollView mHorizontalScrollView;// 上面的水平滚动控件 private ViewPager mViewPager; // 下方的可横向拖动的控件 private ArrayList mViews;// 用来存放下方滚动的layout(layout_1,layout_2,layout_3) @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.title_bar_education); iniController(); iniListener(); iniVariable(); mRadioButton1.setChecked(true); mViewPager.setCurrentItem(1); mCurrentCheckedRadioLeft = getCurrentCheckedRadioLeft(); // 返回 texview_back.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub Intent intent = new Intent(JiaoyuzixunActivity.this, MainActivity.class); startActivity(intent); JiaoyuzixunActivity.this.finish(); } }); // 绑定考研,专升本等等部分 } /** * AsyncTask异步加载部分操作 */ public class MyTaskJianzhi1 extends AsyncTask
dimens.xml部分,控制菜单栏显示条目效果:
8dp 8dp 16dp 0dp 100dp 200dp 300dp 400dp 500dp
过度页面layout_0.xml部分:
显示页面其中一个样式layout_1.xml部分:
效果图: