@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); overridePendingTransition(R.anim.push_right_in, R.anim.push_right_out); int actionBarTitle = Resources.getSystem().getIdentifier("action_bar_title", "id", "android"); TextView actionBarTitleView = (TextView) getWindow().findViewById(actionBarTitle); Typeface robotoBoldCondensedItalic = Typeface.createFromAsset(getAssets(), "fonts/Mallanna.ttf"); if (actionBarTitleView != null) { actionBarTitleView.setTypeface(robotoBoldCondensedItalic); } setContentView(R.layout.eng_activity_main); FontsOverride.setDefaultFont(this, "DEFAULT", "fonts/Mallanna.ttf"); FontsOverride.setDefaultFont(this, "MONOSPACE", "fonts/Mallanna.ttf"); FontsOverride.setDefaultFont(this, "SERIF", "fonts/Mallanna.ttf"); FontsOverride.setDefaultFont(this, "SANS_SERIF", "fonts/Mallanna.ttf"); // Adding Google Analytics... easyTracker = EasyTracker.getInstance(EngSongs.this); easyTracker.send( MapBuilder.createEvent("TrackEventTest", "page_loaded", "main_page", null).build()); try { int a[] = new int[2]; int num = a[4]; } catch (ArrayIndexOutOfBoundsException e) { easyTracker.send( MapBuilder.createException( new StandardExceptionParser(EngSongs.this, null) .getDescription(Thread.currentThread().getName(), e), false) .build()); } // Locate the Banner Ad in activity_main.xml AdView adView = (AdView) this.findViewById(R.id.adView); // Request for Ads AdRequest adRequest = new AdRequest.Builder() // Add a test device to show Test Ads .addTestDevice("2181F924609987B5E1B7117BAB38E3DA") .build(); // Load ads into Banner Ads adView.loadAd(adRequest); // Load ads into Interstitial Ads // Prepare an Interstitial Ad Listener ll = (LinearLayout) findViewById(R.id.adLayoutView); if (isNetworkAvailable(getBaseContext())) { ll.setVisibility(LinearLayout.VISIBLE); } else { ll.setVisibility(LinearLayout.GONE); } Locale locale = new Locale("te"); Locale.setDefault(locale); config = new Configuration(); config.locale = locale; getBaseContext() .getResources() .updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics()); mfont = Typeface.createFromAsset(getAssets(), "fonts/Mallanna.ttf"); Resources res = getResources(); String lis[] = res.getStringArray(R.array.Eng_Alphabets); final List<String> Alphalist = Arrays.asList(lis); songlis = res.getStringArray(R.array.Eng_SongList); lv = (ListView) findViewById(R.id.listView1); lv2 = (ListView) findViewById(R.id.listView2); adapter = new ArrayAdapter<String>(EngSongs.this, R.layout.activity_listview, lis); lv.setAdapter(adapter); String str = songlis[0]; String result[] = str.split(","); adapter2 = new ArrayAdapter<String>(EngSongs.this, R.layout.activity_listview, result); lv2.setAdapter(adapter2); LayoutAnimationController controller = AnimationUtils.loadLayoutAnimation(this, R.anim.list_layout_controller); lv2.setLayoutAnimation(controller); lv.setOnItemClickListener(this); lv2.setOnItemClickListener( new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { song = position; Intent i = new Intent(getApplicationContext(), EngLyricDisp.class); i.putExtra("pos", "" + (indexes[letter] + song)); startActivity(i); } }); }
@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); }