Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.66 KB | None | 0 0
  1. TextView t;
  2. ImageView image;
  3.  
  4. @Override
  5. protected void onCreate(Bundle savedInstanceState) {
  6. getSupportActionBar().setDisplayShowHomeEnabled(true);
  7. getSupportActionBar().setIcon(R.drawable.ic_logo);
  8.  
  9. super.onCreate(savedInstanceState);
  10. setContentView(R.layout.activity_main);
  11.  
  12.  
  13. t = (TextView) findViewById(R.id.nazvanie);
  14. Typeface meCustomFont1 = Typeface.createFromAsset(getAssets(), "fonts/LegionaryBold.otf");
  15. t.setTypeface(meCustomFont1);
  16.  
  17. t = (TextView) findViewById(R.id.predpisanie);
  18. Typeface meCustomFont2 = Typeface.createFromAsset(getAssets(), "fonts/LegionaryItalic.otf");
  19. t.setTypeface(meCustomFont2);
  20.  
  21. t = (TextView) findViewById(R.id.opisan);
  22. Typeface meCustomFont3 = Typeface.createFromAsset(getAssets(), "fonts/Legionary.otf");
  23. t.setTypeface(meCustomFont3);
  24.  
  25.  
  26. RelativeLayout mainpage = (RelativeLayout) findViewById(R.id.mainpage);
  27. ScrollView Opisanie = (ScrollView) findViewById(R.id.Opisanie);
  28. final ImageView imageView = (ImageView) findViewById(R.id.ImageView);
  29. final TextView nazvanie = (TextView) findViewById(R.id.nazvanie);
  30. final TextView predpisanie = (TextView) findViewById(R.id.predpisanie);
  31. final TextView opisan = (TextView) findViewById(R.id.opisan);
  32. ScrollView Perecheslenie = (ScrollView) findViewById(R.id.Perecheslenie);
  33. final ImageButton imageButton = (ImageButton) findViewById(R.id.imageButton);
  34. final ImageButton imageButton2 = (ImageButton) findViewById(R.id.imageButton2);
  35. final ImageButton imageButton3 = (ImageButton) findViewById(R.id.imageButton3);
  36. final ImageButton imageButton4 = (ImageButton) findViewById(R.id.imageButton4);
  37. final ImageButton imageButton5 = (ImageButton) findViewById(R.id.imageButton5);
  38. final ImageButton imageButton6 = (ImageButton) findViewById(R.id.imageButton6);
  39. final ImageButton imageButton7 = (ImageButton) findViewById(R.id.imageButton7);
  40. final ImageButton imageButton8 = (ImageButton) findViewById(R.id.imageButton8);
  41. final ImageButton imageButton9 = (ImageButton) findViewById(R.id.imageButton9);
  42. final ImageButton imageButton10 = (ImageButton) findViewById(R.id.imageButton10);
  43.  
  44.  
  45.  
  46.  
  47. imageButton.setOnClickListener(new View.OnClickListener() {
  48. @Override
  49. public void onClick(View v) {
  50. MediaPlayer ring= MediaPlayer.create(main.this,R.raw.firsts);
  51. ring.start();
  52.  
  53. nazvanie.setText(getResources().getString(R.string.imageButton1));
  54. predpisanie.setText(getResources().getString(R.string.imageButton1_1));
  55. opisan.setText(getResources().getText(R.string.imageButton1_2));
  56. image.setImageResource(R.drawable.ic_launcher_2);
  57. }
  58. });
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement