Skip to content

Commit

Permalink
Theme additional widget components
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperDragonXD committed Apr 6, 2024
1 parent 8b47486 commit 80cc919
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/com/android/launcher3/widget/WidgetCell.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import android.util.AttributeSet;
import android.util.Log;
import android.util.Size;
import android.view.ContextThemeWrapper;
import android.view.Gravity;
import android.view.MotionEvent;
import android.view.View;
Expand All @@ -51,12 +50,12 @@
import com.android.launcher3.icons.RoundDrawableWrapper;
import com.android.launcher3.icons.cache.HandlerRunnable;
import com.android.launcher3.model.WidgetItem;
import com.android.launcher3.util.Themes;
import com.android.launcher3.views.ActivityContext;

import java.util.function.Consumer;

import app.lawnchair.LawnchairAppWidgetHostView;
import app.lawnchair.font.FontManager;

/**
* Represents the individual cell of the widget inside the widget tray. The
Expand Down Expand Up @@ -140,6 +139,10 @@ protected void onFinishInflate() {
mWidgetName = findViewById(R.id.widget_name);
mWidgetDims = findViewById(R.id.widget_dims);
mWidgetDescription = findViewById(R.id.widget_description);

FontManager fontManager = FontManager.INSTANCE.get(getContext());
fontManager.setCustomFont(mWidgetName, R.id.font_body_medium);
fontManager.setCustomFont(mWidgetDescription, R.id.font_body);
}

public void setRemoteViewsPreview(RemoteViews view) {
Expand Down
6 changes: 6 additions & 0 deletions src/com/android/launcher3/widget/WidgetsBottomSheet.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

import java.util.List;

import app.lawnchair.font.FontManager;
import app.lawnchair.theme.drawable.DrawableTokens;

/**
Expand Down Expand Up @@ -117,6 +118,11 @@ public WidgetsBottomSheet(Context context, AttributeSet attrs, int defStyleAttr)
protected void onFinishInflate() {
super.onFinishInflate();
mContent = findViewById(R.id.widgets_bottom_sheet);
TextView mTitle = findViewById(R.id.title);

FontManager fontManager = FontManager.INSTANCE.get(getContext());
fontManager.setCustomFont(mTitle, R.id.font_heading);

mContent.setBackground(DrawableTokens.WidgetsBottomSheetBackground.resolve(getContext()));
}

Expand Down

0 comments on commit 80cc919

Please sign in to comment.