@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); overridePendingTransition(R.anim.pull_in_right, R.anim.push_out_left); setContentView(R.layout.activity_shop_screen); // Hide status bar getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); // Hide the action bar ActionBar actionBar = getSupportActionBar(); actionBar.hide(); MainLayout = (LinearLayout) findViewById(R.id.main_layout); MainLayout.setBackgroundResource(R.drawable.background); // Set opacity on background_coin ImageView img = (ImageView) findViewById(R.id.background_coin); img.setImageAlpha(85); final Button usables = (Button) findViewById(R.id.usablebtn); final Button cosmetic = (Button) findViewById(R.id.Cosmeticbtn); usables.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { if (!FragUsable.isVisible()) { cosmetic.setBackgroundResource(R.drawable.buttonmenu); cosmetic.setTextColor(Color.WHITE); usables.setBackgroundResource(R.drawable.buttonpressed); usables.setTextColor(Color.parseColor("#ce492b")); FragmentManager fm = getFragmentManager(); FragmentTransaction ft = fm.beginTransaction(); ft.setCustomAnimations(R.animator.slide_in_left, R.animator.slide_out_right); ft.replace(R.id.fragment_place, FragUsable); ft.commit(); } } }); cosmetic.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { if (!FragCosmetic.isVisible()) { usables.setBackgroundResource(R.drawable.buttonmenu); usables.setTextColor(Color.WHITE); cosmetic.setBackgroundResource(R.drawable.buttonpressed); cosmetic.setTextColor(Color.parseColor("#ce492b")); FragmentManager fm = getFragmentManager(); FragmentTransaction ft = fm.beginTransaction(); ft.setCustomAnimations(R.animator.slide_in_right, R.animator.slide_out_left); ft.replace(R.id.fragment_place, FragCosmetic); ft.commit(); } } }); TextView goldText = (TextView) findViewById(R.id.editText); Button Cosmeticbtn = (Button) findViewById(R.id.Cosmeticbtn); Button usablebtn = (Button) findViewById(R.id.usablebtn); FontsOverride.setTextViewFont(this, goldText); FontsOverride.setButtonFont(this, Cosmeticbtn); FontsOverride.setButtonFont(this, usablebtn); }