Twitter Facebook Delicious Digg Stumbleupon Favorites More

Tuesday 4 September 2018

love percentage calculator

package lovecalculator.lovecalculator;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;

import java.util.Random;

import static android.view.View.VISIBLE;

public class MainActivity extends AppCompatActivity {
    EditText male, female;
    TextView tv;
    String result;

    ImageButton floatButton;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        floatButton = (ImageButton) findViewById(R.id.fab);
        floatButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(Intent.ACTION_SEND);
                i.setType("text/plain");
                String shareBody="Downdload Love percentage calculator Here https://play.google.com/store/apps/details?id=lovecalculator.lovecalculator";
                String shareSub="Downdload Love percentage calculator Here https://play.google.com/store/apps/details?id=lovecalculator.lovecalculator";

                i.putExtra(Intent.EXTRA_SUBJECT,shareBody);
                i.putExtra(Intent.EXTRA_TEXT,shareSub);
                startActivity(Intent.createChooser(i,"SHARE USING"));

            }
        });
    }

    public void showresult(View view) {
        male = (EditText) findViewById(R.id.malename);
        female = (EditText) findViewById(R.id.female);
        tv = (TextView) findViewById(R.id.peris);


        String f = female.getText().toString();
        String m = male.getText().toString();
        String sum = m + f;

        sum = sum.toLowerCase();
        int value = sum.hashCode();

        Random random = new Random(value);
        result = (random.nextInt(100) + 1) + "%";
        if (f.equals("") || m.equals("")) {
            Toast.makeText(MainActivity.this, "ENTER NAME", Toast.LENGTH_LONG).show();
        } else {

                tv.setText(result);
                tv.setVisibility(VISIBLE);

        }
    }


}


=======================================================================
<?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"
    android:background="@drawable/love"
    tools:context=".MainActivity">

    <EditText
        android:id="@+id/malename"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="15sp"
       android:hint="MALE NAME"
        android:textStyle="bold"
        android:textColor="#FAFAFA"
        android:textColorHint="#FAFAFA"
        android:inputType="textPersonName"
        />

    <EditText
        android:id="@+id/female"
        android:layout_below="@id/malename"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="15sp"
        android:layout_marginRight="15sp"
        android:hint="FEMALE NAME"
        android:textColorHint="#FAFAFA"
        android:textStyle="bold"
        android:textColor="#FAFAFA"
        android:inputType="textPersonName"
         />

    <Button
        android:id="@+id/calculate"
        android:layout_below="@id/female"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="15sp"
        android:layout_marginTop="15dp"
        android:background="#FAFAFA"
        android:gravity="center"
        android:padding="10sp"
        android:textSize="20sp"
        android:text="CALCULATE"
        android:onClick="showresult"/>

    <TextView
        android:id="@+id/peris"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
android:textStyle="italic"
        android:textSize="30sp"
        android:textColor="#FAFAFA"
        android:gravity="center"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="67dp"
android:visibility="invisible"
        android:text="TextView"
        />

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="170dp"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentEnd="true"
        android:layout_marginBottom="19dp"
        android:layout_marginEnd="25dp"
        android:clickable="true"
        app:fabSize="normal"
        app:srcCompat="@drawable/share" />


</RelativeLayout>
Share:

6 comments:

  1. please tell me how to check Love Calculator. i am in relationship from 2 year. i am thinking to knot my relationship but before it i want to check our Love Calculator. please tell me, is it correct to check Love Calculator percentage online.

    ReplyDelete
  2. Hi ! This is very informative & interesting article. Nice to read your blog post first time ever. I really appreciate this post. Thanks for sharing this awesome post.

    Visit here -: Love Calculator

    ReplyDelete
  3. I read your blogpost this is very useful and informative for me.
    Thank you for sharing this Amazing blog post.

    Dot Net Developer
    Hire.Net Developer


    ReplyDelete
  4. Hi,
    It’s amazing bro,
    Thank you such kind of information has been shared on this blog for us.
    Its amazing code for beginners who want to learn about android coding. So this is a live example of writing love cal fo android mobiles as compare making any type of twinflame, soulmate live love testing tool for website.
    Thanks to admin who allowed me to share my comment on this blog.

    ReplyDelete
  5. I like this post, and I believe they are having a good time reading it,they may take a decent site to make an information about android app developmen

    ReplyDelete
  6. Love Calculator By Name | Love Meter to Calculate Love Percentage - https://codingreviews.com/love-calculator/

    ReplyDelete

Search This Blog

Popular Posts

Pages

how to make crores from 1 lakh in stock markets in 1 year

how to make crores from 1 lakh in stock markets in 1 year

Blogger Tutorials

Blogger Templates

Sample Text

Copyright © ANDROID TUTORIAL CODE | Powered by Blogger
Design by SimpleWpThemes | Blogger Theme by NewBloggerThemes.com & Distributed By Protemplateslab