summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanuj <thetanuj@hotmail.com>2026-03-10 17:31:40 +0530
committerTanuj <thetanuj@hotmail.com>2026-03-10 17:32:39 +0530
commit4f044a74be399a27f92b4e4faad2375f7d335cf1 (patch)
treef46d6699bb1d6a97cdd434603234796c9624b10d
parent29335cc50781e637ba7cb2017d2193826ffd37bd (diff)
downloadSidePhOnelauncher-4f044a74be399a27f92b4e4faad2375f7d335cf1.tar.gz
SidePhOnelauncher-4f044a74be399a27f92b4e4faad2375f7d335cf1.tar.bz2
SidePhOnelauncher-4f044a74be399a27f92b4e4faad2375f7d335cf1.zip
App drawer top margin proportionate to screen size
-rw-r--r--app/src/main/java/app/olauncher/ui/AppDrawerFragment.kt9
-rw-r--r--app/src/main/res/layout-land/fragment_app_drawer.xml39
-rw-r--r--app/src/main/res/layout/fragment_app_drawer.xml39
3 files changed, 32 insertions, 55 deletions
diff --git a/app/src/main/java/app/olauncher/ui/AppDrawerFragment.kt b/app/src/main/java/app/olauncher/ui/AppDrawerFragment.kt
index 77a13b8..7e4cd83 100644
--- a/app/src/main/java/app/olauncher/ui/AppDrawerFragment.kt
+++ b/app/src/main/java/app/olauncher/ui/AppDrawerFragment.kt
@@ -96,7 +96,6 @@ class AppDrawerFragment : Fragment() {
override fun onQueryTextChange(newText: String): Boolean {
try {
adapter.filter.filter(newText)
- binding.appDrawerTip.visibility = View.GONE
binding.appRename.visibility =
if (canRename && newText.isNotBlank()) View.VISIBLE else View.GONE
return true
@@ -213,10 +212,6 @@ class AppDrawerFragment : Fragment() {
private fun initObservers() {
viewModel.firstOpen.observe(viewLifecycleOwner) {
- if (it && flag == Constants.FLAG_LAUNCH_APP) {
- binding.appDrawerTip.visibility = View.VISIBLE
- binding.appDrawerTip.isSelected = true
- }
}
if (flag == Constants.FLAG_HIDDEN_APPS) {
viewModel.hiddenApps.observe(viewLifecycleOwner) {
@@ -235,10 +230,6 @@ class AppDrawerFragment : Fragment() {
}
private fun initClickListeners() {
- binding.appDrawerTip.setOnClickListener {
- binding.appDrawerTip.isSelected = false
- binding.appDrawerTip.isSelected = true
- }
binding.appRename.setOnClickListener {
val name = binding.search.query.toString().trim()
if (name.isEmpty()) {
diff --git a/app/src/main/res/layout-land/fragment_app_drawer.xml b/app/src/main/res/layout-land/fragment_app_drawer.xml
index c15bbb1..cacd650 100644
--- a/app/src/main/res/layout-land/fragment_app_drawer.xml
+++ b/app/src/main/res/layout-land/fragment_app_drawer.xml
@@ -1,17 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout 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"
android:animateLayoutChanges="true"
- android:background="?attr/primaryShadeDarkColor">
+ android:background="?attr/primaryShadeDarkColor"
+ android:orientation="vertical">
+
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_marginTop="24dp"
+ android:layout_weight="0.1" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="56dp"
- android:layout_marginTop="24dp"
android:animateLayoutChanges="true"
android:orientation="horizontal">
@@ -46,33 +51,21 @@
</LinearLayout>
- <TextView
- android:id="@+id/appDrawerTip"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="76dp"
- android:layout_marginTop="52dp"
- android:layout_marginEnd="12dp"
- android:ellipsize="marquee"
- android:freezesText="true"
- android:marqueeRepeatLimit="marquee_forever"
- android:maxLines="1"
- android:scrollHorizontally="true"
- android:singleLine="true"
- android:text="@string/app_drawer_tips"
- android:textColor="?attr/primaryColor"
- android:visibility="gone" />
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="0.06" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
- android:layout_height="match_parent"
+ android:layout_height="0dp"
android:layout_marginHorizontal="56dp"
- android:layout_marginTop="80dp"
+ android:layout_weight="1"
android:clipChildren="false"
android:clipToPadding="false"
android:fadingEdgeLength="24dp"
android:requiresFadingEdge="vertical"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
-</FrameLayout> \ No newline at end of file
+</LinearLayout> \ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_app_drawer.xml b/app/src/main/res/layout/fragment_app_drawer.xml
index 91d0484..fed7ffa 100644
--- a/app/src/main/res/layout/fragment_app_drawer.xml
+++ b/app/src/main/res/layout/fragment_app_drawer.xml
@@ -1,16 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout 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"
android:animateLayoutChanges="true"
- android:background="?attr/primaryShadeDarkColor">
+ android:background="?attr/primaryShadeDarkColor"
+ android:orientation="vertical">
+
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_marginTop="24dp"
+ android:layout_weight="0.1" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginTop="88dp"
android:animateLayoutChanges="true"
android:orientation="horizontal">
@@ -46,32 +51,20 @@
</LinearLayout>
- <TextView
- android:id="@+id/appDrawerTip"
- style="@style/TextSmallLight"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="20dp"
- android:layout_marginTop="52dp"
- android:layout_marginEnd="4dp"
- android:ellipsize="marquee"
- android:freezesText="true"
- android:marqueeRepeatLimit="marquee_forever"
- android:maxLines="1"
- android:scrollHorizontally="true"
- android:singleLine="true"
- android:text="@string/app_drawer_tips"
- android:visibility="gone" />
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="0.06" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_marginTop="180dp"
+ android:layout_height="0dp"
+ android:layout_weight="1"
android:layout_marginBottom="24dp"
android:clipChildren="false"
android:clipToPadding="false"
android:fadingEdgeLength="24dp"
android:requiresFadingEdge="vertical" />
-</FrameLayout> \ No newline at end of file
+</LinearLayout> \ No newline at end of file