Skip to content

Commit

Permalink
Import Google Assistant icon and show it when OPA is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
amirzaidi committed May 19, 2019
1 parent cad04d9 commit 744f6f6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
19 changes: 19 additions & 0 deletions res/drawable/ic_poodle_color.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24.0dip"
android:height="24.0dip"
android:viewportWidth="192.0"
android:viewportHeight="192.0">
<path
android:fillColor="#ff34a853"
android:pathData="M160,60a12,12 0 1,0 24,0a12,12 0 1,0 -24,0z" />
<path
android:fillColor="#ffea4335"
android:pathData="M112,88a24,24 0 1,0 48,0a24,24 0 1,0 -48,0z" />
<path
android:fillColor="#fffbbc05"
android:pathData="M108,148a28,28 0 1,0 56,0a28,28 0 1,0 -56,0" />
<path
android:fillColor="#ff4285f4"
android:pathData="M8,64a48,48 0 1,0 96,0a48,48 0 1,0 -96,0z" />
</vector>
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.FrameLayout;
import android.widget.ImageView;

import com.android.launcher3.DeviceProfile;
import com.android.launcher3.DeviceProfile.LauncherLayoutChangeListener;
Expand Down Expand Up @@ -198,7 +199,10 @@ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, Strin
}

private void loadPreferences(SharedPreferences sharedPreferences) {
mMicIconView.setVisibility(sharedPreferences.getBoolean("opa_enabled", true) ? View.GONE : View.VISIBLE);
((ImageView) mMicIconView).setImageResource(
sharedPreferences.getBoolean("opa_enabled", true)
? R.drawable.ic_poodle_color
: R.drawable.ic_mic_color);
requestLayout();
}
}

0 comments on commit 744f6f6

Please sign in to comment.