Skip to content

Commit

Permalink
clean up styles
Browse files Browse the repository at this point in the history
  • Loading branch information
sdex committed Aug 12, 2021
1 parent 2d32b18 commit 7b43b8e
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 53 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ app/src/main/assets/crashlytics-build.properties

# release builds
release
/app/keystore/
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package com.sdex.activityrunner.app.dialog

import android.content.Context
import android.os.Bundle

import android.util.TypedValue
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
Expand Down Expand Up @@ -45,7 +43,7 @@ class ActivityMenuDialog : BottomSheetDialogFragment() {

activity_name.text = model.name
action_activity_add_shortcut.setOnClickListener {
showShortcutDialog(model)
AddShortcutDialogActivity.start(requireContext(), model)
dismiss()
}
// action_activity_launch_with_params.visibility =
Expand All @@ -60,16 +58,6 @@ class ActivityMenuDialog : BottomSheetDialogFragment() {
}
}

override fun getTheme(): Int {
val typedValue = TypedValue()
requireActivity().theme.resolveAttribute(R.attr.bottomDialogStyle, typedValue, true)
return typedValue.data
}

private fun showShortcutDialog(item: ActivityModel) {
AddShortcutDialogActivity.start(requireContext(), item)
}

companion object {

const val TAG = "ActivityMenuDialog"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.sdex.activityrunner.app.dialog

import android.os.Bundle
import android.util.TypedValue
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
Expand Down Expand Up @@ -59,12 +58,6 @@ class ApplicationMenuDialog : BottomSheetDialogFragment() {
}
}

override fun getTheme(): Int {
val typedValue = TypedValue()
requireActivity().theme.resolveAttribute(R.attr.bottomDialogStyle, typedValue, true)
return typedValue.data
}

companion object {

const val TAG = "ApplicationMenuDialog"
Expand Down
9 changes: 0 additions & 9 deletions app/src/main/res/drawable/background_bottom_dialog.xml

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/drawable/background_snackbar.xml

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/values/attrs.xml

This file was deleted.

15 changes: 9 additions & 6 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<resources>

<style name="AppBottomSheetStyle" parent="Widget.Design.BottomSheet.Modal">
<item name="behavior_peekHeight">512dp</item>
</style>

<style name="ToolbarStyle" parent="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="colorAccent">@color/white</item>
</style>
Expand All @@ -18,8 +14,15 @@
<item name="android:ellipsize">end</item>
</style>

<style name="BottomSheet" parent="@style/Widget.Design.BottomSheet.Modal">
<item name="android:background">@drawable/background_bottom_dialog</item>
<style name="BottomSheet" parent="Widget.MaterialComponents.BottomSheet">
<item name="shapeAppearanceOverlay">@style/ShapeAppearanceOverlay</item>
</style>

<style name="ShapeAppearanceOverlay" parent="">
<item name="cornerSizeTopLeft">@dimen/bottom_sheet_corner_radius</item>
<item name="cornerSizeTopRight">@dimen/bottom_sheet_corner_radius</item>
<item name="cornerFamilyTopLeft">rounded</item>
<item name="cornerFamilyTopRight">rounded</item>
</style>

<style name="TooltipTextAppearance">
Expand Down
7 changes: 1 addition & 6 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowBackground">@color/background</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
<item name="bottomDialogStyle">@style/BottomSheetDialogTheme</item>
<item name="bottomSheetDialogTheme">@style/AppBottomSheetDialogTheme</item>
<item name="bottomSheetDialogTheme">@style/BottomSheetDialogTheme</item>
</style>

<style name="AppTheme" parent="Base.V0.AppTheme" />
Expand Down Expand Up @@ -43,10 +42,6 @@
<item name="colorAccent">@color/colorAccent</item>
</style>

<style name="AppBottomSheetDialogTheme" parent="Theme.MaterialComponents.DayNight.BottomSheetDialog">
<item name="bottomSheetStyle">@style/AppBottomSheetStyle</item>
</style>

<style name="Base.V0.BottomSheetDialogTheme" parent="@style/Theme.MaterialComponents.DayNight.BottomSheetDialog">
<item name="android:windowIsFloating">false</item>
</style>
Expand Down

0 comments on commit 7b43b8e

Please sign in to comment.