From 784e186dc76839cb562c1a14da783f577aaabe04 Mon Sep 17 00:00:00 2001 From: fasteque Date: Wed, 4 Nov 2015 22:31:36 +0100 Subject: [PATCH] #59: set title using the HEX representation --- .../fastebro/androidrgbtool/ui/ColorDetailsActivity.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/android-rgb-tool/src/main/java/com/fastebro/androidrgbtool/ui/ColorDetailsActivity.java b/android-rgb-tool/src/main/java/com/fastebro/androidrgbtool/ui/ColorDetailsActivity.java index 6c37430..cfd6fd9 100644 --- a/android-rgb-tool/src/main/java/com/fastebro/androidrgbtool/ui/ColorDetailsActivity.java +++ b/android-rgb-tool/src/main/java/com/fastebro/androidrgbtool/ui/ColorDetailsActivity.java @@ -11,6 +11,7 @@ import com.fastebro.androidrgbtool.R; import com.fastebro.androidrgbtool.fragments.ColorSampleFragment; +import com.fastebro.androidrgbtool.utils.ColorUtils; public class ColorDetailsActivity extends BaseActivity { @@ -35,6 +36,12 @@ protected void onCreate(Bundle savedInstanceState) { tabLayout.setupWithViewPager(viewPager); argbValues = getIntent().getShortArrayExtra(INTENT_EXTRA_RGB_COLOR); + + if (getSupportActionBar() != null) { + getSupportActionBar().setTitle(String.format("#%s%s%s%s", ColorUtils.RGBToHex(argbValues[0]), ColorUtils + .RGBToHex(argbValues[1]), ColorUtils.RGBToHex(argbValues[2]), + ColorUtils.RGBToHex(argbValues[3]))); + } } public class SectionsPagerAdapter extends FragmentPagerAdapter {