diff options
author | Marvin Borner | 2018-07-24 20:28:47 +0200 |
---|---|---|
committer | Marvin Borner | 2018-07-24 20:28:47 +0200 |
commit | 4ada3652d88e7a97680759c44ee7b39953a867a7 (patch) | |
tree | 44d003d19e5e9f38d7a5ae9c25fb808c83109729 /app/src/main/res | |
parent | 43fb95de3fb3e825a6cbf0de68bd965556b73a75 (diff) |
Added transitions and fixed some design issues
Diffstat (limited to 'app/src/main/res')
-rw-r--r-- | app/src/main/res/layout/activity_main.xml | 43 | ||||
-rw-r--r-- | app/src/main/res/layout/content_main.xml | 11 | ||||
-rw-r--r-- | app/src/main/res/layout/fragment_main.xml | 23 | ||||
-rw-r--r-- | app/src/main/res/menu/menu_main.xml | 8 | ||||
-rw-r--r-- | app/src/main/res/values-w820dp/dimens.xml | 6 | ||||
-rw-r--r-- | app/src/main/res/values/dimens.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 7 | ||||
-rw-r--r-- | app/src/main/res/values/styles.xml | 2 |
8 files changed, 85 insertions, 16 deletions
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index eed4d89..2bd5037 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -2,31 +2,68 @@ <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/main_content" android:layout_width="match_parent" android:layout_height="match_parent" + android:fitsSystemWindows="true" tools:context=".MainActivity"> <android.support.design.widget.AppBarLayout + android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="wrap_content" + android:paddingTop="@dimen/appbar_padding_top" android:theme="@style/AppTheme.AppBarOverlay"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" + android:layout_weight="1" android:background="?attr/colorPrimary" - app:popupTheme="@style/AppTheme.PopupOverlay" /> + app:layout_scrollFlags="scroll|enterAlways" + app:popupTheme="@style/AppTheme.PopupOverlay" + app:title="@string/app_name"> + </android.support.v7.widget.Toolbar> + + <android.support.design.widget.TabLayout + android:id="@+id/tabs" + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <android.support.design.widget.TabItem + android:id="@+id/tabItem" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/tab_text_1" /> + + <android.support.design.widget.TabItem + android:id="@+id/tabItem2" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/tab_text_2" /> + + <android.support.design.widget.TabItem + android:id="@+id/tabItem3" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/tab_text_3" /> + + </android.support.design.widget.TabLayout> </android.support.design.widget.AppBarLayout> - <include layout="@layout/content_main" /> + <android.support.v4.view.ViewPager + android:id="@+id/container" + android:layout_width="match_parent" + android:layout_height="match_parent" + app:layout_behavior="@string/appbar_scrolling_view_behavior" /> <android.support.design.widget.FloatingActionButton android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="bottom|end" + android:layout_gravity="end|bottom" android:layout_margin="@dimen/fab_margin" app:srcCompat="@android:drawable/ic_dialog_email" /> diff --git a/app/src/main/res/layout/content_main.xml b/app/src/main/res/layout/content_main.xml deleted file mode 100644 index c649451..0000000 --- a/app/src/main/res/layout/content_main.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="match_parent" - app:layout_behavior="@string/appbar_scrolling_view_behavior" - tools:context=".MainActivity" - tools:showIn="@layout/activity_main"> - -</android.support.constraint.ConstraintLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/fragment_main.xml b/app/src/main/res/layout/fragment_main.xml new file mode 100644 index 0000000..108217e --- /dev/null +++ b/app/src/main/res/layout/fragment_main.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/constraintLayout" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".MainActivity$PlaceholderFragment"> + + <TextView + android:id="@+id/section_label" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/activity_vertical_margin" + android:layout_marginEnd="@dimen/activity_horizontal_margin" + android:layout_marginStart="@dimen/activity_horizontal_margin" + android:layout_marginTop="@dimen/activity_vertical_margin" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintTop_toTopOf="@+id/constraintLayout" + tools:layout_constraintLeft_creator="1" + tools:layout_constraintTop_creator="1" /> + +</android.support.constraint.ConstraintLayout>
\ No newline at end of file diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml new file mode 100644 index 0000000..cefca9d --- /dev/null +++ b/app/src/main/res/menu/menu_main.xml @@ -0,0 +1,8 @@ +<menu xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + tools:context="com.beam_messenger.beam_messenger.MainActivity"> + <item + android:id="@+id/action_settings" + android:orderInCategory="100" + android:title="@string/action_settings" /> +</menu> diff --git a/app/src/main/res/values-w820dp/dimens.xml b/app/src/main/res/values-w820dp/dimens.xml new file mode 100644 index 0000000..63fc816 --- /dev/null +++ b/app/src/main/res/values-w820dp/dimens.xml @@ -0,0 +1,6 @@ +<resources> + <!-- Example customization of dimensions originally defined in res/values/dimens.xml + (such as screen margins) for screens with more than 820dp of available width. This + would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). --> + <dimen name="activity_horizontal_margin">64dp</dimen> +</resources> diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 812cb7b..cef3abc 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -3,4 +3,5 @@ <dimen name="activity_horizontal_margin">16dp</dimen> <dimen name="activity_vertical_margin">16dp</dimen> <dimen name="fab_margin">16dp</dimen> + <dimen name="appbar_padding_top">8dp</dimen> </resources> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6576e72..e4c7ea7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,5 +1,11 @@ <resources> <string name="app_name">BEAM-Messenger</string> + <string name="tab_text_1">Chats</string> + <string name="tab_text_2">Posts</string> + <string name="tab_text_3">Contacts</string> + <string name="action_settings">Sign in</string> + <string name="section_format">This is tab: %1$d</string> + <string name="title_activity_login">Sign in</string> <!-- Strings related to login --> <string name="prompt_email">Email</string> @@ -11,5 +17,4 @@ <string name="error_incorrect_password">This password is incorrect</string> <string name="error_field_required">This field is required</string> <string name="permission_rationale">"Contacts permissions are needed for providing email completions."</string> - <string name="title_activity_main">Home</string> </resources> diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index d4ea9ae..545b9c6 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -1,7 +1,7 @@ <resources> <!-- Base application theme. --> - <style name="AppTheme" parent="Theme.AppCompat"> + <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> |