diff options
author | Andrew Dolgov <[email protected]> | 2014-10-15 23:07:52 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2014-10-15 23:07:52 +0400 |
commit | a88c49c633c4fd81ba0d31182944f3145efaa99a (patch) | |
tree | d10c97b723df360cf1e2df9f202f0c528d3f2094 /src/org | |
parent | 34f23b9901c8a0e77e5147286035eac45e51fd10 (diff) |
statusbartint stuff
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/fox/ttrss/CommonActivity.java | 18 | ||||
-rw-r--r-- | src/org/fox/ttrss/FeedsActivity.java | 9 | ||||
-rw-r--r-- | src/org/fox/ttrss/HeadlinesActivity.java | 1 | ||||
-rw-r--r-- | src/org/fox/ttrss/OnlineActivity.java | 2 | ||||
-rw-r--r-- | src/org/fox/ttrss/offline/OfflineFeedsActivity.java | 4 | ||||
-rw-r--r-- | src/org/fox/ttrss/offline/OfflineHeadlinesActivity.java | 1 |
6 files changed, 33 insertions, 2 deletions
diff --git a/src/org/fox/ttrss/CommonActivity.java b/src/org/fox/ttrss/CommonActivity.java index cff87129..f853d9b9 100644 --- a/src/org/fox/ttrss/CommonActivity.java +++ b/src/org/fox/ttrss/CommonActivity.java @@ -2,6 +2,8 @@ package org.fox.ttrss; import org.fox.ttrss.util.DatabaseHelper; +import com.readystatesoftware.systembartint.SystemBarTintManager; + import android.annotation.SuppressLint; import android.content.SharedPreferences; import android.database.sqlite.SQLiteDatabase; @@ -11,6 +13,7 @@ import android.preference.PreferenceManager; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.app.ActionBarActivity; import android.util.Log; +import android.util.TypedValue; import android.view.Display; import android.view.View; import android.widget.TextView; @@ -132,6 +135,21 @@ public class CommonActivity extends ActionBarActivity { super.onCreate(savedInstanceState); } + + public void setStatusBarTint() { + if (android.os.Build.VERSION.SDK_INT == android.os.Build.VERSION_CODES.KITKAT) { + SystemBarTintManager tintManager = new SystemBarTintManager(this); + // enable status bar tint + tintManager.setStatusBarTintEnabled(true); + // enable navigation bar tint + tintManager.setNavigationBarTintEnabled(true); + + TypedValue tv = new TypedValue(); + getTheme().resolveAttribute(R.attr.statusBarHintColor, tv, true); + + tintManager.setStatusBarTintColor(tv.data); + } + } @Override public void onSaveInstanceState(Bundle out) { diff --git a/src/org/fox/ttrss/FeedsActivity.java b/src/org/fox/ttrss/FeedsActivity.java index 0262c6be..90e2c118 100644 --- a/src/org/fox/ttrss/FeedsActivity.java +++ b/src/org/fox/ttrss/FeedsActivity.java @@ -20,11 +20,15 @@ import android.preference.PreferenceManager; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; import android.util.Log; +import android.util.TypedValue; import android.view.MenuItem; +import android.view.Window; +import android.view.WindowManager; import android.widget.LinearLayout; import com.google.gson.JsonElement; import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu; +import com.readystatesoftware.systembartint.SystemBarTintManager; public class FeedsActivity extends OnlineActivity implements HeadlinesEventListener { private final String TAG = this.getClass().getSimpleName(); @@ -50,7 +54,10 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe super.onCreate(savedInstanceState); - setContentView(R.layout.headlines); + setContentView(R.layout.headlines); + + setStatusBarTint(); + setSmallScreen(findViewById(R.id.sw600dp_anchor) == null && findViewById(R.id.sw600dp_port_anchor) == null); diff --git a/src/org/fox/ttrss/HeadlinesActivity.java b/src/org/fox/ttrss/HeadlinesActivity.java index 4eead0ec..c4e0f0cc 100644 --- a/src/org/fox/ttrss/HeadlinesActivity.java +++ b/src/org/fox/ttrss/HeadlinesActivity.java @@ -34,6 +34,7 @@ public class HeadlinesActivity extends OnlineActivity implements HeadlinesEventL getSupportActionBar().setDisplayHomeAsUpEnabled(true); + setStatusBarTint(); setSmallScreen(findViewById(R.id.sw600dp_anchor) == null); GlobalState.getInstance().load(savedInstanceState); diff --git a/src/org/fox/ttrss/OnlineActivity.java b/src/org/fox/ttrss/OnlineActivity.java index 02d00d1f..ab7a6ab1 100644 --- a/src/org/fox/ttrss/OnlineActivity.java +++ b/src/org/fox/ttrss/OnlineActivity.java @@ -170,6 +170,8 @@ public class OnlineActivity extends CommonActivity { Log.d(TAG, "m_isOffline=" + isOffline); setContentView(R.layout.login); + + setStatusBarTint(); //m_pullToRefreshAttacher = PullToRefreshAttacher.get(this); diff --git a/src/org/fox/ttrss/offline/OfflineFeedsActivity.java b/src/org/fox/ttrss/offline/OfflineFeedsActivity.java index c8a9cfc1..f7263fe0 100644 --- a/src/org/fox/ttrss/offline/OfflineFeedsActivity.java +++ b/src/org/fox/ttrss/offline/OfflineFeedsActivity.java @@ -39,7 +39,9 @@ public class OfflineFeedsActivity extends OfflineActivity implements OfflineHead super.onCreate(savedInstanceState); - setContentView(R.layout.headlines); + setContentView(R.layout.headlines); + + setStatusBarTint(); setSmallScreen(findViewById(R.id.sw600dp_anchor) == null && findViewById(R.id.sw600dp_port_anchor) == null); diff --git a/src/org/fox/ttrss/offline/OfflineHeadlinesActivity.java b/src/org/fox/ttrss/offline/OfflineHeadlinesActivity.java index 128a5919..de57c985 100644 --- a/src/org/fox/ttrss/offline/OfflineHeadlinesActivity.java +++ b/src/org/fox/ttrss/offline/OfflineHeadlinesActivity.java @@ -36,6 +36,7 @@ public class OfflineHeadlinesActivity extends OfflineActivity implements Offline getSupportActionBar().setDisplayHomeAsUpEnabled(true); + setStatusBarTint(); setSmallScreen(findViewById(R.id.sw600dp_anchor) == null); if (isPortrait() || m_prefs.getBoolean("headlines_hide_sidebar", false)) { |