From 61ca865e18a70eedd30dfaca300915ba0dc6953b Mon Sep 17 00:00:00 2001 From: stom79 Date: Sat, 28 Oct 2017 10:38:37 +0200 Subject: [PATCH] Hides tool bar when scrolling on hashtag activity --- .../mastodon/activities/HashTagActivity.java | 8 +- app/src/main/res/layout/activity_hashtag.xml | 152 +++++++++++------- 2 files changed, 97 insertions(+), 63 deletions(-) diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/activities/HashTagActivity.java b/app/src/main/java/fr/gouv/etalab/mastodon/activities/HashTagActivity.java index 395217000..abf7ce41b 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/activities/HashTagActivity.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/activities/HashTagActivity.java @@ -23,6 +23,7 @@ import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; +import android.support.v7.widget.Toolbar; import android.view.MenuItem; import android.view.View; import android.widget.RelativeLayout; @@ -67,13 +68,14 @@ public class HashTagActivity extends AppCompatActivity implements OnRetrieveFeed SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE); int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK); if( theme == Helper.THEME_LIGHT){ - setTheme(R.style.AppTheme); + setTheme(R.style.AppTheme_NoActionBar); }else { - setTheme(R.style.AppThemeDark); + setTheme(R.style.AppThemeDark_NoActionBar); } setContentView(R.layout.activity_hashtag); - + Toolbar toolbar = findViewById(R.id.toolbar); + setSupportActionBar(toolbar); if( getSupportActionBar() != null) getSupportActionBar().setDisplayHomeAsUpEnabled(true); diff --git a/app/src/main/res/layout/activity_hashtag.xml b/app/src/main/res/layout/activity_hashtag.xml index 2c4cca427..066566551 100644 --- a/app/src/main/res/layout/activity_hashtag.xml +++ b/app/src/main/res/layout/activity_hashtag.xml @@ -15,68 +15,100 @@ You should have received a copy of the GNU General Public License along with Mastalab; if not, see . --> - - - - - - - - - - - + + - - - - - + + - - \ No newline at end of file + android:layout_height="wrap_content" + android:theme="@style/AppTheme.AppBarOverlay" + > + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file