Nebojsa Stanojlovic

MATHEGYM

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:paddingBottom="@dimen/activity_vertical_margin"

android:paddingLeft="@dimen/activity_horizontal_margin"

android:paddingRight="@dimen/activity_horizontal_margin"

android:paddingTop="@dimen/activity_vertical_margin"

android:background="@drawable/h2"

tools:context="com.example.stanojlovic.mathegym.First">

<ImageButton

android:layout_width="300dp"

android:layout_height="200dp"

android:id="@+id/btn1"

android:background="@drawable/bb1"

android:layout_alignParentTop="true"

android:layout_centerHorizontal="true"

android:layout_marginTop="101dp" />

<RatingBar

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:id="@+id/ratingBar"

android:backgroundTint="#f0f224"

android:layout_alignParentBottom="true"

android:layout_centerHorizontal="true"

android:layout_marginBottom="85dp" />

</RelativeLayout>

package com.example.stanojlovic.mathegym;

import android.content.Intent;

import android.support.v7.app.AppCompatActivity;

import android.os.Bundle;

import android.view.View;

import android.widget.ImageButton;

public class First extends AppCompatActivity implements View.OnClickListener {

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_first);

ImageButton btm=(ImageButton)findViewById(R.id.btn1);

btm.setOnClickListener(this);

}

@Override

public void onClick(View v) {

Intent in1=new Intent(this,Mathematik.class);

startActivity(in1);

}

}

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:paddingBottom="@dimen/activity_vertical_margin"

android:paddingLeft="@dimen/activity_horizontal_margin"

android:paddingRight="@dimen/activity_horizontal_margin"

android:paddingTop="@dimen/activity_vertical_margin"

android:background="@drawable/h11"

tools:context="com.example.stanojlovic.mathegym.Mathematik">

<TextView

android:layout_width="wrap_content"

android:layout_height="60dp"

android:id="@+id/tx"

android:text="WÄHLE EIN THEMA"

android:textColor="#ffffff"

android:textSize="35dp"

android:layout_alignParentTop="true"

android:layout_centerHorizontal="true" />

<Button

android:layout_width="250dp"

android:layout_height="50dp"

android:id="@+id/btu"

android:layout_marginTop="125dp"

android:background="@null"

android:layout_centerHorizontal="true"

android:text="UMWANDLUNGEN"

android:textSize="30dp"

/>

 <Button

android:layout_width="177dp"

android:layout_height="50dp"

android:id="@+id/bta"

android:background="@null"

android:text="ARITHMETIK"

android:textSize="30dp"

android:layout_below="@+id/btu"

android:layout_alignLeft="@+id/btg"

android:layout_alignStart="@+id/btg"

android:layout_marginTop="24dp"

/>

<Button

android:layout_width="170dp"

android:layout_height="50dp"

android:id="@+id/btg"

android:background="@null"

android:text="GEOMETRIE"

android:textSize="30dp"

android:layout_marginTop="24dp"

android:layout_below="@+id/bta"

android:layout_centerHorizontal="true" />

</RelativeLayout>

 android:background="@null"

package com.example.stanojlovic.mathegym;

import android.content.Intent;

import android.graphics.Color;

import android.graphics.Typeface;

import android.support.v7.app.AppCompatActivity;

import android.os.Bundle;

import android.view.Gravity;

import android.view.View;

import android.view.animation.Animation;

import android.view.animation.AnimationUtils;

import android.widget.Button;

import android.widget.ImageButton;

import android.widget.TextSwitcher;

import android.widget.TextView;

import android.widget.ViewSwitcher;

public class Mathematik extends AppCompatActivity implements View.OnClickListener {

TextView tx;

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_mathematik);

tx=(TextView)findViewById(R.id.tx);

tx.setShadowLayer(9, 9, 9, Color.GREEN);

Typeface tf=Typeface.createFromAsset(getAssets(),"njnaruto.ttf");

Typeface tf1=Typeface.createFromAsset(getAssets(),"KittenBoldTrial.ttf");

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

btu.setOnClickListener(this);

btu.setTypeface(tf);

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

bta.setOnClickListener(this);

bta.setTypeface(tf);

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

btg.setOnClickListener(this);

btg.setTypeface(tf);

tx.setTypeface(tf1);

}

  btg.setTypeface(tf);

tx.setTypeface(tf1);

}

@Override

