Android高仿360安全卫士布局
2012-10-18 12:01:42 来源:WEB开发网核心提示:/* if (result == true) { lin1.scrollBy(0, 0); lin1.scrollTo(80, 0); lin1.setPadd
/*
if (result == true) {
lin1.scrollBy(0, 0);
lin1.scrollTo(80, 0);
lin1.setPadding(0, 30, 0, 30);
lin2.setVisibility(View.VISIBLE);
result = false;
} else {
lin1.setPadding(10, 30, 0, 30);
lin1.scrollBy(80, 0);
lin1.scrollTo(0, 0);
lin2.setVisibility(View.GONE);
result = true;
}
}
});
*/
}else{
ImageView download_btn=(ImageView) collection.findViewById(R.id.download_btn);
download_btn.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
new AlertDialog.Builder(MainActivity.this)
.setTitle("说明")
.setMessage("单个页卡内按钮事件测试")
.setNegativeButton("确定",
new DialogInterface.OnClickListener() {
public void onClick(
DialogInterface dialog,
int which) {
}
}).show();
}
});
}
return mListViews.get(position);
}
/**
* Remove a page for the given position. The adapter is responsible
* for removing the view from its container, although it only must ensure
* this is done by the time it returns from {@link #finishUpdate()}.
*
* @param container The containing View from which the page will be removed.
* @param position The page position to be removed.
* @param object The same object that was returned by
* {@link #instantiateItem(View, int)}.
*/
public void destroyItem(View collection, int position, Object view) {
((ViewPager) collection).removeView(mListViews.get(position));
}
public boolean isViewFromObject(View view, Object object) {
return view==(object);
}
/**
* Called when the a change in the shown pages has been completed. At this
* point you must ensure that all of the pages have actually been added or
* removed from the container as appropriate.
* @param container The containing View which is displaying this adapter's
* page views.
*/
public void finishUpdate(View arg0) {}
public void restoreState(Parcelable arg0, ClassLoader arg1) {}
public Parcelable saveState() {
return null;
}
public void startUpdate(View arg0) {}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
if (result == true) {
lin1.scrollBy(0, 0);
lin1.scrollTo(80, 0);
lin1.setPadding(0, 30, 0, 30);
lin2.setVisibility(View.VISIBLE);
result = false;
} else {
lin1.setPadding(10, 30, 0, 30);
lin1.scrollBy(80, 0);
lin1.scrollTo(0, 0);
lin2.setVisibility(View.GONE);
result = true;
}
}
});
*/
}else{
ImageView download_btn=(ImageView) collection.findViewById(R.id.download_btn);
download_btn.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
new AlertDialog.Builder(MainActivity.this)
.setTitle("说明")
.setMessage("单个页卡内按钮事件测试")
.setNegativeButton("确定",
new DialogInterface.OnClickListener() {
public void onClick(
DialogInterface dialog,
int which) {
}
}).show();
}
});
}
return mListViews.get(position);
}
/**
* Remove a page for the given position. The adapter is responsible
* for removing the view from its container, although it only must ensure
* this is done by the time it returns from {@link #finishUpdate()}.
*
* @param container The containing View from which the page will be removed.
* @param position The page position to be removed.
* @param object The same object that was returned by
* {@link #instantiateItem(View, int)}.
*/
public void destroyItem(View collection, int position, Object view) {
((ViewPager) collection).removeView(mListViews.get(position));
}
public boolean isViewFromObject(View view, Object object) {
return view==(object);
}
/**
* Called when the a change in the shown pages has been completed. At this
* point you must ensure that all of the pages have actually been added or
* removed from the container as appropriate.
* @param container The containing View which is displaying this adapter's
* page views.
*/
public void finishUpdate(View arg0) {}
public void restoreState(Parcelable arg0, ClassLoader arg1) {}
public Parcelable saveState() {
return null;
}
public void startUpdate(View arg0) {}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
更多精彩
赞助商链接