Skip to content

Commit

Permalink
Merge pull request #9 from MohamedWael/develop
Browse files Browse the repository at this point in the history
fix: add back arrow to toolbar
  • Loading branch information
MohamedWael authored Nov 10, 2019
2 parents c72a67e + be36443 commit 5bc7c73
Showing 1 changed file with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.widget.FrameLayout;

import androidx.annotation.ColorRes;
import androidx.annotation.DrawableRes;
import androidx.annotation.LayoutRes;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.core.content.ContextCompat;
import androidx.appcompat.widget.Toolbar;
import android.view.View;
import android.widget.FrameLayout;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;

import com.blogspot.mowael.baselibrary.R;
import com.blogspot.mowael.baselibrary.widgets.InnerNotificationView;
Expand Down Expand Up @@ -54,9 +55,16 @@ public void setContentView(View view) {
* add back arrow to toolbar
*/
public void enableBackButton() {
enableBackButton(true);
}

/**
* add back arrow to toolbar
*/
public void enableBackButton(boolean enable) {
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(enable);
getSupportActionBar().setDisplayShowHomeEnabled(enable);
}
}

Expand Down

0 comments on commit 5bc7c73

Please sign in to comment.