public void onClick(View v) {

Intent inu = new Intent(this, Umwandlungen.class);

Intent ina = new Intent(this, Arithmetik.class);

Intent ing = new Intent(this, Geometrie.class);

if (v.getId() == R.id.btu)

startActivity(inu);

else if(v.getId()==R.id.bta)

startActivity(ina);

else if(v.getId()==R.id.btg)

startActivity(ing);

}

}

 tx.setShadowLayer(9, 9, 9, Color.GREEN);


(float radius, float dx, float dy, int shadowColor)

Typeface tf=Typeface.createFromAsset(getAssets(),"njnaruto.ttf");

Typeface tf1=Typeface.createFromAsset(getAssets(),"KittenBoldTrial.ttf");

android:background="@drawable/h11"

  else if (v.getId() == R.id.barpl) {

if (tx.getText().toString().matches("")){

Toast t1=Toast.makeText(getApplicationContext(),"GEBEN SIE ALS ERSTES EINEN WERT AN",Toast.LENGTH_SHORT);

t1.show();

return;

}

else{ opr = '+';

var1 = Double.parseDouble(String.valueOf(tx.getText()));

rechnen();

tx.setText(" ");}

}

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:background="@drawable/f11"

android:paddingBottom="@dimen/activity_vertical_margin"

android:paddingLeft="@dimen/activity_horizontal_margin"

android:paddingRight="@dimen/activity_horizontal_margin"

android:paddingTop="@dimen/activity_vertical_margin"

tools:context="com.example.stanojlovic.mathegym.Umwandlungen">

<ImageButton

android:layout_width="200dp"

android:layout_height="55dp"

android:id="@+id/btm"

android:background="@drawable/btm"

android:layout_alignParentTop="true"

android:layout_centerHorizontal="true"

android:layout_marginTop="1dp"

/>

<ImageButton

android:layout_width="200dp"

android:layout_height="55dp"

android:id="@+id/btf"

android:background="@drawable/btf"

android:layout_alignParentTop="true"

android:layout_centerHorizontal="true"

android:layout_marginTop="80dp"

/>

<ImageButton

android:layout_width="200dp"

android:layout_height="55dp"

android:id="@+id/btl"

android:background="@drawable/btl"

android:layout_alignParentTop="true"

android:layout_centerHorizontal="true"

android:layout_marginTop="160dp" />

  <ImageButton

android:layout_width="200dp"

android:layout_height="55dp"

android:id="@+id/btv"

android:background="@drawable/btv"

android:layout_alignParentTop="true"

android:layout_centerHorizontal="true"

android:layout_marginTop="240dp" />

<ImageButton

android:layout_width="200dp"

android:layout_height="55dp"

android:id="@+id/btz"

android:background="@drawable/btz"

android:layout_alignParentTop="true"

android:layout_centerHorizontal="true"

android:layout_marginTop="320dp" />

<ImageButton

android:layout_width="200dp"

android:layout_height="55dp"

android:id="@+id/btd"

android:background="@drawable/btd"

android:layout_alignParentTop="true"

android:layout_centerHorizontal="true"

android:layout_marginTop="400dp" />

</RelativeLayout>

package com.example.stanojlovic.mathegym;

import android.content.Intent;

import android.support.v7.app.AppCompatActivity;

import android.os.Bundle;

import android.view.View;

import android.widget.AdapterView;

import android.widget.ArrayAdapter;

import android.widget.EditText;

import android.widget.ImageButton;

import android.widget.Spinner;

import android.widget.TextView;

import android.widget.Toast;

public class Umwandlungen extends AppCompatActivity implements View.OnClickListener {

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_umwandlungen);

ImageButton btm = (ImageButton) findViewById(R.id.btm);

btm.setOnClickListener(this);

ImageButton btf = (ImageButton) findViewById(R.id.btf);

btf.setOnClickListener(this);

ImageButton btl = (ImageButton) findViewById(R.id.btl);

btl.setOnClickListener(this);

ImageButton btv = (ImageButton) findViewById(R.id.btv);

btv.setOnClickListener(this);

ImageButton btz = (ImageButton) findViewById(R.id.btz);

btz.setOnClickListener(this);

ImageButton btd = (ImageButton) findViewById(R.id.btd);

btd.setOnClickListener(this);

}

@Override

