lampiran a-1 · lampiran a-1 . 45 loading masuk . 46 lampiran a-2 . 47 tampilan awal . 48 lampiran...

Post on 17-Sep-2020

5 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

44

LAMPIRAN A-1

45

Loading Masuk

46

LAMPIRAN A-2

47

Tampilan Awal

48

LAMPIRAN B-1

49

Daftar Tokoh Wayang

50

LAMPIRAN B-2

51

Menu Tentang

52

LAMPIRAN B-3

53

Menu Games

54

LAMPIRAN B-4

55

Menu Quiz

56

LAMPIRAN C-1

57

Coding Splash Screen

package com.ruarizky.pengenaltokohwayang;

import android.app.Activity;

import android.content.Intent;

import android.support.v7.app.AppCompatActivity;

import android.os.Bundle;

import android.view.Window;

import android.view.WindowManager;

public class SplashActivity extends Activity {

@Override

protected void onCreate(Bundle savedInstanceState)

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREN,

WindowManager.LayoutParams.FLAG_FULLSCREEN);

this.requestWindowFeature(Window.FEATURE_NO_TITLE);

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_splash);

Thread thread = new Thread(){

public void run()

{

try

{

sleep(3000);

} catch (InterruptedException e)

{

e.printStackTrace();

} finally {

startActivity(new Intent(SplashActivity.this,

MenuActivity.class));

finish();

}

}

};

thread.start();

}

}

58

LAMPIRAN C-2

59

Coding Menu Utama

package com.ruarizky.pengenaltokohwayang;

import android.app.Activity;

import android.content.Intent;

import android.support.v7.app.AppCompatActivity;

import android.os.Bundle;

import android.view.View;

import android.view.Window;

import android.view.WindowManager;

import android.widget.Button;

import android.widget.Toast;

public class MenuActivity extends Activity {

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,

WindowManager.LayoutParams.FLAG_FULLSCREEN);

this.requestWindowFeature(Window.FEATURE_NO_TITLE);

setContentView(R.layout.activity_menu);

Button BMulai = (Button) findViewById(R.id.BMulai);

Button BTentang = (Button) findViewById(R.id.BTentang);

BMulai.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

Intent namaintent = new

Intent(getApplicationContext(),AwalActivity.class);

startActivity(namaintent);

}

});

BTentang.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

Intent namaintent = new

Intent(getApplicationContext(),TentangActivity.class);

startActivity(namaintent);

}

});

}

60

Coding Menu Utama

boolean sudahpencetduakali = false;

@Override

public void onBackPressed()

{

if(sudahpencetduakali) {

super.onBackPressed();

}

else

{

Toast.makeText(this, "Tekan Dua Kali Untuk Bisa Keluar",

Toast.LENGTH_SHORT).show();

sudahpencetduakali = true;

}

}

}

61

LAMPIRAN C-3

62

Coding Menu Let’s Go

package com.ruarizky.pengenaltokohwayang;

import android.app.Activity;

import android.content.Intent;

import android.support.v7.app.AppCompatActivity;

import android.os.Bundle;

import android.view.MotionEvent;

import android.view.View;

import android.view.Window;

import android.view.WindowManager;

import android.widget.ImageView;

import android.widget.LinearLayout;

public class AwalActivity extends AppCompatActivity {

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,

WindowManager.LayoutParams.FLAG_FULLSCREEN);

this.requestWindowFeature(Window.FEATURE_NO_TITLE);

setContentView(R.layout.activity_awal);

getSupportActionBar().hide();

ImageView IVTokoh = (ImageView)findViewById(R.id.IVTokoh);

ImageView IVGames = (ImageView)findViewById(R.id.IVGames);

ImageView IVQuiz = (ImageView)findViewById(R.id.IVQuiz);

LinearLayout Menu = (LinearLayout)findViewById(R.id.Menu);

Menu.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

Intent namaintent = new Intent(getApplicationContext(),

DaftarActivity.class);

startActivity(namaintent);

}

});

63

Coding Menu Let’s Go

IVTokoh.setOnTouchListener(new View.OnTouchListener() {

@Override

public boolean onTouch(View v, MotionEvent event) {

if (event.getAction() == event.ACTION_DOWN) {

v.setAlpha(0.5f);

} else if (event.getAction() == event.ACTION_UP) {

v.setAlpha(0.5f);

} else if (event.getAction() == event.ACTION_CANCEL) {

v.setAlpha(0.5f);

}

return false;

}

});

LinearLayout Menu2 = (LinearLayout)findViewById(R.id.Menu2);

Menu2.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

Intent namaintent = new Intent(getApplicationContext(),

PuzzleActivity.class);

startActivity(namaintent);

}

});

IVGames.setOnTouchListener(new View.OnTouchListener() {

@Override

public boolean onTouch(View v, MotionEvent event) {

if (event.getAction() == event.ACTION_DOWN) {

v.setAlpha(0.5f);

} else if (event.getAction() == event.ACTION_UP) {

v.setAlpha(0.5f);

} else if (event.getAction() == event.ACTION_CANCEL) {

v.setAlpha(0.5f);

}

return false;

}

});

64

Coding Menu Let’s Go

LinearLayout Menu3 = (LinearLayout)findViewById(R.id.Menu3);

Menu3.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

Intent namaintent = new Intent(getApplicationContext(),

QuizActivity.class);

startActivity(namaintent);

}

});

IVQuiz.setOnTouchListener(new View.OnTouchListener() {

@Override

public boolean onTouch(View v, MotionEvent event) {

if (event.getAction() == event.ACTION_DOWN) {

v.setAlpha(0.5f);

} else if (event.getAction() == event.ACTION_UP) {

v.setAlpha(0.5f);

} else if (event.getAction() == event.ACTION_CANCEL) {

v.setAlpha(0.5f);

}

return false;

}

});

}

}

65

LAMPIRAN C-4

66

Coding Menu Tentang

package com.ruarizky.pengenaltokohwayang;

import android.app.Activity;

import android.os.Bundle;

import android.support.design.widget.FloatingActionButton;

import android.support.design.widget.Snackbar;

import android.support.v7.app.AppCompatActivity;

import android.support.v7.widget.Toolbar;

import android.view.View;

import android.view.Window;

import android.view.WindowManager;

public class TentangActivity extends Activity {

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,

WindowManager.LayoutParams.FLAG_FULLSCREEN);

this.requestWindowFeature(Window.FEATURE_NO_TITLE);

setContentView(R.layout.activity_tentang);

}

}

67

top related