use of com.movitech.aicaprio.CurtainView in project CurtainView by aicaprio.
the class SampleActivity method showSample2.
private void showSample2() {
setContentView(R.layout.activity_sample2);
final CurtainView curtainView = (CurtainView) findViewById(R.id.cv1);
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 com.movitech.aicaprio.CurtainView in project CurtainView by aicaprio.
the class SampleActivity method showSample1.
private void showSample1() {
setContentView(R.layout.activity_sample);
mCurtainView = (CurtainView) findViewById(R.id.cv1);
final Button btn1 = (Button) findViewById(R.id.btn1);
btn1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mCurtainView.isAutoScrolling()) {
showToast();
} 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;
Button checkedBtn = mCurtainView.getCurtainStatus() == ICurtainViewBase.CurtainStatus.OPENED ? btnOpened : btnClosed;
setChecked(checkedBtn);
}
});
findViewById(R.id.btnCGravityLeft).setOnClickListener(mOnGravityChangedListener);
findViewById(R.id.btnCGravityTop).setOnClickListener(mOnGravityChangedListener);
findViewById(R.id.btnCGravityRight).setOnClickListener(mOnGravityChangedListener);
findViewById(R.id.btnCGravityBottom).setOnClickListener(mOnGravityChangedListener);
findViewById(R.id.btnAlwaysBack).setOnClickListener(mOnReboundModeChangedListener);
findViewById(R.id.btnHalf).setOnClickListener(mOnReboundModeChangedListener);
btnOpened = (Button) findViewById(R.id.btnOpened);
btnClosed = (Button) findViewById(R.id.btnClosed);
}
Aggregations