Skip to content

Commit

Permalink
Merge branch 'master' into icon
Browse files Browse the repository at this point in the history
  • Loading branch information
VishnuSanal committed Aug 22, 2023
2 parents ed659de + 14cd375 commit a224825
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
settingsFAB,
homeFAB;

private ImageView homeFABOverlay;

private CircularProgressIndicator progressIndicator;
private ChipGroup chipGroup;
private HorizontalScrollView chipGroupScrollView;
Expand Down Expand Up @@ -484,6 +486,8 @@ private void initFABs() {
settingsFAB = findViewById(R.id.settingsFAB);
homeFAB = findViewById(R.id.homeFAB);

homeFABOverlay = findViewById(R.id.homeFABAnimationView);

homeFAB.setOnClickListener(this);
settingsFAB.setOnClickListener(this);
favFAB.setOnClickListener(this);
Expand All @@ -493,6 +497,9 @@ private void initFABs() {
aboutFAB.setOnClickListener(this);
cardFAB.setOnClickListener(this);
new SwipeListener(homeFAB);

homeFABOverlay.startAnimation(
AnimationUtils.loadAnimation(this, R.anim.ripple_pulse_animation));
}

private void closeFABMenu() {
Expand Down
23 changes: 23 additions & 0 deletions app/src/main/res/anim/ripple_pulse_animation.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">

<scale
android:duration="2000"
android:fromXScale="0"
android:fromYScale="0"
android:interpolator="@android:anim/accelerate_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="infinite"
android:repeatMode="restart"
android:toXScale="5"
android:toYScale="5" />

<alpha
android:duration="2000"
android:fromAlpha="1.0"
android:repeatCount="infinite"
android:repeatMode="restart"
android:toAlpha="0.0" />

</set>
14 changes: 14 additions & 0 deletions app/src/main/res/drawable/circle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">

<solid android:color="@color/FABOverlayBGColor" />

<size
android:width="120dp"
android:height="120dp" />

<stroke
android:width="4dp"
android:color="@color/FABOverlayColor" />
</shape>
46 changes: 29 additions & 17 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/homeSearchTIL"
app:layout_constraintTop_toTopOf="parent"
app:tint="@color/colorWhite" />
app:tint="@color/FABIconColor" />

<androidx.constraintlayout.widget.Guideline
android:id="@+id/homeGuideLineOne"
Expand Down Expand Up @@ -126,16 +126,16 @@
android:contentDescription="@string/about_fab"
android:focusable="true"
android:scaleType="fitXY"
android:tint="@color/colorPrimaryDark"
android:visibility="gone"
app:backgroundTint="@color/FABColor"
app:elevation="8dp"
app:fabSize="mini"
app:layout_constraintBottom_toBottomOf="@id/homeFAB"
app:layout_constraintEnd_toEndOf="@id/homeFAB"
app:layout_constraintStart_toStartOf="@id/homeFAB"
app:layout_constraintTop_toTopOf="@id/homeFAB"
app:srcCompat="@drawable/ic_info"
app:tint="@color/colorWhite" />
app:tint="@color/FABIconColor" />

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/cardFAB"
Expand All @@ -146,16 +146,16 @@
android:contentDescription="@string/about_fab"
android:focusable="true"
android:scaleType="fitXY"
android:tint="@color/colorPrimaryDark"
android:visibility="gone"
app:backgroundTint="@color/FABColor"
app:elevation="8dp"
app:fabSize="mini"
app:layout_constraintBottom_toBottomOf="@id/homeFAB"
app:layout_constraintEnd_toEndOf="@id/homeFAB"
app:layout_constraintStart_toStartOf="@id/homeFAB"
app:layout_constraintTop_toTopOf="@id/homeFAB"
app:srcCompat="@drawable/ic_move"
app:tint="@color/colorWhite" />
app:tint="@color/FABIconColor" />

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/settingsFAB"
Expand All @@ -166,15 +166,15 @@
android:contentDescription="@string/settings_fab"
android:focusable="true"
android:scaleType="fitXY"
android:tint="@color/colorPrimaryDark"
android:visibility="gone"
app:backgroundTint="@color/FABColor"
app:fabSize="mini"
app:layout_constraintBottom_toBottomOf="@id/homeFAB"
app:layout_constraintEnd_toEndOf="@id/homeFAB"
app:layout_constraintStart_toStartOf="@id/homeFAB"
app:layout_constraintTop_toTopOf="@id/homeFAB"
app:srcCompat="@drawable/ic_settings"
app:tint="@color/colorWhite" />
app:tint="@color/FABIconColor" />

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fontFAB"
Expand All @@ -185,16 +185,16 @@
android:contentDescription="@string/font_fab"
android:focusable="true"
android:scaleType="fitXY"
android:tint="@color/colorPrimaryDark"
android:visibility="gone"
app:backgroundTint="@color/FABColor"
app:elevation="8dp"
app:fabSize="mini"
app:layout_constraintBottom_toBottomOf="@id/homeFAB"
app:layout_constraintEnd_toEndOf="@id/homeFAB"
app:layout_constraintStart_toStartOf="@id/homeFAB"
app:layout_constraintTop_toTopOf="@id/homeFAB"
app:srcCompat="@drawable/ic_font"
app:tint="@color/colorWhite" />
app:tint="@color/FABIconColor" />

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/homeFAB"
Expand All @@ -205,14 +205,26 @@
android:contentDescription="@string/home_fab"
android:focusable="true"
android:scaleType="fitXY"
android:tint="@color/colorPrimaryDark"
app:backgroundTint="@color/FABColor"
app:elevation="12dp"
app:fabSize="normal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:srcCompat="@drawable/ic_menu"
app:tint="@color/colorWhite" />
app:tint="@color/FABIconColor" />

<ImageView
android:id="@+id/homeFABAnimationView"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_margin="2dp"
android:contentDescription="@string/home_fab_overlay"
android:src="@drawable/circle"
app:layout_constraintBottom_toBottomOf="@id/homeFAB"
app:layout_constraintEnd_toEndOf="@id/homeFAB"
app:layout_constraintStart_toStartOf="@id/homeFAB"
app:layout_constraintTop_toTopOf="@id/homeFAB" />

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/bgFAB"
Expand All @@ -223,16 +235,16 @@
android:contentDescription="@string/bg_fab"
android:focusable="true"
android:scaleType="fitXY"
android:tint="@color/colorPrimaryDark"
android:visibility="gone"
app:backgroundTint="@color/FABColor"
app:elevation="8dp"
app:fabSize="mini"
app:layout_constraintBottom_toBottomOf="@id/homeFAB"
app:layout_constraintEnd_toEndOf="@id/homeFAB"
app:layout_constraintStart_toStartOf="@id/homeFAB"
app:layout_constraintTop_toTopOf="@id/homeFAB"
app:srcCompat="@drawable/ic_insert_photo"
app:tint="@color/colorWhite" />
app:tint="@color/FABIconColor" />

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/colorFAB"
Expand All @@ -243,16 +255,16 @@
android:contentDescription="@string/color_fab"
android:focusable="true"
android:scaleType="fitXY"
android:tint="@color/colorPrimaryDark"
android:visibility="gone"
app:backgroundTint="@color/FABColor"
app:elevation="8dp"
app:fabSize="mini"
app:layout_constraintBottom_toBottomOf="@id/homeFAB"
app:layout_constraintEnd_toEndOf="@id/homeFAB"
app:layout_constraintStart_toStartOf="@id/homeFAB"
app:layout_constraintTop_toTopOf="@id/homeFAB"
app:srcCompat="@drawable/ic_color_lens"
app:tint="@color/colorWhite" />
app:tint="@color/FABIconColor" />

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/favFAB"
Expand All @@ -263,15 +275,15 @@
android:contentDescription="@string/fav_fab"
android:focusable="true"
android:scaleType="fitXY"
android:tint="@color/colorPrimaryDark"
android:visibility="gone"
app:backgroundTint="@color/FABColor"
app:elevation="8dp"
app:fabSize="mini"
app:layout_constraintBottom_toBottomOf="@id/homeFAB"
app:layout_constraintEnd_toEndOf="@id/homeFAB"
app:layout_constraintStart_toStartOf="@id/homeFAB"
app:layout_constraintTop_toTopOf="@id/homeFAB"
app:srcCompat="@drawable/ic_favorite"
app:tint="@color/colorWhite" />
app:tint="@color/FABIconColor" />

</androidx.constraintlayout.widget.ConstraintLayout>
6 changes: 6 additions & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,10 @@
<color name="favRedColor">#FF1744</color>
<color name="favGreenColor">#00C853</color>

<color name="FABColor">#32FFFFFF</color>
<color name="FABIconColor">@color/colorWhite</color>

<color name="FABOverlayColor">#312C69</color>
<color name="FABOverlayBGColor">#26FFFFFF</color>

</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
<string name="settings_fab" translatable="false">Settings FAB</string>
<string name="font_fab" translatable="false">Font FAB</string>
<string name="home_fab" translatable="false">Home FAB</string>
<string name="home_fab_overlay" translatable="false">Home FAB Overlay</string>
<string name="bg_fab" translatable="false">BG FAB</string>
<string name="color_fab" translatable="false">Color FAB</string>
<string name="fav_fab" translatable="false">Fav FAB</string>
Expand Down

0 comments on commit a224825

Please sign in to comment.