mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-04-14 19:56:32 +00:00
Close drawer on back button pressed.
This commit is contained in:
parent
b7b659a19e
commit
213a00a74a
2 changed files with 8 additions and 1 deletions
|
|
@ -29,6 +29,10 @@
|
|||
{
|
||||
"type": "F",
|
||||
"title": "Quest-Text can now display the HTML correctly"
|
||||
},
|
||||
{
|
||||
"type": "N",
|
||||
"title": "Task filter drawer now closes when back button is pressed"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import android.support.v7.app.ActionBar;
|
|||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.Menu;
|
||||
import android.view.View;
|
||||
|
|
@ -449,6 +450,8 @@ public class MainActivity extends AppCompatActivity implements HabitRPGUserCallb
|
|||
public void onBackPressed() {
|
||||
if (drawer.isDrawerOpen()) {
|
||||
drawer.closeDrawer();
|
||||
} else if (drawer.getDrawerLayout().isDrawerOpen(Gravity.RIGHT)) {
|
||||
drawer.getDrawerLayout().closeDrawer(Gravity.RIGHT);
|
||||
} else {
|
||||
super.onBackPressed();
|
||||
}
|
||||
|
|
@ -570,7 +573,7 @@ public class MainActivity extends AppCompatActivity implements HabitRPGUserCallb
|
|||
}
|
||||
|
||||
|
||||
public void onEvent(final DeleteTaskCommand cmd){
|
||||
public void onEvent(final DeleteTaskCommand cmd) {
|
||||
mAPIHelper.apiService.deleteTask(cmd.TaskIdToDelete, new Callback<Void>() {
|
||||
@Override
|
||||
public void success(Void aVoid, Response response) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue