From f482c623168dd83e30230562a5d379a0d050dafe Mon Sep 17 00:00:00 2001 From: fasteque Date: Mon, 26 Oct 2015 21:33:10 +0100 Subject: [PATCH] #59: get the rgb color values from the intent --- .../fastebro/androidrgbtool/ui/ColorDetailsActivity.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 6de4b9a..22fb9c9 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 @@ -14,8 +14,10 @@ public class ColorDetailsActivity extends BaseActivity { + protected static final String INTENT_EXTRA_RGB_COLOR = "com.fastebro.androidrgbtool.extra.RGB_COLOR"; private SectionsPagerAdapter sectionsPagerAdapter; private ViewPager viewPager; + private short[] rgbaValues; @Override protected void onCreate(Bundle savedInstanceState) { @@ -31,6 +33,8 @@ protected void onCreate(Bundle savedInstanceState) { TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs); tabLayout.setupWithViewPager(viewPager); + + rgbaValues = getIntent().getShortArrayExtra(INTENT_EXTRA_RGB_COLOR); } public class SectionsPagerAdapter extends FragmentPagerAdapter { @@ -54,9 +58,9 @@ public int getCount() { public CharSequence getPageTitle(int position) { switch (position) { case 0: - return "SECTION 1"; + return getString(R.string.color_details_as_text_title); case 1: - return "SECTION 2"; + return getString(R.string.color_details_as_background_title); } return null; }