Skip to content

Commit

Permalink
#59: set title using the HEX representation
Browse files Browse the repository at this point in the history
  • Loading branch information
fasteque committed Nov 4, 2015
1 parent ecb5220 commit 784e186
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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 {
Expand Down

0 comments on commit 784e186

Please sign in to comment.