- Removed hardcoded colors.

- Used colorSurface for the original comment in replies.
This commit is contained in:
faisalcodes 2023-01-30 19:17:01 +05:30
parent 843bdfd8e4
commit 3265ce81f4
5 changed files with 5 additions and 26 deletions

View File

@ -7,7 +7,6 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.view.ViewGroup.MarginLayoutParams import android.view.ViewGroup.MarginLayoutParams
import android.widget.Toast import android.widget.Toast
import androidx.core.content.ContextCompat
import androidx.core.text.parseAsHtml import androidx.core.text.parseAsHtml
import androidx.core.view.updateLayoutParams import androidx.core.view.updateLayoutParams
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
@ -23,6 +22,7 @@ import com.github.libretube.util.ClipboardHelper
import com.github.libretube.util.ImageHelper import com.github.libretube.util.ImageHelper
import com.github.libretube.util.NavigationHelper import com.github.libretube.util.NavigationHelper
import com.github.libretube.util.TextUtils import com.github.libretube.util.TextUtils
import com.github.libretube.util.ThemeHelper
import kotlinx.serialization.json.Json import kotlinx.serialization.json.Json
class CommentsAdapter( class CommentsAdapter(
@ -79,17 +79,12 @@ class CommentsAdapter(
if (position == 0) { if (position == 0) {
root.setBackgroundColor( root.setBackgroundColor(
ContextCompat.getColor( ThemeHelper.getThemeColor(root.context, R.attr.colorSurface)
root.context,
R.color.replies_original_comment_background
)
) )
root.updateLayoutParams<MarginLayoutParams> { bottomMargin = 40 } root.updateLayoutParams<MarginLayoutParams> { bottomMargin = 40 }
divider.visibility = View.VISIBLE
} else { } else {
root.background = null root.background = null
root.updateLayoutParams<MarginLayoutParams> { bottomMargin = 0 } root.updateLayoutParams<MarginLayoutParams> { bottomMargin = 0 }
divider.visibility = View.GONE
} }
} }

View File

@ -14,7 +14,7 @@
android:orientation="vertical" android:orientation="vertical"
android:paddingStart="15dp" android:paddingStart="15dp"
android:paddingEnd="15dp" android:paddingEnd="15dp"
app:layout_constraintBottom_toTopOf="@id/divider" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
<LinearLayout <LinearLayout
@ -50,7 +50,7 @@
android:ellipsize="end" android:ellipsize="end"
android:maxLines="2" android:maxLines="2"
android:textSize="14sp" android:textSize="14sp"
android:textColor="@color/text_color_secondary" android:textColor="?android:attr/textColorSecondary"
tools:text="Author and Time" /> tools:text="Author and Time" />
<ImageView <ImageView
@ -133,11 +133,4 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<com.google.android.material.divider.MaterialDivider
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -24,7 +24,7 @@
android:layout_height="20dp" android:layout_height="20dp"
android:paddingTop="8dp" android:paddingTop="8dp"
android:paddingBottom="0dp" android:paddingBottom="0dp"
app:tint="@color/drag_handle_color" /> app:tint="?android:attr/textColorSecondaryInverse" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="text_color_secondary">#BFBFBF</color>
<color name="drag_handle_color">#3A3A3A</color>
<color name="replies_original_comment_background">#222222</color>
</resources>

View File

@ -3,9 +3,6 @@
<color name="duration_background_color">#AA000000</color> <color name="duration_background_color">#AA000000</color>
<color name="duration_text_color">#EEFFFFFF</color> <color name="duration_text_color">#EEFFFFFF</color>
<color name="shortcut_color">#0061A6</color> <color name="shortcut_color">#0061A6</color>
<color name="text_color_secondary">#505050</color>
<color name="drag_handle_color">#CCCCCC</color>
<color name="replies_original_comment_background">#E8E8E8</color>
<color name="blue_md_theme_light_primary">#0058CB</color> <color name="blue_md_theme_light_primary">#0058CB</color>
<color name="blue_md_theme_light_onPrimary">#FFFFFF</color> <color name="blue_md_theme_light_onPrimary">#FFFFFF</color>