Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 523bf092 authored by Philipp Heckel's avatar Philipp Heckel
Browse files

Dark mode, proper alignment

parent 0d790a44
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -5,7 +5,6 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.cardview.widget.CardView
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView
@@ -48,7 +47,6 @@ class MainAdapter(private val repository: Repository, private val onClick: (Subs
        RecyclerView.ViewHolder(itemView) {
        private var subscription: Subscription? = null
        private val context: Context = itemView.context
        private val cardView: CardView = itemView.findViewById(R.id.main_item_card)
        private val nameView: TextView = itemView.findViewById(R.id.main_item_text)
        private val statusView: TextView = itemView.findViewById(R.id.main_item_status)
        private val dateView: TextView = itemView.findViewById(R.id.main_item_date)
@@ -99,10 +97,10 @@ class MainAdapter(private val repository: Repository, private val onClick: (Subs
                newItemsView.visibility = View.VISIBLE
                newItemsView.text = if (subscription.newCount <= 99) subscription.newCount.toString() else "99+"
            }
            cardView.setOnClickListener { onClick(subscription) }
            cardView.setOnLongClickListener { onLongClick(subscription); true }
            itemView.setOnClickListener { onClick(subscription) }
            itemView.setOnLongClickListener { onLongClick(subscription); true }
            if (selected.contains(subscription.id)) {
                cardView.setCardBackgroundColor(Colors.itemSelectedBackgroundColor(context))
                itemView.setBackgroundResource(Colors.itemSelectedBackground(context))
            }
        }
    }
+1 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
        tools:context=".ui.DetailActivity"
>
    <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
            style="@style/SwipeRefreshLayoutWithCards"
            android:id="@+id/detail_notification_list_container"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
+15 −13
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout 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"
>
                                                   xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
                                                   android:layout_height="match_parent">

    <com.google.android.material.card.MaterialCardView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:shapeAppearance="?shapeAppearanceLargeComponent" app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent"
            android:id="@+id/main_banner_battery" android:visibility="visible">

            app:shapeAppearance="?shapeAppearanceLargeComponent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            android:id="@+id/main_banner_battery"
            android:visibility="visible"
    >
        <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
@@ -136,6 +137,7 @@
                    android:text="@string/main_banner_json_stream_button_dismiss"
                    tools:layout_editor_absoluteX="260dp" tools:layout_editor_absoluteY="83dp"/>


            <com.google.android.material.button.MaterialButton
                    android:id="@+id/main_banner_json_stream_learn_mode"
                    style="@style/Widget.MaterialComponents.Button.TextButton"
@@ -158,11 +160,11 @@
                android:id="@+id/main_subscriptions_list"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:clickable="true"
                android:focusable="true"
                android:paddingTop="5dp"
                android:paddingBottom="5dp"
                android:clipToPadding="false"
                android:clickable="true"
                android:focusable="true"
                android:background="?android:attr/selectableItemBackground"
                app:layoutManager="LinearLayoutManager"/>
    </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
+5 −6
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
<androidx.cardview.widget.CardView
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        style="@style/CardView"
        android:id="@+id/detail_item_card"
        android:background="?android:attr/selectableItemBackground"
        android:clickable="true"
@@ -11,10 +12,8 @@
        android:layout_marginTop="0dp"
        android:layout_marginStart="6dp"
        android:layout_marginEnd="6dp"
        android:layout_marginBottom="0dp"
        android:layout_marginBottom="1dp"
        android:padding="3dp"
        android:paddingBottom="3dp"
        app:cardBackgroundColor="@color/white"
        app:cardCornerRadius="3dp"
        app:cardElevation="2dp"
        app:cardMaxElevation="2dp"
@@ -26,7 +25,7 @@
            android:orientation="horizontal"
            android:background="?android:attr/selectableItemBackground"
            android:focusable="true"
            android:paddingBottom="5dp">
            android:paddingBottom="6dp" android:paddingTop="6dp">
        <TextView
                android:text="Sun, October 31, 2021, 10:43:12"
                android:layout_width="wrap_content"
@@ -34,7 +33,7 @@
                android:id="@+id/detail_item_date_text"
                android:textAppearance="@style/TextAppearance.AppCompat.Small"
                app:layout_constraintTop_toTopOf="parent"
                android:layout_marginTop="10dp" app:layout_constraintStart_toStartOf="parent"
                android:layout_marginTop="5dp" app:layout_constraintStart_toStartOf="parent"
                android:layout_marginStart="10dp"/>
        <TextView
                android:layout_width="10dp"
@@ -54,7 +53,7 @@
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="5dp"
                android:background="?android:attr/selectableItemBackground" android:paddingTop="-5dp"
                android:layout_marginTop="5dp"/>
        />
        <TextView
                android:text="This is a very very very long message. It could be as long as 1024 charaters, which is a lot more than you'd think. No, really so far this message is barely 180 characters long. I can't believe how long 1024 bytes are. This is outrageous. Oh you know what, I think I won't type the whole thing. This seems a little too long for a sample text. Well, anyway, it was nice chatting. So far this message is about 400 bytes long. So maybe just double what you see and that's that."
                android:layout_width="0dp"
+74 −95
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
        xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
                                                   xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/main_item_card"
        android:background="?android:attr/selectableItemBackground"
        android:clickable="true"
        android:focusable="true"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="0dp"
        android:layout_marginStart="6dp"
        android:layout_marginEnd="6dp"
        android:layout_marginBottom="0dp"
        android:padding="0dp"
        app:cardBackgroundColor="@color/white"
        app:cardCornerRadius="3dp"
        app:cardElevation="2dp"
        app:cardMaxElevation="2dp"
        app:cardPreventCornerOverlap="true"
        app:cardUseCompatPadding="true">
    <androidx.constraintlayout.widget.ConstraintLayout
                                                   android:layout_width="match_parent"
                                                   android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:paddingEnd="15dp"
            android:paddingStart="15dp"
                                                   android:background="?android:attr/selectableItemBackground"
            android:focusable="true"
            android:paddingBottom="3dp">
                                                   android:orientation="horizontal" android:clickable="true"
                                                   android:focusable="true" android:paddingEnd="18dp"
                                                   android:paddingStart="18dp">
    <ImageView
            android:layout_width="35dp"
            android:layout_height="35dp" app:srcCompat="@drawable/ic_sms_gray_24dp"
@@ -40,7 +19,7 @@
            android:layout_height="wrap_content" android:id="@+id/main_item_text"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintBottom_toTopOf="@+id/main_item_status"
                android:layout_marginStart="10dp" app:layout_constraintStart_toEndOf="@+id/main_item_image"
            android:layout_marginStart="12dp" app:layout_constraintStart_toEndOf="@+id/main_item_image"
            app:layout_constraintVertical_bias="0.0" android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            android:textColor="?android:attr/textColorPrimary" android:layout_marginTop="10dp"
            app:layout_constraintEnd_toStartOf="@+id/main_item_instant_image"/>
@@ -93,4 +72,4 @@
            app:layout_constraintStart_toEndOf="@+id/main_item_instant_image"
            android:textSize="10sp" android:textStyle="bold"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
Loading