Browse Source

fix: Removed arrow and increased click area

beautusg 7 năm trước cách đây
mục cha
commit
4af8014947

+ 0 - 16
app/src/main/java/com/sduduzog/slimlauncher/ui/main/MainFragment.kt

@@ -15,7 +15,6 @@ 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.google.android.material.bottomsheet.BottomSheetBehavior.STATE_HALF_EXPANDED
 import com.sduduzog.slimlauncher.MainActivity
 import com.sduduzog.slimlauncher.R
 import kotlinx.android.synthetic.main.main_bottom_sheet.*
@@ -49,7 +48,6 @@ class MainFragment : StatusBarThemeFragment(), MainActivity.OnBackPressedListene
         receiver = ClockReceiver()
         activity?.registerReceiver(receiver, IntentFilter(Intent.ACTION_TIME_TICK))
         sheetBehavior.state = STATE_COLLAPSED
-        doBounceAnimation(ivExpand)
     }
 
     override fun getFragmentView(): View {
@@ -152,9 +150,6 @@ class MainFragment : StatusBarThemeFragment(), MainActivity.OnBackPressedListene
             }
             true
         }
-        ivExpand.setOnClickListener {
-            if (sheetBehavior.state == STATE_COLLAPSED) sheetBehavior.state = STATE_HALF_EXPANDED
-        }
 
         ivCamera.setOnClickListener {
             try {
@@ -222,17 +217,6 @@ class MainFragment : StatusBarThemeFragment(), MainActivity.OnBackPressedListene
         }
     }
 
-    private fun doBounceAnimation(targetView: View) {
-        targetView.animate()
-                .setStartDelay(500)
-                .translationYBy(-20f).withEndAction {
-                    targetView.animate()
-                            .setStartDelay(0)
-                            .translationYBy(20f).duration = 100
-                }.duration = 100
-
-    }
-
     fun updateUi() {
         val twenty4Hour = context?.getSharedPreferences(getString(R.string.prefs_settings), Context.MODE_PRIVATE)
                 ?.getBoolean(getString(R.string.prefs_settings_key_clock_type), false)

+ 0 - 15
app/src/main/res/layout/main_bottom_sheet.xml

@@ -117,21 +117,6 @@
             app:srcCompat="@drawable/ic_call"
             android:layout_marginLeft="8dp" />
 
-        <ImageView
-            android:id="@+id/ivExpand"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginStart="8dp"
-            android:layout_marginLeft="8dp"
-            android:layout_marginEnd="8dp"
-            android:layout_marginRight="8dp"
-            android:contentDescription="@string/main_slim_options"
-            android:padding="16dp"
-            app:layout_constraintEnd_toStartOf="@+id/ivCamera"
-            app:layout_constraintStart_toEndOf="@+id/ivCall"
-            app:layout_constraintTop_toTopOf="parent"
-            app:srcCompat="@drawable/ic_expand" />
-
         <ImageView
             android:id="@+id/ivCamera"
             android:layout_width="wrap_content"

+ 2 - 1
app/src/main/res/layout/main_list_item.xml

@@ -6,11 +6,12 @@
 
     <TextView
         android:id="@+id/main_label"
-        android:layout_width="wrap_content"
+        android:layout_width="0dp"
         android:layout_height="wrap_content"
         android:layout_margin="@dimen/_10sdp"
         android:textSize="@dimen/_26ssp"
         app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toTopOf="parent" />
 </androidx.constraintlayout.widget.ConstraintLayout>