Skip to content

Commit a721c61

Browse files
Add Icons to Settings Activity (#585)
* Added Material Icons * Update Settings logos * reformat code Co-authored-by: Chirag Jain <[email protected]>
1 parent 7eab1ea commit a721c61

14 files changed

+134
-9
lines changed

src/main/java/org/amahi/anywhere/activity/SettingsActivity.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@
1919

2020
package org.amahi.anywhere.activity;
2121

22-
import androidx.fragment.app.FragmentManager;
23-
import androidx.fragment.app.FragmentTransaction;
24-
2522
import android.content.Context;
23+
import android.graphics.PorterDuff;
24+
import android.graphics.drawable.Drawable;
2625
import android.os.Bundle;
26+
import android.view.MenuItem;
2727

2828
import androidx.appcompat.app.AppCompatActivity;
2929
import androidx.appcompat.app.AppCompatDelegate;
30-
31-
import android.view.MenuItem;
30+
import androidx.fragment.app.FragmentManager;
31+
import androidx.fragment.app.FragmentTransaction;
3232

3333
import com.squareup.otto.Subscribe;
3434

@@ -66,7 +66,12 @@ protected void onCreate(Bundle savedInstanceState) {
6666
}
6767

6868
private void setUpHomeNavigation() {
69-
getSupportActionBar().setHomeButtonEnabled(true);
69+
Drawable icon = getResources().getDrawable(R.drawable.arrow_back);
70+
icon.setColorFilter(getResources().getColor(R.color.primary_text_material_light), PorterDuff.Mode.SRC_IN);
71+
if (getSupportActionBar() != null) {
72+
getSupportActionBar().setHomeAsUpIndicator(R.drawable.arrow_back);
73+
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
74+
}
7075
}
7176

7277
private void setUpSettingsFragment() {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="24"
5+
android:viewportHeight="24"
6+
android:tint="?attr/colorControlNormal">
7+
<path
8+
android:fillColor="@android:color/white"
9+
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
10+
</vector>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="36dp"
3+
android:height="36dp"
4+
android:viewportWidth="24"
5+
android:viewportHeight="24">
6+
<path
7+
android:fillColor="#000000"
8+
android:pathData="M20,15.31L23.31,12 20,8.69V4h-4.69L12,0.69 8.69,4H4v4.69L0.69,12 4,15.31V20h4.69L12,23.31 15.31,20H20v-4.69zM12,18V6c3.31,0 6,2.69 6,6s-2.69,6 -6,6z" />
9+
</vector>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="36dp"
3+
android:height="36dp"
4+
android:viewportWidth="24"
5+
android:viewportHeight="24">
6+
<path
7+
android:fillColor="#000000"
8+
android:pathData="M1,9l2,2c4.97,-4.97 13.03,-4.97 18,0l2,-2C16.93,2.93 7.08,2.93 1,9zM9,17l3,3 3,-3c-1.65,-1.66 -4.34,-1.66 -6,0zM5,13l2,2c2.76,-2.76 7.24,-2.76 10,0l2,-2C15.14,9.14 8.87,9.14 5,13z" />
9+
</vector>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="36dp"
3+
android:height="36dp"
4+
android:viewportWidth="24"
5+
android:viewportHeight="24">
6+
<path
7+
android:fillColor="#000000"
8+
android:pathData="M20,2L4,2c-1.1,0 -1.99,0.9 -1.99,2L2,22l4,-4h14c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM13,14h-2v-2h2v2zM13,10h-2L11,6h2v4z" />
9+
</vector>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="36dp"
3+
android:height="36dp"
4+
android:viewportWidth="24"
5+
android:viewportHeight="24">
6+
<path
7+
android:fillColor="#000000"
8+
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,5c1.66,0 3,1.34 3,3s-1.34,3 -3,3 -3,-1.34 -3,-3 1.34,-3 3,-3zM12,19.2c-2.5,0 -4.71,-1.28 -6,-3.22 0.03,-1.99 4,-3.08 6,-3.08 1.99,0 5.97,1.09 6,3.08 -1.29,1.94 -3.5,3.22 -6,3.22z" />
9+
</vector>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="36dp"
3+
android:height="36dp"
4+
android:viewportWidth="24"
5+
android:viewportHeight="24">
6+
<path
7+
android:fillColor="#000000"
8+
android:pathData="M21,5c-1.11,-0.35 -2.33,-0.5 -3.5,-0.5c-1.95,0 -4.05,0.4 -5.5,1.5c-1.45,-1.1 -3.55,-1.5 -5.5,-1.5S2.45,4.9 1,6v14.65c0,0.25 0.25,0.5 0.5,0.5c0.1,0 0.15,-0.05 0.25,-0.05C3.1,20.45 5.05,20 6.5,20c1.95,0 4.05,0.4 5.5,1.5c1.35,-0.85 3.8,-1.5 5.5,-1.5c1.65,0 3.35,0.3 4.75,1.05c0.1,0.05 0.15,0.05 0.25,0.05c0.25,0 0.5,-0.25 0.5,-0.5V6C22.4,5.55 21.75,5.25 21,5zM21,18.5c-1.1,-0.35 -2.3,-0.5 -3.5,-0.5c-1.7,0 -4.15,0.65 -5.5,1.5V8c1.35,-0.85 3.8,-1.5 5.5,-1.5c1.2,0 2.4,0.15 3.5,0.5V18.5z" />
9+
<path
10+
android:fillColor="#000000"
11+
android:pathData="M17.5,10.5c0.88,0 1.73,0.09 2.5,0.26V9.24C19.21,9.09 18.36,9 17.5,9c-1.7,0 -3.24,0.29 -4.5,0.83v1.66C14.13,10.85 15.7,10.5 17.5,10.5z" />
12+
<path
13+
android:fillColor="#000000"
14+
android:pathData="M13,12.49v1.66c1.13,-0.64 2.7,-0.99 4.5,-0.99c0.88,0 1.73,0.09 2.5,0.26V11.9c-0.79,-0.15 -1.64,-0.24 -2.5,-0.24C15.8,11.66 14.26,11.96 13,12.49z" />
15+
<path
16+
android:fillColor="#000000"
17+
android:pathData="M17.5,14.33c-1.7,0 -3.24,0.29 -4.5,0.83v1.66c1.13,-0.64 2.7,-0.99 4.5,-0.99c0.88,0 1.73,0.09 2.5,0.26v-1.52C19.21,14.41 18.36,14.33 17.5,14.33z" />
18+
</vector>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="36dp"
3+
android:height="36dp"
4+
android:viewportWidth="24"
5+
android:viewportHeight="24">
6+
<path
7+
android:fillColor="#000000"
8+
android:pathData="M18,1.01L8,1c-1.1,0 -2,0.9 -2,2v3h2V5h10v14H8v-1H6v3c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2V3c0,-1.1 -0.9,-1.99 -2,-1.99zM10,15h2V8H5v2h3.59L3,15.59 4.41,17 10,11.41z" />
9+
</vector>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="36dp"
3+
android:height="36dp"
4+
android:viewportWidth="24"
5+
android:viewportHeight="24">
6+
<path
7+
android:fillColor="#000000"
8+
android:pathData="M20,2L4,2c-1.1,0 -1.99,0.9 -1.99,2L2,22l4,-4h14c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM6,14v-2.47l6.88,-6.88c0.2,-0.2 0.51,-0.2 0.71,0l1.77,1.77c0.2,0.2 0.2,0.51 0,0.71L8.47,14L6,14zM18,14h-7.5l2,-2L18,12v2z" />
9+
</vector>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="36dp"
3+
android:height="36dp"
4+
android:viewportWidth="24"
5+
android:viewportHeight="24">
6+
<path
7+
android:pathData="M21,4L11,4l-1,-3L3,1c-1.1,0 -2,0.9 -2,2v15c0,1.1 0.9,2 2,2h8l1,3h9c1.1,0 2,-0.9 2,-2L23,6c0,-1.1 -0.9,-2 -2,-2zM7,16c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5c1.35,0 2.48,0.5 3.35,1.3L9.03,8.57c-0.38,-0.36 -1.04,-0.78 -2.03,-0.78 -1.74,0 -3.15,1.44 -3.15,3.21S5.26,14.21 7,14.21c2.01,0 2.84,-1.44 2.92,-2.41L7,11.8v-1.71h4.68c0.07,0.31 0.12,0.61 0.12,1.02C11.8,13.97 9.89,16 7,16zM13.17,10.58h3.7c-0.43,1.25 -1.11,2.43 -2.05,3.47 -0.31,-0.35 -0.6,-0.72 -0.86,-1.1l-0.79,-2.37zM21.5,20.5c0,0.55 -0.45,1 -1,1L14,21.5l2,-2.5 -1.04,-3.1 3.1,3.1 0.92,-0.92 -3.3,-3.25 0.02,-0.02c1.13,-1.25 1.93,-2.69 2.4,-4.22L20,10.59v-1.3h-4.53L15.47,8h-1.29v1.29h-1.44L11.46,5.5h9.04c0.55,0 1,0.45 1,1v14z"
8+
android:fillColor="#000000"/>
9+
</vector>

0 commit comments

Comments
 (0)