public void onClick(View v) {

Intent in1 = new Intent(this, Masse.class);

Intent in2 = new Intent(this, Flaeche.class);

 public void onClick(View v) {

Intent in1 = new Intent(this, Masse.class);

Intent in2 = new Intent(this, Flaeche.class);

...

if (v.getId() == R.id.btm) {

startActivity(in1);

} else if (v.getId() == R.id.btf) {

startActivity(in2);

}

}

}

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:paddingBottom="@dimen/activity_vertical_margin"

android:paddingLeft="@dimen/activity_horizontal_margin"

android:paddingRight="@dimen/activity_horizontal_margin"

android:paddingTop="@dimen/activity_vertical_margin"

android:background="#404040"

tools:context="com.example.stanojlovic.mathegym.Masse">

<ImageView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:id="@+id/imageView2"

android:layout_alignParentTop="true"

android:layout_centerHorizontal="true" />

<EditText

android:layout_width="150dp"

android:layout_height="55dp"

android:background="#000000"

android:inputType="numberDecimal"

android:textDirection="rtl"

android:textSize="30dp"

android:maxLength="9"

android:id="@+id/textView"

android:layout_marginLeft="2dp"

android:layout_marginTop="135dp" />

<Spinner

android:layout_width="90dp"

android:layout_height="50dp"

android:id="@+id/s1"

android:layout_marginLeft="250dp"

android:layout_marginTop="135dp"

android:spinnerMode="dropdown"

/>

<Button

android:layout_width="200dp"

android:layout_height="55dp"

android:text="BERECHNE"

android:textSize="30dp"

android:background="#050505"

android:textColor="#ee2c2c"

android:id="@+id/button"

android:layout_centerHorizontal="true"

android:layout_marginTop="225dp" />

 <Button

android:layout_width="200dp"

android:layout_height="55dp"

android:text="BERECHNE"

android:textSize="30dp"

android:background="#050505"

android:textColor="#ee2c2c"

android:id="@+id/button"

android:layout_centerHorizontal="true"

android:layout_marginTop="225dp" />

<TextView

android:layout_width="150dp"

android:layout_height="55dp"

android:background="#000000"

android:textDirection="rtl"

android:textSize="30dp"

android:maxLength="11"

android:id="@+id/textView2"

android:layout_marginTop="310dp"

android:layout_marginLeft="2dp"/>

<Spinner

android:layout_width="90dp"

android:layout_height="50dp"

android:id="@+id/s2"

android:layout_marginTop="310dp"

android:layout_marginLeft="250dp"

android:spinnerMode="dropdown" />

 <ImageButton

android:layout_width="85dp"

android:layout_height="85dp"

android:id="@+id/imageButton"

android:background="@drawable/del3"

android:layout_alignParentBottom="true"

android:layout_centerHorizontal="true"

android:layout_marginBottom="58dp" />

<ImageView

android:layout_width="wrap_content"

android:layout_height="120dp"

android:id="@+id/imageView3"

android:background="@drawable/umwm"

android:layout_alignParentTop="true"

android:layout_centerHorizontal="true" />

</RelativeLayout>

  <Spinner

android:layout_width="90dp"

android:layout_height="50dp"

android:id="@+id/s2"

android:layout_marginTop="310dp"

android:layout_marginLeft="250dp"

android:spinnerMode="dropdown" />

package com.example.stanojlovic.mathegym;

import android.graphics.Typeface;

import android.support.v7.app.AppCompatActivity;

import android.os.Bundle;

import android.view.View;

import android.widget.AdapterView;

import android.widget.ArrayAdapter;

import android.widget.Button;

import android.widget.EditText;

import android.widget.ImageButton;

import android.widget.Spinner;

import android.widget.TextView;

public class Masse extends AppCompatActivity implements AdapterView.OnItemSelectedListener,View.OnClickListener {

Spinner a, b;

double f, g;

TextView tx2;

EditText tx1;

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_masse);

Typeface tf=Typeface.createFromAsset(getAssets(),"SciFly-Sans.ttf");

a = (Spinner) findViewById(R.id.s1);

a.setOnItemSelectedListener(this);

ArrayAdapter adapter1 = ArrayAdapter.createFromResource(this, R.array.masse_array, android.R.layout.simple_spinner_dropdown_item);

a.setAdapter(adapter1);

b = (Spinner) findViewById(R.id.s2);

b.setOnItemSelectedListener(this);

ArrayAdapter adapter2 = ArrayAdapter.createFromResource(this, R.array.masse1_array, android.R.layout.simple_spinner_dropdown_item);

