use of org.aicaprio.curtainview.CurtainView in project CurtainView by aicaprio.
the class MainActivity method showSample2.
private void showSample2() {
setContentView(R.layout.activity_sample2);
final CurtainView curtainView = (CurtainView) findViewById(R.id.cb1);
final ImageView iv1 = (ImageView) findViewById(R.id.iv1);
final GridView gv1 = (GridView) findViewById(R.id.gv1);
final List<Map<String, Integer>> data = getData();
gv1.setAdapter(new SimpleAdapter(this, data, R.layout.item_numbers, new String[] { TEXT_TAG }, new int[] { R.id.item_tvNum }));
gv1.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
showToast(data.get(position).get(TEXT_TAG) + " clicked");
}
});
iv1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
curtainView.toggleStatus();
}
});
curtainView.setScrollerInterpolator(new BounceInterpolator());
curtainView.post(new Runnable() {
@Override
public void run() {
curtainView.setCurtainGravityAndFixedValue(null, iv1.getHeight());
}
});
}
use of org.aicaprio.curtainview.CurtainView in project CurtainView by aicaprio.
the class MainActivity method showSample1.
private void showSample1() {
setContentView(R.layout.activity_sample);
mCurtainView = (CurtainView) findViewById(R.id.cb1);
final Button btn1 = (Button) findViewById(R.id.btn1);
btn1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mCurtainView.isAutoScrolling()) {
showToast("Scrolling is not end...");
} else {
mCurtainView.toggleStatus();
}
}
});
mCurtainView.setAutoScrollingListener(new ICurtainViewBase.AutoScrollingListener() {
@Override
public void onScrolling(int currValue, int currVelocity, int startValue, int finalValue) {
}
@Override
public void onScrollFinished() {
boolean isOpened = mCurtainView.getCurtainStatus() == ICurtainViewBase.CurtainStatus.OPENED;
rbOpened.setChecked(isOpened);
rbClosed.setChecked(!isOpened);
}
});
rgCGravity = (RadioGroup) findViewById(R.id.rgCurtainGravity);
rgReboundMode = (RadioGroup) findViewById(R.id.rgReboundMode);
rgCGravity.setOnCheckedChangeListener(mOnCheckedChangeListener);
rgReboundMode.setOnCheckedChangeListener(mOnCheckedChangeListener);
rbOpened = (RadioButton) findViewById(R.id.rbOpened);
rbClosed = (RadioButton) findViewById(R.id.rbClosed);
}
Aggregations