Started working on night mode

This commit is contained in:
Michael Schättgen 2016-08-22 00:48:02 +02:00
parent 847d8acdd4
commit 27c70aea27
5 changed files with 21 additions and 3 deletions

View file

@ -11,6 +11,7 @@ import android.support.design.widget.FloatingActionButton;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.app.AppCompatDelegate;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
@ -50,6 +51,7 @@ public class MainActivity extends AppCompatActivity {
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {

View file

@ -32,6 +32,7 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="me.impy.aegis.MainActivity"
tools:showIn="@layout/activity_main">

View file

@ -42,6 +42,7 @@
android:layout_height="wrap_content"
android:id="@+id/profile_name"
android:text="Post title"
android:textColor="@color/secondary_text"
android:textSize="20sp"
android:layout_below="@+id/profile_code"
android:layout_alignLeft="@+id/profile_code"
@ -56,7 +57,7 @@
android:text="Medium Text"
android:id="@+id/profile_code"
android:textSize="36sp"
android:textColor="?android:attr/textColorPrimary"
android:textColor="@color/primary_text"
android:layout_marginLeft="6dp"
android:layout_marginStart="6dp"
android:layout_alignParentTop="true"

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#03A9F4</color>
<color name="colorPrimaryDark">#0288D1</color>
<color name="colorHeaderSuccess">#12b600</color>
<color name="colorPrimaryLight">#B3E5FC</color>
<color name="colorAccent">#49ca8a</color>
<color name="primary_text">#ffffff</color>
<color name="secondary_text">#49ca8a</color>
<color name="icons">#FFFFFF</color>
<color name="divider">#BDBDBD</color>
<color name="background">#191919</color>
</resources>

View file

@ -4,9 +4,10 @@
<color name="colorPrimaryDark">#0288D1</color>
<color name="colorHeaderSuccess">#12b600</color>
<color name="colorPrimaryLight">#B3E5FC</color>
<color name="colorAccent">#FF5252</color>
<color name="colorAccent">#49ca8a</color>
<color name="primary_text">#212121</color>
<color name="secondary_text">#757575</color>
<color name="secondary_text">#49ca8a</color>
<color name="icons">#FFFFFF</color>
<color name="divider">#BDBDBD</color>
<color name="background">#ffffff</color>
</resources>