aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/src/main
diff options
context:
space:
mode:
authorMarvin Borner2018-07-25 19:29:54 +0200
committerMarvin Borner2018-07-25 19:29:54 +0200
commit69ebd3e2ad575f01a88ef946cb10f2b64c6115b4 (patch)
treec9bad626df212d6e0f6b9000b5558f11215b32ff /app/src/main
parent1ae5b9e0c7aa95adf8d99ab7151888fc2b18c825 (diff)
Modernized design
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/AndroidManifest.xml3
-rw-r--r--app/src/main/java/com/beam_messenger/beam_messenger/LoginActivity.kt10
-rw-r--r--app/src/main/java/com/beam_messenger/beam_messenger/MainActivity.kt16
-rw-r--r--app/src/main/res/layout/activity_main.xml8
-rw-r--r--app/src/main/res/values/colors.xml4
-rw-r--r--app/src/main/res/values/styles.xml16
6 files changed, 32 insertions, 25 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 114c168..37391b2 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -26,7 +26,8 @@
</activity>
<activity
android:name=".LoginActivity"
- android:label="@string/title_activity_login"></activity>
+ android:label="@string/title_activity_login"
+ android:theme="@style/AppTheme"></activity>
</application>
</manifest> \ No newline at end of file
diff --git a/app/src/main/java/com/beam_messenger/beam_messenger/LoginActivity.kt b/app/src/main/java/com/beam_messenger/beam_messenger/LoginActivity.kt
index 02d1d6f..4572134 100644
--- a/app/src/main/java/com/beam_messenger/beam_messenger/LoginActivity.kt
+++ b/app/src/main/java/com/beam_messenger/beam_messenger/LoginActivity.kt
@@ -4,7 +4,6 @@ import android.Manifest.permission.READ_CONTACTS
import android.animation.Animator
import android.animation.AnimatorListenerAdapter
import android.annotation.TargetApi
-import android.app.ActivityOptions
import android.app.LoaderManager.LoaderCallbacks
import android.content.CursorLoader
import android.content.Intent
@@ -19,10 +18,8 @@ import android.provider.ContactsContract
import android.support.design.widget.Snackbar
import android.support.v7.app.AppCompatActivity
import android.text.TextUtils
-import android.transition.Explode
import android.view.Gravity
import android.view.View
-import android.view.Window
import android.view.inputmethod.EditorInfo
import android.widget.ArrayAdapter
import android.widget.TextView
@@ -40,11 +37,6 @@ class LoginActivity : AppCompatActivity(), LoaderCallbacks<Cursor> {
private var mAuthTask: UserLoginTask? = null
override fun onCreate(savedInstanceState: Bundle?) {
- with(window) {
- requestFeature(Window.FEATURE_CONTENT_TRANSITIONS)
- exitTransition = Explode()
- }
-
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_login)
// Set up the login form.
@@ -279,7 +271,7 @@ class LoginActivity : AppCompatActivity(), LoaderCallbacks<Cursor> {
val intent = Intent(this@LoginActivity, MainActivity::class.java)
//intent.putExtra("keyIdentifier", value)
- startActivity(intent, ActivityOptions.makeSceneTransitionAnimation(this@LoginActivity).toBundle())
+ startActivity(intent)
} else {
password.error = getString(R.string.error_incorrect_password)
password.requestFocus()
diff --git a/app/src/main/java/com/beam_messenger/beam_messenger/MainActivity.kt b/app/src/main/java/com/beam_messenger/beam_messenger/MainActivity.kt
index 1686589..e759854 100644
--- a/app/src/main/java/com/beam_messenger/beam_messenger/MainActivity.kt
+++ b/app/src/main/java/com/beam_messenger/beam_messenger/MainActivity.kt
@@ -1,15 +1,12 @@
package com.beam_messenger.beam_messenger
-import android.app.ActivityOptions
import android.content.Intent
import android.os.Bundle
-import android.support.design.widget.Snackbar
import android.support.design.widget.TabLayout
import android.support.v4.app.Fragment
import android.support.v4.app.FragmentManager
import android.support.v4.app.FragmentPagerAdapter
import android.support.v7.app.AppCompatActivity
-import android.transition.Fade
import android.view.*
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.fragment_main.view.*
@@ -27,11 +24,6 @@ class MainActivity : AppCompatActivity() {
private var mSectionsPagerAdapter: SectionsPagerAdapter? = null
override fun onCreate(savedInstanceState: Bundle?) {
- with(window) {
- requestFeature(Window.FEATURE_CONTENT_TRANSITIONS)
- exitTransition = Fade()
- }
-
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
@@ -47,8 +39,10 @@ class MainActivity : AppCompatActivity() {
tabs.addOnTabSelectedListener(TabLayout.ViewPagerOnTabSelectedListener(container))
fab.setOnClickListener { view ->
- Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
- .setAction("Action", null).show()
+ val intent = Intent(this@MainActivity, LoginActivity::class.java)
+ startActivity(intent)
+ /*Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
+ .setAction("Action", null).show()*/
}
}
@@ -67,7 +61,7 @@ class MainActivity : AppCompatActivity() {
if (id == R.id.action_settings) {
val intent = Intent(this@MainActivity, LoginActivity::class.java)
- startActivity(intent, ActivityOptions.makeSceneTransitionAnimation(this).toBundle())
+ startActivity(intent)
}
return super.onOptionsItemSelected(item)
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 2bd5037..0e2a766 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -23,6 +23,7 @@
android:background="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/AppTheme.PopupOverlay"
+ app:theme="@style/ActionBarThemeOverlay"
app:title="@string/app_name">
</android.support.v7.widget.Toolbar>
@@ -30,7 +31,10 @@
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
- android:layout_height="wrap_content">
+ android:layout_height="wrap_content"
+ app:tabMode="fixed"
+ app:tabSelectedTextColor="@color/tabSelectedTextColor"
+ app:tabTextColor="@color/tabTextColor">
<android.support.design.widget.TabItem
android:id="@+id/tabItem"
@@ -65,6 +69,6 @@
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="@dimen/fab_margin"
- app:srcCompat="@android:drawable/ic_dialog_email" />
+ app:srcCompat="@android:drawable/ic_secure" />
</android.support.design.widget.CoordinatorLayout> \ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index 58e3556..6af5057 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <color name="colorPrimary">#3F51B5</color>
+ <color name="colorPrimary">#fffafafa</color>
<color name="colorPrimaryDark">#283593</color>
<color name="colorAccent">#E91E63</color>
+ <color name="tabTextColor">#6c6c6c</color>
+ <color name="tabSelectedTextColor">#000</color>
</resources>
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 545b9c6..0153ca7 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -1,11 +1,15 @@
<resources>
<!-- Base application theme. -->
- <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
+ <style name="AppTheme" parent="Theme.AppCompat.Light">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
+ <item name="tabTextColor">@color/tabTextColor</item>
+ <item name="android:colorControlNormal">@color/tabTextColor</item>
+ <item name="android:windowAnimationStyle">@style/AppTheme.WindowTransition</item>
+ <item name="android:toolbarStyle">@color/tabTextColor</item>
</style>
<style name="AppTheme.NoActionBar">
@@ -13,6 +17,16 @@
<item name="windowNoTitle">true</item>
</style>
+ <style name="ActionBarThemeOverlay">
+ <item name="android:textColorPrimary">@color/tabSelectedTextColor</item>
+ </style>
+
+ <!-- Setting window animation -->
+ <style name="AppTheme.WindowTransition">
+ <item name="android:windowEnterAnimation">@android:anim/fade_in</item>
+ <item name="android:windowExitAnimation">@android:anim/fade_out</item>
+ </style>
+
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />