Skip to content

Commit

Permalink
🔨 Fixes #31
Browse files Browse the repository at this point in the history
  • Loading branch information
iyxan23 committed Sep 30, 2020
1 parent b297311 commit c50519b
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permis
continueActivity();

} else {
// Hmm
Intent intent = new Intent();
intent.setData(Uri.parse("https://www.youtube.com/watch?v=dQw4w9WgXcQ"));
intent.setAction(Intent.ACTION_VIEW);
Expand Down
31 changes: 31 additions & 0 deletions thmmanager/src/main/java/tw/osthm/manager/ThemeEditorActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ private void initializeViews() {
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
bottomsheetview = inflater.inflate(R.layout.bottomsheet_newtheme, null);


image_saveb = bottomsheetview.findViewById(R.id.image_save);
bottomSheetDialog.setContentView(bottomsheetview);

Expand All @@ -196,6 +197,36 @@ private void initializeViews() {
til2 = bottomsheetview.findViewById(R.id.til2);
til3 = bottomsheetview.findViewById(R.id.til3);
til4 = bottomsheetview.findViewById(R.id.til4);

// Apply the theme to bottom_sheet_save_theme

// Get the current applied theme
OsThmTheme theme = osthmEngine.getCurrentTheme();

// Apply
bottomsheetview.findViewById(R.id.bottomsheet_bar).setBackgroundTintList(ColorStateList.valueOf(theme.colorDialog));
bottomsheetview.findViewById(R.id.bottomsheet_root).setBackgroundColor(theme.colorDialog);

((TextView)bottomsheetview.findViewById(R.id.text_title)).setTextColor(theme.colorDialogText);

image_saveb.setColorFilter(theme.colorDialogTint);
image_saveb.setColorFilter(theme.colorControlHighlight);

til1.setBackgroundColor(theme.colorAccent);
til1.setHintTextColor(theme.colorHint);
til1.setTextColor(theme.colorDialogText);

til2.setBackgroundColor(theme.colorAccent);
til2.setHintTextColor(theme.colorHint);
til2.setTextColor(theme.colorDialogText);

til3.setBackgroundColor(theme.colorAccent);
til3.setHintTextColor(theme.colorHint);
til3.setTextColor(theme.colorDialogText);

til4.setBackgroundColor(theme.colorAccent);
til4.setHintTextColor(theme.colorHint);
til4.setTextColor(theme.colorDialogText);
}

private void loadColors() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,35 @@ public void onClick(View view) {

ImageView save = bottom_sheet_save_theme.findViewById(R.id.image_save);

//TODO: Implement custom dialog color for bottomsheet_newtheme. int ThemeEditorActivity.java too
/*
// Apply the theme to bottom_sheet_save_theme

// Get the current applied theme
OsThmTheme theme = osthmEngine.getCurrentTheme();

// Apply
bottom_sheet_save_theme.findViewById(R.id.bottomsheet_bar).setBackgroundTintList(ColorStateList.valueOf(theme.colorDialog));
bottom_sheet_save_theme.findViewById(R.id.bottomsheet_root).setBackgroundColor(theme.colorDialog);

((TextView)bottom_sheet_save_theme.findViewById(R.id.text_title)).setTextColor(theme.colorDialogText);

save.setColorFilter(theme.colorDialogTint);
save.setColorFilter(theme.colorControlHighlight);
name.setBac
*/

name.setBackgroundColor(theme.colorAccent);
name.setHintTextColor(theme.colorHint);
name.setTextColor(theme.colorDialogText);

author.setBackgroundColor(theme.colorAccent);
author.setHintTextColor(theme.colorHint);
author.setTextColor(theme.colorDialogText);

description.setBackgroundColor(theme.colorAccent);
description.setHintTextColor(theme.colorHint);
description.setTextColor(theme.colorDialogText);

version.setBackgroundColor(theme.colorAccent);
version.setHintTextColor(theme.colorHint);
version.setTextColor(theme.colorDialogText);

final BottomSheetDialog bsd = new BottomSheetDialog(ThemeManagerActivity.this);
bsd.setContentView(bottom_sheet_save_theme);
Expand Down Expand Up @@ -261,7 +281,6 @@ public void onClick(View view) {
@Override
public void onClick(View view) {
bottomSheetDialog.dismiss();

try {
makeSnackbar("Saved in " + osthmManager.exportThemeFile(osthmEngine
.exportThemes(new String[]{arrayList.get(selectedNum)
Expand Down Expand Up @@ -291,11 +310,13 @@ public void onClick(View view) {
bottomsheetView1.findViewById(R.id.bottomsheet_bar).setBackgroundTintList(ColorStateList.valueOf(theme.colorDialog));
bottomsheetView1.findViewById(R.id.bottomsheet_root).setBackgroundColor(theme.colorDialog);
((TextView)bottomsheetView1.findViewById(R.id.text_title)).setTextColor(theme.colorDialogText);

text_name.setTextColor(theme.colorDialogText);
text_description.setTextColor(theme.colorDialogText);
text_author.setTextColor(theme.colorDialogText);
text_version.setTextColor(theme.colorDialogText);
text_osthm.setTextColor(theme.colorDialogText);

((ImageView)bottomsheetView1.findViewById(R.id.image_name)).setColorFilter(theme.colorDialogTint);
((ImageView)bottomsheetView1.findViewById(R.id.image_description)).setColorFilter(theme.colorDialogTint);
((ImageView)bottomsheetView1.findViewById(R.id.image_author)).setColorFilter(theme.colorDialogTint);
Expand Down Expand Up @@ -481,11 +502,14 @@ private void loadTheme() {

bottomsheetView.findViewById(R.id.bottomsheet_bar).setBackgroundTintList(ColorStateList.valueOf(theme.colorDialog));
bottomsheetView.findViewById(R.id.bottomsheet_root).setBackgroundColor(theme.colorDialog);

image_delete.setColorFilter(theme.colorDialogTint);
image_edit.setColorFilter(theme.colorDialogTint);

((ImageView) bottomsheetView.findViewById(R.id.image_clone)).setColorFilter(theme.colorDialogTint);
((ImageView) bottomsheetView.findViewById(R.id.image_export)).setColorFilter(theme.colorDialogTint);
((ImageView) bottomsheetView.findViewById(R.id.image_info)).setColorFilter(theme.colorDialogTint);

image_delete.setBackground(new RippleDrawable(ColorStateList.valueOf(theme
.colorControlHighlight), null, null));
image_edit.setBackground(new RippleDrawable(ColorStateList.valueOf(theme
Expand All @@ -496,6 +520,7 @@ private void loadTheme() {
.colorControlHighlight), null, new ShapeDrawable()));
linear_info.setBackground(new RippleDrawable(ColorStateList.valueOf(theme
.colorControlHighlight), null, new ShapeDrawable()));

((TextView) bottomsheetView.findViewById(R.id.text_title)).setTextColor(theme.colorDialogText);
((TextView) bottomsheetView.findViewById(R.id.text_subtitle)).setTextColor(theme.colorDialogText);
((TextView) bottomsheetView.findViewById(R.id.text_clone)).setTextColor(theme.colorDialogText);
Expand Down

0 comments on commit c50519b

Please sign in to comment.