Transparent status bar

This commit is contained in:
Tanguy Herbron 2018-04-26 12:33:36 +02:00
parent edbb27dd37
commit a082bb3d99
8 changed files with 32 additions and 14 deletions

View File

@ -1,6 +1,7 @@
package com.nauk.moodl.Activities;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.AppBarLayout;
@ -9,6 +10,8 @@ import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.Window;
import android.view.WindowManager;
import com.nauk.moodl.PagerAdapter;
import com.nauk.moodl.R;
@ -54,6 +57,9 @@ public class HomeActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
/**Interface setup**/
Window w = getWindow();
w.addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
w.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
//Setup main interface
//requestWindowFeature(Window.FEATURE_NO_TITLE);

View File

@ -1,5 +1,7 @@
package com.nauk.moodl.DataManagers.CurrencyData;
import android.util.Log;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
@ -60,7 +62,15 @@ public class CurrencyTickerList {
JSONObject jsonObject = new JSONObject(coinTickersHashmap.get(symbol));
tickerId = jsonObject.getString("id");
} catch (JSONException | NullPointerException e) {
e.printStackTrace();
switch (e.getMessage())
{
case "Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference":
Log.d("moodl", "Symbol " + symbol + " not supported");
break;
default:
e.printStackTrace();
break;
}
}
return tickerId;

View File

@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:width="36dp"
android:height="36dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path

View File

@ -4,8 +4,8 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.nauk.moodl.Activities.HomeActivity"
android:fitsSystemWindows="true">
android:fitsSystemWindows="true"
tools:context="com.nauk.moodl.Activities.HomeActivity">
<LinearLayout
android:id="@+id/masterLayout"

View File

@ -3,18 +3,20 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:layout_marginBottom="56dp">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:theme="@style/AppTheme.AppBarOverlay"
android:background="@drawable/gradient_background_reverse">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:title="Test"
app:layout_collapseMode="pin">
<FrameLayout

View File

@ -12,16 +12,14 @@
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/app_bar_height"
android:fitsSystemWindows="true"
android:theme="@style/AppTheme.AppBarOverlay"
android:paddingTop="10dp"
android:background="@drawable/gradient_background">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="@drawable/gradient_background"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:toolbarId="@+id/toolbar"
app:collapsedTitleGravity="center"
@ -33,7 +31,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center|bottom"
android:layout_marginBottom="35dp"
android:layout_marginBottom="20dp"
android:gravity="center"
android:textSize="20sp"
app:layout_collapseMode="parallax"/>

View File

@ -3,11 +3,13 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:layout_marginBottom="56dp">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:background="@drawable/gradient_background_reverse">
<android.support.v7.widget.Toolbar
@ -75,7 +77,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="10dp">
android:paddingTop="20dp">
<ScrollView
android:layout_width="match_parent"

View File

@ -3,7 +3,7 @@
<dimen name="cardViewSecondaryText">12sp</dimen>
<dimen name="cardViewChartSize">150dp</dimen>
<dimen name="app_bar_height">180dp</dimen>
<dimen name="app_bar_height">150dp</dimen>
<dimen name="fab_margin">16dp</dimen>
<dimen name="text_margin">16dp</dimen>
<dimen name="mainText">6dp</dimen>