Skip to content

Commit

Permalink
chore(change): Added a close button onto the new context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
CreativeCodeCat committed Apr 9, 2024
1 parent d15251a commit f23a712
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ class AppDrawerAdapter(
private val appRename: TextView = itemView.appRename
private val appTitle: TextView = itemView.appTitle
private val appTitleFrame: FrameLayout = itemView.appTitleFrame
private val appClose: TextView = itemView.appClose
private val appInfo: TextView = itemView.appInfo
private val appDelete: TextView = itemView.appDelete

Expand Down Expand Up @@ -298,7 +299,7 @@ class AppDrawerAdapter(
}
}

appHideLayout.apply {
appClose.apply {
setOnClickListener {
appHideLayout.visibility = View.GONE
}
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_close.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="?attr/primaryColor"
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z" />
</vector>
20 changes: 19 additions & 1 deletion app/src/main/res/layout/adapter_app_drawer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
android:clickable="true"
android:focusable="true"
android:gravity="end|center_vertical"
android:paddingVertical="@dimen/app_padding_vertical"
android:visibility="gone"
tools:visibility="visible">

Expand Down Expand Up @@ -95,6 +96,21 @@
android:textSize="12sp"
app:drawableTopCompat="@drawable/ic_info" />

<TextView
android:id="@+id/appClose"
style="@style/TextSmall"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawablePadding="2dp"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:paddingHorizontal="8dp"
android:text="@string/close"
android:textSize="12sp"
app:drawableTopCompat="@drawable/ic_close" />

</LinearLayout>

<LinearLayout
Expand Down Expand Up @@ -123,7 +139,9 @@
android:maxLength="30"
android:maxLines="1"
android:paddingVertical="@dimen/app_padding_vertical"
android:textColorHint="?attr/primaryColorTrans50" />
android:textColorHint="?attr/primaryColorTrans50"
android:autofillHints="name"
tools:ignore="LabelFor" />

<TextView
android:id="@+id/appSaveRename"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@
<string name="system_default">System</string>
<string name="delete">Delete</string>
<string name="hide">Hide</string>
<string name="info">Info</string>
<string name="rename">Rename</string>
<string name="info">Info</string>
<string name="okay">Okay</string>
<string name="save">Save</string>
<string name="show">Show</string>
Expand Down

0 comments on commit f23a712

Please sign in to comment.