Android Open Source - AccroApp Contact






From Project

Back to project page AccroApp.

License

The source code is released under:

GNU General Public License

If you think the Android project AccroApp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
AccroDesTournois : list all the volleyball tournaments of the french
website Accro Des Tournois (http://www.accro-des-tournois.com)
//from www .j  a  va 2  s .c  om
Copyright (C) 2014  Henri Buyse

AccroDesTournois is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

AccroDesTournois is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with AccroDesTournois.  If not, see <http://www.gnu.org/licenses/>.
*/

package fr.hbuyse.accrodestournois;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.NavUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.TableRow;

public class Contact extends Activity {

    TableRow em_hb;
    TableRow gh_hb;

    ImageView fb;
    ImageView tw;
    ImageView gp;
    ImageView em;
    ImageView wb;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_contact);

        getActionBar().setDisplayHomeAsUpEnabled(true);

        em_hb = (TableRow)  findViewById(R.id.email_hb);
        gh_hb = (TableRow)  findViewById(R.id.github_hb);

        fb    = (ImageView) findViewById(R.id.facebook_adt);
        tw    = (ImageView) findViewById(R.id.twitter_adt);
        gp    = (ImageView) findViewById(R.id.googleplus_adt);
        em    = (ImageView) findViewById(R.id.email_adt);
        wb    = (ImageView) findViewById(R.id.website_adt);

        em_hb.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent i = new Intent(Intent.ACTION_VIEW);
                i.addCategory(Intent.CATEGORY_BROWSABLE);
                i.setData(Uri.parse(getResources().getString(R.string.dev_mail_addr)));
                startActivity(i);
            }
        });

        gh_hb.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent i = new Intent(Intent.ACTION_VIEW);
                i.addCategory(Intent.CATEGORY_BROWSABLE);
                i.setData(Uri.parse(getResources().getString(R.string.dev_github_addr)));
                startActivity(i);
            }
        });

        fb.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent i = new Intent(Intent.ACTION_VIEW);
                i.addCategory(Intent.CATEGORY_BROWSABLE);
                try {
                    i.setData(Uri.parse(getResources().getString(R.string.facebook_addr)));
                    startActivity(i);
                }
                catch (android.content.ActivityNotFoundException e) {
                    i.setData(Uri.parse(getResources().getString(R.string.facebook_addr2)));
                    startActivity(i);
                }

            }
        });

        tw.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent i = new Intent(Intent.ACTION_VIEW);
                i.addCategory(Intent.CATEGORY_BROWSABLE);
                i.setData(Uri.parse(getResources().getString(R.string.twitter_addr)));
                startActivity(i);
            }
        });

        gp.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent i = new Intent(Intent.ACTION_VIEW);
                i.addCategory(Intent.CATEGORY_BROWSABLE);
                i.setData(Uri.parse(getResources().getString(R.string.googleplus_addr)));
                startActivity(i);
            }
        });

        em.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent i = new Intent(Intent.ACTION_VIEW);
                i.addCategory(Intent.CATEGORY_BROWSABLE);
                i.setData(Uri.parse(getResources().getString(R.string.email_addr)));
                startActivity(i);
            }
        });

        wb.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent i = new Intent(Intent.ACTION_VIEW);
                i.addCategory(Intent.CATEGORY_BROWSABLE);
                i.setData(Uri.parse(getResources().getString(R.string.website_addr)));
                startActivity(i);
            }
        });
    }


    @Override
    public void onBackPressed() {
        super.onBackPressed();
        finish();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.contact, 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.

        switch(item.getItemId()){
            case R.id.action_settings:
                return true;
            case android.R.id.home:
                NavUtils.navigateUpFromSameTask(this);
                return true;
        }

        return super.onOptionsItemSelected(item);
    }
}




Java Source Code List

com.hbuyse.accrodestournois.ApplicationTest.java
fr.hbuyse.accrodestournois.Contact.java
fr.hbuyse.accrodestournois.MainActivity.java
fr.hbuyse.accrodestournois.MainFragment.java
fr.hbuyse.accrodestournois.NavigationDrawerFragment.java
fr.hbuyse.accrodestournois.SplashScreen.java
fr.hbuyse.accrodestournois.TournamentActivity.java
fr.hbuyse.accrodestournois.TournamentFragment.java
fr.hbuyse.accrodestournois.TournamentListAdapter.java
fr.hbuyse.accrodestournois.Tournament.java
fr.hbuyse.accrodestournois.drawer.java