NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

-----Sembollü Hesap Makinesi Yapımı ----------------------
Resim ekleme :
1-İCONFİNDER.COM DAN RESİM BUL
2-APP-RES-DRAWABLE İÇİNE AT GİTSİN
---MAİN ACTİVİTY-YAPILACAK İŞLER
package com.example.user.menuluhesapmak;

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.Menu;
import android.view.MenuItem;
import android.widget.EditText;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

EditText sayi1,sayi2;
TextView sonuc;

int s1,s2,sonucu;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);

sayi1 = findViewById(R.id.sayi1);
sayi2 = findViewById(R.id.sayi2);
sonuc = findViewById(R.id.sonuc);
--ÇIKIŞ BUTONU KODU BU --
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();

s1 = Integer.parseInt(sayi1.getText().toString());
s2 = Integer.parseInt(sayi2.getText().toString());


//noinspection SimplifiableIfStatement
if (id == R.id.topla) {

sonucu = s1+s2;

sonuc.setText(""+sonucu);
return true;
}
else if (id == R.id.cikar) {
sonucu = s1-s2;

sonuc.setText(""+sonucu);
return true;
}
else if (id == R.id.carp) {
sonucu = s1*s2;

sonuc.setText(""+sonucu);
return true;
}
else if (id == R.id.bol) {
sonucu = s1/s2;

sonuc.setText(""+sonucu);
return true;
}
else if (id == R.id.cikis) {
sayi1.setText(null);
sayi2.setText(null);
sonuc.setText(null);
return true;
}




return super.onOptionsItemSelected(item);
}
}
---MENU MAİN XML(MENUNUN SADE TASARIMI )
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.example.user.menuluhesapmak.MainActivity">


<item
android:id="@+id/topla"
android:orderInCategory="100"
android:title="Toplama"
app:showAsAction="always"//BUNU SİLERSEN ALT ALTA İNER
android:icon="@drawable/top"
/>

<item
android:id="@+id/cikar"
android:orderInCategory="100"
android:title="Çıkarma"
app:showAsAction="always"
android:icon="@drawable/ic_remove_black_24dp"
/>

<item
android:id="@+id/carp"
android:orderInCategory="100"
android:title="Çarpma"
app:showAsAction="always"
android:icon="@drawable/ic_clear_black_24dp"
/>

<item
android:id="@+id/bol"
android:orderInCategory="100"
android:title="Bölme"
app:showAsAction="always"
android:icon="@drawable/ic_done_black_24dp"
/>
<item
android:id="@+id/cikis"
android:orderInCategory="100"
android:title="Çıkış"
app:showAsAction="always"
android:icon="@drawable/ic_exit_to_app_black_24dp"
/>

</menu>


----CONTEXT MAİN
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".MainActivity"
tools:showIn="@layout/activity_main">

<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">

<EditText
android:id="@+id/sayi1"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginTop="20dp"
android:hint="Birinci Sayi"
android:inputType="number" />

<EditText
android:id="@+id/sayi2"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginTop="20dp"
android:hint="İkinci Sayi"
android:inputType="number" />

<TextView
android:id="@+id/sonuc"
android:layout_marginLeft="50dp"
android:layout_marginTop="20dp"
android:layout_width="300dp"
android:layout_height="wrap_content" />


</LinearLayout>

</RelativeLayout>
------------------------------------


     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.