mirror of
				https://github.com/SimpleMobileTools/Simple-Launcher.git
				synced 2025-06-05 21:59:15 +02:00 
			
		
		
		
	handle updating the text color
This commit is contained in:
		| @@ -68,6 +68,13 @@ class LaunchersAdapter( | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     fun updateTextColor(newTextColor: Int) { | ||||
|         if (newTextColor != textColor) { | ||||
|             textColor = newTextColor | ||||
|             notifyDataSetChanged() | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) { | ||||
|         fun bindView(launcher: AppLauncher): View { | ||||
|             itemView.apply { | ||||
|   | ||||
| @@ -122,6 +122,13 @@ class WidgetsAdapter( | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     fun updateTextColor(newTextColor: Int) { | ||||
|         if (newTextColor != textColor) { | ||||
|             textColor = newTextColor | ||||
|             notifyDataSetChanged() | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) { | ||||
|         fun bindView(widgetListItem: WidgetsListItem, callback: (itemView: View, adapterPosition: Int) -> Unit) { | ||||
|             itemView.apply { | ||||
|   | ||||
| @@ -142,6 +142,7 @@ class AllAppsFragment(context: Context, attributeSet: AttributeSet) : MyFragment | ||||
|         val topPadding = if (addTopPadding) activity!!.statusBarHeight else 0 | ||||
|         setPadding(0, topPadding, 0, 0) | ||||
|         background = ColorDrawable(context.getProperBackgroundColor()) | ||||
|         (all_apps_grid.adapter as? LaunchersAdapter)?.updateTextColor(context.getProperTextColor()) | ||||
|     } | ||||
|  | ||||
|     override fun onAppLauncherLongPressed(x: Float, y: Float, appLauncher: AppLauncher) { | ||||
|   | ||||
| @@ -202,6 +202,7 @@ class WidgetsFragment(context: Context, attributeSet: AttributeSet) : MyFragment | ||||
|         val topPadding = if (addTopPadding) activity!!.statusBarHeight else 0 | ||||
|         setPadding(0, topPadding, 0, 0) | ||||
|         background = ColorDrawable(context.getProperBackgroundColor()) | ||||
|         (widgets_list.adapter as? WidgetsAdapter)?.updateTextColor(context.getProperTextColor()) | ||||
|     } | ||||
|  | ||||
|     private fun getAppMetadataFromPackage(packageName: String): WidgetsListSection? { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user