Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActionBarActivity is deprecated on SDK version 26 #47

Open
Dn-a opened this issue Dec 29, 2017 · 4 comments
Open

ActionBarActivity is deprecated on SDK version 26 #47

Dn-a opened this issue Dec 29, 2017 · 4 comments

Comments

@Dn-a
Copy link

Dn-a commented Dec 29, 2017

The ActionBarActivity, extended into SwipeBackActivity, is deprecated on SDK versione 26.
Not compile
it must be replaced with AppCompatActivity

@MadAxon
Copy link

MadAxon commented Jan 9, 2018

#42

@mohamedebrahim96
Copy link

ActionBarActivity is deprecated on SDK version 26

soo...
what is the solve ?

@mohamedebrahim96
Copy link

how can I solve it?

@phatnhse
Copy link

phatnhse commented Jun 19, 2018

You can customize SwipeBackActivity by extending AppcompatActivity and implementing SwipebackListener

public class SwipeDownActivity extends AppCompatActivity implements SwipeBackLayout.SwipeBackListener {
    private SwipeBackLayout swipeBackLayout;
    private ImageView ivShadow;

    @Override
    public void setContentView(int layoutResID) {
        super.setContentView(getContainer());
        View view = LayoutInflater.from(this).inflate(layoutResID, null);
        swipeBackLayout.addView(view);
    }

    private View getContainer() {
        RelativeLayout container = new RelativeLayout(this);
        swipeBackLayout = new SwipeBackLayout(this);
        swipeBackLayout.setOnSwipeBackListener(this);
        ivShadow = new ImageView(this);
        ivShadow.setBackgroundColor(getResources().getColor(com.liuguangqiang.swipeback.R.color.black_p50));
        RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
        container.addView(ivShadow, params);
        container.addView(swipeBackLayout);
        return container;
    }

    public void setDragEdge(SwipeBackLayout.DragEdge dragEdge) {
        swipeBackLayout.setDragEdge(dragEdge);
    }

    public SwipeBackLayout getSwipeBackLayout() {
        return swipeBackLayout;
    }

    @Override
    public void onViewPositionChanged(float fractionAnchor, float fractionScreen) {
        ivShadow.setAlpha(1 - fractionScreen);
    }
}

Edited: When you take a look at the source code, the new code has been added. (Maybe the documentation not updated yet)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants