Просмотр исходного кода

chore: Implement MotionLayout animation on drag up and down

beautusg 7 лет назад
Родитель
Сommit
249e67653c

+ 1 - 1
app/src/main/java/com/sduduzog/slimlauncher/ui/main/HomeAppsAdapter.kt

@@ -33,7 +33,7 @@ class HomeAppsAdapter(private var fragment: MainFragment)
 
     override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): HomeAppsAdapter.ViewHolder {
         val view = LayoutInflater.from(parent.context)
-                .inflate(R.layout.main_list_item, parent, false)
+                .inflate(R.layout.main_fragment_list_item, parent, false)
         return ViewHolder(view)
     }
 

+ 14 - 93
app/src/main/java/com/sduduzog/slimlauncher/ui/main/MainFragment.kt

@@ -1,25 +1,17 @@
 package com.sduduzog.slimlauncher.ui.main
 
 import android.content.*
-import android.net.Uri
 import android.os.Build
 import android.os.Bundle
 import android.provider.AlarmClock
 import android.provider.MediaStore
-import android.provider.Settings
 import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
-import android.widget.FrameLayout
 import androidx.core.app.ActivityOptionsCompat
-import androidx.navigation.Navigation
-import com.google.android.material.bottomsheet.BottomSheetBehavior
-import com.google.android.material.bottomsheet.BottomSheetBehavior.STATE_COLLAPSED
 import com.sduduzog.slimlauncher.MainActivity
 import com.sduduzog.slimlauncher.R
-import kotlinx.android.synthetic.main.main_bottom_sheet.*
-import kotlinx.android.synthetic.main.main_content.*
-import kotlinx.android.synthetic.main.main_fragment.*
+import kotlinx.android.synthetic.main.main_fragment2.*
 import java.text.SimpleDateFormat
 import java.util.*
 
@@ -27,31 +19,26 @@ import java.util.*
 class MainFragment : StatusBarThemeFragment(), MainActivity.OnBackPressedListener {
 
     private lateinit var receiver: BroadcastReceiver
-    private lateinit var sheetBehavior: BottomSheetBehavior<FrameLayout>
 
     override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
                               savedInstanceState: Bundle?): View {
-        return inflater.inflate(R.layout.main_fragment, container, false)
+        return inflater.inflate(R.layout.main_fragment2, container, false)
     }
 
     override fun onActivityCreated(savedInstanceState: Bundle?) {
         super.onActivityCreated(savedInstanceState)
-        mainAppsList.adapter = HomeAppsAdapter(this)
-        sheetBehavior = BottomSheetBehavior.from(bottomSheet)
-        optionsView.alpha = 0.0f
+        main_fragment_list.adapter = HomeAppsAdapter(this)
         setEventListeners()
-        setupBottomSheet()
     }
 
     override fun onStart() {
         super.onStart()
         receiver = ClockReceiver()
         activity?.registerReceiver(receiver, IntentFilter(Intent.ACTION_TIME_TICK))
-        sheetBehavior.state = STATE_COLLAPSED
     }
 
     override fun getFragmentView(): View {
-        return main
+        return main_fragment2
     }
 
     override fun onResume() {
@@ -79,7 +66,6 @@ class MainFragment : StatusBarThemeFragment(), MainActivity.OnBackPressedListene
     }
 
     override fun onBackPress() {
-        sheetBehavior.state = STATE_COLLAPSED
     }
 
     override fun onBackPressed() {
@@ -89,7 +75,7 @@ class MainFragment : StatusBarThemeFragment(), MainActivity.OnBackPressedListene
     private fun setEventListeners() {
 
 
-        clockTextView.setOnClickListener {
+        main_fragment_time.setOnClickListener {
             if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
                 try {
                     val intent = Intent(AlarmClock.ACTION_SHOW_ALARMS)
@@ -107,7 +93,7 @@ class MainFragment : StatusBarThemeFragment(), MainActivity.OnBackPressedListene
             }
         }
 
-        dateTextView.setOnClickListener {
+        main_fragment_date.setOnClickListener {
             try {
                 val intent = Intent(Intent.ACTION_MAIN)
                 intent.addCategory(Intent.CATEGORY_APP_CALENDAR)
@@ -123,7 +109,7 @@ class MainFragment : StatusBarThemeFragment(), MainActivity.OnBackPressedListene
             }
         }
 
-        ivCall.setOnClickListener {
+        main_fragment_call.setOnClickListener {
             try {
                 val intent = Intent(Intent.ACTION_DIAL)
                 val left = 0
@@ -136,22 +122,8 @@ class MainFragment : StatusBarThemeFragment(), MainActivity.OnBackPressedListene
                 // Do nothing
             }
         }
-        ivCall.setOnLongClickListener {
-            try {
-                val intent = Intent(Intent.ACTION_DIAL, null)
-                val left = 0
-                val top = 0
-                val width = it.measuredWidth
-                val height = it.measuredHeight
-                val opts = ActivityOptionsCompat.makeClipRevealAnimation(it, left, top, width, height)
-                startActivity(intent, opts.toBundle())
-            } catch (e: ActivityNotFoundException) {
-                // Do nothing
-            }
-            true
-        }
 
-        ivCamera.setOnClickListener {
+        main_fragment_camera.setOnClickListener {
             try {
                 val intent = Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA)
                 val left = 0
@@ -166,74 +138,23 @@ class MainFragment : StatusBarThemeFragment(), MainActivity.OnBackPressedListene
         }
     }
 
-    private fun setupBottomSheet() {
-        bottomSheet.setOnClickListener {
-            // Do nothing
-        }
-        sheetBehavior.setBottomSheetCallback(object : BottomSheetBehavior.BottomSheetCallback() {
-            override fun onSlide(p0: View, p1: Float) {
-                val multi = 3 * p1
-                optionsView.alpha = multi
-                optionsView.cardElevation = p1 * 8
-                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
-                    optionsView.elevation = p1 * 8
-                }
-            }
-
-            override fun onStateChanged(bottomSheet: View, newState: Int) {
-                iconTray.visibility = View.GONE
-                if (newState == STATE_COLLAPSED) {
-                    iconTray.visibility = View.VISIBLE
-                }
-            }
-        })
-        textView12.setOnClickListener(Navigation.createNavigateOnClickListener(R.id.action_mainFragment_to_notesListFragment))
-        settingsText.setOnClickListener(Navigation.createNavigateOnClickListener(R.id.action_mainFragment_to_settingsFragment))
-
-        rateAppText.setOnClickListener {
-            val uri = Uri.parse("market://details?id=" + context?.packageName)
-            val intent = Intent(Intent.ACTION_VIEW, uri)
-            intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY or
-                    Intent.FLAG_ACTIVITY_MULTIPLE_TASK)
-            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
-                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT)
-            }
-            try {
-                startActivity(intent)
-            } catch (e: ActivityNotFoundException) {
-                startActivity(Intent(Intent.ACTION_VIEW,
-                        Uri.parse("http://play.google.com/store/apps/details?id=" + context?.packageName)))
-            }
-        }
-        aboutText.setOnClickListener(Navigation.createNavigateOnClickListener(R.id.action_mainFragment_to_aboutFragment))
-
-        deviceSettingsText.setOnClickListener {
-            startActivity(Intent(Settings.ACTION_SETTINGS))
-        }
-        changeLauncherText.setOnClickListener {
-            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
-                startActivity(Intent(Settings.ACTION_HOME_SETTINGS))
-            }
-        }
-    }
-
     fun updateUi() {
         val twenty4Hour = context?.getSharedPreferences(getString(R.string.prefs_settings), Context.MODE_PRIVATE)
                 ?.getBoolean(getString(R.string.prefs_settings_key_clock_type), false)
         val date = Date()
         if (twenty4Hour as Boolean) {
             val fWatchTime = SimpleDateFormat("HH:mm", Locale.ENGLISH)
-            clockTextView.text = fWatchTime.format(date)
-            clockAmPm.visibility = View.GONE
+            main_fragment_time.text = fWatchTime.format(date)
+            main_fragment_time_format.visibility = View.GONE
         } else {
             val fWatchTime = SimpleDateFormat("hh:mm", Locale.ENGLISH)
             val fWatchTimeAP = SimpleDateFormat("aa", Locale.ENGLISH)
-            clockTextView.text = fWatchTime.format(date)
-            clockAmPm.text = fWatchTimeAP.format(date)
-            clockAmPm.visibility = View.VISIBLE
+            main_fragment_time.text = fWatchTime.format(date)
+            main_fragment_time_format.text = fWatchTimeAP.format(date)
+            main_fragment_time_format.visibility = View.VISIBLE
         }
         val fWatchDate = SimpleDateFormat("EEE, MMM dd", Locale.ENGLISH)
-        dateTextView.text = fWatchDate.format(date)
+        main_fragment_date.text = fWatchDate.format(date)
     }
 
 

+ 1 - 1
app/src/main/res/drawable/ic_call.xml

@@ -4,6 +4,6 @@
     android:viewportWidth="24.0"
     android:viewportHeight="24.0">
     <path
-        android:fillColor="@color/colorAccent"
+        android:fillColor="?attr/colorAccent"
         android:pathData="M6.62,10.79c1.44,2.83 3.76,5.14 6.59,6.59l2.2,-2.2c0.27,-0.27 0.67,-0.36 1.02,-0.24 1.12,0.37 2.33,0.57 3.57,0.57 0.55,0 1,0.45 1,1V20c0,0.55 -0.45,1 -1,1 -9.39,0 -17,-7.61 -17,-17 0,-0.55 0.45,-1 1,-1h3.5c0.55,0 1,0.45 1,1 0,1.25 0.2,2.45 0.57,3.57 0.11,0.35 0.03,0.74 -0.25,1.02l-2.2,2.2z" />
 </vector>

+ 1 - 1
app/src/main/res/drawable/ic_expand.xml

@@ -4,6 +4,6 @@
     android:viewportWidth="24.0"
     android:viewportHeight="24.0">
     <path
-        android:fillColor="@color/colorAccent"
+        android:fillColor="?attr/colorAccent"
         android:pathData="M12,8l-6,6 1.41,1.41L12,10.83l4.59,4.58L18,14z" />
 </vector>

+ 2 - 2
app/src/main/res/drawable/ic_photo_camera.xml

@@ -4,9 +4,9 @@
     android:viewportWidth="24.0"
     android:viewportHeight="24.0">
     <path
-        android:fillColor="@color/colorAccent"
+        android:fillColor="?attr/colorAccent"
         android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0" />
     <path
-        android:fillColor="@color/colorAccent"
+        android:fillColor="?attr/colorAccent"
         android:pathData="M9,2L7.17,4L4,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2L9,2zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z" />
 </vector>

+ 78 - 0
app/src/main/res/layout/main_fragment2.xml

@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.motion.widget.MotionLayout 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_fragment2"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    app:layoutDescription="@xml/main_motion_scene"
+    tools:showPaths="true">
+
+    <TextView
+        android:id="@+id/main_fragment_time"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="@dimen/_64sdp"
+        android:text="@string/main_placeholder_clock"
+        android:textAppearance="@style/TextAppearance.AppCompat"
+        android:textSize="@dimen/_40ssp" />
+
+    <TextView
+        android:id="@+id/main_fragment_time_format"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="@dimen/_16sdp"
+        android:textAppearance="@style/TextAppearance.AppCompat"
+        android:textSize="@dimen/_13sdp" />
+
+    <TextView
+        android:id="@+id/main_fragment_date"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:padding="@dimen/_4sdp"
+        android:text="@string/main_placeholder_date"
+        android:textAppearance="@style/TextAppearance.AppCompat"
+        android:textSize="@dimen/_12sdp" />
+
+    <androidx.recyclerview.widget.RecyclerView
+        android:id="@+id/main_fragment_list"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
+        tools:itemCount="1"
+        tools:listitem="@layout/main_fragment_list_item" />
+
+    <androidx.recyclerview.widget.RecyclerView
+        android:id="@+id/main_fragment_list_exp"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
+        tools:itemCount="3"
+        tools:listitem="@layout/main_fragment_list_item" />
+
+    <TextView
+        android:id="@+id/main_fragment_options"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:padding="@dimen/_8sdp"
+        android:text="@string/main_fragment_options"
+        android:textAppearance="@style/TextAppearance.AppCompat"
+        android:textSize="@dimen/_18ssp" />
+
+    <ImageView
+        android:id="@+id/main_fragment_call"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:padding="@dimen/_8sdp"
+        app:srcCompat="@drawable/ic_call"
+        tools:ignore="ContentDescription" />
+
+    <ImageView
+        android:id="@+id/main_fragment_camera"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:padding="@dimen/_8sdp"
+        app:srcCompat="@drawable/ic_photo_camera"
+        tools:ignore="ContentDescription" />
+
+</androidx.constraintlayout.motion.widget.MotionLayout>

+ 11 - 0
app/src/main/res/layout/main_fragment_list_item.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:id="@+id/main_label"
+    android:padding="12dp"
+    android:text="WhatsApp"
+    android:textSize="@dimen/_24ssp"
+    android:textAppearance="@style/TextAppearance.AppCompat">
+
+</TextView>

+ 109 - 0
app/src/main/res/layout/main_motion_end.xml

@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.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/linearLayout"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <TextView
+        android:id="@+id/main_fragment_time"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/main_placeholder_clock"
+        android:textSize="@dimen/_40ssp"
+        app:layout_constraintBottom_toTopOf="@+id/main_fragment_date"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintHorizontal_bias="0.5"
+        app:layout_constraintStart_toStartOf="parent" />
+
+    <TextView
+        android:id="@+id/main_fragment_time_format"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="16dp"
+        android:textSize="@dimen/_13sdp"
+        app:layout_constraintStart_toEndOf="@+id/main_fragment_time"
+        app:layout_constraintTop_toTopOf="@+id/main_fragment_time" />
+
+    <TextView
+        android:id="@+id/main_fragment_date"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:padding="4dp"
+        android:text="@string/main_placeholder_date"
+        android:textSize="@dimen/_12sdp"
+        app:layout_constraintBottom_toTopOf="parent"
+        app:layout_constraintEnd_toEndOf="@+id/main_fragment_time"
+        app:layout_constraintStart_toStartOf="@+id/main_fragment_time" />
+
+    <androidx.recyclerview.widget.RecyclerView
+        android:id="@+id/main_fragment_list"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="16dp"
+        android:layout_marginLeft="16dp"
+        android:layout_marginEnd="16dp"
+        android:layout_marginRight="16dp"
+        app:layout_constraintBottom_toTopOf="@+id/main_fragment_list_exp"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintHorizontal_bias="0.5"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/main_fragment_date"
+        app:layout_constraintVertical_chainStyle="packed"
+        tools:itemCount="5"
+        tools:listitem="@layout/main_fragment_list_item" />
+
+    <androidx.recyclerview.widget.RecyclerView
+        android:id="@+id/main_fragment_list_exp"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="16dp"
+        android:layout_marginLeft="16dp"
+        android:layout_marginEnd="16dp"
+        android:layout_marginRight="16dp"
+        android:layout_marginBottom="8dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintHorizontal_bias="0.5"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/main_fragment_list"
+        tools:itemCount="3"
+        tools:listitem="@layout/main_fragment_list_item" />
+
+    <TextView
+        android:id="@+id/main_fragment_options"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:padding="8dp"
+        android:text="@string/main_fragment_options"
+        android:textAppearance="@style/TextAppearance.AppCompat"
+        android:textSize="18sp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintStart_toStartOf="@+id/main_fragment_list_exp"
+        app:layout_constraintTop_toBottomOf="@+id/main_fragment_list_exp" />
+
+    <ImageView
+        android:id="@+id/main_fragment_call"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:padding="8dp"
+        app:layout_constraintEnd_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="parent"
+        app:srcCompat="@drawable/ic_call"
+        tools:ignore="ContentDescription" />
+
+    <ImageView
+        android:id="@+id/main_fragment_camera"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginBottom="8dp"
+        android:padding="8dp"
+        app:layout_constraintStart_toEndOf="parent"
+        app:layout_constraintTop_toBottomOf="parent"
+        app:srcCompat="@drawable/ic_photo_camera"
+        tools:ignore="ContentDescription" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 117 - 0
app/src/main/res/layout/main_motion_start.xml

@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.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/linearLayout2"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <TextView
+        android:id="@+id/main_fragment_time"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="@dimen/_64sdp"
+        android:text="@string/main_placeholder_clock"
+        android:textAppearance="@style/TextAppearance.AppCompat"
+        android:textSize="@dimen/_40ssp"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintHorizontal_bias="0.506"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+    <TextView
+        android:id="@+id/main_fragment_time_format"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="@dimen/_16sdp"
+        android:textAppearance="@style/TextAppearance.AppCompat"
+        android:textSize="@dimen/_13sdp"
+        app:layout_constraintStart_toEndOf="@+id/main_fragment_time"
+        app:layout_constraintTop_toTopOf="@+id/main_fragment_time" />
+
+    <TextView
+        android:id="@+id/main_fragment_date"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:padding="@dimen/_4sdp"
+        android:text="@string/main_placeholder_date"
+        android:textAppearance="@style/TextAppearance.AppCompat"
+        android:textSize="@dimen/_12sdp"
+        app:layout_constraintEnd_toEndOf="@+id/main_fragment_time"
+        app:layout_constraintStart_toStartOf="@+id/main_fragment_time"
+        app:layout_constraintTop_toBottomOf="@+id/main_fragment_time" />
+
+    <androidx.recyclerview.widget.RecyclerView
+        android:id="@+id/main_fragment_list"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="16dp"
+        android:layout_marginLeft="16dp"
+        android:layout_marginTop="8dp"
+        android:layout_marginEnd="16dp"
+        android:layout_marginRight="16dp"
+        android:layout_marginBottom="8dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintHorizontal_bias="0.0"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="@+id/main_fragment_time"
+        app:layout_constraintVertical_bias="0.494"
+        tools:itemCount="1"
+        tools:listitem="@layout/main_fragment_list_item" />
+
+    <androidx.recyclerview.widget.RecyclerView
+        android:id="@+id/main_fragment_list_exp"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="16dp"
+        android:layout_marginLeft="16dp"
+        android:layout_marginEnd="16dp"
+        android:layout_marginRight="16dp"
+        android:layout_marginBottom="8dp"
+        android:layout_marginTop="@dimen/_16sdp"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintHorizontal_bias="0.5"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="parent"
+        tools:itemCount="3"
+        tools:listitem="@layout/main_fragment_list_item" />
+
+    <TextView
+        android:id="@+id/main_fragment_options"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:padding="@dimen/_8sdp"
+        android:text="@string/main_fragment_options"
+        android:textAppearance="@style/TextAppearance.AppCompat"
+        android:textSize="@dimen/_18ssp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintStart_toStartOf="@+id/main_fragment_list_exp"
+        app:layout_constraintTop_toBottomOf="@+id/main_fragment_list_exp" />
+
+    <ImageView
+        android:id="@+id/main_fragment_call"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginBottom="8dp"
+        android:padding="@dimen/_8sdp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:srcCompat="@drawable/ic_call"
+        tools:ignore="ContentDescription" />
+
+    <ImageView
+        android:id="@+id/main_fragment_camera"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginBottom="8dp"
+        android:padding="@dimen/_8sdp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:srcCompat="@drawable/ic_photo_camera"
+        tools:ignore="ContentDescription" />
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 3 - 3
app/src/main/res/layout/theme_setup_fragment.xml

@@ -44,7 +44,7 @@
         android:focusable="true"
         app:srcCompat="@drawable/ic_text_fields"
         android:contentDescription="@string/setup_text_dark"
-        android:tint="@color/inverseTextColor"
+        android:tint="@color/darkAccentColor"
         app:backgroundTint="@color/primaryDarkColor"
         app:fabSize="normal"
         app:layout_constraintEnd_toStartOf="@+id/setup_fab_jupiter"
@@ -61,7 +61,7 @@
         android:contentDescription="@string/setup_text_jupiter"
         android:focusable="true"
         app:srcCompat="@drawable/ic_text_fields"
-        android:tint="@color/inverseTextColor"
+        android:tint="@color/darkAccentColor"
         app:backgroundTint="@color/colorBlueGrey"
         app:fabSize="normal"
         app:layout_constraintEnd_toEndOf="parent"
@@ -94,7 +94,7 @@
         android:contentDescription="@string/setup_text_candy"
         android:focusable="true"
         app:srcCompat="@drawable/ic_text_fields"
-        android:tint="@color/inverseTextColor"
+        android:tint="@color/darkAccentColor"
         app:backgroundTint="@color/colorCandy"
         app:fabSize="normal"
         app:layout_constraintEnd_toStartOf="@+id/setup_fab_pastel"

+ 2 - 8
app/src/main/res/values/colors.xml

@@ -1,26 +1,20 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-    <color name="colorAccent">#37474F</color>
 
     <color name="colorWhite">#ffffff</color>
     <color name="colorWhiteDark">#BDBDBD</color>
 
-    <color name="primaryColor">#212121</color>
     <color name="primaryDarkColor">#000000</color>
 
     <color name="colorBlueGrey">#37474f</color>
-    <color name="colorBlueGreyDark">#263238</color>
 
     <color name="colorPink">#fce4ec</color>
-    <color name="colorPinkDark">#F8BBD0</color>
 
     <color name="colorTeal">#B2DFDB</color>
-    <color name="colorTealDark">#80CBC4</color>
 
-    <color name="inverseTextColor">#e0e0e0</color>
-    <color name="inverseAccentColor">#607d8b</color>
+    <color name="lightAccentColor">#080808</color>
+    <color name="darkAccentColor">#e0e0e0</color>
 
     <color name="colorCandy">#f06292</color>
-    <color name="colorCandyDark">#e91e63</color>
 
 </resources>

+ 1 - 0
app/src/main/res/values/strings.xml

@@ -84,6 +84,7 @@
     <string name="content_description_my_phone">My phone</string>
     <string name="main_admin_title">Allow Slim to lock your device</string>
     <string name="main_admin_message">Double tapping on the free space on your home screen locks your device instantly.</string>
+    <string name="main_fragment_options">Options</string>
 
 
 </resources>

+ 6 - 8
app/src/main/res/values/styles.xml

@@ -2,27 +2,27 @@
 <resources>
 
     <style name="AppTheme" parent="@style/Theme.AppCompat.Light.NoActionBar">
-        <item name="colorAccent">@color/colorAccent</item>
-        <item name="android:colorForeground">@android:color/black</item>
+        <item name="colorAccent">@color/lightAccentColor</item>
+        <item name="android:colorForeground">@color/lightAccentColor</item>
         <item name="colorPrimary">@color/colorWhite</item>
         <item name="colorPrimaryDark">@color/colorWhiteDark</item>
         <item name="android:colorBackground">@color/colorWhite</item>
     </style>
 
     <style name="AppDarkTheme" parent="@style/Theme.AppCompat.NoActionBar">
-        <item name="colorAccent">@color/colorAccent</item>
+        <item name="colorAccent">@color/darkAccentColor</item>
         <item name="colorPrimary">@color/primaryDarkColor</item>
         <item name="colorPrimaryDark">@color/primaryDarkColor</item>
         <item name="android:colorBackground">@color/primaryDarkColor</item>
-        <item name="android:colorForeground">@color/inverseTextColor</item>
+        <item name="android:colorForeground">@color/darkAccentColor</item>
     </style>
 
     <style name="AppGreyTheme" parent="@style/AppDarkTheme">
         <item name="colorPrimary">@color/colorBlueGrey</item>
         <item name="colorPrimaryDark">@color/colorBlueGrey</item>
         <item name="android:colorBackground">@color/colorBlueGrey</item>
-        <item name="cardBackgroundColor">@color/colorBlueGreyDark</item>
-        <item name="colorAccent">@color/inverseAccentColor</item>
+        <item name="cardBackgroundColor">@color/colorBlueGrey</item>
+        <item name="colorAccent">@color/darkAccentColor</item>
     </style>
 
     <style name="AppCandyTheme" parent="AppDarkTheme">
@@ -35,13 +35,11 @@
         <item name="colorPrimary">@color/colorPink</item>
         <item name="colorPrimaryDark">@color/colorPink</item>
         <item name="android:colorBackground">@color/colorPink</item>
-        <!--<item name="android:statusBarColor">@color/colorPinkDark</item>-->
     </style>
 
     <style name="AppTealTheme" parent="AppTheme">
         <item name="colorPrimary">@color/colorTeal</item>
         <item name="colorPrimaryDark">@color/colorTeal</item>
         <item name="android:colorBackground">@color/colorTeal</item>
-        <!--<item name="android:statusBarColor">@color/colorTealDark</item>-->
     </style>
 </resources>

+ 12 - 0
app/src/main/res/xml/main_motion_scene.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<MotionScene xmlns:motion="http://schemas.android.com/apk/res-auto">
+    <Transition
+        motion:constraintSetEnd="@layout/main_motion_end"
+        motion:constraintSetStart="@layout/main_motion_start"
+        motion:duration="250">
+        <OnSwipe
+            motion:touchAnchorId="@+id/main_fragment_date"
+            motion:dragDirection="dragUp"
+            motion:touchAnchorSide="bottom" />
+    </Transition>
+</MotionScene>