文件名称:Android滑动监听组件SwipeBackLayout.zip
文件大小:1.04MB
文件格式:ZIP
更新时间:2022-08-07 21:48:18
开源项目
SwipeBackLayout 是一个支持屏幕上下左右滑动返回上层 Activity, 关闭当前 Activity, 类似简书 App。效果图:示例代码:public class DemoActivity extends SwipeBackActivity implements View.OnClickListener { private int[] mBgColors; private static int mBgIndex = 0; private String mKeyTrackingMode; private RadioGroup mTrackingModeGroup; private SwipeBackLayout mSwipeBackLayout; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_demo); changeActionBarColor(); findViews(); mKeyTrackingMode = getString(R.string.key_tracking_mode); mSwipeBackLayout = getSwipeBackLayout(); mTrackingModeGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { @Override public void onCheckedChanged(RadioGroup group, int checkedId) { int edgeFlag; switch (checkedId) { case R.id.mode_left: edgeFlag = SwipeBackLayout.EDGE_LEFT; break; case R.id.mode_right: edgeFlag = SwipeBackLayout.EDGE_RIGHT; break; case R.id.mode_bottom: edgeFlag = SwipeBackLayout.EDGE_BOTTOM; break; default: edgeFlag = SwipeBackLayout.EDGE_ALL; } mSwipeBackLayout.setEdgeTrackingEnabled(edgeFlag); saveTrackingMode(edgeFlag); } }); }
【文件预览】:
SwipeBackLayout-master
----gradlew(5KB)
----settings.gradle(31B)
----art()
--------support.jpeg(67KB)
--------ic_web.png(18KB)
--------screenshot.png(355KB)
----library()
--------src()
--------libs()
--------build.gradle(2KB)
----LICENSE(10KB)
----gradle()
--------wrapper()
----samples()
--------src()
--------libs()
--------build.gradle(943B)
----README.md(3KB)
----gradlew.bat(2KB)
----.gitignore(335B)
----build.gradle(361B)