Skip to content

Commit

Permalink
#59: get the rgb color values from the intent
Browse files Browse the repository at this point in the history
  • Loading branch information
fasteque committed Oct 26, 2015
1 parent 7fbfbe9 commit f482c62
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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 {
Expand All @@ -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;
}
Expand Down

0 comments on commit f482c62

Please sign in to comment.