Revert "PoC: widget day/night mode (2)"

This reverts commit d26e4bfd56.
pull/207/head
M66B 3 years ago
parent d26e4bfd56
commit 72f57cfaf0

@ -91,8 +91,7 @@ public class WidgetUnified extends AppWidgetProvider {
PendingIntent piCompose = PendingIntentCompat.getActivity(
context, appWidgetId, edit, PendingIntent.FLAG_UPDATE_CURRENT);
RemoteViews views = new RemoteViews(context.getPackageName(),
daynight ? R.layout.widget_unified_dn : R.layout.widget_unified);
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_unified);
views.setTextViewTextSize(R.id.title, TypedValue.COMPLEX_UNIT_SP, getFontSizeSp(font));

@ -181,9 +181,7 @@ public class WidgetUnifiedRemoteViewsFactory implements RemoteViewsService.Remot
@Override
public RemoteViews getViewAt(int position) {
RemoteViews views = new RemoteViews(context.getPackageName(),
daynight ? R.layout.item_widget_unified_dn : R.layout.item_widget_unified);
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.item_widget_unified);
int idFrom = (subject_top ? R.id.tvSubject : R.id.tvFrom);
int idTime = (subject_top ? R.id.tvAccount : R.id.tvTime);
int idSubject = (subject_top ? R.id.tvFrom : R.id.tvSubject);

@ -49,7 +49,7 @@
android:maxLines="1"
android:text="From"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="@color/colorWidgetForeground" />
android:textColor="?android:textColorPrimary" />
<TextView
android:id="@+id/tvTime"
@ -59,7 +59,7 @@
android:maxLines="1"
android:text="12:34"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="@color/colorWidgetForeground" />
android:textColor="?android:textColorPrimary" />
</LinearLayout>
<LinearLayout
@ -76,7 +76,7 @@
android:maxLines="1"
android:text="Subject"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="@color/colorWidgetForeground" />
android:textColor="?android:textColorPrimary" />
<TextView
android:id="@+id/tvAccount"
@ -86,7 +86,7 @@
android:maxLines="1"
android:text="Account"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="@color/colorWidgetForeground" />
android:textColor="?android:textColorPrimary" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
@ -95,5 +95,5 @@
android:id="@+id/separator"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/grey" />
android:background="?android:colorControlNormal" />
</LinearLayout>

@ -1,99 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/llMessage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<FrameLayout
android:id="@+id/stripe"
android:layout_width="3dp"
android:layout_height="match_parent"
android:layout_marginEnd="3dp"
android:background="@color/grey" />
<ImageView
android:id="@+id/avatar"
android:layout_width="36dp"
android:layout_height="match_parent"
android:layout_marginEnd="3dp"
android:adjustViewBounds="true"
android:paddingTop="3dp"
android:paddingBottom="3dp"
android:scaleType="fitCenter"
android:src="@mipmap/ic_launcher" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="6dp"
android:paddingBottom="6dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tvFrom"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:text="From"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:textColorPrimary" />
<TextView
android:id="@+id/tvTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:maxLines="1"
android:text="12:34"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:textColorPrimary" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tvSubject"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:text="Subject"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:textColorPrimary" />
<TextView
android:id="@+id/tvAccount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:maxLines="1"
android:text="Account"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:textColorPrimary" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<FrameLayout
android:id="@+id/separator"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:colorControlNormal" />
</LinearLayout>

@ -4,7 +4,8 @@
android:id="@+id/background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/widget_background">
android:background="?android:colorBackground"
android:theme="@style/Theme.AppCompat.DayNight">
<LinearLayout
android:id="@+id/content"
@ -28,7 +29,7 @@
android:padding="6dp"
android:text="@string/title_widget_title_list"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="@color/colorWidgetForeground"
android:textColor="?android:textColorPrimary"
android:textStyle="bold" />
<ImageView
@ -38,8 +39,10 @@
android:layout_weight="0"
android:contentDescription="@string/tile_synchronize"
android:padding="6dp"
android:src="@drawable/twotone_sync_24_white"
android:visibility="gone" />
android:src="@drawable/twotone_sync_24"
android:tint="?android:textColorPrimary"
android:visibility="visible"
app:tint="?android:textColorPrimary" />
<ImageView
android:id="@+id/compose"
@ -48,15 +51,17 @@
android:layout_weight="0"
android:contentDescription="@string/title_compose"
android:padding="6dp"
android:src="@drawable/twotone_edit_24_white"
android:visibility="gone" />
android:src="@drawable/twotone_edit_24"
android:tint="?android:textColorPrimary"
android:visibility="visible"
app:tint="?android:textColorPrimary" />
</LinearLayout>
<FrameLayout
android:id="@+id/separator"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/grey" />
android:background="?android:colorControlNormal" />
<ListView
android:id="@+id/lv"

@ -1,73 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:colorBackground"
android:theme="@style/Theme.AppCompat.DayNight">
<LinearLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingStart="6dp"
android:paddingEnd="6dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:padding="6dp"
android:text="@string/title_widget_title_list"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="?android:textColorPrimary"
android:textStyle="bold" />
<ImageView
android:id="@+id/refresh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:contentDescription="@string/tile_synchronize"
android:padding="6dp"
android:src="@drawable/twotone_sync_24"
android:tint="?android:textColorPrimary"
android:visibility="visible"
app:tint="?android:textColorPrimary" />
<ImageView
android:id="@+id/compose"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:contentDescription="@string/title_compose"
android:padding="6dp"
android:src="@drawable/twotone_edit_24"
android:tint="?android:textColorPrimary"
android:visibility="visible"
app:tint="?android:textColorPrimary" />
</LinearLayout>
<FrameLayout
android:id="@+id/separator"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:colorControlNormal" />
<ListView
android:id="@+id/lv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="6dp"
android:divider="@null" />
</LinearLayout>
</FrameLayout>
Loading…
Cancel
Save