mirror of
https://github.com/SimpleMobileTools/Simple-App-Launcher.git
synced 2025-06-05 21:49:21 +02:00
create a separate layout for launchers in the dialog
This commit is contained in:
parent
69645885f3
commit
dbcb1817bf
@ -6,7 +6,7 @@ import android.view.View
|
|||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import com.simplemobiletools.applauncher.R
|
import com.simplemobiletools.applauncher.R
|
||||||
import com.simplemobiletools.applauncher.models.AppLauncher
|
import com.simplemobiletools.applauncher.models.AppLauncher
|
||||||
import kotlinx.android.synthetic.main.app_launcher_item.view.*
|
import kotlinx.android.synthetic.main.app_launcher_dialog_item.view.*
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
class RecyclerAdapter(val launchers: ArrayList<AppLauncher>, val itemClick: (AppLauncher) -> Unit) :
|
class RecyclerAdapter(val launchers: ArrayList<AppLauncher>, val itemClick: (AppLauncher) -> Unit) :
|
||||||
@ -17,7 +17,7 @@ class RecyclerAdapter(val launchers: ArrayList<AppLauncher>, val itemClick: (App
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): ViewHolder {
|
override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): ViewHolder {
|
||||||
val view = LayoutInflater.from(parent?.context).inflate(R.layout.app_launcher_item, parent, false)
|
val view = LayoutInflater.from(parent?.context).inflate(R.layout.app_launcher_dialog_item, parent, false)
|
||||||
return ViewHolder(view, itemClick)
|
return ViewHolder(view, itemClick)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
26
app/src/main/res/layout/app_launcher_dialog_item.xml
Normal file
26
app/src/main/res/layout/app_launcher_dialog_item.xml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/launcher_holder"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingBottom="@dimen/launcher_padding_small"
|
||||||
|
android:paddingLeft="@dimen/launcher_padding_small"
|
||||||
|
android:paddingRight="@dimen/launcher_padding_small"
|
||||||
|
android:paddingTop="@dimen/launcher_padding_large">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/launcher_icon"
|
||||||
|
android:layout_width="@dimen/icon_size_smaller"
|
||||||
|
android:layout_height="@dimen/icon_size_smaller"
|
||||||
|
android:layout_gravity="center"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/launcher_label"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center_horizontal|top"
|
||||||
|
android:textSize="@dimen/font_size_smaller"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
@ -6,6 +6,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:paddingTop="@dimen/activity_margin"
|
android:padding="@dimen/launcher_padding_large"
|
||||||
app:layoutManager="android.support.v7.widget.GridLayoutManager"
|
app:layoutManager="android.support.v7.widget.GridLayoutManager"
|
||||||
app:spanCount="@integer/columns"/>
|
app:spanCount="@integer/columns"/>
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
<dimen name="launcher_padding_small">4dp</dimen>
|
<dimen name="launcher_padding_small">4dp</dimen>
|
||||||
<dimen name="launcher_padding_large">8dp</dimen>
|
<dimen name="launcher_padding_large">8dp</dimen>
|
||||||
<dimen name="icon_size">60dp</dimen>
|
<dimen name="icon_size">60dp</dimen>
|
||||||
|
<dimen name="icon_size_smaller">50dp</dimen>
|
||||||
|
|
||||||
<dimen name="font_size">12sp</dimen>
|
<dimen name="font_size">12sp</dimen>
|
||||||
|
<dimen name="font_size_smaller">11sp</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user