A-10
Created by ILMUKOMPUTER on 862016.
public class
AboutActivity
extends
AppCompatActivity { Override
protected void
onCreateBundle savedInstanceState {
super
.onCreatesavedInstanceState; setContentViewR.layout.
activity_about
; ImageButton b_back = ImageButton findViewByIdR.id.
b_back
; b_back.setOnClickListener
new
View.OnClickListener { Override
public void
onClickView v { Intent i =
new
IntentAboutActivity.
this
, MainActivity.
class
; i.setFlagsIntent.
FLAG_ACTIVITY_CLEAR_TOP ;
startActivityi; }
}; }
} 4.
activity_main.xml
? xml version=
1.0 encoding=
utf-8 ?
RelativeLayout xmlns:
android =
http:schemas.android.comapkresandroid xmlns:
tools =
http:schemas.android.comtools android
:layout_width= match_parent
android :layout_height=
match_parent tools
:context= com.example.ilmukomputer.mycipher.MainActivity
android :background=
drawablebackground TabHost
android :id=
+idtabHost android
:layout_width= match_parent
android :layout_height=
match_parent LinearLayout
android :id=
+idlinearLayout android
:layout_width= match_parent
android :layout_height=
match_parent android
:orientation= vertical
TabWidget android
:id= android:idtabs
android :layout_width=
match_parent android
:layout_height= wrap_content
android :background=
colorcolorPrimary TabWidget
FrameLayout android
:id= android:idtabcontent
android :layout_width=
match_parent android
:layout_height= match_parent
include android
:id= +idlayout1
layout= layoutlayout_encrypt
android :layout_width=
match_parent android
:layout_height= match_parent
include include
android :id=
+idlayout2 layout=
layoutlayout_decrypt android
:layout_width= match_parent
android :layout_height=
match_parent include
FrameLayout LinearLayout
TabHost RelativeLayout
5.
layout_encrypt.xml
? xml version=
1.0 encoding=
utf-8 ?
RelativeLayout xmlns:
android =
http:schemas.android.comapkresandroid android
:layout_width= match_parent
android :layout_height=
match_parent
Universitas Sumatera Utara
A-11
TextView android
:id= +idtv_ciphertext_en
android :layout_width=
fill_parent android
:layout_height= fill_parent
android :hint=
Pesan Tersandi android
:background= drawablebox
android :gravity=
left android
:textIsSelectable= true
android :padding=
20dp android
:layout_margin= 10dp
android :layout_below=
+idet_key2_en android
:layout_above= +idet_plaintext_en
android :layout_alignParentEnd=
true ImageButton
android :id=
+idb_encrypt android
:layout_width= 50dip
android :layout_height=
50dip android
:background= drawableic_encrypt
android :gravity=
center android
:layout_marginLeft= 10dp
android :layout_marginRight=
10dp android
:layout_marginBottom= 10dp
android :layout_alignParentBottom=
true android
:layout_alignParentEnd= true
EditText android
:id= +idet_plaintext_en
android :layout_width=
wrap_content android
:layout_height= wrap_content
android :inputType=
text android
:hint= Tulis Pesan
android :maxLines=
1 android
:minHeight= 40dp
android :background=
drawablebox android
:gravity= center_vertical
android :padding=
10dp android
:layout_toStartOf= +idb_encrypt
android :layout_marginLeft=
10dp android
:layout_marginBottom= 10dp
android :layout_alignParentStart=
true android
:layout_alignParentBottom= true
EditText android
:id= +idet_key1_en
android :layout_width=
wrap_content android
:layout_height= wrap_content
android :ems=
10 android
:inputType= textPassword
android :hint=
Kunci 1 android
:maxLines= 1
android :background=
drawablebox android
:gravity= center_vertical
android :paddingLeft=
10dp android
:paddingTop= 5dp
android :paddingBottom=
5dp android
:layout_below= +idb_clear_en
android :layout_toStartOf=
+idcb_view1_en EditText
android :id=
+idet_key2_en android
:layout_width= wrap_content
android :layout_height=
wrap_content android
:ems= 10
android :inputType=
numberPassword android
:hint= Kunci 2
android :maxLines=
1 android
:background= drawablebox
android :gravity=
center_vertical android
:paddingLeft= 10dp
android :paddingTop=
5dp android
:paddingBottom= 5dp
android :layout_marginTop=
5dp android
:layout_below= +idet_key1_en
Universitas Sumatera Utara
A-12
android :layout_toStartOf=
+idcb_view2_en android
:layout_alignStart= +idet_key1_en
ImageButton android
:id= +idb_clear_en
android :layout_width=
50dip android
:layout_height= 50dip
android :background=
drawableic_clear android
:gravity= center
android :layout_marginBottom=
10dp android
:layout_alignParentTop= true
android :layout_alignParentEnd=
true ImageButton
android :id=
+idb_about_en android
:layout_width= 50dip
android :layout_height=
50dip android
:background= drawableic_about
android :gravity=
center android
:layout_toRightOf= +idb_help_en
android :layout_marginBottom=
10dp android
:layout_alignParentTop= true
ImageButton android
:id= +idb_help_en
android :layout_width=
50dip android
:layout_height= 50dip
android :background=
drawableic_help android
:gravity= center
android :layout_alignParentStart=
true android
:layout_marginBottom= 10dp
android :layout_alignParentTop=
true CheckBox
android :id=
+idcb_view1_en android
:layout_width= 40dip
android :layout_height=
40dip android
:gravity= center
android :layout_below=
+idb_clear_en android
:layout_alignBottom= +idet_key1_en
android :layout_alignParentEnd=
true CheckBox
android :id=
+idcb_view2_en android
:layout_width= 40dip
android :layout_height=
40dip android
:gravity= center
android :layout_below=
+idet_key1_en android
:layout_alignBottom= +idet_key2_en
android :layout_alignParentEnd=
true RelativeLayout
6.
layout_decrypt.xml
? xml version=
1.0 encoding=