mirror of
https://github.com/SimpleMobileTools/Simple-Launcher.git
synced 2025-02-16 11:31:46 +01:00
removing the top toolbar
This commit is contained in:
parent
7bface3d99
commit
15c9b29534
@ -43,5 +43,5 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:6f922ee918'
|
implementation 'com.github.SimpleMobileTools:Simple-Commons:8b339d6e4b'
|
||||||
}
|
}
|
||||||
|
@ -5,10 +5,12 @@ import android.content.Context
|
|||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.pm.LauncherApps
|
import android.content.pm.LauncherApps
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
|
import android.graphics.Color
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.Surface
|
import android.view.Surface
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
|
import android.widget.FrameLayout
|
||||||
import com.simplemobiletools.commons.extensions.*
|
import com.simplemobiletools.commons.extensions.*
|
||||||
import com.simplemobiletools.commons.helpers.isRPlus
|
import com.simplemobiletools.commons.helpers.isRPlus
|
||||||
import com.simplemobiletools.commons.views.MyGridLayoutManager
|
import com.simplemobiletools.commons.views.MyGridLayoutManager
|
||||||
@ -25,28 +27,17 @@ class MainActivity : SimpleActivity() {
|
|||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_main)
|
setContentView(R.layout.activity_main)
|
||||||
appLaunched(BuildConfig.APPLICATION_ID)
|
appLaunched(BuildConfig.APPLICATION_ID)
|
||||||
setupOptionsMenu()
|
|
||||||
getLaunchers()
|
getLaunchers()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
setupToolbar(main_toolbar)
|
|
||||||
updateTextColors(main_coordinator)
|
|
||||||
launchers_fastscroller.updateColors(getProperPrimaryColor())
|
launchers_fastscroller.updateColors(getProperPrimaryColor())
|
||||||
|
(launchers_holder.layoutParams as FrameLayout.LayoutParams).topMargin = statusBarHeight
|
||||||
|
updateStatusbarColor(Color.TRANSPARENT)
|
||||||
setupNavigationBar()
|
setupNavigationBar()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupOptionsMenu() {
|
|
||||||
main_toolbar.setOnMenuItemClickListener { menuItem ->
|
|
||||||
when (menuItem.itemId) {
|
|
||||||
R.id.settings -> launchSettings()
|
|
||||||
else -> return@setOnMenuItemClickListener false
|
|
||||||
}
|
|
||||||
return@setOnMenuItemClickListener true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressLint("WrongConstant")
|
@SuppressLint("WrongConstant")
|
||||||
private fun getLaunchers() {
|
private fun getLaunchers() {
|
||||||
val allApps = ArrayList<AppLauncher>()
|
val allApps = ArrayList<AppLauncher>()
|
||||||
@ -131,9 +122,4 @@ class MainActivity : SimpleActivity() {
|
|||||||
launchers_grid.setPadding(0, 0, resources.getDimension(R.dimen.medium_margin).toInt(), bottomListPadding)
|
launchers_grid.setPadding(0, 0, resources.getDimension(R.dimen.medium_margin).toInt(), bottomListPadding)
|
||||||
launchers_fastscroller.setPadding(leftListPadding, 0, rightListPadding, 0)
|
launchers_fastscroller.setPadding(leftListPadding, 0, rightListPadding, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun launchSettings() {
|
|
||||||
hideKeyboard()
|
|
||||||
startActivity(Intent(applicationContext, SettingsActivity::class.java))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,74 +1,22 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
android:id="@+id/launchers_holder"
|
||||||
android:id="@+id/main_coordinator"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
<com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller
|
||||||
android:id="@+id/main_app_bar_layout"
|
android:id="@+id/launchers_fastscroller"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.simplemobiletools.commons.views.MyRecyclerView
|
||||||
android:id="@+id/main_toolbar"
|
android:id="@+id/launchers_grid"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="?attr/actionBarSize"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/color_primary"
|
android:clipToPadding="false"
|
||||||
app:menu="@menu/menu_main"
|
app:layoutManager="com.simplemobiletools.commons.views.MyGridLayoutManager"
|
||||||
app:title="@string/app_launcher_name"
|
app:spanCount="@integer/portrait_column_count" />
|
||||||
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
|
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller>
|
||||||
|
</RelativeLayout>
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/main_holder"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
|
||||||
|
|
||||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
|
||||||
android:id="@+id/coordinator_layout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/launchers_holder"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
|
||||||
android:id="@+id/no_items_placeholder"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
android:alpha="0.8"
|
|
||||||
android:gravity="center"
|
|
||||||
android:paddingStart="@dimen/activity_margin"
|
|
||||||
android:paddingTop="@dimen/activity_margin"
|
|
||||||
android:paddingEnd="@dimen/activity_margin"
|
|
||||||
android:text="@string/no_items_found"
|
|
||||||
android:textSize="@dimen/bigger_text_size"
|
|
||||||
android:textStyle="italic"
|
|
||||||
android:visibility="gone"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller
|
|
||||||
android:id="@+id/launchers_fastscroller"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyRecyclerView
|
|
||||||
android:id="@+id/launchers_grid"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:clipToPadding="false"
|
|
||||||
app:layoutManager="com.simplemobiletools.commons.views.MyGridLayoutManager"
|
|
||||||
app:spanCount="@integer/portrait_column_count" />
|
|
||||||
|
|
||||||
</com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller>
|
|
||||||
</RelativeLayout>
|
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
||||||
</RelativeLayout>
|
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
android:layout_below="@+id/launcher_icon"
|
android:layout_below="@+id/launcher_icon"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:gravity="center_horizontal|top"
|
android:gravity="center_horizontal|top"
|
||||||
android:maxLines="2"
|
android:maxLines="1"
|
||||||
android:textSize="@dimen/smaller_text_size" />
|
android:textSize="@dimen/smaller_text_size" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<menu 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"
|
|
||||||
tools:ignore="AppCompatResource">
|
|
||||||
<item
|
|
||||||
android:id="@+id/settings"
|
|
||||||
android:icon="@drawable/ic_settings_cog_vector"
|
|
||||||
android:title="@string/settings"
|
|
||||||
app:showAsAction="always" />
|
|
||||||
</menu>
|
|
Loading…
x
Reference in New Issue
Block a user