Skip to content

Commit

Permalink
chat: smoother darkmode for share chat (fixes #5078)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavi38 committed Jan 22, 2025
1 parent b32cc6f commit 6719245
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package org.ole.planet.myplanet.ui.chat

import android.app.AlertDialog
import android.content.Context
import android.graphics.drawable.ColorDrawable
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.google.gson.Gson
Expand Down Expand Up @@ -158,6 +160,10 @@ class ChatHistoryListAdapter(var context: Context, private var chatHistory: List
dialog?.dismiss()
}
dialog = builder.create()

val backgroundColor = ContextCompat.getColor(context, R.color.daynight_grey)
dialog.window?.setBackgroundDrawable(ColorDrawable(backgroundColor))

dialog.show()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import android.view.View
import android.view.ViewGroup
import android.widget.BaseExpandableListAdapter
import android.widget.TextView
import androidx.core.content.ContextCompat
import org.ole.planet.myplanet.R

class ExpandableListAdapter(private val context: Context, private val expandableTitleList: List<String>, private val expandableDetailList: HashMap<String, List<String>>) : BaseExpandableListAdapter() {
Expand All @@ -27,6 +28,8 @@ class ExpandableListAdapter(private val context: Context, private val expandable
}
val expandedListTextView = reusedView?.findViewById<View>(R.id.expandedListItem) as TextView
expandedListTextView.text = expandedListText
reusedView.setBackgroundColor(ContextCompat.getColor(parent?.context!!, R.color.multi_select_grey))
expandedListTextView.setTextColor(ContextCompat.getColor(parent.context, R.color.daynight_textColor))
return reusedView
}

Expand Down Expand Up @@ -56,6 +59,7 @@ class ExpandableListAdapter(private val context: Context, private val expandable
val listTitleTextView = reusedView?.findViewById<View>(R.id.listTitle) as TextView
listTitleTextView.setTypeface(null, Typeface.BOLD)
listTitleTextView.text = listTitle
listTitleTextView.setTextColor(ContextCompat.getColor(parent.context, R.color.daynight_textColor))
return reusedView
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/chat_share_dialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
android:layout_marginStart="10dp"
android:text="@string/share_chat"
android:layout_marginTop="10dp"
android:textColor="@color/md_black_1000"
android:textColor="@color/daynight_textColor"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
Expand Down

0 comments on commit 6719245

Please sign in to comment.