Skip to content

Commit ca479cf

Browse files
fix(m3): Update to M3 design tokens
Signed-off-by: Andy Scherzinger <[email protected]>
1 parent 32101fc commit ca479cf

File tree

4 files changed

+28
-19
lines changed

4 files changed

+28
-19
lines changed

app/src/main/java/it/niedermann/owncloud/notes/branding/BrandedActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ protected void onStart() {
3636
super.onStart();
3737

3838
final var typedValue = new TypedValue();
39-
getTheme().resolveAttribute(R.attr.colorAccent, typedValue, true);
39+
getTheme().resolveAttribute(R.attr.colorSecondary, typedValue, true);
4040
colorAccent = typedValue.data;
4141

4242
readBrandMainColorLiveData(this).observe(this, this::applyBrand);

app/src/main/java/it/niedermann/owncloud/notes/branding/BrandedFragment.kt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ import kotlinx.coroutines.launch
3131
* @see BrandingUtil for brand color resolution and application.
3232
* @see Branded for the interface definition related to branding behavior.
3333
*/
34-
abstract class BrandedFragment : Fragment(), Branded {
34+
abstract class BrandedFragment :
35+
Fragment(),
36+
Branded {
3537
@JvmField
3638
@ColorInt
3739
protected var colorAccent: Int = 0
@@ -55,16 +57,16 @@ abstract class BrandedFragment : Fragment(), Branded {
5557
val typedValue = TypedValue()
5658

5759
context.theme.resolveAttribute(
58-
com.google.android.material.R.attr.colorAccent,
60+
com.google.android.material.R.attr.colorSecondary,
5961
typedValue,
60-
true
62+
true,
6163
)
6264
colorAccent = typedValue.data
6365

6466
context.theme.resolveAttribute(
65-
com.google.android.material.R.attr.colorPrimary,
67+
com.google.android.material.R.attr.colorPrimaryContainer,
6668
typedValue,
67-
true
69+
true,
6870
)
6971
colorPrimary = typedValue.data
7072

@@ -75,7 +77,10 @@ abstract class BrandedFragment : Fragment(), Branded {
7577

7678
@Suppress("DEPRECATION")
7779
@Deprecated("Deprecated in Java")
78-
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
80+
override fun onCreateOptionsMenu(
81+
menu: Menu,
82+
inflater: MenuInflater,
83+
) {
7984
super.onCreateOptionsMenu(menu, inflater)
8085
val utils = BrandingUtil.of(colorAccent, requireContext())
8186

app/src/main/java/it/niedermann/owncloud/notes/main/MultiSelectedActionModeCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public MultiSelectedActionModeCallback(
8080
this.fragmentManager = fragmentManager;
8181

8282
final TypedValue typedValue = new TypedValue();
83-
context.getTheme().resolveAttribute(com.google.android.material.R.attr.colorAccent, typedValue, true);
83+
context.getTheme().resolveAttribute(com.google.android.material.R.attr.colorSecondary, typedValue, true);
8484
colorAccent = typedValue.data;
8585
}
8686

app/src/main/java/it/niedermann/owncloud/notes/shared/util/ExtendedFabUtil.kt

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,22 @@ object ExtendedFabUtil {
2525
extendedFab.hide()
2626
} else {
2727
if (extendedFab.animation == null) {
28-
val animation = AnimationUtils.loadAnimation(
29-
extendedFab.context,
30-
R.anim.abc_shrink_fade_out_from_bottom,
31-
)
32-
animation.setAnimationListener(object : Animation.AnimationListener {
33-
override fun onAnimationStart(animation: Animation) {}
34-
override fun onAnimationEnd(animation: Animation) {
35-
extendedFab.visibility = View.GONE
36-
}
28+
val animation =
29+
AnimationUtils.loadAnimation(
30+
extendedFab.context,
31+
R.anim.design_bottom_sheet_slide_out,
32+
)
33+
animation.setAnimationListener(
34+
object : Animation.AnimationListener {
35+
override fun onAnimationStart(animation: Animation) {}
36+
37+
override fun onAnimationEnd(animation: Animation) {
38+
extendedFab.visibility = View.GONE
39+
}
3740

38-
override fun onAnimationRepeat(animation: Animation) {}
39-
})
41+
override fun onAnimationRepeat(animation: Animation) {}
42+
},
43+
)
4044
extendedFab.startAnimation(animation)
4145
}
4246
}

0 commit comments

Comments
 (0)