b.setAdapter(adapter2);

Button bt = (Button) findViewById(R.id.button);

bt.setOnClickListener(this);

bt.setTypeface(tf);

ImageButton ib = (ImageButton) findViewById(R.id.imageButton);

ib.setOnClickListener(this);

tx1 = (EditText) findViewById(R.id.textView);

tx2 = (TextView) findViewById(R.id.textView2);

}

 @Override

public void onClick(View v) {

g = Double.parseDouble(String.valueOf(tx1.getText()));

String t1 = a.getSelectedItem().toString();

String t2 = b.getSelectedItem().toString();

 if (v.getId() == R.id.button) {

if (t1.equals("t") && t2.equals("t")) {

f = g;

} else if (t1.equals("t") && t2.equals("kg")) {

f = g *1000;

} else if (t1.equals("t") && t2.equals("dg")) {

f = g *10000;

} else if (t1.equals("t") && t2.equals("g")) {

f = g *1000000;

} else if (t1.equals("t") && t2.equals("mg")) {

f = g *1000000000;

} else if (t1.equals("kg") && t2.equals("t")) {

f = g /1000;

} else if (t1.equals("kg") && t2.equals("kg")) {

f = g ;

...





      tx2.setText(f + "");

} else if (v.getId() == R.id.imageButton) {

tx1.setText("");

tx2.setText("");

}

}

 a = (Spinner) findViewById(R.id.s1);

a.setOnItemSelectedListener(this);

ArrayAdapter adapter1 = ArrayAdapter.createFromResource(this, R.array.masse_array, android.R.layout.simple_spinner_dropdown_item);

a.setAdapter(adapter1);





Arrayadapter ist eine Klasse, die mit Array mit Daten arbeiten können

  if (v.getId() == R.id.button) {

if (t1.equals("ha") && t2.equals("ha")) {

f = g;

} else if (t1.equals("ha") && t2.equals("a")) {

f = g * 100;

} else if (t1.equals("ha") && t2.equals("m²")) {

f = g * 10000;

} else if (t1.equals("ha") && t2.equals("dm²")) {

f = g * 1000000;

} else if (t1.equals("ha") && t2.equals("cm²")) {

f = g * 100000000;

} else if (t1.equals("ha") && t2.equals("mm²")) {

f = g * 1000000000;

} else if (t1.equals("a") && t2.equals("ha")) {

f = g/100;

} else if (t1.equals("a") && t2.equals("a")) {

f = g ;

} else if (t1.equals("a") && t2.equals("m²")) {

f = g * 100;

} else if (t1.equals("a") && t2.equals("dm²")) {

f = g * 10000;

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:paddingBottom="@dimen/activity_vertical_margin"

android:paddingLeft="@dimen/activity_horizontal_margin"

android:paddingRight="@dimen/activity_horizontal_margin"

android:paddingTop="@dimen/activity_vertical_margin"

android:background="#383838"

tools:context="com.example.stanojlovic.mathegym.Geometrie">

<ScrollView

android:layout_width="match_parent"

android:layout_height="match_parent"

android:id="@+id/scrollView"

android:layout_alignParentTop="true"

android:layout_centerHorizontal="true"

android:fillViewport="false">

<LinearLayout

android:orientation="vertical"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:layout_below="@+id/scrollView"

android:layout_centerHorizontal="true">

 <Button

android:layout_width="match_parent"

android:layout_height="match_parent"

android:background="#000000"

android:text="Kreis"

android:textColor="#698b69"

android:textSize="30dp"

android:id="@+id/bt1"

/>

<Button

android:layout_width="match_parent"

android:layout_height="match_parent"

android:background="#000000"

android:text="Dreieck"

android:textColor="#4876ff"

android:textSize="30dp"

android:layout_marginTop="5dp"

android:id="@+id/bt2"

/>

<Button

android:layout_width="match_parent"

android:layout_height="match_parent"

android:background="#000000"

android:text="Quadrat"

android:textColor="#698b69"

android:textSize="30dp"

android:layout_marginTop="5dp"

android:id="@+id/bt3"

/>

<Button

android:layout_width="match_parent"

android:layout_height="match_parent"

android:background="#000000"

android:text="RECHTECK"

android:textColor="#4876ff"

android:textSize="30dp"

android:layout_marginTop="5dp"

android:id="@+id/bt4"

/>

      />

<Button

android:layout_width="match_parent"

android:layout_height="match_parent"

android:background="#000000"

android:text="KEGEL"

android:textColor="#698b69"

android:textSize="30dp"

android:layout_marginTop="5dp"

android:id="@+id/bt13"

/>

<Button

android:layout_width="match_parent"

android:layout_height="match_parent"

android:background="#000000"

android:text="PYRAMIDE"

android:textColor="#4876ff"

android:textSize="30dp"

android:layout_marginTop="5dp"

android:id="@+id/bt14"

/>

</LinearLayout>

</ScrollView>

</RelativeLayout>

package com.example.stanojlovic.mathegym;

import android.content.Intent;

import android.graphics.Typeface;

import android.support.v7.app.AppCompatActivity;

import android.os.Bundle;

import android.view.View;

import android.widget.Button;

public class Geometrie extends AppCompatActivity implements View.OnClickListener {

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_geometrie);

Typeface tf=Typeface.createFromAsset(getAssets(),"SciFly-Sans.ttf");

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

bt1.setOnClickListener(this);

bt1.setTypeface(tf);

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

bt2.setOnClickListener(this);

bt2.setTypeface(tf);

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

bt3.setOnClickListener(this);

bt3.setTypeface(tf);

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

bt4.setOnClickListener(this);

bt4.setTypeface(tf);

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

bt5.setOnClickListener(this);

bt5.setTypeface(tf);

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

bt6.setOnClickListener(this);

bt6.setTypeface(tf);

 @Override

public void onClick(View v) {

Intent in1 = new Intent(this, Kreis.class);

Intent in2 = new Intent(this, Dreieck.class);

Intent in3 = new Intent(this, Kreis.class);

Intent in4 = new Intent(this, Kreis.class);

Intent in5 = new Intent(this, Kreis.class);

Intent in6 = new Intent(this, Kreis.class);

Intent in7 = new Intent(this, Kreis.class);

Intent in8 = new Intent(this, Kreis.class);

Intent in9 = new Intent(this, Kreis.class);

Intent in10 = new Intent(this, Kreis.class);

Intent in11 = new Intent(this, Kreis.class);

Intent in12 = new Intent(this, Kreis.class);

Intent in13 = new Intent(this, Kreis.class);

Intent in14 = new Intent(this, Kreis.class);

if (v.getId() == R.id.bt1)

startActivity(in1);

else if(v.getId()==R.id.bt2)

startActivity(in2);

else if(v.getId()==R.id.bt3)

startActivity(in3);

else if(v.getId()==R.id.bt4)

startActivity(in4);

else if(v.getId()==R.id.bt5)

startActivity(in5);

else if(v.getId()==R.id.bt6)

startActivity(in6);

else if(v.getId()==R.id.bt7)

startActivity(in7);

else if(v.getId()==R.id.bt8)

startActivity(in8);

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:paddingBottom="@dimen/activity_vertical_margin"

android:paddingLeft="@dimen/activity_horizontal_margin"

android:paddingRight="@dimen/activity_horizontal_margin"

android:paddingTop="@dimen/activity_vertical_margin"

android:background="@drawable/fr3"

android:backgroundTint="#e0eeee"

tools:context="com.example.stanojlovic.mathegym.Kreis">

<RelativeLayout

android:layout_width="match_parent"

android:layout_height="match_parent"

android:layout_centerHorizontal="true"

android:layout_alignParentTop="true"

android:layout_marginTop="1dp"

android:layout_marginBottom="1dp"

android:layout_marginLeft="5dp"

android:background="#e0eeee">

<ImageView

android:layout_width="175dp"

android:layout_height="175dp"

android:id="@+id/imageView"

android:background="@drawable/k1"

android:layout_alignParentTop="true"

android:layout_alignParentLeft="true"

android:layout_alignParentStart="true" />

 <LinearLayout

android:orientation="vertical"

android:layout_width="match_parent"

android:layout_height="155dp"

android:layout_marginTop="25dp"

android:layout_toRightOf="@+id/imageView"

android:layout_toEndOf="@+id/imageView"

android:id="@+id/linearLayout5">

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:textAppearance="?android:attr/textAppearanceMedium"

android:textColor="#000000"

android:text="r:Radius"

android:id="@+id/tx1" />

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:textAppearance="?android:attr/textAppearanceMedium"

android:textColor="#000000"

android:text="d:Durchmesser"

android:id="@+id/tx2" />

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:textAppearance="?android:attr/textAppearanceMedium"

android:textColor="#000000"

android:text="M:Mittelpunkt"

android:id="@+id/tx3" />

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:textAppearance="?android:attr/textAppearanceMedium"

android:text="U:Umfang"

android:textColor="#000000"

android:id="@+id/tx4" />

 <EditText

android:layout_width="105dp"

android:layout_height="45dp"

android:id="@+id/txr"

android:background="#b0e0e6"

android:textColor="#000000"

android:textDirection="rtl"

android:maxLength="6"

android:textSize="28dp"

android:layout_marginTop="250dp"

android:layout_marginLeft="42dp"

android:inputType="numberDecimal" />

<TextView

android:layout_width="45dp"

android:layout_height="45dp"

android:text=" A:"

android:textSize="35dp"

android:textColor="#000000"

android:id="@+id/tx3"

android:layout_marginLeft="2dp"

android:background="#ff4040"

android:layout_marginTop="310dp"/>

<TextView

android:layout_width="105dp"

android:layout_height="45dp"

android:background="#b0e0e6"

android:layout_marginTop="310dp"

android:textColor="#000000"

android:textDirection="rtl"

android:maxLength="6"

android:textSize="28dp"

android:layout_marginLeft="42dp"

android:id="@+id/txc" />

<TextView

android:layout_width="45dp"

android:layout_height="45dp"

android:text=" d:"

android:textSize="35dp"

android:textColor="#000000"

android:id="@+id/tx5"

android:layout_marginLeft="165dp"

android:background="#ff4040"

android:layout_marginTop="250dp"

/>

<TextView

android:layout_width="105dp"

android:layout_height="45dp"

android:background="#b0e0e6"

android:textColor="#000000"

android:textDirection="rtl"

android:maxLength="6"

android:textSize="28dp"

android:layout_marginTop="250dp"

android:layout_marginLeft="206dp"

android:id="@+id/txfl" />

<TextView

android:layout_width="45dp"

android:layout_height="45dp"

android:text=" U:"

android:textSize="35dp"

android:textColor="#000000"

android:id="@+id/tx11"

android:layout_marginLeft="165dp"

android:background="#ff4040"

android:layout_marginTop="310dp"/>

<TextView

android:layout_width="105dp"

android:layout_height="45dp"

android:background="#b0e0e6"

android:textColor="#000000"

android:textDirection="rtl"

android:maxLength="6"

android:textSize="28dp"

android:layout_marginTop="310dp"

android:layout_marginLeft="207dp"

android:id="@+id/txu" />

 <ImageButton

android:layout_width="80dp"

android:layout_height="80dp"

android:id="@+id/bt1"

android:background="@drawable/btn0"

android:layout_alignParentBottom="true"

android:layout_centerHorizontal="true"

android:layout_marginBottom="70dp" />

<ImageButton

android:layout_width="50dp"

android:layout_height="50dp"

android:id="@+id/btd"

android:background="@drawable/del4"

android:layout_marginBottom="15dp"

android:layout_marginLeft="1dp"

android:layout_alignBottom="@+id/bt1"

android:layout_alignRight="@+id/txfl"

android:layout_alignEnd="@+id/txfl" />

</RelativeLayout>

</RelativeLayout>

package com.example.stanojlovic.mathegym;

import android.support.v7.app.AppCompatActivity;

import android.os.Bundle;

import android.view.View;

import android.widget.EditText;

import android.widget.ImageButton;

import android.widget.TextView;

public class Kreis extends AppCompatActivity implements View.OnClickListener{

TextView tx1,tx3,tx4,tx5,tx6,tx7,tx8;

EditText tx2;

Double rad,umf,fla,dur;

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_kreis);

ImageButton bt1=(ImageButton)findViewById(R.id.bt1);

bt1.setOnClickListener(this);

ImageButton bt2=(ImageButton)findViewById(R.id.btd);

bt2.setOnClickListener(this);

tx1=(TextView)findViewById(R.id.tx1);

tx2=(EditText)findViewById(R.id.txr);

tx3=(TextView)findViewById(R.id.tx3);

tx4=(TextView)findViewById(R.id.txc);

tx5=(TextView)findViewById(R.id.tx5);

tx6=(TextView)findViewById(R.id.txfl);

tx7=(TextView)findViewById(R.id.tx11);

tx8=(TextView)findViewById(R.id.txu);

   @Override

public void onClick(View v) {

if(v.getId()==R.id.bt1){

rechnen();

tx4.setText(fla+"");

tx6.setText(dur+"");

tx8.setText(umf+"");}

else if(v.getId()==R.id.btd){

tx2.setText("");

tx4.setText("");

tx6.setText("");

tx8.setText("");

}

}

private void rechnen() {

rad=Double.parseDouble(String.valueOf(tx2.getText()));

dur=2*rad;

umf=2*Math.PI*rad;

fla=Math.PI*rad*rad;

}

  else if (v.getId() == R.id.barpl) {

if (tx.getText().toString().matches("")){

Toast t1=Toast.makeText(getApplicationContext(),"GEBEN SIE ALS ERSTES EINEN WERT AN",Toast.LENGTH_SHORT);

t1.show();

return;

}

else{ opr = '+';

var1 = Double.parseDouble(String.valueOf(tx.getText()));

rechnen();

tx.setText(" ");}

}

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:paddingBottom="@dimen/activity_vertical_margin"

android:paddingLeft="@dimen/activity_horizontal_margin"

android:paddingRight="@dimen/activity_horizontal_margin"

android:paddingTop="@dimen/activity_vertical_margin"

android:background="#292929"

tools:context="com.example.stanojlovic.mathegym.Arithmetik">

<ImageView

android:layout_width="match_parent"

android:layout_height="125dp"

android:id="@+id/ar1"

android:background="@drawable/ar1"

/>

<TextView

android:layout_width="329dp"

android:layout_height="105dp"

android:layout_marginTop="25dp"

android:layout_marginLeft="9dp"

android:layout_marginRight="11dp"

android:textDirection="rtl"

android:textSize="50dp"

android:textColor="#f8f8ff"

android:maxLength="11"

android:id="@+id/tx" />

 <LinearLayout

android:orientation="horizontal"

android:layout_width="match_parent"

android:layout_height="82dp"

android:layout_below="@+id/ar1"

android:layout_centerHorizontal="true"

android:id="@+id/linearLayout">

<ImageButton

android:layout_width="82dp"

android:layout_height="wrap_content"

android:background="@drawable/barpl"

android:id="@+id/barpl" />

<ImageButton

android:layout_width="82dp"

android:layout_height="wrap_content"

android:background="@drawable/barmi"

android:drawingCacheQuality="high"

android:id="@+id/barmi" />

<ImageButton

android:layout_width="82dp"

android:layout_height="wrap_content"

android:background="@drawable/barma"

android:id="@+id/barma" />

 </LinearLayout>

<LinearLayout

android:orientation="horizontal"

android:layout_width="match_parent"

android:layout_height="82dp"

android:layout_below="@+id/linearLayout"

android:layout_centerHorizontal="true"

android:id="@+id/linearLayout2">

<ImageButton

android:layout_width="82dp"

android:layout_height="wrap_content"

android:background="@drawable/bar7"

android:id="@+id/bar7" />

<ImageButton

android:layout_width="82dp"

android:layout_height="wrap_content"

android:background="@drawable/bar8"

android:id="@+id/bar8" />

<ImageButton

android:layout_width="82dp"

android:layout_height="wrap_content"

android:background="@drawable/bar9"

android:id="@+id/bar9" />

<ImageButton

android:layout_width="82dp"

android:layout_height="wrap_content"

android:background="@drawable/barzu"

android:id="@+id/barzu" />

</LinearLayout>

<LinearLayout

android:orientation="horizontal"

android:layout_width="match_parent"

android:layout_height="82dp"

android:layout_below="@+id/linearLayout2"

android:layout_centerHorizontal="true"

android:id="@+id/linearLayout3">

<ImageButton

android:layout_width="82dp"

android:layout_height="80dp"

android:background="@drawable/bar4"

android:id="@+id/bar4" />

<ImageButton

android:layout_width="82dp"

android:layout_height="80dp"

android:background="@drawable/bar5"

android:id="@+id/bar5" />

<ImageButton

android:layout_width="82dp"

android:layout_height="80dp"

android:background="@drawable/bar6"

android:id="@+id/bar6" />

<ImageButton

android:layout_width="82dp"

android:layout_height="80dp"

android:background="@drawable/barc"

android:id="@+id/barc" />

</LinearLayout>

<LinearLayout

android:orientation="horizontal"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:layout_below="@+id/linearLayout3"

android:layout_centerHorizontal="true"

android:id="@+id/linearLayout4"

android:weightSum="1">

<ImageButton

android:layout_width="82dp"

android:layout_height="80dp"

android:background="@drawable/bar1"

android:id="@+id/bar1" />

<ImageButton

android:layout_width="82dp"

android:layout_height="80dp"

android:background="@drawable/bar2"

android:id="@+id/bar2" />

<ImageButton

android:layout_width="82dp"

android:layout_height="80dp"

android:background="@drawable/bar3"

android:id="@+id/bar3" />

<ImageButton

android:layout_width="82dp"

android:layout_height="160dp"

android:background="@drawable/bare"

android:id="@+id/bare"

android:layout_weight="0.22" />

<LinearLayout

android:orientation="horizontal"

android:layout_width="wrap_content"

android:layout_height="match_parent"/>

package com.example.stanojlovic.mathegym;

import android.os.Bundle;

import android.support.v7.app.AppCompatActivity;

import android.view.View;

import android.widget.ImageButton;

import android.widget.TextView;

public class Arithmetik extends AppCompatActivity implements View.OnClickListener {

double var1 = 0;

double var2 = 0;

double res = 0;

char opr;

TextView tx;

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_arithmetik);

tx = (TextView) findViewById(R.id.tx);

ImageButton bar1 = (ImageButton) findViewById(R.id.bar1);

bar1.setOnClickListener(this);

ImageButton bar2 = (ImageButton) findViewById(R.id.bar2);

bar2.setOnClickListener(this);

ImageButton bar3 = (ImageButton) findViewById(R.id.bar3);

bar3.setOnClickListener(this);

ImageButton bar4 = (ImageButton) findViewById(R.id.bar4);

bar4.setOnClickListener(this);

 @Override

public void onClick(View v) {

if (v.getId() == R.id.bar1) {

tx.setText((tx.getText().toString() + "1"));

} else if (v.getId() == R.id.bar2) {

tx.setText((tx.getText().toString() + "2"));

} else if (v.getId() == R.id.bar3) {

tx.setText((tx.getText().toString() + "3"));

} else if (v.getId() == R.id.bar4) {

tx.setText((tx.getText().toString() + "4"));

} else if (v.getId() == R.id.bar5) {

tx.setText((tx.getText().toString() + "5"));

} else if (v.getId() == R.id.bar6) {

tx.setText((tx.getText().toString() + "6"));

} else if (v.getId() == R.id.bar7) {

tx.setText((tx.getText().toString() + "7"));

} else if (v.getId() == R.id.bar8) {

tx.setText((tx.getText().toString() + "8"));

} else if (v.getId() == R.id.bar9) {

tx.setText((tx.getText().toString() + "9"));

} else if (v.getId() == R.id.bar0) {

tx.setText((tx.getText().toString() + "0"));

}

   }

else if (v.getId() == R.id.barpl) {

opr = '+';

var1 = Double.parseDouble(String.valueOf(tx.getText()));

rechnen();

tx.setText(" ");

}

else if (v.getId() == R.id.barmi) {

opr = '-';

var1 = Double.parseDouble(String.valueOf(tx.getText()));

rechnen();

tx.setText(" ");

}

else if (v.getId() == R.id.barma) {

opr = 'x';

var1 = Double.parseDouble(String.valueOf(tx.getText()));

rechnen();

tx.setText(" ");

}

else if (v.getId() == R.id.bardi) {

opr = '/';

var1 = Double.parseDouble(String.valueOf(tx.getText()));

rechnen();

tx.setText(" ");

}

else if (v.getId() == R.id.bare) {

var2 = Double.parseDouble(String.valueOf(tx.getText()));

rechnen();

tx.setText(res + "");

}

else if (v.getId() == R.id.barc) {

tx.setText("");

var1 = 0;

var2 = 0;

res = 0;

}

 public void rechnen() {

var2 = Double.parseDouble(String.valueOf(tx.getText()));

if (opr == '+') {

res = var1 + var2;

} else if (opr == '-') {

res = var1 - var2;

} else if (opr == 'x') {

res = var1 * var2;

} else if (opr == '/') {

res = var1 / var2;

}

}

}

Create a presentation like this one
Share it on social medias
Share it on your own
Share it on social medias
Share it on your own

How to export your presentation

Please use Google Chrome to obtain the best export results.


How to export your presentation

New presentation

by nstanojlovic

12 views

Public - 6/30/16, 5:11 PM