Search in sources :

Example 1 with SwipeBackLayout

use of me.imid.swipebacklayout.lib.SwipeBackLayout in project SimpleNews by liuling07.

the class SwipeBackActivityHelper method onActivityCreate.

@SuppressWarnings("deprecation")
public void onActivityCreate() {
    mActivity.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    mActivity.getWindow().getDecorView().setBackgroundDrawable(null);
    mSwipeBackLayout = (SwipeBackLayout) LayoutInflater.from(mActivity).inflate(me.imid.swipebacklayout.lib.R.layout.swipeback_layout, null);
    mSwipeBackLayout.addSwipeListener(new SwipeBackLayout.SwipeListener() {

        @Override
        public void onScrollStateChange(int state, float scrollPercent) {
        }

        @Override
        public void onEdgeTouch(int edgeFlag) {
            Utils.convertActivityToTranslucent(mActivity);
        }

        @Override
        public void onScrollOverThreshold() {
        }
    });
}
Also used : SwipeBackLayout(me.imid.swipebacklayout.lib.SwipeBackLayout) ColorDrawable(android.graphics.drawable.ColorDrawable)

Example 2 with SwipeBackLayout

use of me.imid.swipebacklayout.lib.SwipeBackLayout in project SwipeBackLayout by ikew0ng.

the class SwipeBackActivityHelper method onActivityCreate.

@SuppressWarnings("deprecation")
public void onActivityCreate() {
    mActivity.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    mActivity.getWindow().getDecorView().setBackgroundDrawable(null);
    mSwipeBackLayout = (SwipeBackLayout) LayoutInflater.from(mActivity).inflate(me.imid.swipebacklayout.lib.R.layout.swipeback_layout, null);
    mSwipeBackLayout.addSwipeListener(new SwipeBackLayout.SwipeListener() {

        @Override
        public void onScrollStateChange(int state, float scrollPercent) {
        }

        @Override
        public void onEdgeTouch(int edgeFlag) {
            Utils.convertActivityToTranslucent(mActivity);
        }

        @Override
        public void onScrollOverThreshold() {
        }
    });
}
Also used : SwipeBackLayout(me.imid.swipebacklayout.lib.SwipeBackLayout) ColorDrawable(android.graphics.drawable.ColorDrawable)

Aggregations

ColorDrawable (android.graphics.drawable.ColorDrawable)2 SwipeBackLayout (me.imid.swipebacklayout.lib.SwipeBackLayout)2