Skip to content

Commit

Permalink
Issue #50: Migrate to Material 3
Browse files Browse the repository at this point in the history
  • Loading branch information
AmrDeveloper committed Oct 29, 2023
1 parent c13aa96 commit 5c979ab
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 18 deletions.
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/ic_check.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z"/>
</vector>
12 changes: 6 additions & 6 deletions app/src/main/res/layout/fragment_folder.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/folder_title_layout"
style="@style/TextInputLayoutStyle"
android:layout_below="@id/folder_logo"
android:layout_margin="@dimen/dimen10dp"
android:hint="@string/folder_name"
style="@style/TextInputLayoutStyle"
app:counterEnabled="true"
app:counterMaxLength="30">

Expand All @@ -38,12 +38,12 @@

<com.amrdeveloper.linkhub.ui.view.ColorSelector
android:id="@+id/folder_color_selector"
android:layout_below="@+id/folder_title_layout"
android:layout_width="wrap_content"
android:layout_centerHorizontal="true"
android:layout_height="wrap_content"/>
android:layout_height="wrap_content"
android:layout_below="@+id/folder_title_layout"
android:layout_centerHorizontal="true" />

<com.google.android.material.switchmaterial.SwitchMaterial
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/folder_pinned_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand All @@ -52,7 +52,7 @@
android:checked="false"
android:text="@string/pinned"
android:textSize="@dimen/dimen18sp"
app:thumbTint="@color/sky"
app:thumbIcon="@drawable/ic_check"
app:trackTint="@color/grey" />
</RelativeLayout>
</ScrollView>
10 changes: 5 additions & 5 deletions app/src/main/res/layout/fragment_link.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,24 @@

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/folder_name_layout"
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox.Dense.ExposedDropdownMenu"
style="@style/Widget.Material3.TextInputLayout.FilledBox.Dense.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/link_url_layout"
android:layout_margin="@dimen/dimen5dp"
android:hint="@string/folder_name"
app:hintTextColor="@color/sky">

<AutoCompleteTextView
<com.google.android.material.textfield.MaterialAutoCompleteTextView
android:id="@+id/folder_name_menu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="none"
android:fontFamily="serif"
android:inputType="none"
android:text="@string/none" />
</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.switchmaterial.SwitchMaterial
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/link_pinned_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand All @@ -86,7 +86,7 @@
android:text="@string/pinned"
android:textSize="@dimen/dimen18sp"
app:switchPadding="@dimen/dimen5dp"
app:thumbTint="@color/sky"
app:thumbIcon="@drawable/ic_check"
app:trackTint="@color/grey" />

<TextView
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values-night/themes.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.LinkHub" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<style name="Theme.LinkHub" parent="Theme.Material3.Dark">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/black</item>
<item name="colorPrimaryVariant">@color/black</item>
Expand All @@ -26,7 +26,7 @@
<item name="appWidgetTextColor">@color/light_blue_100</item>
</style>

<style name="Theme.LinkHub.Button" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<style name="Theme.LinkHub.Button" parent="Theme.Material3.Dark">
<item name="colorPrimary">@color/light_blue_600</item>
<item name="colorOnPrimary">@color/black</item>
</style>
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<resources xmlns:tools="http://schemas.android.com/tools">

<style name="Theme.LinkHub" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<style name="Theme.LinkHub" parent="Theme.Material3.Light">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/white</item>
<item name="colorPrimaryVariant">@color/white</item>
Expand All @@ -26,11 +26,11 @@
<item name="hintTextColor">@android:color/black</item>
</style>

<style name="LightToolBar" parent="@style/Widget.MaterialComponents.Toolbar">
<style name="LightToolBar" parent="@style/Widget.Material3.Toolbar">
<item name="titleTextColor">@color/sky</item>
</style>

<style name="TextInputLayoutStyle" parent="Widget.MaterialComponents.TextInputLayout.FilledBox.Dense">
<style name="TextInputLayoutStyle" parent="Widget.Material3.TextInputLayout.FilledBox.Dense">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="boxStrokeColor">@color/sky</item>
Expand All @@ -39,7 +39,7 @@
<item name="theme">@style/Widget.AppTheme.TextInputLayout.FilledBox.Dense</item>
</style>

<style name="Widget.AppTheme.TextInputLayout.FilledBox.Dense" parent="Widget.MaterialComponents.TextInputLayout.FilledBox.Dense">
<style name="Widget.AppTheme.TextInputLayout.FilledBox.Dense" parent="Widget.Material3.TextInputLayout.FilledBox.Dense">
<item name="colorControlActivated">@color/sky</item>
</style>

Expand All @@ -48,7 +48,7 @@
<item name="appWidgetTextColor">@color/black</item>
</style>

<style name="Theme.LinkHub.Button" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<style name="Theme.LinkHub.Button" parent="Theme.Material3.DayNight">
<item name="colorPrimary">@color/sky</item>
<item name="colorOnPrimary">@color/white</item>
</style>
Expand Down

0 comments on commit 5c979ab

Please sign in to comment.