ArticleListActivity: close drawer on back instead of quitting the activity
authorDa Risk <da_risk@geekorum.com>
Fri, 07 Dec 2018 16:52:21 -0800
changeset 31 c048fd6ba8fa
parent 30 b582497babb0
child 32 140ab24f166b
ArticleListActivity: close drawer on back instead of quitting the activity
app/src/main/java/com/geekorum/ttrss/articles_list/ArticleCardsList.kt
app/src/main/java/com/geekorum/ttrss/articles_list/ArticleListActivity.kt
app/src/main/res/drawable/ic_search_24dp.xml
--- a/app/src/main/java/com/geekorum/ttrss/articles_list/ArticleCardsList.kt	Fri Dec 07 16:51:57 2018 -0800
+++ b/app/src/main/java/com/geekorum/ttrss/articles_list/ArticleCardsList.kt	Fri Dec 07 16:52:21 2018 -0800
@@ -1,3 +1,23 @@
+/**
+ * Geekttrss is a RSS feed reader application on the Android Platform.
+ *
+ * Copyright (C) 2017-2018 by Frederic-Charles Barthelery.
+ *
+ * This file is part of Geekttrss.
+ *
+ * Geekttrss is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Geekttrss is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Geekttrss.  If not, see <http://www.gnu.org/licenses/>.
+ */
 package com.geekorum.ttrss.articles_list
 
 import android.content.Context
--- a/app/src/main/java/com/geekorum/ttrss/articles_list/ArticleListActivity.kt	Fri Dec 07 16:51:57 2018 -0800
+++ b/app/src/main/java/com/geekorum/ttrss/articles_list/ArticleListActivity.kt	Fri Dec 07 16:52:21 2018 -0800
@@ -281,4 +281,11 @@
         supportFragmentManager.popBackStack(FRAGMENT_BACKSTACK_SEARCH, POP_BACK_STACK_INCLUSIVE)
     }
 
+    override fun onBackPressed() {
+        if (drawerLayout?.isDrawerOpen(GravityCompat.START) == true) {
+            drawerLayout?.closeDrawers()
+        } else {
+            super.onBackPressed()
+        }
+    }
 }
--- a/app/src/main/res/drawable/ic_search_24dp.xml	Fri Dec 07 16:51:57 2018 -0800
+++ b/app/src/main/res/drawable/ic_search_24dp.xml	Fri Dec 07 16:52:21 2018 -0800
@@ -1,3 +1,25 @@
+<!--
+
+    Geekttrss is a RSS feed reader application on the Android Platform.
+
+    Copyright (C) 2017-2018 by Frederic-Charles Barthelery.
+
+    This file is part of Geekttrss.
+
+    Geekttrss is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    Geekttrss is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Geekttrss.  If not, see <http://www.gnu.org/licenses/>.
+
+-->
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
         android:width="24dp"
         android:height="24dp"